{"version":3,"file":"js/redesign-application-5becff474a7ab882b2bd.js","sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/img sync ^\\.\\/.*$","webpack:///./app/javascript/img/advice-bg.png","webpack:///./app/javascript/img/avatar.png","webpack:///./app/javascript/img/bgicon.svg","webpack:///./app/javascript/img/bgicon_secondary.svg","webpack:///./app/javascript/img/cat.png","webpack:///./app/javascript/img/dog.png","webpack:///./app/javascript/img/draft.png","webpack:///./app/javascript/img/filetypes/doc.svg","webpack:///./app/javascript/img/filetypes/img.svg","webpack:///./app/javascript/img/filetypes/pdf.svg","webpack:///./app/javascript/img/filetypes/xls.svg","webpack:///./app/javascript/img/fullscreen.png","webpack:///./app/javascript/img/hero-list-venue.jpg","webpack:///./app/javascript/img/hero_bg.jpg","webpack:///./app/javascript/img/hero_bg_new.jpg","webpack:///./app/javascript/img/hero_bg_workspace.jpg","webpack:///./app/javascript/img/img_placeholder.png","webpack:///./app/javascript/img/img_placeholder.svg","webpack:///./app/javascript/img/info_window_close.png","webpack:///./app/javascript/img/list-cards-bg.svg","webpack:///./app/javascript/img/list-venues-icons.png","webpack:///./app/javascript/img/logo.png","webpack:///./app/javascript/img/logo.svg","webpack:///./app/javascript/img/logo_blue.png","webpack:///./app/javascript/img/logo_og.png","webpack:///./app/javascript/img/main.svg","webpack:///./app/javascript/img/map-expand.svg","webpack:///./app/javascript/img/mappin-active.svg","webpack:///./app/javascript/img/mappin.svg","webpack:///./app/javascript/img/muuchit_for_non_profits.jpg","webpack:///./app/javascript/img/muuchit_for_providers.jpg","webpack:///./app/javascript/img/muuchit_for_renters.jpg","webpack:///./app/javascript/img/muuchit_promotion_video.jpg","webpack:///./app/javascript/img/no-avatar.svg","webpack:///./app/javascript/img/people/person_1.jpg","webpack:///./app/javascript/img/pet-rescue.png","webpack:///./app/javascript/img/play_btn.png","webpack:///./app/javascript/img/play_btn_white.png","webpack:///./app/javascript/img/play_white.svg","webpack:///./app/javascript/img/powered_by_stripe.svg","webpack:///./app/javascript/img/primary-bottom.svg","webpack:///./app/javascript/img/primary-desktop.svg","webpack:///./app/javascript/img/primary-left.svg","webpack:///./app/javascript/img/primary.svg","webpack:///./app/javascript/img/primary_small.svg","webpack:///./app/javascript/img/residence-slide.jpg","webpack:///./app/javascript/img/secondary.svg","webpack:///./app/javascript/img/secondary_white.svg","webpack:///./app/javascript/img/steps-actions-bg.png","webpack:///./app/javascript/img/stripe_connect_account.png","webpack:///./app/javascript/img/test.jpg","webpack:///./app/javascript/img/white-logo.svg","webpack:///./app/javascript/media sync ^\\.\\/.*$","webpack:///./app/javascript/media/Event-Planning-Checklist.pdf","webpack:///./app/javascript/media/Vendor-Proposal-Template-Muuchit.pdf","webpack:///./app/javascript/packs/_constants.js","webpack:///./app/javascript/packs/app.js","webpack:///./app/javascript/packs/components/ValidationForm.js","webpack:///./app/javascript/packs/components/accordion.js","webpack:///./app/javascript/packs/components/additionalFilters.js","webpack:///./app/javascript/packs/components/addressAutocomplete.js","webpack:///./app/javascript/packs/components/benefitingShowMission.js","webpack:///./app/javascript/packs/components/bodyHiddenPosition.js","webpack:///./app/javascript/packs/components/bookingCountdown.js","webpack:///./app/javascript/packs/components/checkSelectFilled.js","webpack:///./app/javascript/packs/components/checkViewport.js","webpack:///./app/javascript/packs/components/checkboxToggle.js","webpack:///./app/javascript/packs/components/clickFunc.js","webpack:///./app/javascript/packs/components/copyLink.js","webpack:///./app/javascript/packs/components/copyToClipBoard.js","webpack:///./app/javascript/packs/components/counter.js","webpack:///./app/javascript/packs/components/customSelect.js","webpack:///./app/javascript/packs/components/customSelectTabs.js","webpack:///./app/javascript/packs/components/datepicker/calculateBookingPrice.js","webpack:///./app/javascript/packs/components/datepicker/createAvailableHoursArray.js","webpack:///./app/javascript/packs/components/datepicker/createDateRange.js","webpack:///./app/javascript/packs/components/datepicker/datePicker.js","webpack:///./app/javascript/packs/components/datepicker/datePickerBooking.js","webpack:///./app/javascript/packs/components/datepicker/datePickerBookingToggle.js","webpack:///./app/javascript/packs/components/datepicker/formatDate.js","webpack:///./app/javascript/packs/components/datepicker/formatTime.js","webpack:///./app/javascript/packs/components/datepicker/getDayAvailableHours.js","webpack:///./app/javascript/packs/components/datepicker/selectors.js","webpack:///./app/javascript/packs/components/datepicker/updateFormFields.js","webpack:///./app/javascript/packs/components/datepicker/updateSelect.js","webpack:///./app/javascript/packs/components/downloadPdf.js","webpack:///./app/javascript/packs/components/emailSubscription.js","webpack:///./app/javascript/packs/components/expander.js","webpack:///./app/javascript/packs/components/feedback.js","webpack:///./app/javascript/packs/components/filteringDropDown.js","webpack:///./app/javascript/packs/components/fixedHeader.js","webpack:///./app/javascript/packs/components/fixedHeaderOnScroll.js","webpack:///./app/javascript/packs/components/forbidAllCaps.js","webpack:///./app/javascript/packs/components/getElemSize.js","webpack:///./app/javascript/packs/components/infoModal.js","webpack:///./app/javascript/packs/components/initMap.js","webpack:///./app/javascript/packs/components/initStripe.js","webpack:///./app/javascript/packs/components/initVideos.js","webpack:///./app/javascript/packs/components/inputDropdown.js","webpack:///./app/javascript/packs/components/isUpperCase.js","webpack:///./app/javascript/packs/components/lazyLoading.js","webpack:///./app/javascript/packs/components/loading.js","webpack:///./app/javascript/packs/components/mailchimp.js","webpack:///./app/javascript/packs/components/mainSearch.js","webpack:///./app/javascript/packs/components/mapZoomBtns.js","webpack:///./app/javascript/packs/components/mask.js","webpack:///./app/javascript/packs/components/numberWithCommas.js","webpack:///./app/javascript/packs/components/onlyNumbers.js","webpack:///./app/javascript/packs/components/passwordInput.js","webpack:///./app/javascript/packs/components/payments.js","webpack:///./app/javascript/packs/components/popup.js","webpack:///./app/javascript/packs/components/reCAPTCHA.js","webpack:///./app/javascript/packs/components/redirectTo.js","webpack:///./app/javascript/packs/components/reinitVideoPopup.js","webpack:///./app/javascript/packs/components/scrollTo.js","webpack:///./app/javascript/packs/components/setTextareaHeight.js","webpack:///./app/javascript/packs/components/sharePopup.js","webpack:///./app/javascript/packs/components/showFilters.js","webpack:///./app/javascript/packs/components/showMore.js","webpack:///./app/javascript/packs/components/showMoreReviews.js","webpack:///./app/javascript/packs/components/slider.js","webpack:///./app/javascript/packs/components/storeMessageContent.js","webpack:///./app/javascript/packs/components/submitFormStatus.js","webpack:///./app/javascript/packs/components/submitSearchChatForm.js","webpack:///./app/javascript/packs/components/tabs.js","webpack:///./app/javascript/packs/components/textareaCounter.js","webpack:///./app/javascript/packs/components/timeZoneDetector.js","webpack:///./app/javascript/packs/components/toggleContent.js","webpack:///./app/javascript/packs/components/toggleMapSwitch.js","webpack:///./app/javascript/packs/components/togglePayout.js","webpack:///./app/javascript/packs/components/toggleWishList.js","webpack:///./app/javascript/packs/components/validateBenefiting.js","webpack:///./app/javascript/packs/components/validateBooking.js","webpack:///./app/javascript/packs/components/validateDonation.js","webpack:///./app/javascript/packs/components/validateEmptyMessage.js","webpack:///./app/javascript/packs/components/video.js","webpack:///./app/javascript/packs/components/viewportHeight.js","webpack:///./app/javascript/packs/envVariables.js.erb","webpack:///./app/javascript/packs/lib/detectTouch.js","webpack:///./app/javascript/packs/lib/infoBoxMap.js","webpack:///./app/javascript/packs/redesign-application.js","webpack:///./app/javascript/redesign-stylesheets/app.sass","webpack:///./node_modules/debounce/index.js","webpack:///./node_modules/flatpickr/dist/flatpickr.js","webpack:///./node_modules/imask/dist/imask.esm.js","webpack:///./node_modules/jquery-validation/dist/jquery.validate.js","webpack:///./node_modules/jquery/dist/jquery.js","webpack:///./node_modules/js-cookie/src/js.cookie.js","webpack:///./node_modules/lodash/lodash.js","webpack:///./node_modules/moment-range/dist/moment-range.js","webpack:///./node_modules/moment/locale sync ^\\.\\/.*$","webpack:///./node_modules/moment/locale/af.js","webpack:///./node_modules/moment/locale/ar-dz.js","webpack:///./node_modules/moment/locale/ar-kw.js","webpack:///./node_modules/moment/locale/ar-ly.js","webpack:///./node_modules/moment/locale/ar-ma.js","webpack:///./node_modules/moment/locale/ar-sa.js","webpack:///./node_modules/moment/locale/ar-tn.js","webpack:///./node_modules/moment/locale/ar.js","webpack:///./node_modules/moment/locale/az.js","webpack:///./node_modules/moment/locale/be.js","webpack:///./node_modules/moment/locale/bg.js","webpack:///./node_modules/moment/locale/bm.js","webpack:///./node_modules/moment/locale/bn.js","webpack:///./node_modules/moment/locale/bo.js","webpack:///./node_modules/moment/locale/br.js","webpack:///./node_modules/moment/locale/bs.js","webpack:///./node_modules/moment/locale/ca.js","webpack:///./node_modules/moment/locale/cs.js","webpack:///./node_modules/moment/locale/cv.js","webpack:///./node_modules/moment/locale/cy.js","webpack:///./node_modules/moment/locale/da.js","webpack:///./node_modules/moment/locale/de-at.js","webpack:///./node_modules/moment/locale/de-ch.js","webpack:///./node_modules/moment/locale/de.js","webpack:///./node_modules/moment/locale/dv.js","webpack:///./node_modules/moment/locale/el.js","webpack:///./node_modules/moment/locale/en-au.js","webpack:///./node_modules/moment/locale/en-ca.js","webpack:///./node_modules/moment/locale/en-gb.js","webpack:///./node_modules/moment/locale/en-ie.js","webpack:///./node_modules/moment/locale/en-il.js","webpack:///./node_modules/moment/locale/en-in.js","webpack:///./node_modules/moment/locale/en-nz.js","webpack:///./node_modules/moment/locale/en-sg.js","webpack:///./node_modules/moment/locale/eo.js","webpack:///./node_modules/moment/locale/es-do.js","webpack:///./node_modules/moment/locale/es-us.js","webpack:///./node_modules/moment/locale/es.js","webpack:///./node_modules/moment/locale/et.js","webpack:///./node_modules/moment/locale/eu.js","webpack:///./node_modules/moment/locale/fa.js","webpack:///./node_modules/moment/locale/fi.js","webpack:///./node_modules/moment/locale/fil.js","webpack:///./node_modules/moment/locale/fo.js","webpack:///./node_modules/moment/locale/fr-ca.js","webpack:///./node_modules/moment/locale/fr-ch.js","webpack:///./node_modules/moment/locale/fr.js","webpack:///./node_modules/moment/locale/fy.js","webpack:///./node_modules/moment/locale/ga.js","webpack:///./node_modules/moment/locale/gd.js","webpack:///./node_modules/moment/locale/gl.js","webpack:///./node_modules/moment/locale/gom-deva.js","webpack:///./node_modules/moment/locale/gom-latn.js","webpack:///./node_modules/moment/locale/gu.js","webpack:///./node_modules/moment/locale/he.js","webpack:///./node_modules/moment/locale/hi.js","webpack:///./node_modules/moment/locale/hr.js","webpack:///./node_modules/moment/locale/hu.js","webpack:///./node_modules/moment/locale/hy-am.js","webpack:///./node_modules/moment/locale/id.js","webpack:///./node_modules/moment/locale/is.js","webpack:///./node_modules/moment/locale/it-ch.js","webpack:///./node_modules/moment/locale/it.js","webpack:///./node_modules/moment/locale/ja.js","webpack:///./node_modules/moment/locale/jv.js","webpack:///./node_modules/moment/locale/ka.js","webpack:///./node_modules/moment/locale/kk.js","webpack:///./node_modules/moment/locale/km.js","webpack:///./node_modules/moment/locale/kn.js","webpack:///./node_modules/moment/locale/ko.js","webpack:///./node_modules/moment/locale/ku.js","webpack:///./node_modules/moment/locale/ky.js","webpack:///./node_modules/moment/locale/lb.js","webpack:///./node_modules/moment/locale/lo.js","webpack:///./node_modules/moment/locale/lt.js","webpack:///./node_modules/moment/locale/lv.js","webpack:///./node_modules/moment/locale/me.js","webpack:///./node_modules/moment/locale/mi.js","webpack:///./node_modules/moment/locale/mk.js","webpack:///./node_modules/moment/locale/ml.js","webpack:///./node_modules/moment/locale/mn.js","webpack:///./node_modules/moment/locale/mr.js","webpack:///./node_modules/moment/locale/ms-my.js","webpack:///./node_modules/moment/locale/ms.js","webpack:///./node_modules/moment/locale/mt.js","webpack:///./node_modules/moment/locale/my.js","webpack:///./node_modules/moment/locale/nb.js","webpack:///./node_modules/moment/locale/ne.js","webpack:///./node_modules/moment/locale/nl-be.js","webpack:///./node_modules/moment/locale/nl.js","webpack:///./node_modules/moment/locale/nn.js","webpack:///./node_modules/moment/locale/oc-lnc.js","webpack:///./node_modules/moment/locale/pa-in.js","webpack:///./node_modules/moment/locale/pl.js","webpack:///./node_modules/moment/locale/pt-br.js","webpack:///./node_modules/moment/locale/pt.js","webpack:///./node_modules/moment/locale/ro.js","webpack:///./node_modules/moment/locale/ru.js","webpack:///./node_modules/moment/locale/sd.js","webpack:///./node_modules/moment/locale/se.js","webpack:///./node_modules/moment/locale/si.js","webpack:///./node_modules/moment/locale/sk.js","webpack:///./node_modules/moment/locale/sl.js","webpack:///./node_modules/moment/locale/sq.js","webpack:///./node_modules/moment/locale/sr-cyrl.js","webpack:///./node_modules/moment/locale/sr.js","webpack:///./node_modules/moment/locale/ss.js","webpack:///./node_modules/moment/locale/sv.js","webpack:///./node_modules/moment/locale/sw.js","webpack:///./node_modules/moment/locale/ta.js","webpack:///./node_modules/moment/locale/te.js","webpack:///./node_modules/moment/locale/tet.js","webpack:///./node_modules/moment/locale/tg.js","webpack:///./node_modules/moment/locale/th.js","webpack:///./node_modules/moment/locale/tl-ph.js","webpack:///./node_modules/moment/locale/tlh.js","webpack:///./node_modules/moment/locale/tr.js","webpack:///./node_modules/moment/locale/tzl.js","webpack:///./node_modules/moment/locale/tzm-latn.js","webpack:///./node_modules/moment/locale/tzm.js","webpack:///./node_modules/moment/locale/ug-cn.js","webpack:///./node_modules/moment/locale/uk.js","webpack:///./node_modules/moment/locale/ur.js","webpack:///./node_modules/moment/locale/uz-latn.js","webpack:///./node_modules/moment/locale/uz.js","webpack:///./node_modules/moment/locale/vi.js","webpack:///./node_modules/moment/locale/x-pseudo.js","webpack:///./node_modules/moment/locale/yo.js","webpack:///./node_modules/moment/locale/zh-cn.js","webpack:///./node_modules/moment/locale/zh-hk.js","webpack:///./node_modules/moment/locale/zh-mo.js","webpack:///./node_modules/moment/locale/zh-tw.js","webpack:///./node_modules/moment/moment.js","webpack:///./node_modules/pubsub-js/src/pubsub.js","webpack:///./node_modules/slick-carousel/slick/slick.js","webpack:///./node_modules/tinymce/skins/ui/oxide/skin.css","webpack:///./node_modules/uppy/dist/uppy.min.css","webpack:///./node_modules/vanilla-lazyload/dist/lazyload.min.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///(webpack)/buildin/global.js","webpack:///(webpack)/buildin/module.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./app/javascript/packs/redesign-application.js\");\n","var map = {\n\t\"./advice-bg\": \"./app/javascript/img/advice-bg.png\",\n\t\"./advice-bg.png\": \"./app/javascript/img/advice-bg.png\",\n\t\"./avatar\": \"./app/javascript/img/avatar.png\",\n\t\"./avatar.png\": \"./app/javascript/img/avatar.png\",\n\t\"./bgicon\": \"./app/javascript/img/bgicon.svg\",\n\t\"./bgicon.svg\": \"./app/javascript/img/bgicon.svg\",\n\t\"./bgicon_secondary\": \"./app/javascript/img/bgicon_secondary.svg\",\n\t\"./bgicon_secondary.svg\": \"./app/javascript/img/bgicon_secondary.svg\",\n\t\"./cat\": \"./app/javascript/img/cat.png\",\n\t\"./cat.png\": \"./app/javascript/img/cat.png\",\n\t\"./dog\": \"./app/javascript/img/dog.png\",\n\t\"./dog.png\": \"./app/javascript/img/dog.png\",\n\t\"./draft\": \"./app/javascript/img/draft.png\",\n\t\"./draft.png\": \"./app/javascript/img/draft.png\",\n\t\"./filetypes/doc\": \"./app/javascript/img/filetypes/doc.svg\",\n\t\"./filetypes/doc.svg\": \"./app/javascript/img/filetypes/doc.svg\",\n\t\"./filetypes/img\": \"./app/javascript/img/filetypes/img.svg\",\n\t\"./filetypes/img.svg\": \"./app/javascript/img/filetypes/img.svg\",\n\t\"./filetypes/pdf\": \"./app/javascript/img/filetypes/pdf.svg\",\n\t\"./filetypes/pdf.svg\": \"./app/javascript/img/filetypes/pdf.svg\",\n\t\"./filetypes/xls\": \"./app/javascript/img/filetypes/xls.svg\",\n\t\"./filetypes/xls.svg\": \"./app/javascript/img/filetypes/xls.svg\",\n\t\"./fullscreen\": \"./app/javascript/img/fullscreen.png\",\n\t\"./fullscreen.png\": \"./app/javascript/img/fullscreen.png\",\n\t\"./hero-list-venue\": \"./app/javascript/img/hero-list-venue.jpg\",\n\t\"./hero-list-venue.jpg\": \"./app/javascript/img/hero-list-venue.jpg\",\n\t\"./hero_bg\": \"./app/javascript/img/hero_bg.jpg\",\n\t\"./hero_bg.jpg\": \"./app/javascript/img/hero_bg.jpg\",\n\t\"./hero_bg_new\": \"./app/javascript/img/hero_bg_new.jpg\",\n\t\"./hero_bg_new.jpg\": \"./app/javascript/img/hero_bg_new.jpg\",\n\t\"./hero_bg_workspace\": \"./app/javascript/img/hero_bg_workspace.jpg\",\n\t\"./hero_bg_workspace.jpg\": \"./app/javascript/img/hero_bg_workspace.jpg\",\n\t\"./img_placeholder\": \"./app/javascript/img/img_placeholder.png\",\n\t\"./img_placeholder.png\": \"./app/javascript/img/img_placeholder.png\",\n\t\"./img_placeholder.svg\": \"./app/javascript/img/img_placeholder.svg\",\n\t\"./info_window_close\": \"./app/javascript/img/info_window_close.png\",\n\t\"./info_window_close.png\": \"./app/javascript/img/info_window_close.png\",\n\t\"./list-cards-bg\": \"./app/javascript/img/list-cards-bg.svg\",\n\t\"./list-cards-bg.svg\": \"./app/javascript/img/list-cards-bg.svg\",\n\t\"./list-venues-icons\": \"./app/javascript/img/list-venues-icons.png\",\n\t\"./list-venues-icons.png\": \"./app/javascript/img/list-venues-icons.png\",\n\t\"./logo\": \"./app/javascript/img/logo.png\",\n\t\"./logo.png\": \"./app/javascript/img/logo.png\",\n\t\"./logo.svg\": \"./app/javascript/img/logo.svg\",\n\t\"./logo_blue\": \"./app/javascript/img/logo_blue.png\",\n\t\"./logo_blue.png\": \"./app/javascript/img/logo_blue.png\",\n\t\"./logo_og\": \"./app/javascript/img/logo_og.png\",\n\t\"./logo_og.png\": \"./app/javascript/img/logo_og.png\",\n\t\"./main\": \"./app/javascript/img/main.svg\",\n\t\"./main.svg\": \"./app/javascript/img/main.svg\",\n\t\"./map-expand\": \"./app/javascript/img/map-expand.svg\",\n\t\"./map-expand.svg\": \"./app/javascript/img/map-expand.svg\",\n\t\"./mappin\": \"./app/javascript/img/mappin.svg\",\n\t\"./mappin-active\": \"./app/javascript/img/mappin-active.svg\",\n\t\"./mappin-active.svg\": \"./app/javascript/img/mappin-active.svg\",\n\t\"./mappin.svg\": \"./app/javascript/img/mappin.svg\",\n\t\"./muuchit_for_non_profits\": \"./app/javascript/img/muuchit_for_non_profits.jpg\",\n\t\"./muuchit_for_non_profits.jpg\": \"./app/javascript/img/muuchit_for_non_profits.jpg\",\n\t\"./muuchit_for_providers\": \"./app/javascript/img/muuchit_for_providers.jpg\",\n\t\"./muuchit_for_providers.jpg\": \"./app/javascript/img/muuchit_for_providers.jpg\",\n\t\"./muuchit_for_renters\": \"./app/javascript/img/muuchit_for_renters.jpg\",\n\t\"./muuchit_for_renters.jpg\": \"./app/javascript/img/muuchit_for_renters.jpg\",\n\t\"./muuchit_promotion_video\": \"./app/javascript/img/muuchit_promotion_video.jpg\",\n\t\"./muuchit_promotion_video.jpg\": \"./app/javascript/img/muuchit_promotion_video.jpg\",\n\t\"./no-avatar\": \"./app/javascript/img/no-avatar.svg\",\n\t\"./no-avatar.svg\": \"./app/javascript/img/no-avatar.svg\",\n\t\"./people/person_1\": \"./app/javascript/img/people/person_1.jpg\",\n\t\"./people/person_1.jpg\": \"./app/javascript/img/people/person_1.jpg\",\n\t\"./pet-rescue\": \"./app/javascript/img/pet-rescue.png\",\n\t\"./pet-rescue.png\": \"./app/javascript/img/pet-rescue.png\",\n\t\"./play_btn\": \"./app/javascript/img/play_btn.png\",\n\t\"./play_btn.png\": \"./app/javascript/img/play_btn.png\",\n\t\"./play_btn_white\": \"./app/javascript/img/play_btn_white.png\",\n\t\"./play_btn_white.png\": \"./app/javascript/img/play_btn_white.png\",\n\t\"./play_white\": \"./app/javascript/img/play_white.svg\",\n\t\"./play_white.svg\": \"./app/javascript/img/play_white.svg\",\n\t\"./powered_by_stripe\": \"./app/javascript/img/powered_by_stripe.svg\",\n\t\"./powered_by_stripe.svg\": \"./app/javascript/img/powered_by_stripe.svg\",\n\t\"./primary\": \"./app/javascript/img/primary.svg\",\n\t\"./primary-bottom\": \"./app/javascript/img/primary-bottom.svg\",\n\t\"./primary-bottom.svg\": \"./app/javascript/img/primary-bottom.svg\",\n\t\"./primary-desktop\": \"./app/javascript/img/primary-desktop.svg\",\n\t\"./primary-desktop.svg\": \"./app/javascript/img/primary-desktop.svg\",\n\t\"./primary-left\": \"./app/javascript/img/primary-left.svg\",\n\t\"./primary-left.svg\": \"./app/javascript/img/primary-left.svg\",\n\t\"./primary.svg\": \"./app/javascript/img/primary.svg\",\n\t\"./primary_small\": \"./app/javascript/img/primary_small.svg\",\n\t\"./primary_small.svg\": \"./app/javascript/img/primary_small.svg\",\n\t\"./residence-slide\": \"./app/javascript/img/residence-slide.jpg\",\n\t\"./residence-slide.jpg\": \"./app/javascript/img/residence-slide.jpg\",\n\t\"./secondary\": \"./app/javascript/img/secondary.svg\",\n\t\"./secondary.svg\": \"./app/javascript/img/secondary.svg\",\n\t\"./secondary_white\": \"./app/javascript/img/secondary_white.svg\",\n\t\"./secondary_white.svg\": \"./app/javascript/img/secondary_white.svg\",\n\t\"./steps-actions-bg\": \"./app/javascript/img/steps-actions-bg.png\",\n\t\"./steps-actions-bg.png\": \"./app/javascript/img/steps-actions-bg.png\",\n\t\"./stripe_connect_account\": \"./app/javascript/img/stripe_connect_account.png\",\n\t\"./stripe_connect_account.png\": \"./app/javascript/img/stripe_connect_account.png\",\n\t\"./test\": \"./app/javascript/img/test.jpg\",\n\t\"./test.jpg\": \"./app/javascript/img/test.jpg\",\n\t\"./white-logo\": \"./app/javascript/img/white-logo.svg\",\n\t\"./white-logo.svg\": \"./app/javascript/img/white-logo.svg\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"./app/javascript/img sync recursive ^\\\\.\\\\/.*$\";","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2FkdmljZS1iZy1hMWMwMzcwZDUwNmQ5MDc2NzFjMTgzYmRlYmNlMTFkNC5wbmciOw==\"","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2F2YXRhci01ZjRmMzU4MTJjMDU4MGQxOWIwZWY5NDcyM2YzZDk2Yy5wbmciOw==\"","export default __webpack_public_path__ + \"media/img/bgicon-40a8afd3ae58f7011aee4b8b55fcdf84.svg\";","export default __webpack_public_path__ + \"media/img/bgicon_secondary-7c9361ec6e58957da00e5a6acce7503e.svg\";","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2NhdC0zMWE2ZTNjNmQ5M2FkMjM5NWYyZWZmMjg1Njg5NzU0MC5wbmciOw==\"","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2RvZy01MDFkZDNhNThhNWVjYjM1MTk5MTNhNTkwNGU2OTU5Yy5wbmciOw==\"","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2RyYWZ0LWY2YjkwZmY1NWE5ODkzMGVjYmQ5YTlhZGRmYzUwYWZjLnBuZyI7\"","export default __webpack_public_path__ + \"media/img/filetypes/doc-b773a715a0274cc68eff9e29b36facf7.svg\";","export default __webpack_public_path__ + \"media/img/filetypes/img-93f006a3f7dbad2025e49412fbb94e8b.svg\";","export default __webpack_public_path__ + \"media/img/filetypes/pdf-96b612ffd3de402279cf1eef891a948f.svg\";","export default __webpack_public_path__ + \"media/img/filetypes/xls-4ce81e61a135feb8a067ca65c4f18f2b.svg\";","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2Z1bGxzY3JlZW4tNTFlYWQ2Y2Y1NGI5MGE4MzcyZjZhY2MxYmYwMTBlNjMucG5nIjs=\"","module.exports = \"data:image/jpeg;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2hlcm8tbGlzdC12ZW51ZS02Yzg2ODFjNDM1ZGJjMjg4NTc4NzY0MjE0NWY5MTIyYi5qcGciOw==\"","module.exports = \"data:image/jpeg;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2hlcm9fYmctMzI0MDI3NzY2NTI1YzZlYWJmZDIwZWQxNzI4ZTBjODkuanBnIjs=\"","module.exports = \"data:image/jpeg;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2hlcm9fYmdfbmV3LTMyNDAyNzc2NjUyNWM2ZWFiZmQyMGVkMTcyOGUwYzg5LmpwZyI7\"","module.exports = \"data:image/jpeg;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2hlcm9fYmdfd29ya3NwYWNlLTI5MjFhY2I0ZDBhZjE0ZWUxMDM0ZGJiMDEyMDJlNjg2LmpwZyI7\"","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2ltZ19wbGFjZWhvbGRlci0wNDFlZTFhODg3NzRhYzBjYzJlMjMwY2NmNjdlNTA5NS5wbmciOw==\"","export default __webpack_public_path__ + \"media/img/img_placeholder-0887a1e4d4e89155ba1fcb8f17d432ae.svg\";","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2luZm9fd2luZG93X2Nsb3NlLTc5Mjc1MGRhMTE1ZDZhZGZhMTRkOGIzODQwYzczMWQ4LnBuZyI7\"","export default __webpack_public_path__ + \"media/img/list-cards-bg-cae19afb0c2a5e299488ddb0d3fe884a.svg\";","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2xpc3QtdmVudWVzLWljb25zLThjODA3N2FlZDM4NzI4NDBlZGJiMTg0NzE0NjM4Njk5LnBuZyI7\"","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2xvZ28tOGUzMGZmOWE4OWMxMDUzODZkZTkyNjhmMTMwNWNjZTYucG5nIjs=\"","export default __webpack_public_path__ + \"media/img/logo-8a4a5b892c145376c40db3deb2a68f52.svg\";","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2xvZ29fYmx1ZS03NWY2MzFiODVlYzk5NjJmZTI4MTY3ZDAyMzI3OGY1Ni5wbmciOw==\"","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL2xvZ29fb2ctMzRiNDEyYjFhMGVkMmE2MzIxNjcwYzU5NmNjY2I5ZjYucG5nIjs=\"","export default __webpack_public_path__ + \"media/img/main-88368679bdefd6429bb990526bd17159.svg\";","export default __webpack_public_path__ + \"media/img/map-expand-c4d7f6a26609401ea6bf2d58a3b833ed.svg\";","export default __webpack_public_path__ + \"media/img/mappin-active-913b70519bc651f7dd36ee03d2c9f96c.svg\";","export default __webpack_public_path__ + \"media/img/mappin-36b1b6625bfd0ab69bb6f1df75d46bc0.svg\";","module.exports = \"data:image/jpeg;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL211dWNoaXRfZm9yX25vbl9wcm9maXRzLTNjZTI4MWNiYWVmM2E1ZTAzZmJiMmI0MWFhNjQ4YTJkLmpwZyI7\"","module.exports = \"data:image/jpeg;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL211dWNoaXRfZm9yX3Byb3ZpZGVycy1jNzMxODAxYWY5YjIwNGY3YmQ5Zjk1OGY3MDEyMjExZC5qcGciOw==\"","module.exports = \"data:image/jpeg;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL211dWNoaXRfZm9yX3JlbnRlcnMtZjg4NDU4ZTgzZTllODFjNDA2YjljOWNhNTk1NTBmY2EuanBnIjs=\"","module.exports = \"data:image/jpeg;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL211dWNoaXRfcHJvbW90aW9uX3ZpZGVvLTE4ZTRiNDE5YjU1MTI2ODRmMTUyOGQ4OWZjZjAwODgxLmpwZyI7\"","export default __webpack_public_path__ + \"media/img/no-avatar-e162209d0cee22b57388bec5dce35ade.svg\";","module.exports = \"data:image/jpeg;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL3Blb3BsZS9wZXJzb25fMS0yYTIzNTcxNWZmZmIzZDMwYTA0MzUzNWM4ZGU2Yjc1Yi5qcGciOw==\"","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL3BldC1yZXNjdWUtOWRiMmJhZDg2N2M2NThiYzdkOGJmYWRiZDY3ZTNkZjkucG5nIjs=\"","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL3BsYXlfYnRuLWViMTI5ODY0MjkwZGNhMWRkNjQ1ZjBiMmVjODI1NTAxLnBuZyI7\"","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL3BsYXlfYnRuX3doaXRlLTlmZGQxMmYwZmVjNmNkYTlmNDNmOThkYmM2OGFlNDJmLnBuZyI7\"","export default __webpack_public_path__ + \"media/img/play_white-cb7768adc0be423ce2c95bb537e5d639.svg\";","export default __webpack_public_path__ + \"media/img/powered_by_stripe-7f1e4e15e8f5e21e8401d17c6aab4414.svg\";","export default __webpack_public_path__ + \"media/img/primary-bottom-73fc22acbc1770e6569d5461c866558b.svg\";","export default __webpack_public_path__ + \"media/img/primary-desktop-22e8a1ef75cabe3187cafc4295626989.svg\";","export default __webpack_public_path__ + \"media/img/primary-left-58f0abdf1a40a975c669322621df0c46.svg\";","export default __webpack_public_path__ + \"media/img/primary-c7e334e7f245350fc2fa5dd5fe7ce6a3.svg\";","export default __webpack_public_path__ + \"media/img/primary_small-f56b38ccbca264016d45778125fa6647.svg\";","module.exports = \"data:image/jpeg;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL3Jlc2lkZW5jZS1zbGlkZS0xNzFlZjYwMWE4MWQ1NGVlM2EyMTgxN2Q3ODBhNWRkYi5qcGciOw==\"","export default __webpack_public_path__ + \"media/img/secondary-3cfb477a97972bc454e01e0dadd2c15b.svg\";","export default __webpack_public_path__ + \"media/img/secondary_white-ec877c742ce16eec5a524384251e7a91.svg\";","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL3N0ZXBzLWFjdGlvbnMtYmctOTkyOTY1ZmE4YWFiYjBiNWRiMGU2OTQ0ZDdmYmI5YzkucG5nIjs=\"","module.exports = \"data:image/png;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL3N0cmlwZV9jb25uZWN0X2FjY291bnQtNjU4ZmMzZmRhNGY1NGFiMjg4ZjZhNDQyNWFkM2I5YzQucG5nIjs=\"","module.exports = \"data:image/jpeg;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvaW1nL3Rlc3QtNTg3NjdhMDg5ZTcwN2ZjNjQyZDJkMjIzNmI2MmViOGMuanBnIjs=\"","export default __webpack_public_path__ + \"media/img/white-logo-58a31bfcbc668fd0153750e4794b6206.svg\";","var map = {\n\t\"./Event-Planning-Checklist\": \"./app/javascript/media/Event-Planning-Checklist.pdf\",\n\t\"./Event-Planning-Checklist.pdf\": \"./app/javascript/media/Event-Planning-Checklist.pdf\",\n\t\"./Vendor-Proposal-Template-Muuchit\": \"./app/javascript/media/Vendor-Proposal-Template-Muuchit.pdf\",\n\t\"./Vendor-Proposal-Template-Muuchit.pdf\": \"./app/javascript/media/Vendor-Proposal-Template-Muuchit.pdf\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"./app/javascript/media sync recursive ^\\\\.\\\\/.*$\";","module.exports = \"data:application/pdf;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvbWVkaWEvRXZlbnQtUGxhbm5pbmctQ2hlY2tsaXN0LWQyYTk2M2I2M2ViMmFhMWZkMDZkN2ViYzJlYmZjZTZjLnBkZiI7\"","module.exports = \"data:application/pdf;base64,ZXhwb3J0IGRlZmF1bHQgX193ZWJwYWNrX3B1YmxpY19wYXRoX18gKyAibWVkaWEvbWVkaWEvVmVuZG9yLVByb3Bvc2FsLVRlbXBsYXRlLU11dWNoaXQtYWIxMmY3MmU0OWUxYzA3MGY4MzJlNDc0OGNjMTY3YTUucGRmIjs=\"","export const {\n DOC,\n BODY,\n WINDOW,\n\n ISACTIVE,\n ISOPEN,\n ISHIDDEN,\n ISFIXED,\n ISERROR\n} = {\n WINDOW: $(window),\n DOC: $(document),\n BODY: $('body'),\n\n ISACTIVE: 'is-active',\n ISHIDDEN: 'is-hidden',\n ISOPEN: 'is-open',\n ISFIXED: 'is-fixed',\n ISERROR: 'is-error'\n};\n","// v1 scripts\nimport { accordion } from './components/accordion.js';\nimport { counter } from './components/counter.js';\nimport { downloadPdf } from './components/downloadPdf';\nimport { forbidAllCaps } from './components/forbidAllCaps';\nimport { loading } from './components/loading.js';\nimport { onlyNumbers } from './components/onlyNumbers.js';\nimport { setTextareaHeight } from './components/setTextareaHeight.js';\nimport { sharePopup } from './components/sharePopup.js';\nimport { showMore } from './components/showMore.js';\nimport { storeMessageContent } from './components/storeMessageContent';\nimport { submitFormStatus } from './components/submitFormStatus.js';\nimport { submitSearchChatForm } from './components/submitSearchChatForm.js';\nimport { timeZoneDetector } from './components/timeZoneDetector';\nimport { togglePayout } from './components/togglePayout.js';\nimport { validateEmptyMessage } from './components/validateEmptyMessage.js';\nimport { viewportHeight } from './components/viewportHeight.js';\n\n// v2 scripts\nimport './components/customSelect.js';\nimport './components/customSelectTabs.js';\nimport { additionalFilters } from './components/additionalFilters.js';\nimport { addressAutocomplete } from './components/addressAutocomplete.js';\nimport { benefitingShowMission } from './components/benefitingShowMission';\nimport { bookingCountdown } from './components/bookingCountdown';\nimport { calculateBookingPrice } from './components/datepicker/calculateBookingPrice.js';\nimport { checkboxToggle } from './components/checkboxToggle.js';\nimport { checkSelectFilled } from './components/checkSelectFilled.js';\nimport { clickFunctions } from './components/clickFunc.js';\nimport { copyLink } from './components/copyLink.js';\nimport { datePicker } from './components/datepicker/datePicker.js';\nimport { datePickerBooking } from './components/datepicker/datePickerBooking.js';\nimport { datePickerBookingToggle } from './components/datepicker/datePickerBookingToggle.js';\nimport { emailSubscription } from './components/emailSubscription.js';\nimport { expander } from './components/expander.js';\nimport { feedback } from './components/feedback';\nimport { filteringDropDown } from './components/filteringDropDown.js';\nimport { fixedHeaderOnScroll } from './components/fixedHeaderOnScroll.js';\nimport { infoModal } from './components/infoModal.js';\nimport { initMap } from './components/initMap.js';\nimport { initStripe } from './components/initStripe';\nimport { initVideos } from './components/initVideos.js';\nimport { inputDropdown } from './components/inputDropdown.js';\nimport { mailchimp } from './components/mailchimp.js';\nimport { mainSearch } from './components/mainSearch.js';\nimport { mask } from './components/mask';\nimport { passwordInput } from './components/passwordInput.js';\nimport { payments } from './components/payments.js';\nimport { popups } from './components/popup.js';\nimport { reCAPTCHA } from './components/reCAPTCHA.js';\nimport { reinitVideoPopup } from './components/reinitVideoPopup.js';\nimport { showFilters } from './components/showFilters.js';\nimport { showMoreReviews } from './components/showMoreReviews.js';\nimport { sliders } from './components/slider.js';\nimport { tabs } from './components/tabs.js';\nimport { textareaCounter } from './components/textareaCounter.js';\nimport { toggleContent } from './components/toggleContent.js';\nimport { toggleMapSwitch } from './components/toggleMapSwitch.js';\nimport { toggleWishList } from './components/toggleWishList.js';\nimport { validateBenefiting } from './components/validateBenefiting';\nimport { ValidationForm } from './components/ValidationForm.js';\nimport { video } from './components/video.js';\n\n$(document).ready(() => {\n $(function() {\n// v1 scripts\n accordion();\n counter();\n downloadPdf();\n forbidAllCaps();\n loading();\n onlyNumbers();\n setTextareaHeight();\n sharePopup();\n showMore();\n storeMessageContent();\n submitFormStatus();\n submitSearchChatForm();\n timeZoneDetector();\n togglePayout();\n validateEmptyMessage();\n viewportHeight();\n\n// v2 scripts\n additionalFilters();\n addressAutocomplete();\n benefitingShowMission();\n bookingCountdown();\n calculateBookingPrice();\n checkboxToggle();\n checkSelectFilled();\n clickFunctions();\n copyLink();\n datePicker();\n datePickerBooking();\n datePickerBookingToggle();\n emailSubscription();\n expander();\n feedback();\n filteringDropDown();\n fixedHeaderOnScroll();\n infoModal();\n initStripe();\n initVideos();\n inputDropdown();\n mailchimp();\n mainSearch();\n mask();\n passwordInput();\n payments();\n popups();\n reinitVideoPopup();\n showFilters();\n showMoreReviews();\n sliders();\n tabs();\n textareaCounter();\n toggleContent();\n toggleMapSwitch();\n toggleWishList();\n validateBenefiting();\n ValidationForm();\n video();\n });\n});\n\nwindow.reCAPTCHA = reCAPTCHA;\n","export const ValidationForm = () => {\n const target = $('.js-validator-email');\n\n if (target.length) {\n $.validator.addMethod('emailExt', value => {\n const patternEmail = /^[A-z0-9._%+-]+@[A-z0-9.-]+\\.[A-z]{2,4}$/.test(value);\n return patternEmail;\n }, 'Please enter valid E-mail');\n $('.js-validation').each((i, el) => {\n $(el).validate({\n errorElement: 'div',\n errorPlacement: (error, element) => {\n if (element.is(':checkbox')) {\n error.insertAfter(element.parent()).addClass('error-checkbox');\n } else {\n error.insertAfter(element);\n }\n },\n });\n });\n\n target.rules('add', {\n emailExt: true,\n });\n }\n};\n","import { ISOPEN } from '../_constants';\n\nexport function accordion() {\n let accordionToggle = $('.js-toggle-accordion');\n let accordions = $(accordionToggle).closest('.js-accordions').find('.js-accordion-item');\n\n $(accordionToggle).on('click', function() {\n var currentItem = $(this).closest('.js-accordion-item');\n var currentContent = $(this).closest('.js-accordion-item').find('.js-accordion-content');\n $(accordions).find('.js-accordion-content').not(currentContent).slideUp();\n $(accordions).not(currentItem).removeClass(ISOPEN);\n $(currentItem).toggleClass(ISOPEN);\n $(currentContent).slideToggle();\n return false;\n });\n}\n","export function additionalFilters() {\n let additionalFilter = $('.js-additional-filter');\n\n if (additionalFilter.length > 0) {\n let showFiltersBtn = $('.js-additional-filters-btn');\n\n showFiltersBtn.on('click', () => {\n if (additionalFilter.hasClass('hidden')) {\n additionalFilter.removeClass('hidden');\n showFiltersBtn.text('Hide Filters');\n } else {\n additionalFilter.addClass('hidden');\n showFiltersBtn.text('Show Filters');\n }\n });\n\n let locationInput = $('.js-filter-location');\n let radiusInput = $('.js-filter-radius');\n\n const isRadiusDisabled = () => {\n if (locationInput.val().length === 0) {\n radiusInput.val('');\n locationInput.addClass('active').attr('placeholder', 'Please fill this field').focus();\n }\n };\n\n radiusInput.on('input', () => {\n isRadiusDisabled();\n });\n\n locationInput.on('input', () => {\n locationInput.removeClass('active').attr('placeholder', 'Fort Lauderdale, FL');\n })\n }\n}\n","export function addressAutocomplete() {\n let autocomplete = $('.js-geocomplete');\n\n if (autocomplete.length > 0) {\n autocomplete.each(function () {\n let $this = $(this)\n\n let latInput = $this.parent().find('.js-geocomplete-lat');\n let lngInput = $this.parent().find('.js-geocomplete-lng');\n let cityInput = $this.parent().find('.js-geocomplete-city');\n let stateInput = $this.parent().find('.js-geocomplete-state');\n let searchBox = new google.maps.places.SearchBox(this);\n\n $this.on('click', () => {\n if (latInput.val().length > 0 && lngInput.val().length > 0 || $this.val().length > 0) {\n $this.val('')\n latInput.val('')\n lngInput.val('')\n cityInput.val('')\n stateInput.val('')\n }\n });\n\n autocomplete.on('keyup', e => {\n if(e.which === 13) {\n if (latInput.val().length === 0 && lngInput.val().length === 0) {\n e.preventDefault()\n } else {\n autocomplete.closest('form').submit()\n }\n }\n });\n\n searchBox.addListener('places_changed', function () {\n\n let placesResult = searchBox.getPlaces();\n\n if (placesResult.length === 0) return;\n\n let typesResult = []\n let places = placesResult[0]\n\n latInput.val(places.geometry.location.lat());\n lngInput.val(places.geometry.location.lng());\n\n // create array of types as key and places.address_components index as value\n places.address_components.map((item, index) => {\n typesResult[item.types[0]] = index\n })\n\n // set values to state or/and city\n if (places.types[0] === 'administrative_area_level_1') {\n stateInput.val(places.address_components[typesResult['administrative_area_level_1']].short_name)\n } else if (places.types[0] === 'locality') {\n cityInput.val(places.address_components[typesResult['locality']].long_name)\n } else {\n stateInput.val('')\n cityInput.val('')\n }\n });\n });\n }\n}\n","export function benefitingShowMission() {\n let missionEl = $('.js-benefiting-mission');\n\n if (missionEl.length) {\n let missions = missionEl.data('missions');\n\n $('.js-select').on('custom-select:change', function () {\n missionEl.html(missions[+$(this).find('option:selected').val()])\n });\n }\n}\n","import { BODY, WINDOW, ISHIDDEN } from '../_constants';\n\nexport function addBodyHidden() {\n sessionStorage.scrollTop = WINDOW.scrollTop();\n BODY.addClass(ISHIDDEN);\n BODY.css('top', - sessionStorage.scrollTop + 'px' );\n}\n\nexport function removeBodyHidden() {\n let bodyFromTop = parseInt(BODY.css('top'), 10) * -1;\n\n WINDOW.scrollTop(bodyFromTop);\n BODY.css('top', 0);\n}\n","import Cookies from 'js-cookie';\nimport { env } from '../envVariables.js.erb';\n\nexport const bookingCountdown = () => {\n const countdownEl = $('.js-countdown');\n\n if (countdownEl.length > 0) {\n const countdownTime = env.INITIAL_BOOKING_EXPIRATION_TIME_IN_MINUTES > 9\n ? env.INITIAL_BOOKING_EXPIRATION_TIME_IN_MINUTES\n : '0' + env.INITIAL_BOOKING_EXPIRATION_TIME_IN_MINUTES;\n const targetMinutes = countdownEl.find('.js-countdown-minutes');\n const targetSeconds = countdownEl.find('.js-countdown-seconds');\n const choicePopup = $('[data-popup=\"checkout\"]');\n const newBookingPopup = $('[data-popup=\"cancel-booking\"]');\n const resetTimerBtn = choicePopup.find('.js-countdown-reset-timer');\n const cancelBookingBtn = $('.js-cancel-booking');\n const deleteBookingPath = cancelBookingBtn.data('delete-booking-path');\n const redirectBookingPath = cancelBookingBtn.data('redirect');\n const bookingId = +resetTimerBtn.data('booking-id');\n const extendBookingPath = resetTimerBtn.data('extend-booking-path');\n let isExtended = resetTimerBtn.data('is-extended');\n const cookieTimerStarted = 'timer-start-time-for-id-' + bookingId;\n\n function showChoicePopup() {\n choicePopup.show()\n }\n\n function showNewBookingPopup() {\n printNumber(0, targetSeconds);\n choicePopup.remove();\n newBookingPopup.show()\n }\n\n function printNumber(time, targetElement) {\n targetElement.text(time > 9 ? time : '0' + time);\n }\n\n // Update the count down every 1 second\n function Counter() {\n let counter = setInterval(() => {\n\n // check if we have first visit time written to Cookies\n if (!Cookies.get(cookieTimerStarted)) {\n Cookies.set(cookieTimerStarted, Date.now(), { expires: 1 });\n }\n\n const timerStarted = Cookies.get(cookieTimerStarted);\n let countdownTimerTime = Date.parse('1970-01-01T00:' + countdownTime + ':00Z');\n let countdownDateTime = +timerStarted + +countdownTimerTime;\n let now = Date.now();\n\n if (now < countdownDateTime) {\n\n // Find the remaining milliseconds between now an the count down date\n let remainingMilliseconds = countdownDateTime - now;\n\n // Time calculations for minutes and seconds\n let minutes = Math.floor((remainingMilliseconds % (1000 * 60 * 60)) / (1000 * 60));\n let seconds = Math.floor((remainingMilliseconds % (1000 * 60)) / 1000);\n\n printNumber(minutes, targetMinutes);\n printNumber(seconds, targetSeconds);\n\n if (minutes === 0 && seconds === 0) {\n showNewBookingPopup();\n deleteBooking();\n } else if (minutes < 3 && !isExtended) {\n showChoicePopup();\n } else if (minutes < 5) {\n countdownEl.addClass('warning');\n } else {\n countdownEl.removeClass('warning');\n }\n\n // If the count down is finished, delete the button\n if (remainingMilliseconds < 0) {\n clearInterval(counter);\n }\n\n } else {\n clearInterval(counter);\n showNewBookingPopup();\n }\n }, 1000);\n }\n\n resetTimerBtn.on('click', e => {\n e.preventDefault();\n\n if (!isExtended) {\n $.ajax({\n type: 'put',\n url: extendBookingPath,\n contentType: \"text/plain\",\n data: {\n id: bookingId\n },\n success: () => {\n Cookies.remove(cookieTimerStarted);\n Counter();\n isExtended = true;\n choicePopup.fadeOut(200);\n },\n error: () => {\n console.log('=====', 'error');\n },\n })\n }\n });\n\n cancelBookingBtn.on('click', e => {\n e.preventDefault();\n\n $.ajax({\n type: 'delete',\n url: deleteBookingPath,\n contentType: \"text/plain\",\n data: {\n id: bookingId\n },\n success: () => {\n window.location.href = redirectBookingPath;\n },\n error: () => {\n console.log('=====', 'error');\n },\n })\n });\n\n function deleteBooking() {\n $.ajax({\n type: 'delete',\n url: deleteBookingPath,\n contentType: \"text/plain\",\n data: {\n id: bookingId\n },\n success: () => {\n console.log('-----', 'success');\n },\n error: () => {\n console.log('=====', 'error');\n },\n })\n }\n\n Counter();\n }\n};\n","import { ISACTIVE } from '../_constants';\n\nexport function checkSelectFilled() {\n// let mainBlock = $('.js-booking-request');\n//\n// let datepickerInputs = $('.js-datepicker-value').find('input');\n// let dropdowns = mainBlock.find('.custom-select__list');\n// let requestTimeToggle = $('.js-toggle-time-selects');\n//\n//\n// dropdowns.on('click', function() {\n// let selectsBlock = $(this).closest(mainBlock);\n// checkSelected(selectsBlock);\n// });\n// datepickerInputs.on('change', function() {\n// let selectsBlock = $(this).closest(mainBlock);\n// checkSelected(selectsBlock);\n// });\n//\n// requestTimeToggle.on('click', function() {\n// let btnAttr = $(this).attr('data-select-time-target');\n// requestTimeToggle.addClass(ISACTIVE);\n// $(this).removeClass(ISACTIVE);\n// let selectsBlock = $(this).closest(mainBlock).find('.js-check-select-values');\n// let thisBlock = $(this).closest(mainBlock);\n// selectsBlock.each(function() {\n// let selectBlocksAttr = $(this).attr('data-select-time');\n// if(selectBlocksAttr === btnAttr) {\n// selectsBlock.removeClass(ISACTIVE);\n// $(this).addClass(ISACTIVE);\n// }\n// });\n// checkSelected(thisBlock);\n// });\n// }\n//\n// function checkSelected(thisBlock) {\n//\n// let requestBtn = $('.js-request-btn');\n// let pricingBlock = $('.js-show-cost');\n// let selects = $(thisBlock).find('.js-check-select-values.is-active').find('select');\n//\n// let datepickers = $(thisBlock).find('.js-check-select-values.is-active').find('.js-datepicker-value');\n// let selectedArr = [];\n// selects.each(function() {\n// let allSelected = $(this).find('option:selected').attr('selected');\n// if(allSelected !== undefined) {\n// selectedArr.push(allSelected);\n// }\n// });\n//\n// datepickers.each(function() {\n// let dateInputs = $(this).find('input').eq(0).val();\n// if(dateInputs.length !== 0) {\n// selectedArr.push(dateInputs);\n// }\n// });\n//\n//\n// if(selectedArr.length === (selects.length + datepickers.length)) {\n// requestBtn.removeClass('is-disabled');\n// requestBtn.prop('disabled', false);\n// pricingBlock.addClass('is-shown');\n// } else {\n// requestBtn.addClass('is-disabled');\n// requestBtn.prop('disabled', true);\n// pricingBlock.removeClass('is-shown');\n// }\n}\n\n","\nexport function isElementInViewport(el) {\n if (typeof jQuery === 'function' && el instanceof jQuery) {\n el = el[0];\n }\n if(el.length > 0) {\n var rect = el.getBoundingClientRect();\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */\n rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */\n );\n }\n}\n","export function checkboxToggle() {\n\n function toggleCheckBox(el) {\n let checkbox = $(el).closest('.checkbox').find('input[type=checkbox]');\n let input_value = $(el).val()\n if(input_value.length > 0) {\n $(checkbox).prop('checked', true);\n $(checkbox).prop('value', input_value);\n } else {\n $(checkbox).prop('checked', false);\n }\n }\n\n const checkboxes = [].slice.call(document.querySelectorAll('.js-checkbox-input'));\n \n checkboxes.forEach(function(el) {\n\n el.addEventListener('input', function() {\n toggleCheckBox(el);\n }, false);\n \n });\n}\n","import { ISOPEN, BODY, ISHIDDEN } from '../_constants';\nimport { addBodyHidden, removeBodyHidden } from './bodyHiddenPosition.js';\n\nexport function clickFunctions() {\n let burger = $('.js-burger');\n let nav = $('.js-nav');\n let sidebar = $('.js-sidebar');\n\n $(burger).on('click', function() {\n if($(this).hasClass(ISOPEN)) {\n $(this).removeClass(ISOPEN);\n $(nav).removeClass(ISOPEN);\n $(sidebar).removeClass(ISOPEN);\n BODY.removeClass(ISHIDDEN);\n $(nav).slideUp(300);\n removeBodyHidden();\n } else {\n $(this).addClass(ISOPEN);\n $(sidebar).addClass(ISOPEN);\n $(nav).addClass(ISOPEN);\n $(nav).slideDown(300);\n addBodyHidden();\n }\n });\n\n let scrollTimeout;\n const throttle = 500;\n $(window).on('resize', function() {\n if (!scrollTimeout) {\n scrollTimeout = setTimeout(function() {\n if(burger.hasClass(ISOPEN)) {\n if (window.matchMedia('(min-width: 767px)').matches) {\n BODY.removeClass(ISHIDDEN);\n } else {\n BODY.addClass(ISHIDDEN);\n }\n }\n scrollTimeout = null;\n }, throttle);\n }\n });\n\n}\n","import { ISOPEN } from '../_constants';\nimport { copyToClipboard } from './copyToClipBoard.js';\n\nexport function copyLink() {\n let openCopyBtn = $('.js-copy-btn-open');\n let copyBlock = $('.js-copy-link');\n let copyLinkMessage = $('.js-copy-link-message');\n let copyText = copyBlock.find('.js-copy-text');\n let copyLink = copyBlock.find('.js-copy-text-btn');\n\n openCopyBtn.on('click', function(e) {\n e.preventDefault();\n copyBlock.addClass(ISOPEN);\n });\n copyLink.on('click', function(e) {\n e.preventDefault(); \n copyToClipboard(copyText[0]);\n copyLinkMessage.css('display', 'block');\n\n setTimeout(function () {\n copyLinkMessage.css('display', 'none');\n }, 5000);\n\n });\n \n}\n","export function copyToClipboard(selector) {\n if (document.selection) { \n var range = document.body.createTextRange();\n range.moveToElementText(selector);\n range.select().createTextRange();\n document.execCommand('copy'); \n\n } else if (window.getSelection) {\n var range = document.createRange();\n range.selectNode(selector);\n window.getSelection().removeAllRanges();\n window.getSelection().addRange(range);\n document.execCommand('copy');\n }}\n","export function counter() {\n let counters = $('.js-counter');\n let increment = $(counters).find('.js-counter-increment');\n let decrement = $(counters).find('.js-counter-decrement');\n var timer = 1;\n var timerInterval;\n let amountInput = counters.find('.js-counter-amount-input');\n let allowedMinHour = +counters.data('allowed-min-hour');\n let errorBlock = $('.js-counter-error');\n\n if (amountInput.val()) {\n $('.js-counter-amount').text(amountInput.val())\n } else {\n amountInput.val(0);\n $('.js-counter-amount').text(0);\n }\n\n /***** increment *****/\n $(increment).on('click', function() {\n let amountBlock = $(this).siblings('.js-counter-amount');\n incrementCounter(amountBlock);\n });\n\n $(increment).on('mousedown', function() {\n let amountBlock = $(this).siblings('.js-counter-amount');\n timerInterval = setInterval(function() {\n incrementCounter(amountBlock);\n }, 300);\n });\n\n $(increment).on('mouseup', function() {\n clearInterval(timerInterval);\n timer = 1;\n });\n /*******************/\n\n\n /***** decrement *****/\n $(decrement).on('click', function() {\n let amountBlock = $(this).siblings('.js-counter-amount');\n decrementCounter(amountBlock);\n });\n\n $(decrement).on('mousedown', function() {\n let amountBlock = $(this).siblings('.js-counter-amount');\n timerInterval = setInterval(function() {\n decrementCounter(amountBlock);\n }, 300);\n });\n\n $(decrement).on('mouseup', function() {\n clearInterval(timerInterval);\n timer = 0;\n });\n /*******************/\n\n $(document).on('mouseup', function() {\n clearInterval(timerInterval);\n timer = 1;\n });\n\n function incrementCounter(el) {\n $('.counter__wrapper .field__error-message').css('display', 'none');\n let amount = parseInt($(el).text());\n if(amount >= 0) {\n if (amount === allowedMinHour) {\n errorBlock.html('Minimal Rental Hours cannot be more than minimum venue availability hours noted in previous screen');\n return;\n }\n amount += 1;\n $(el).text(amount);\n amountInput.val(amount);\n errorBlock.html('');\n } else {\n return;\n }\n }\n function decrementCounter(el) {\n let amount = parseInt($(el).text());\n if(amount > 0) {\n if (amount === 1) {\n return;\n }\n amount -= 1;\n $(el).text(amount);\n amountInput.val(amount);\n errorBlock.html('');\n } else {\n return;\n }\n }\n}\n","import { BODY } from '../_constants';\nexport default class Select {\n constructor(config) {\n this.elem = $(config);\n this.options = this.elem.find('option');\n this.init();\n }\n init() {\n this._createWrapper();\n this._createElement();\n this._show();\n this._hide();\n this._placeholder();\n this._change();\n this._icon();\n // this._setLabel();\n }\n _createWrapper() {\n if (!this._parent.hasClass(Select.classes.wrapper)) {\n this.elem.wrap(`
`);\n }\n }\n get _parent() {\n return this.elem.closest(`.${Select.classes.wrapper}`);\n }\n get _fieldText() {\n return this._parent.find(`.${Select.classes.text}`);\n }\n // generate elements for custom select\n _createElement() {\n let selectedArray = [];\n this._parent.append(`
`);\n this._parent.find(`.${Select.classes.field}`).append(`
`);\n this._parent.append(`
`);\n this._parent.find(`.${Select.classes.dropdown}`).append(``);\n this.options.each((i, elem) => {\n let optionLabel = $(elem).html();\n let value = $(elem).val();\n this._parent.find(`.${Select.classes.list}`).append(`
  • ${optionLabel}
  • `);\n\n if (elem.getAttribute('selected')) {\n this._parent.find(`.${Select.classes.list} li`).eq(i).addClass(Select.classes.active);\n selectedArray.push(1);\n }\n\n if (elem.disabled) {\n this._parent.find(`.${Select.classes.list} li`).eq(i).addClass(Select.classes.disabled);\n }\n\n });\n\n if (selectedArray.length === 0) {\n this._parent.find(`.${Select.classes.list} li`).eq(0).addClass(Select.classes.active);\n this.options.eq(0).attr('selected', true);\n }\n }\n get _children() {\n return this._parent.find('li');\n }\n get _field() {\n return this._parent.find(`.${Select.classes.field}`);\n }\n // show dropdown\n _show() {\n this._field.on('click', () => {\n if(!this._parent.hasClass(Select.classes.open)) {\n $(`.${Select.classes.wrapper}`).removeClass(Select.classes.open);\n this._parent.addClass(Select.classes.open);\n } else {\n this._parent.removeClass(Select.classes.open);\n }\n });\n }\n // close dropdown\n _hide() {\n BODY.click((e) => {\n if (!$(e.target).closest(`.${Select.classes.wrapper}`).length) {\n $(`.${Select.classes.wrapper}`).removeClass(Select.classes.open);\n }\n });\n }\n // generate text for select input field\n _placeholder() {\n let selectedArray = [];\n this.options.each((i, elem) => {\n if (elem.getAttribute('selected')) {\n this._parent.find(`.${Select.classes.text}`).text(this.options.eq(i).text()).addClass('is-placeholder');\n selectedArray.push(1);\n }\n });\n\n if (selectedArray.length === 0) {\n this._parent.find(`.${Select.classes.text}`).text(this.options.eq(0).text()).addClass('is-placeholder');\n }\n }\n // change attributes after clicked option\n _change() {\n this._children.on('click', (e) => {\n let that = $(e.currentTarget);\n let text = that.text();\n let data_value = that.data('value');\n let index = that.index();\n if (!that.hasClass('disabled')) {\n that.addClass(Select.classes.active).siblings().removeClass(Select.classes.active);\n this.options.eq(index)\n .attr('selected', true)\n .val(data_value)\n .siblings()\n .removeAttr('selected')\n .trigger('custom-select:change')\n this._fieldText.html(text);\n this._fieldText.removeClass('is-placeholder');\n this._parent.removeClass(Select.classes.open);\n if(index === 0) {\n this._parent.find(`.${Select.classes.text}`).addClass('is-placeholder');\n } else {\n this._parent.find(`.${Select.classes.text}`).removeClass('is-placeholder');\n }\n }\n });\n }\n _icon() {\n if(this.elem.data('icon')) {\n let iconName = this.elem.data('icon');\n let iconHtml = ``;\n this._parent.find(`.${Select.classes.field}`).append(iconHtml);\n }\n }\n _setLabel() {\n let arrSearch = window.location.search.split('?');\n var params = [];\n\n if (arrSearch[1]) {\n let arrParams = arrSearch[1].split('&');\n\n $.each(arrParams, function(index, param){\n let keyValue = param.split('=')\n params.push({selectId: keyValue[0], value: keyValue[1]});\n });\n }\n\n let options = $(this.elem).find('option');\n if (params.length) {\n options.each(function () {\n for (let i = 0; i < params.length; i++) {\n let id = $(this).closest('.js-select').attr('id');\n let value = this.value;\n let text = this.text;\n\n if (value === params[i].value && id === params[i].selectId) {\n $(this)\n .attr('selected', true)\n .val(value)\n .text(text)\n .siblings()\n .removeAttr('selected')\n $(this).closest('.js-select')\n .siblings(`.${Select.classes.field}`)\n .find(`.${Select.classes.text}`)\n .html(text);\n let listItem = $(this).closest(`.${Select.classes.wrapper}`).find('li');\n listItem.each(function () {\n if ($(this).text() === text) {\n $(this).addClass(Select.classes.active).siblings().removeClass(Select.classes.active);\n }\n });\n }\n }\n });\n }\n }\n}\nSelect.classes = {\n wrapper: 'custom-select',\n field: 'custom-select__field',\n text: 'custom-select__text',\n dropdown: 'custom-select__dropdown',\n list: 'custom-select__list',\n active: 'is-active',\n open: 'is-open',\n disabled: 'disabled'\n};\n$.fn.customSelect = function() {\n this.each((i, el) => new Select($(el)));\n return this;\n};\n\n$('.js-select').customSelect();\n","import { BODY } from '../_constants';\nclass SelectTabs {\n constructor(config) {\n this.elem = $(config);\n this.options = this.elem.find('option');\n this.init();\n }\n init() {\n this._createWrapper();\n this._createElement();\n this._change();\n }\n _createWrapper() {\n this.elem.wrap(`
    `);\n }\n get _parent() {\n return this.elem.closest(`.${SelectTabs.classes.wrapper}`);\n }\n \n // generate elements for custom select\n _createElement() {\n let self = this;\n this._parent.append(``);\n this.options.each((i, elem) => {\n let optionValue = $(elem).html();\n this._parent.find(`.${SelectTabs.classes.list}`).append(`
  • ${optionValue}
  • `);\n this._parent.find(`.${SelectTabs.classes.list} li`).eq(Math.floor(self.options.length/2)).addClass(SelectTabs.classes.active);\n });\n }\n get _children() {\n return this._parent.find('li');\n }\n \n // change attributes after clicked option\n _change() {\n this._children.on('click', (e) => {\n let that = $(e.currentTarget);\n let index = that.index();\n that.addClass(SelectTabs.classes.active).siblings().removeClass(SelectTabs.classes.active);\n this.options.eq(index)\n .attr('selected', true)\n .siblings()\n .removeAttr('selected');\n });\n }\n \n}\nSelectTabs.classes = {\n wrapper: 'custom-select-tabs',\n dropdown: 'custom-select-tabs__dropdown',\n list: 'custom-select-tabs__list',\n active: 'is-active'\n};\n$.fn.customSelectTabs = function() {\n this.each((i, el) => new SelectTabs($(el)));\n return this;\n};\n\n$('.js-select-tabs').customSelectTabs();\n","import { createDateRange } from './createDateRange';\nimport { dataDaysWithMultipleRanges } from './selectors';\n\nexport function calculateBookingPrice() {\n let priceWrap = $('.js-price-wrap');\n let priceDesc = priceWrap.find('.js-price-desc');\n let priceSumEl = priceWrap.find('.js-price-sum');\n let priceDiscountWrap = priceWrap.find('.js-price-discount-wrap');\n let priceDiscountEl = priceWrap.find('.js-price-discount');\n let pricePersonalDiscountWrap = priceWrap.find('.js-price-personal-discount-wrap');\n let pricePersonalDiscountEl = priceWrap.find('.js-price-personal-discount');\n let priceCleaningWrap = priceWrap.find('.js-price-cleaning-wrap');\n let priceCleaningEl = priceWrap.find('.js-price-cleaning');\n let priceTotalEl = priceWrap.find('.js-price-total');\n let submitBtn = $('.js-request-btn');\n\n let datepickerDataInput = $('input.datepicker-data');\n let dataDisabledDates = datepickerDataInput.data('disabled-dates') ? datepickerDataInput.data('disabled-dates') : [new Date()];\n let dataDisabledDaysOfWeek = datepickerDataInput.data('disabled-days') ? datepickerDataInput.data('disabled-days') : [];\n\n// vars for getting selected data\n let bookingForm = $('.js-booking-form');\n let bookingFormStartDate = bookingForm.find('.js-form-start-date');\n let bookingFormEndDate = bookingForm.find('.js-form-end-date');\n let bookingFormFromTime = bookingForm.find('.js-form-from-time');\n let bookingFormToTime = bookingForm.find('.js-form-to-time');\n let bookingFormType = bookingForm.find('.js-form-type');\n\n// initial venue numbers\n let discountPercent = +bookingForm.data('discount') || 0;\n let personalDiscountPercent = +bookingForm.data('private-discount') || 0;\n let fullDayRate = +bookingForm.data('full-day-rate') || 0;\n let fullDayRateWizard = +bookingForm.data('full-day-rate-wizard') || 0;\n let hourlyRate = +bookingForm.data('hourly-rate');\n let hourlyRateWizard = +bookingForm.data('hourly-rate-wizard');\n let cleaningFee = +bookingForm.data('cleaning-fee') || 0;\n\n let startDate, endDate, fromTime, toTime, type;\n\n if (discountPercent === 0) {\n priceDiscountWrap.css('display', 'none');\n }\n if (personalDiscountPercent === 0) {\n pricePersonalDiscountWrap.css('display', 'none');\n }\n if (cleaningFee === 0) {\n priceCleaningWrap.css('display', 'none');\n }\n if (fullDayRate !== 0) {\n $('.js-toggle-time-selects').css('display', 'block');\n }\n\n bookingForm.on('hidden-input-change', function () {\n startDate = bookingFormStartDate.val();\n endDate = bookingFormEndDate.val();\n fromTime = bookingFormFromTime.val();\n toTime = bookingFormToTime.val();\n type = bookingFormType.val();\n\n if (startDate.length && endDate.length && fromTime.length && toTime.length && type.length) {\n calculatePrice();\n priceWrap.addClass('is-shown');\n submitBtn.removeClass('is-disabled').attr('disabled', false);\n } else {\n priceWrap.removeClass('is-shown');\n submitBtn.addClass('is-disabled').attr('disabled', true);\n }\n });\n\n function calculatePrice() {\n let priceSum, discount, personalDiscount, priceTotal;\n\n// calculations for single day\n if (type === 'single') {\n let hoursCount = +toTime - +fromTime;\n hoursCount = hoursCount < 0 ? 0 : hoursCount;\n priceSum = hoursCount * hourlyRate;\n discount = discountPercent * hoursCount * hourlyRateWizard / 100;\n personalDiscount = personalDiscountPercent * hoursCount * hourlyRateWizard / 100;\n priceTotal = priceSum - discount - personalDiscount + cleaningFee;\n\n priceDesc.html(`$${(hourlyRate / 100).toFixed(2)}/hr x ${hoursCount} hour${hoursCount > 1 ? 's' : ''}:`);\n } else {\n let datesArray = createDateRange(startDate, endDate);\n let woDisabledDates = [];\n\n // remove disabled days\n for (let i = 0; i < datesArray.length; i++) {\n if (dataDisabledDates.indexOf(datesArray[i]) === -1 && dataDaysWithMultipleRanges.indexOf(new Date(datesArray[i]).getDay()) === -1) {\n woDisabledDates.push(new Date(datesArray[i]).getUTCDay());\n }\n }\n\n // create array of day indexes to count actual selected number of dates\n let countDaysArray = woDisabledDates;\n for (let i = 0; i < dataDisabledDaysOfWeek.length; i++) {\n countDaysArray = countDaysArray.filter((e) => { return e !== dataDisabledDaysOfWeek[i] })\n }\n\n let daysCount = countDaysArray.length;\n\n priceDesc.html(`$${(fullDayRate / 100).toFixed(2)}/day x ${daysCount} day${daysCount > 1 ? 's' : ''}:`);\n priceSum = fullDayRate * daysCount;\n discount = discountPercent * daysCount * fullDayRateWizard / 100;\n personalDiscount = personalDiscountPercent * daysCount * fullDayRateWizard / 100;\n priceTotal = priceSum - discount - personalDiscount + cleaningFee;\n }\n\n priceSumEl.html(`$${(priceSum / 100).toFixed(2)}`);\n priceDiscountEl.html(`- $${(discount / 100).toFixed(2)}`);\n pricePersonalDiscountEl.html(`- $${(personalDiscount / 100).toFixed(2)}`);\n priceCleaningEl.html(`$${(cleaningFee / 100).toFixed(2)}`);\n priceTotalEl.html(`$${(priceTotal / 100).toFixed(2)}`);\n }\n}","import formatTime from './formatTime';\n\nexport default function createAvailableHoursArray(availables, type, selectedFrom = null, selectedTo = null, range = null) {\n let availablesArrayFrom = [];\n let availablesArrayTo = [];\n let bookingForm = $('.js-booking-form');\n let minHours = +bookingForm.data('min-hours');\n\n availables.map(({ from, to }, index) => {\n availablesArrayFrom[index] = [];\n availablesArrayTo[index] = [];\n\n if (type === 'from-to') {\n let hourFrom = selectedFrom || availables[index].from;\n let hourTo = selectedTo || availables[index].to;\n\n if (range === null) {\n for (let i = from; i <= to; i++) {\n availablesArrayFrom[index].push([i, formatTime(i), !(i + minHours <= hourTo), index]);\n availablesArrayTo[index].push([i, formatTime(i), !(hourFrom + minHours <= i), index])\n }\n } else {\n for (let i = from; i <= to; i++) {\n if (range === index) {\n availablesArrayFrom[index].push([i, formatTime(i), !(i + minHours <= hourTo), index]);\n availablesArrayTo[index].push([i, formatTime(i), !(hourFrom + minHours <= i), index])\n }\n }\n }\n } else {\n if (index === 0) {\n availablesArrayFrom[index].push([from, formatTime(from), false, index])\n availablesArrayTo[index].push([to, formatTime(to), false, index])\n }\n }\n });\n\n return { from: availablesArrayFrom, to: availablesArrayTo }\n}","import Moment from 'moment';\nimport { extendMoment } from 'moment-range';\n\nexport function createDateRange(startDate, endDate) {\n const moment = extendMoment(Moment);\n let range = moment().range(startDate, endDate);\n\n return Array.from(range.by('days')).map(m => m.format('YYYY-MM-DD'));\n}","import flatpickr from 'flatpickr';\nimport moment from 'moment';\n\nexport function datePicker() {\n let currentDate = new Date();\n let endDate = new Date(currentDate.getFullYear() + 2, currentDate.getMonth(), currentDate.getDate());\n let targetInput = $('.js-dates-input');\n let bookedDaysInput = $('.js-booked-dates-input');\n let selectedDates = targetInput.val() ? JSON.parse(targetInput.val()) : [];\n let bookedDays = bookedDaysInput.val() ? JSON.parse(bookedDaysInput.val()) : [];\n\n flatpickr('.js-datepicker', {\n altInput: true,\n inline: true,\n clickOpens: false,\n closeOnSelect: false,\n ignoredFocusElements: [document.body],\n mode: 'multiple',\n minDate: currentDate,\n maxDate: endDate,\n dateFormat: \"Y-m-d\",\n defaultDate: selectedDates,\n disable: bookedDays,\n monthSelectorType: 'static',\n onChange: (e) => {getSelectedDates(e)},\n onDayCreate: (dObj, dStr, fp, dayElem) => {\n if (bookedDays.indexOf(moment(dayElem.getAttribute(\"aria-label\")).format('YYYY-MM-DD')) > -1) {\n dayElem.classList.add('booked')\n }\n }\n });\n\n function formatDate(date) {\n let month, day;\n month = date.getMonth() + 1;\n day = date.getDate();\n\n return date.getFullYear() + '-' + (month > '9' ? month : '0' + month) + '-' + (day > '9' ? day : '0' + day);\n }\n\n // generate selected dates array for multiple choice\n function getSelectedDates(e) {\n selectedDates = e.map((date) => {\n return formatDate(date);\n });\n selectedDates.sort();\n targetInput.val(JSON.stringify(selectedDates));\n }\n}\n","import flatpickr from 'flatpickr';\n\nimport formatDate from './formatDate';\nimport getDayAvailableHours from './getDayAvailableHours';\nimport createAvailableHoursArray from './createAvailableHoursArray';\nimport updateSelect from './updateSelect';\nimport { datesArray } from './getDayAvailableHours';\n\nimport {\n bookingFormStartDate,\n bookingFormEndDate,\n bookingFormType,\n bookingFormFromTime,\n bookingFormToTime,\n currentDate,\n endDate,\n datepickerRow,\n dataDisabledDates,\n dataDaysWithMultipleRanges,\n dataDisabledDaysOfWeek,\n datepickerDataInput\n} from './selectors';\n\nexport function datePickerBooking() {\n function updateHoursInputs(select, targetInput) {\n select.on('custom-select:change', function () {\n let selectedValue = $(this).find('option[selected=\"selected\"]').val();\n targetInput.val(selectedValue).trigger('hidden-input-change');\n });\n }\n\n updateHoursInputs($('.js-select-start-time'), bookingFormFromTime);\n updateHoursInputs($('.js-select-end-time'), bookingFormToTime);\n\n// START TODO needs to be refactored\n let selectsToUpdate = $('.booking-request__row[data-type=\"row-from-to\"]');\n let fromSelect = selectsToUpdate.find('.js-select-start-time');\n let toSelect = selectsToUpdate.find('.js-select-end-time');\n let currentSelectedDate = '';\n\n fromSelect.on('custom-select:change', function () {\n let $this = $(this);\n let to = +$this.children().last().val();\n\n if (+$this.find('option:selected').val().length) {\n let availablesArray = createAvailableHoursArray(datesArray, 'from-to', +$this.find('option:selected').val(), to, +$this.find('option:selected').data('range'));\n updateSelect(toSelect, availablesArray.to);\n\n let optionToBeSelected = toSelect.parent().find(`.custom-select__list li[data-value=\"${+bookingFormToTime.val()}\"]`);\n\n toSelect.parent().find('.custom-select__list li').removeClass('is-active');\n optionToBeSelected.addClass('is-active');\n toSelect.parent().find('.custom-select__text').text(optionToBeSelected.text());\n toSelect.children().removeAttr('selected');\n toSelect.find(`option[value=\"${+bookingFormToTime.val()}\"]`).attr('selected', true);\n }\n });\n\n toSelect.on('custom-select:change', function () {\n let $this = $(this);\n let from = +$this.children().first().val();\n\n if (+$this.find('option:selected').val().length) {\n let availablesArray = createAvailableHoursArray(datesArray, 'from-to', from, +$this.find('option:selected').val(), +$this.find('option:selected').data('range'));\n updateSelect(fromSelect, availablesArray.from);\n\n let optionToBeSelected = fromSelect.parent().find(`.custom-select__list li[data-value=\"${+bookingFormFromTime.val()}\"]`);\n\n fromSelect.parent().find('.custom-select__list li').removeClass('is-active');\n optionToBeSelected.addClass('is-active');\n fromSelect.parent().find('.custom-select__text').text(optionToBeSelected.text());\n fromSelect.children().removeAttr('selected');\n fromSelect.find(`option[value=\"${+bookingFormToTime.val()}\"]`).attr('selected', true);\n }\n });\n\n// END TODO needs to be refactored\n\n let datepickers = [];\n\n// booking card datepicker\n datepickerRow.each(function () {\n let $this = $(this);\n let bookingCard = this.querySelector('.js-datepicker-booking');\n let selectFrom = $this.find('.js-select-start-time');\n let selectTo = $this.find('.js-select-end-time');\n let datepickerType = bookingCard.dataset.type;\n\n datepickers[datepickerType] = initDatepicker(bookingCard, selectFrom, selectTo);\n });\n\n $(window).scroll(function () {\n Object.keys(datepickers).forEach(item => {\n datepickers[item].close();\n });\n });\n\n function initDatepicker(datepickerTarget, selectFrom, selectTo) {\n let datepickerType = datepickerTarget.dataset.type;\n let isTodayAvailable = datepickerDataInput.data('current-day-available');\n let currentDay = datepickerDataInput.data('current-day');\n let flatpickrItem = flatpickr(datepickerTarget, {\n mode: 'single',\n disable: [\n function (date) {\n return (dataDisabledDates.indexOf(formatDate(date)) !== -1 || dataDisabledDaysOfWeek.indexOf(date.getDay()) !== -1)\n ||\n (datepickerType !== 'from-to' && dataDaysWithMultipleRanges.indexOf(date.getDay()) !== -1)\n ||\n (isTodayAvailable === false && currentDay === formatDate(date))\n }\n ],\n minDate: currentDate,\n maxDate: endDate,\n format: 'd-m-Y',\n altFormat: 'm/d/Y',\n altInput: true,\n onOpen: function (selectedDates, dateStr, instance) {\n $(instance.calendarContainer).addClass('flatpickr-booking');\n },\n onChange: (date) => {\n if (date.length) {\n updateDependentDatepicker(date, selectFrom, selectTo, datepickerType);\n $('.js-not-available').css('display', 'none');\n $('.js-reset-hours').on('click', () => {\n updateDependentDatepicker(date, selectFrom, selectTo, datepickerType);\n bookingFormStartDate.val('').trigger('hidden-input-change');\n bookingFormEndDate.val('').trigger('hidden-input-change');\n bookingFormFromTime.val('').trigger('hidden-input-change');\n bookingFormToTime.val('').trigger('hidden-input-change');\n bookingFormType.val('').trigger('hidden-input-change');\n })\n }\n }\n });\n return flatpickrItem;\n }\n\n function updateDependentDatepicker(date, selectFrom, selectTo, datepickerType) {\n if (datepickerType === 'from') {\n datepickers['to'].set('minDate', new Date(date));\n } else if (datepickerType === 'to') {\n datepickers['from'].set('maxDate', new Date(date));\n }\n\n getDayAvailableHours(date, selectFrom, selectTo, datepickerType);\n }\n}\n","let chooseBlock = $('.js-check-select-values');\nlet bookingForm = $('.js-booking-form');\nlet bookingFormStartDate = bookingForm.find('.js-form-start-date');\nlet bookingFormEndDate = bookingForm.find('.js-form-end-date');\nlet bookingFormFromTime = bookingForm.find('.js-form-from-time');\nlet bookingFormToTime = bookingForm.find('.js-form-to-time');\nlet bookingFormType = bookingForm.find('.js-form-type');\n\nlet bookingRowFromTo = $('.booking-request__row[data-type=\"row-from-to\"]');\nlet bookingRowFrom = $('.booking-request__row[data-type=\"row-from\"]');\nlet bookingRowTo = $('.booking-request__row[data-type=\"row-to\"]');\n\nexport function datePickerBookingToggle() {\n $('.js-toggle-time-selects').on('click', function () {\n let $this = $(this);\n let startDate, endDate, fromTime, toTime;\n let type;\n chooseBlock.toggleClass('is-active');\n\n if ($this.data('select-time-target') === 'multiple') {\n startDate = bookingRowFrom.find('.js-datepicker-booking').val();\n endDate = bookingRowTo.find('.js-datepicker-booking').val();\n fromTime = bookingRowFrom.find('.js-select-start-time option[selected=\"selected\"]').val();\n toTime = bookingRowTo.find('.js-select-end-time option[selected=\"selected\"]').val();\n type = 'multiple';\n } else {\n startDate = bookingRowFromTo.find('.js-datepicker-booking').val();\n endDate = startDate;\n fromTime = bookingRowFromTo.find('.js-select-start-time option[selected=\"selected\"]').val();\n toTime = bookingRowFromTo.find('.js-select-end-time option[selected=\"selected\"]').val();\n type = 'single';\n }\n\n bookingFormStartDate.val(startDate ? startDate : '').trigger('hidden-input-change');\n bookingFormEndDate.val(endDate ? endDate : '').trigger('hidden-input-change');\n bookingFormFromTime.val(fromTime ? fromTime : '').trigger('hidden-input-change');\n bookingFormToTime.val(toTime ? toTime : '').trigger('hidden-input-change');\n bookingFormType.val(type).trigger('hidden-input-change');\n });\n}","export default function formatDate(date) {\n let month, day;\n month = date.getMonth() + 1;\n day = date.getDate();\n\n return date.getFullYear() + '-' + (month > '9' ? month : '0' + month) + '-' + (day > '9' ? day : '0' + day);\n}","export default function formatTime(timeString) {\n let hour = timeString;\n let dayFormat;\n\n if (+hour < 24) {\n dayFormat = +hour < 12 ? ' a.m.' : ' p.m.';\n } else {\n dayFormat = ' a.m.';\n }\n hour = +hour % 12 || 12;\n\n return hour + ':00 ' + dayFormat;\n}","import formatDate from \"./formatDate\";\nimport updateSelect from \"./updateSelect\";\nimport createAvailableHoursArray from \"./createAvailableHoursArray\";\nimport updateFormFields from \"./updateFormFields\";\nimport {\n datepickerDataInput,\n} from './selectors';\nlet availablesArray = [];\n\nexport const datesArray = [];\n\nexport default function getDayAvailableHours(date, selectFromBlock, selectToBlock, type) {\n let requestPath = datepickerDataInput.data('request-path');\n let currentDateStr = datepickerDataInput.data('current-day');\n let currentHour = +datepickerDataInput.data('current-hour');\n let selectedDate = formatDate(date[0]);\n\n datesArray.length = 0;\n\n $.ajax({\n url: requestPath,\n method: 'POST',\n data: {date: selectedDate},\n success: function (event) {\n\n datesArray.push(...event)\n\n availablesArray = createAvailableHoursArray(datesArray, type);\n\n let timeFrom;\n if (selectedDate === currentDateStr && currentHour > availablesArray.from[0][0][0]) {\n timeFrom = currentHour + 1\n } else {\n timeFrom = availablesArray.from[0][0][0]\n }\n\n if (selectFromBlock.length) {\n updateSelect(selectFromBlock, availablesArray.from, timeFrom);\n if (type === 'from') selectFromBlock.parent().find('.custom-select__list li').last().click();\n }\n if (selectToBlock.length) {\n updateSelect(selectToBlock, availablesArray.to, timeFrom);\n if (type === 'to') selectToBlock.parent().find('.custom-select__list li').last().click();\n }\n\n updateFormFields(type, formatDate(date[0]), timeFrom, datesArray[0][1]);\n $('.js-reset-hours').removeClass('hidden')\n },\n error: function (e, data) {\n console.log('=====', 'e', e);\n console.log('=====', 'data', data);\n }\n });\n}\n","export const currentDate = new Date();\nexport const endDate = new Date(currentDate.getFullYear() + 2, currentDate.getMonth(), currentDate.getDate());\nexport const datepickerRow = $('.booking-request__row');\n\nexport const datepickerDataInput = $('input.datepicker-data');\nexport const dataDisabledDates = datepickerDataInput.data('disabled-dates') ? datepickerDataInput.data('disabled-dates') : [new Date()];\nexport const dataDaysWithMultipleRanges = datepickerDataInput.data('multiple-ranges-days') ? datepickerDataInput.data('multiple-ranges-days') : [];\nexport const dataDisabledDaysOfWeek = datepickerDataInput.data('disabled-days') ? datepickerDataInput.data('disabled-days') : [];\n\n// vars for sending data to backend\n export const bookingForm = $('.js-booking-form');\n export const bookingFormStartDate = bookingForm.find('.js-form-start-date');\n export const bookingFormEndDate = bookingForm.find('.js-form-end-date');\n export const bookingFormFromTime = bookingForm.find('.js-form-from-time');\n export const bookingFormToTime = bookingForm.find('.js-form-to-time');\n export const bookingFormType = bookingForm.find('.js-form-type');","import {\n bookingFormStartDate,\n bookingFormEndDate,\n bookingFormFromTime,\n bookingFormToTime,\n bookingFormType,\n bookingForm\n} from './selectors';\n\n// generate selected dates array for multiple choice\nexport default function updateFormFields(type, date, from, to) {\n let calendarType = 'multiple';\n if (type === 'from-to') {\n bookingFormStartDate.val(date);\n bookingFormEndDate.val(date);\n calendarType = 'single';\n } else if (type === 'from') {\n bookingFormStartDate.val(date);\n } else if (type === 'to') {\n bookingFormEndDate.val(date);\n }\n bookingFormStartDate.trigger('hidden-input-change');\n bookingFormEndDate.trigger('hidden-input-change');\n // bookingFormFromTime.val(from).trigger('hidden-input-change');\n // bookingFormToTime.val(to).trigger('hidden-input-change');\n bookingFormType.val(calendarType).trigger('hidden-input-change');\n bookingForm.data('type', type);\n}","import { isArray } from 'lodash';\nimport Select from '../customSelect';\n\nexport default function updateSelect(element, optionList, timeFrom = 0) {\n\n let options = optionList.map((hours, index) => {\n if (_.isArray(hours)) {\n return hours.map(item => (\n timeFrom <= item[0]\n ? ``\n : null\n ))\n } else {\n timeFrom <= item[0]\n ? ``\n : null\n }\n });\n\n element.parent().find('.custom-select__field').remove();\n element.parent().find('.custom-select__dropdown').remove();\n\n options.unshift(\"\");\n element.html(options.flat().join(''));\n new Select(element);\n}\n","import { redirectTo } from './redirectTo';\n\nexport const downloadPdf = () => {\n const redirectEl = $('[data-redirect]');\n const redirectUrl = redirectEl.data('redirect-url');\n const redirectDelay = +redirectEl.data('redirect-delay');\n const successMessageEl = $(redirectEl.data('success-element'));\n\n redirectEl.on('click', () => {\n redirectEl.addClass('hidden');\n successMessageEl.removeClass('hidden');\n redirectTo(redirectUrl, redirectDelay)\n })\n}","import { env } from '../envVariables.js.erb';\n\nexport function emailSubscription() {\n $('.js-subscription-form').each((index, item) => {\n let form = $(item);\n let subscriptionForm = form.find('.js-email-subscription-form');\n let email = form.find('input');\n let errorBlock = form.find('.js-subscription-error');\n let successBlock = form.find('.js-subscription-success');\n let loadingBlock = form.find('.js-subscription-loading');\n\n subscriptionForm.on('submit', function (e) {\n e.preventDefault();\n\n if (validateEmail()) {\n loadingBlock.css('display', 'block');\n subscriptionForm.find('.recaptcha').removeClass('hidden')\n }\n });\n\n $('.js-recaptcha').on('captcha-change', () => {\n $.ajax({\n type: \"POST\",\n url: '/email_subscriptions',\n data: {email: email.val()},\n complete: function (data) {\n loadingBlock.css('display', 'none');\n subscriptionForm.css('display', 'none');\n successBlock.css('display', 'block');\n },\n dataType: 'JSON'\n });\n });\n\n function validateEmail() {\n let filter = /^([a-zA-Z0-9_\\.\\-\\+])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\n if (!filter.test(email.val())) {\n errorBlock.text('Please provide a valid email address');\n email.focus();\n return false\n } else {\n errorBlock.text('');\n return true\n }\n }\n })\n}","import { ISOPEN } from '../_constants';\n\nexport function expander() {\n $('.js-expander-head').on('click', function() {\n $(this).parent().find('.js-expander-content').slideToggle();\n $(this).parent().toggleClass(ISOPEN);\n });\n}\n","export const feedback = () => {\n const form = $('.js-feedback-form');\n const requiredFields = $('.js-feedback-required');\n const submitBtn = $('.js-feedback-submit');\n let errorsArray = [];\n\n if (form.length > 0) {\n function validateFeedbackForm() {\n errorsArray = [];\n requiredFields.each((index, input) => {\n if ($(input).val().length === 0 ) {\n const errorMessage = $(input).hasClass('js-recaptcha') ? 'Please prove that you are not a Robot' : 'Can\\'t be blank';\n\n $(input).closest('.field')\n .addClass('is-error')\n .find('.js-feedback-error').text(errorMessage);\n\n errorsArray.push('1')\n } else {\n if ($(input).hasClass('js-feedback-email')) {\n validateEmail($(input));\n } else {\n $(input).closest('.field')\n .removeClass('is-error')\n .find('.js-feedback-error').text('');\n }\n }\n });\n }\n\n submitBtn.on('click', e => {\n e.preventDefault();\n\n validateFeedbackForm();\n if (errorsArray.length === 0) form.submit()\n });\n\n requiredFields.each((index, item) => {\n $(item).on('input captcha-change', () => validateFeedbackForm())\n });\n\n function validateEmail(input) {\n errorsArray = [];\n let filter = /^([a-zA-Z0-9_\\.\\-\\+])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\n if (!filter.test(input.val())) {\n input.closest('.field').addClass('is-error').find('.js-feedback-error').text('Please provide a valid email address');\n errorsArray.push('1')\n } else {\n input.closest('.field').removeClass('is-error').find('.js-feedback-error').text('');\n }\n }\n }\n};","export function filteringDropDown() {\n $('.js-listing-filter, .js-booking-filter, .js-review-filter').parent().find('.custom-select__list li').on('click', function () {\n $(this).closest('form').submit();\n });\n}\n","import { WINDOW, ISFIXED } from '../_constants';\nimport { getElemHeight } from './getElemSize.js';\n\nexport function fixedHeader() { \n let popupVisible = $('.js-popup').is(':visible');\n if (WINDOW.scrollTop() > getElemHeight('.js-header') || popupVisible) {\n $('.js-header').addClass(ISFIXED);\n } else {\n $('.js-header').removeClass(ISFIXED);\n } \n}\n","\nimport debounce from 'debounce';\nimport { fixedHeader } from './fixedHeader.js';\n\nexport function fixedHeaderOnScroll() {\n window.onscroll = debounce(fixedHeader, 25);\n}\n\n// var scrollTimeout;\n// var throttle = 50;\n\n// $(window).on('scroll', function() {\n// if (!scrollTimeout) {\n// scrollTimeout = setTimeout(function() {\n// fixedHeader();\n// scrollTimeout = null;\n// }, throttle);\n// }\n// });\n","import { isUpperCase } from './isUpperCase.js';\n\n// in case 4 capitalized letters in a row\n// it replaces them with lower case\nexport function forbidAllCaps() {\n if($('.venue-registration').length) {\n $(\"input[type='text'], textarea\").each(function(){\n let input = $(this);\n\n input.keyup(function() {\n let value = $(this).val();\n let words = value.split(\" \");\n\n $.each(words, function(_i,v){\n if (isUpperCase(v)) {\n let newWord = v.toLowerCase();\n let newValue = input.val().replace(v, newWord)\n\n input.val(newValue)\n }\n });\n })\n })\n }\n}\n","export function getElemHeight(elem) {\n return $(elem).outerHeight();\n};\n\nexport function getElemWidth(elem) {\n return $(elem).outerWidth();\n};","export function infoModal() {\n let infoBlock = $('.js-info-modal');\n let closeInfoModal = $('.js-close-info-modal');\n\n closeInfoModal.on('click', function() {\n $(this).closest('.js-info-modal').hide();\n });\n\n infoBlock.each(function() {\n const $this = $(this);\n\n if ($this.hasClass('alert') || $this.hasClass('notice' )) {\n const hideBlock = () => {\n $this.hide(400);\n };\n setTimeout(hideBlock, 7000);\n }\n });\n}\n","import { ZoomControl } from './mapZoomBtns.js';\nimport { ISOPEN } from '../_constants';\nimport isTouchDevice from '../lib/detectTouch.js';\nimport { env } from '../envVariables.js.erb';\n\nclass Map {\n constructor(config, mainMap) {\n this.elem = $(config);\n this.mapMain = mainMap;\n this._initMap()\n }\n\n _initMap() {\n let self = this;\n\n if(this.mapMain) {\n self._searchMap();\n } else {\n let mapWrapper = self.elem,\n mapInitBlock = mapWrapper.find('.js-map-init'),\n zoomValue = parseInt(mapInitBlock.attr('data-zoom')),\n coords = mapInitBlock.attr('coords').split(','),\n latitude = parseFloat(coords[0]),\n longtitude = parseFloat(coords[1]),\n iconSrc = mapWrapper.find('.js-active-pin').attr('src'),\n data = $('#listings_data').data('listing');\n\n let icon = {\n url: iconSrc, // url\n scaledSize: new google.maps.Size(40, 40), // scaled size\n origin: new google.maps.Point(0,0), // origin\n anchor: new google.maps.Point(20, 40) // anchor\n };\n\n let map = new google.maps.Map(mapInitBlock[0], {\n zoom: zoomValue,\n center: {lat: latitude, lng: longtitude},\n mapTypeControl: false,\n zoomControl: false,\n fullscreenControl: false\n });\n\n let marker = new google.maps.Marker({\n position: { lat: latitude, lng: longtitude },\n map: map,\n icon: icon\n });\n\n let zoomInButton = $(mapWrapper).find('.js-map-zoomin');\n let zoomOutButton = $(mapWrapper).find('.js-map-zoomout');\n\n ZoomControl(map, zoomInButton[0], zoomOutButton[0]);\n }\n }\n\n _searchMap() {\n let self = this;\n let mainMapSearch = $('#js-main-map');\n let mapWrapper = $(mainMapSearch).closest('.js-map');\n let zoomValue = parseInt($(mainMapSearch).attr('data-zoom'));\n let data = $('#listings_data').data('listing');\n let map = new google.maps.Map(document.getElementById('js-main-map'), {\n zoom: zoomValue,\n center: {lat: data[0].latitude, lng: data[0].longitude},\n mapTypeControl: false,\n zoomControl: false,\n fullscreenControl: false\n // disableDefaultUI: true\n });\n\n let zoomInButton = $(mapWrapper).find('.js-map-zoomin');\n let zoomOutButton = $(mapWrapper).find('.js-map-zoomout');\n\n ZoomControl(map, zoomInButton[0], zoomOutButton[0]);\n\n self._fullscreen(mapWrapper);\n\n let mapData = mainMapSearch[0].getAttribute('data-json');\n\n self._setMarkers(data, map, mapWrapper);\n }\n\n _setMarkers(items, map, mapWrapper) {\n let self = this;\n let mainMapBlock = mapWrapper;\n\n let inactivePin = $(mainMapBlock).find('.js-inactive-pin');\n const INACTIVEPIN = $(inactivePin).attr('src');\n\n let activePin = $(mainMapBlock).find('.js-active-pin');\n let ACTIVEPIN = $(activePin).attr('src');\n\n let closePopupBtn = $(mainMapBlock).find('.js-close-map-popup');\n let closePopupBtnSrc = $(closePopupBtn).attr('src');\n\n let bounds = new google.maps.LatLngBounds();\n\n if (INACTIVEPIN) {\n var icon = {\n url: INACTIVEPIN\n };\n }\n\n let InfoBox = require('../lib/infoBoxMap.js');\n if (window.matchMedia('(max-width: 599px)').matches) {\n var infoBoxMobPosXAxis = -150;\n } else {\n var infoBoxMobPosXAxis = 0;\n }\n\n var myOptions = {\n content: ''\n , disableAutoPan: false\n , maxWidth: 0\n , pixelOffset: new google.maps.Size(-150, infoBoxMobPosXAxis)\n , zIndex: null\n , boxStyle: {\n backgroundColor: '#fff'\n }\n , closeBoxMargin: ''\n , closeBoxURL: closePopupBtnSrc\n , infoBoxClearance: new google.maps.Size(1, 1)\n , isHidden: false\n , pane: 'floatPane'\n , enableEventPropagation: false\n };\n let infoBoxCustom = new InfoBox(myOptions);\n let markerArray = [];\n\n for (let i = 0; i < items.length; i++) {\n let latitude = parseFloat(items[i].offset_latitude);\n let longtitude = parseFloat(items[i].offset_longitude);\n\n let marker = new google.maps.Marker({\n position: { lat: latitude, lng: longtitude },\n map: map,\n icon: icon,\n id: i\n });\n\n bounds.extend(marker.position);\n\n markerArray.push(marker);\n\n var clicked;\n\n let residenceCards = document.querySelectorAll('.js-residence-card-map');\n residenceCards = [...residenceCards];\n\n for (let i = 0; i < residenceCards.length; i++) {\n residenceCards[i].addEventListener('mouseover', function () {\n let infoOpen = infoBoxCustom.content_.length;\n let cardId = parseInt(residenceCards[i].getAttribute('data-card-id'), 10);\n if (cardId === marker.id && infoOpen === 0) {\n marker.setIcon(ACTIVEPIN);\n }\n });\n\n residenceCards[i].addEventListener('mouseleave', function () {\n let cardId = parseInt(residenceCards[i].getAttribute('data-card-id'), 10);\n let infoOpen = infoBoxCustom.content_.length;\n if (cardId === marker.id && infoOpen === 0) {\n for (let j = 0; j < markerArray.length; j++) {\n markerArray[j].setIcon(INACTIVEPIN);\n }\n }\n });\n }\n\n google.maps.event.addListener(marker, 'mouseover', function () {\n if (!clicked) {\n marker.setIcon(ACTIVEPIN);\n if (residenceCards[i]) {\n let cardId = parseInt(residenceCards[i].getAttribute('data-card-id'), 10);\n if (cardId === marker.id) {\n $(residenceCards[i]).addClass('is-marker-hovered');\n } else {\n $(residenceCards[i]).removeClass('is-marker-hovered');\n }\n }\n }\n });\n\n google.maps.event.addListener(marker, 'mouseout', function () {\n if (!clicked) {\n marker.setIcon(INACTIVEPIN);\n if (residenceCards[i]) {\n $(residenceCards[i]).removeClass('is-marker-hovered');\n }\n }\n });\n\n google.maps.event.addListener(marker, 'click', function () {\n clicked = true;\n if (isTouchDevice()) {\n for (let h = 0; h < markerArray.length; h++) {\n if (residenceCards[h]) {\n $(residenceCards[h]).removeClass('is-marker-hovered');\n }\n $(residenceCards[i]).addClass('is-marker-hovered');\n }\n }\n\n function printFilledRate(vPoints) {\n let str = '';\n for (let k = 0; k < vPoints; k++) {\n str += '';\n }\n return str;\n }\n\n function printEmptyRate(vPoints) {\n let str = '';\n for (let k = 0; k < 5 - vPoints; k++) {\n str += '';\n }\n return str;\n }\n\n var contentBox =\n ''+\n '
    '+\n '
    '+\n '\"\"/'+\n '
    '+\n '
    '+\n '
    '+\n '

    '+ items[i].venue_title +'

    '+\n '
    '+ items[i].short_venue_address +'
    '+\n '
    '+\n '
    $'+ (items[i].total_full_hourly_rate.fractional / 100).toFixed(2) +'/hour
    '+\n '
    '+\n '
    ' + printFilledRate(items[i].rating) +\n printEmptyRate(items[i].rating) +\n '
    '+\n '
    '+\n '
    '+\n '
    '+\n '
    ';\n if (infoBoxCustom) {\n infoBoxCustom.close();\n for (let j = 0; j < markerArray.length; j++) {\n markerArray[j].setIcon(INACTIVEPIN);\n }\n }\n infoBoxCustom.setContent(contentBox);\n infoBoxCustom.open(map, marker);\n map.panTo(marker.getPosition());\n marker.setIcon(ACTIVEPIN);\n });\n\n google.maps.event.addListener(infoBoxCustom,\n 'closeclick',\n function () {\n clicked = false;\n for (let j = 0; j < markerArray.length; j++) {\n markerArray[j].setIcon(INACTIVEPIN);\n }\n if (residenceCards[i]) {\n $(residenceCards[i]).removeClass('is-marker-hovered');\n }\n infoBoxCustom.setContent('');\n });\n }\n\n map.fitBounds(bounds);\n }\n\n _fullscreen(mapWrapper) {\n let mapFullscreen = $(mapWrapper).find('.js-map-fullscreen');\n let mapFullscreenCloseBtn = $(mapWrapper).find('.js-map-fullscreen-close');\n let mapMainWrapper = $(mapWrapper).closest('.js-map-main-wrapper');\n\n let mapFullscreenWrapper = $(mapMainWrapper).find('.js-map-fullscreen-wrapper');\n let mapFullscreenExpandBtn = $(mapMainWrapper).find('.js-map-fullscreen');\n let mapFullscreenClose = $(mapMainWrapper).find('.js-map-fullscreen-close');\n\n function toggleMapExpanding(btn, el) {\n if ($(mapFullscreenWrapper).hasClass(ISOPEN)) {\n $(mapFullscreenWrapper).removeClass(ISOPEN);\n $(btn).removeClass(ISOPEN);\n $(el).removeClass(ISOPEN);\n } else {\n $(mapFullscreenWrapper).addClass(ISOPEN);\n $(btn).addClass(ISOPEN);\n $(el).addClass(ISOPEN);\n }\n }\n\n $(mapFullscreen).on('click', function() {\n toggleMapExpanding(mapFullscreenClose, this);\n });\n\n $(mapFullscreenCloseBtn).on('click', function() {\n toggleMapExpanding(mapFullscreenExpandBtn, this);\n });\n }\n\n _getUrl(jsonName) {\n return window.location.protocol + '//' + window.location.host + `/data/${jsonName}.json`;\n }\n}\n\n$.fn.maps = function(main) {\n this.each((i, el) => new Map($(el), main));\n return this;\n};\n\n/*** search map ***/\n$('#js-main-map').maps(true);\n/*****************/\n\n$('.js-map-common').maps();\n","import {env} from '../envVariables.js.erb';\nimport {validateBooking} from './validateBooking.js';\n\nexport function initStripe() {\n if (document.querySelector('.js-stripe-payment-form')) {\n let stripe = Stripe(env.STRIPE_PUBLISHABLE_KEY);\n let elements = stripe.elements();\n let displayErrorEl = document.querySelector('.payment__error-message');\n let paymentForm = document.getElementById('payment-form');\n let cardholderInputWrap = document.querySelector('.js-cardholder-name');\n let cardholderInput = document.getElementById('cardholder-name');\n let submitBtn = document.querySelector('.js-stripe-submit');\n let validationResult;\n\n // Style the payment element\n let style = {\n base: {\n fontSize: \"16px\"\n }\n };\n\n let classes = {\n invalid: 'is-error',\n };\n\n // Create an instance of stripe Elements\n let cardNumber = elements.create('cardNumber', {style: style, classes: classes});\n cardNumber.mount('#stripe-card-number');\n\n let cardCvc = elements.create('cardCvc', {style: style, classes: classes});\n cardCvc.mount('#stripe-cvc');\n\n let cardExpiry = elements.create('cardExpiry', {style: style, classes: classes});\n cardExpiry.mount('#stripe-exp-date');\n\n handleErrors(cardNumber);\n handleErrors(cardCvc);\n handleErrors(cardExpiry);\n\n // Listen for errors\n function handleErrors(component) {\n component.addEventListener('change', function (event) {\n\n if (event.error) {\n displayErrorEl.textContent = event.error.message;\n displayErrorEl.style.display = 'block';\n } else {\n displayErrorEl.textContent = '';\n displayErrorEl.style.display = 'none';\n }\n });\n }\n\n function validateCardholderInput() {\n if (cardholderInput.value === '') {\n cardholderInputWrap.classList.add('is-error');\n displayErrorEl.textContent = 'Please enter Cardholder Name';\n displayErrorEl.style.display = 'block';\n } else {\n cardholderInputWrap.classList.remove('is-error');\n displayErrorEl.textContent = '';\n displayErrorEl.style.display = 'none';\n }\n }\n\n cardholderInput.addEventListener('input', () => {\n validateCardholderInput();\n });\n\n // Create a token\n submitBtn.addEventListener('click', function (event) {\n event.preventDefault();\n\n validationResult = validateBooking();\n\n validateCardholderInput();\n if (cardholderInput.value === '') {\n return;\n }\n\n var submit_btn = document.querySelector('.js-stripe-submit');\n var cardDetails = {name: cardholderInput.value};\n\n if (validationResult) {\n stripe.createToken(cardNumber, cardDetails).then(function (result) {\n if (result.error) {\n displayErrorEl.textContent = result.error.message;\n displayErrorEl.style.display = 'block';\n submit_btn.classList.remove(\"disabled\");\n } else {\n // Reset errors\n displayErrorEl.textContent = '';\n displayErrorEl.style.display = 'none';\n submit_btn.classList.add(\"is-disabled\");\n // Send the token to the server\n stripeTokenHandler(result.token);\n }\n });\n }\n });\n\n // Submit the token\n function stripeTokenHandler(token) {\n // Insert the token ID into the form so it gets submitted to the server\n var hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'stripeToken');\n hiddenInput.setAttribute('value', token.id);\n paymentForm.appendChild(hiddenInput);\n\n // Submit the form\n paymentForm.submit();\n }\n }\n}\n","export function initVideos() {\n let videos = document.querySelectorAll('.js-video');\n let popupVideosLink = document.querySelectorAll('.js-popup-video');\n\n videos = [...videos];\n popupVideosLink = [...popupVideosLink];\n\n for(let i=0; i\\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' +\n '';\n\n $('[data-loading=\"true\"]').on('submit', function () {\n $('.out').append(`
    ${loadingSvg}
    `)\n });\n }\n}\n","import Cookies from 'js-cookie';\nimport { env } from '../envVariables.js.erb';\n\nexport function mailchimp() {\n let mailchimpPopup = $('.js-popup-mailchimp');\n\n if (mailchimpPopup.length) {\n let popupDelay = 20000;\n let animationDuration = 200;\n let closeBtn = $('.js-close-mailchimp');\n\n let form = $('.js-mailchimp-form');\n let email = $('.js-mailchimp-email');\n let firstName = $('.js-mailchimp-first-name');\n let submitBtn = $('.js-mailchimp-submit');\n let errorBlock = $('.js-mailchimp-error');\n let successBlock = $('.js-mailchimp-success');\n let loadingBlock = $('.js-mailchimp-loading');\n let recaptcha = $('.js-recaptcha');\n\n if (!Cookies.get('rejected')) {\n setTimeout(() => {\n mailchimpPopup.fadeIn(animationDuration);\n }, popupDelay);\n }\n\n closeBtn.on('click', function () {\n $(this).parents('.js-popup').fadeOut(animationDuration);\n Cookies.set('rejected', true, { expires: 5 });\n })\n\n submitBtn.on('click', function (e) {\n e.preventDefault();\n\n if (validateEmail()) {\n loadingBlock.css('display', 'block');\n $.ajax({\n type: \"POST\",\n url: '/email_subscriptions',\n data: {email: email.val(), first_name: firstName.val(), token: recaptcha.val()},\n complete: function (data) {\n if (data.status === 401 || data.responseText === 'unauthorized') {\n errorBlock.text('Please prove that you are not a bot');\n recaptcha.val('');\n }\n\n else if (data.status === 201 || data.responseText === 'ok' || data.status === 400 || data.responseText === 'failed') {\n loadingBlock.css('display', 'none');\n form.css('display', 'none');\n successBlock.css('display', 'block');\n Cookies.set('addedEmail', true, { expires: ( 3650 )});\n setTimeout(() => {\n mailchimpPopup.fadeOut(animationDuration);\n }, 6000);\n }\n },\n\n dataType: 'JSON'\n });\n }\n });\n\n function validateEmail() {\n let filter = /^([a-zA-Z0-9_\\.\\-\\+])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\n if (!filter.test(email.val())) {\n errorBlock.text('Please provide a valid email address');\n email.focus();\n return false\n } else {\n errorBlock.text('');\n return true\n }\n }\n }\n}\n","export function mainSearch() {\n $('#event_list a').on('click', function() {\n const text = $(this).text();\n const id = $(this).data('id');\n\n $('#search_event_text').val(text);\n $('#search_event_id').val(id);\n\n // close dropdown\n $(document).trigger('click');\n\n return false;\n });\n}\n","export function ZoomControl(map, zoomInButton, zoomOutButton) {\n\n // Setup the click event listener - zoomIn\n google.maps.event.addDomListener(zoomInButton, 'click', function() {\n map.setZoom(map.getZoom() + 1);\n });\n\n // Setup the click event listener - zoomOut\n google.maps.event.addDomListener(zoomOutButton, 'click', function() {\n map.setZoom(map.getZoom() - 1);\n });\n\n}\n","import IMask from 'imask';\nimport {env} from \"../envVariables.js.erb\";\n\nexport const mask = () => {\n const maskEl = document.querySelectorAll('.js-mask-phone');\n const mask = env.TWILIO_PHONE_MASK;\n const submitBtn = $('.js-profile-submit');\n const form = $('.js-profile-form');\n\n const validateNumber = (number = '', errorEl) => {\n console.log('=====', 'validateNumber')\n if (number.length > 0 && number.length < 10) {\n errorEl.text(`The number is invalid. Number must comply with the following mask \\\"${mask}\\\"`);\n return false\n } else {\n errorEl.text('');\n return true\n }\n };\n\n if (maskEl.length) {\n const maskOptions = {\n mask\n };\n\n maskEl.forEach(item => {\n const el = $(item);\n const mask = IMask(item, maskOptions);\n const errorEl = el.closest('.field').find('.js-phone-error');\n\n submitBtn.on('click', () => {\n const unmaskedValue = mask._unmaskedValue;\n el.data('unmasked-value', unmaskedValue);\n validateNumber(unmaskedValue, errorEl)\n })\n });\n\n submitBtn.on('click', e => {\n e.preventDefault();\n\n const validationArray = [];\n\n maskEl.forEach(item => {\n const el = $(item);\n const unmaskedValue = el.data('unmasked-value') || '';\n const errorEl = el.closest('.field').find('.js-phone-error');\n const isValid = validateNumber(unmaskedValue, errorEl);\n if (!isValid) validationArray.push(0);\n el.val(unmaskedValue);\n });\n\n if (validationArray.length === 0) form.submit();\n });\n }\n};\n","export function numberWithCommas(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n};\n","export function onlyNumbers() {\n $('input[type=\"number\"]').each(function () {\n let $this = $(this);\n\n $this.on('input', function (e) {\n e.target.value = e.target.value.replace(/[^0-9]/g, '');\n });\n\n $this.on('keypress', function () {\n return event.charCode >= 48 && event.charCode <= 57\n });\n })\n}","export function passwordInput() {\n let inputWrapper = $('.js-form-password');\n let passToggleBtn = $('.js-form-password').find('.js-toggle-password');\n let inputPass = $(inputWrapper).find('input[type=\"password\"]');\n\n $(inputPass).on('input change', function() {\n let valueLength = this.value.length;\n let toggleBtn = $(this).closest('.js-form-password').find('.js-toggle-password');\n if(valueLength >= 1) {\n $(toggleBtn).show();\n } else {\n $(toggleBtn).hide();\n }\n });\n\n $(passToggleBtn).on('click', function(e) {\n e.preventDefault();\n let input = $(this).closest('.js-form-password').find('input');\n if (input[0].type === 'password') {\n input[0].type = 'text';\n $(this).text('Hide').removeClass('btn_primary').addClass('btn_secondary');\n } else {\n input[0].type = 'password';\n $(this).text('Show').removeClass('btn_secondary').addClass('btn_primary');\n }\n });\n}\n","export function payments() {\n\n let paymentPaypal = $('.js-payment-paypal');\n let paymentCard = $('.js-payment-card');\n let paymentMethods = $('.js-payment-methods');\n\n $('.js-payment-method-paypal').on( 'click', function() {\n if ($('.js-payment-method-paypal input[type=radio]').is(':checked')) {\n paymentMethods.hide();\n paymentPaypal.show();\n } \n });\n $('.js-payment-method-card').on( 'click', function() {\n if ($('.js-payment-method-card input[type=radio]').is(':checked')) {\n paymentMethods.hide();\n paymentCard.show();\n } \n });\n\n\n $('.js-payment-paypal-change').on( 'click', function() {\n paymentPaypal.hide();\n paymentCard.show();\n });\n\n $('.js-payment-card-change').on( 'click', function() {\n paymentCard.hide();\n paymentPaypal.show();\n });\n\n};\n","import PubSub from 'pubsub-js';\nimport { BODY, ISFIXED, ISHIDDEN } from '../_constants';\nimport { addBodyHidden, removeBodyHidden } from './bodyHiddenPosition.js';\n\nexport function popups() {\n\n let bodyHiddenStatus = 0;\n $('.js-popup-link').on('click', function(e) {\n if (!$(this).hasClass('phone-verification')) {\n e.preventDefault();\n }\n\n let $this = $(this),\n attr = $this.attr('data-popup');\n let target = $(`.js-popup[data-popup=\"${attr}\"]`);\n\n if ($this.hasClass('js-popup-gallery-link')) {\n PubSub.publish('open-popup-gallery', $this);\n }\n\n $('.js-popup').fadeOut(200);\n target.fadeIn(300);\n\n if(!target.hasClass('is-scrollable')) {\n addBodyHidden();\n }\n });\n\n $('.js-popup-overlay, .js-close-popup').on('click', function(e) {\n e.stopPropagation();\n\n let parent = $(this).parents('.js-popup');\n parent.fadeOut(200);\n\n let videosFrame = $('.js-video-in-popup').closest('iframe');\n if(videosFrame !== null && videosFrame !== undefined) {\n $(videosFrame).remove();\n }\n if (parent.attr('data-popup') === 'popup-gallery') {\n PubSub.publish('close-popup-gallery');\n }\n\n if (bodyHiddenStatus === 1) {\n bodyHiddenStatus = 0;\n } else {\n BODY.removeClass(ISHIDDEN);\n if(!parent.hasClass('is-scrollable')) {\n removeBodyHidden();\n }\n $('.js-header').removeClass(ISFIXED);\n }\n });\n\n $('.js-popup-content').on('click', function(e) {\n e.stopPropagation();\n });\n\n}\n","import { env } from '../envVariables.js.erb';\n\nexport const reCAPTCHA = () => {\n $('.js-recaptcha').val(env.RECAPTCHA_SITE_KEY).trigger('captcha-change')\n};\n","export const redirectTo = (redirectUrl = window.location.pathname, redirectDelay = 3000) => {\n setTimeout(() => {\n window.location.pathname = redirectUrl\n }, redirectDelay)\n};\n","export function reinitVideoPopup() {\n\n var target = document.querySelectorAll('.video');\n target = [...target];\n\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n // console.log(mutation);\n let ifvideoPopupChanged = mutation.target.children[0].className === 'js-video-in-popup';\n\n if(ifvideoPopupChanged && mutation.removedNodes.length) {\n let ifNotIframe = $(mutation.removedNodes[0]).prop('tagName') === 'IFRAME';\n if(!ifNotIframe) {\n let removedNode = mutation.removedNodes[0];\n $(mutation.target).append(removedNode); \n $(mutation.target).closest('iframe').remove();\n }\n }\n }); \n });\n \n // configuration\n var config = { attributes: true, childList: true, characterData: true };\n \n for(let i=0; i 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n textareaElement.style.height = Math.max(minHeight, textareaElement.scrollHeight + diff) + 'px';\n } else {\n textareaElement.style.height = 0;\n textareaElement.style.height = Math.max(minHeight, textareaElement.scrollHeight + diff) + 'px';\n }; \n \n let parentAccordionItem = textareaElement.closest('[data-accordion-item]');\n if (parentAccordionItem && parentAccordionItem.classList.contains('is-active') && parentAccordionItem.style.maxHeight !== 'none') {\n parentAccordionItem.style.maxHeight = 'none';\n };\n let textareaPlaceholder = $(textareaElement).is('[v-center]');\n if(textareaPlaceholder) {\n $(textareaElement).addClass('is-center');\n }\n };\n \n const textAreas = [].slice.call(document.querySelectorAll('textarea[data-adaptheight]'));\n \n textAreas.forEach(function(el) {\n \n let minHeight = el.scrollHeight;\n \n el.addEventListener('input', function() {\n adjustHeight(el, minHeight);\n }, false);\n \n el.addEventListener('focus', function() {\n let parent = el.parentNode;\n parent.classList.add('has-focus');\n });\n \n el.addEventListener('blur', function() {\n let parent = el.parentNode;\n parent.classList.remove('has-focus');\n });\n \n\n var scrollTimeout;\n var throttle = 50;\n\n WINDOW.on('resize', function() {\n if (!scrollTimeout) {\n scrollTimeout = setTimeout(function() {\n adjustHeight(el, minHeight);\n scrollTimeout = null;\n }, throttle);\n }\n });\n\n $(document).ready(() => {\n adjustHeight(el, minHeight);\n });\n \n });\n};\n\n","export function sharePopup() {\n let socialBtn = $('.js-open-social-popup');\n\n if (socialBtn.length) {\n socialBtn.each(function () {\n let $this = $(this);\n $this.on('click', function (e) {\n e.preventDefault();\n window.open($this.attr(\"href\"), '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600')\n });\n });\n }\n}\n","export function showFilters() {\n let toggleFiltersBtn = $('.js-show-filters');\n\n if (toggleFiltersBtn.length) {\n let filtersEl = $('.js-show-filters-target');\n\n toggleFiltersBtn.on('click', function () {\n if (filtersEl.hasClass('opened')) {\n toggleFiltersBtn.text('Show Filters');\n } else {\n toggleFiltersBtn.text('Hide Filters');\n }\n filtersEl.toggleClass('closed opened')\n });\n }\n}\n","export function showMore() {\n let textBlocks = $('.js-show-all-text');\n let toggleBtn = $('.js-show-more-btn');\n\n var scrollTimeout;\n var throttle = 250;\n $(window).on('resize', function() {\n if (!scrollTimeout) {\n scrollTimeout = setTimeout(function() {\n textBlocks.each(function() {\n if (this.scrollHeight > $(this).innerHeight()) {\n $(this).find('.js-show-more-btn').show();\n } else {\n $(this).find('.js-show-more-btn').hide();\n }\n });\n scrollTimeout = null;\n }, throttle);\n }\n });\n\n textBlocks.each(function() {\n if (this.scrollHeight > $(this).innerHeight()) {\n $(this).find('.js-show-more-btn').show();\n } else {\n $(this).find('.js-show-more-btn').hide();\n }\n });\n \n toggleBtn.on('click', function(e) {\n e.preventDefault();\n let textBlock = $(this).closest('.js-show-all-text');\n var linkText = $(this).text().toUpperCase(); \n if(!textBlock.hasClass('is-open')) {\n linkText = 'show less';\n textBlock.addClass('is-open');\n $(this).addClass('is-open');\n } else {\n linkText = 'show more';\n textBlock.removeClass('is-open');\n $(this).removeClass('is-open');\n };\n \n $(this).text(linkText); \n\n });\n}\n","export function showMoreReviews() {\n const showMoreBtn = $('.js-review-show-more');\n const reviewWrappers = $('.js-review-more');\n const buttonTextShow = showMoreBtn.text();\n const buttonTextHide = showMoreBtn.data('hide-text');\n\n showMoreBtn.on('click', function(e) {\n e.preventDefault();\n\n if(showMoreBtn.hasClass('is-open')) {\n showMoreBtn.removeClass('is-open').text(buttonTextShow);\n reviewWrappers.addClass('hidden');\n } else {\n showMoreBtn.addClass('is-open').text(buttonTextHide);\n reviewWrappers.removeClass('hidden');\n }\n });\n}\n","import slick from 'slick-carousel';\nimport debounce from 'debounce';\nimport { isElementInViewport } from './checkViewport';\nimport PubSub from 'pubsub-js';\nimport { BODY, ISHIDDEN } from '../_constants';\nimport { addBodyHidden, removeBodyHidden } from './bodyHiddenPosition.js';\nimport { myLazyLoad } from './lazyLoading.js';\n\nexport function sliders() {\n\n\n // custom common arrow btns\n let commonNextArrow = `
    \n
    `;\n let commonPrevArrow = `
    \n \n
    `;\n\n\n // slider in popular venue section\n let sliderVenue = $('.js-venue-slider');\n\n $(sliderVenue).slick({\n arrows: false,\n dots: true,\n infinite: true,\n slidesToShow: 3,\n slidesToScroll: 1,\n autoplay: false,\n autoplaySpeed: 3000,\n responsive: [{\n breakpoint: 1200,\n settings: {\n slidesToShow: 2\n }\n },\n {\n breakpoint: 1023,\n settings: {\n slidesToShow: 2,\n rows: 2\n }\n },\n {\n breakpoint: 599,\n settings: {\n slidesToShow: 2,\n autoplay: false,\n rows: 2\n }\n }\n ]\n });\n\n $('.js-booking-slider-for').slick({\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false,\n fade: true,\n asNavFor: '.js-booking-slider-nav',\n responsive: [{\n breakpoint: 991,\n settings: {\n arrows: true,\n nextArrow: commonNextArrow,\n prevArrow: commonPrevArrow\n }\n }]\n });\n $('.js-booking-slider-nav').slick({\n slidesToShow: 4,\n slidesToScroll: 1,\n asNavFor: '.js-booking-slider-for',\n dots: false,\n prevArrow: commonPrevArrow,\n nextArrow: commonNextArrow,\n centerMode: false,\n infinite: true,\n focusOnSelect: true\n });\n\n\n // slider in booking similar\n let bookingSimilarSlider = $('.js-booking-similar-slider');\n\n $(bookingSimilarSlider).slick({\n arrows: false,\n dots: true,\n infinite: true,\n slidesToShow: 3,\n slidesToScroll: 1,\n autoplay: false,\n autoplaySpeed: 3000,\n swipe: false,\n responsive: [{\n breakpoint: 1023,\n settings: {\n slidesToShow: 2,\n rows: 1\n }\n },\n {\n breakpoint: 599,\n settings: {\n slidesToShow: 1,\n autoplay: false,\n rows: 1\n }\n }\n ]\n });\n\n\n // slider in lp-reasons section\n let sliderReasonsLP = $('.js-advantages-slider');\n\n reinitAutoplay(sliderReasonsLP);\n\n $(sliderReasonsLP).on('destroy', function(ev, slick) {\n reinitSlider(this, slick.options);\n }).slick({\n mobileFirst: true,\n arrows: false,\n dots: true,\n infinite: true,\n slidesToShow: 1,\n slidesToScroll: 1,\n adaptiveHeight: true,\n autoplay: false,\n autoplaySpeed: 2500,\n responsive: [{\n breakpoint: 599,\n settings: 'unslick'\n }]\n });\n\n\n // slider in reasons-video section\n let sliderReasonsVideoLP = $('.js-review-videos-mob-slider');\n reinitAutoplay(sliderReasonsVideoLP);\n $(sliderReasonsVideoLP).on('destroy', function(ev, slick) {\n let popupLink = $(this).find('.js-popup-link');\n reinitSlider(this, slick.options, popupLink);\n }).slick({\n mobileFirst: true,\n arrows: false,\n dots: true,\n infinite: true,\n slidesToShow: 1,\n slidesToScroll: 1,\n adaptiveHeight: true,\n autoplay: false,\n autoplaySpeed: 2500,\n responsive: [{\n breakpoint: 599,\n settings: 'unslick'\n }]\n });\n\n\n // slider in steps\n let steps = $('.js-steps-slider');\n\n reinitAutoplay(steps);\n $(steps).on('destroy', function(ev, slick) {\n reinitSlider(this, slick.options);\n }).slick({\n mobileFirst: true,\n arrows: false,\n dots: true,\n infinite: true,\n slidesToShow: 1,\n slidesToScroll: 1,\n adaptiveHeight: true,\n autoplay: false,\n autoplaySpeed: 2500,\n responsive: [{\n breakpoint: 767,\n settings: 'unslick'\n }]\n });\n\n\n // slider in reasons-video section\n let cards = $('.js-cards-slider');\n reinitAutoplay(cards);\n $(cards).on('destroy', function(ev, slick) {\n reinitSlider(this, slick.options);\n }).slick({\n mobileFirst: true,\n arrows: false,\n dots: true,\n infinite: true,\n slidesToShow: 1,\n slidesToScroll: 1,\n autoplay: false,\n responsive: [{\n breakpoint: 767,\n settings: 'unslick'\n }]\n });\n\n // slider in dashboard first time menu\n let chooseCardsDashboard = $('.js-choose-card-slider');\n $(chooseCardsDashboard).on('destroy', function(ev, slick) {\n reinitSlider(this, slick.options);\n }).slick({\n mobileFirst: true,\n arrows: false,\n dots: true,\n infinite: true,\n slidesToShow: 1,\n slidesToScroll: 1,\n autoplay: false,\n responsive: [{\n breakpoint: 767,\n settings: 'unslick'\n }]\n });\n\n\n // slider residence-cards\n let residenceCards = $('.js-residence-card-slider');\n\n $(residenceCards).slick({\n arrows: false,\n dots: false,\n infinite: true,\n slidesToShow: 1,\n slidesToScroll: 1,\n autoplay: false\n // nextArrow: commonNextArrow,\n // prevArrow: commonPrevArrow\n });\n\n\n\n\n // slider in booking\n let sliderHeroBooking = $('.js-hero-booking-slider');\n\n $(sliderHeroBooking).slick({\n arrows: false,\n dots: false,\n infinite: true,\n slidesToShow: 1,\n slidesToScroll: 1,\n autoplay: false,\n autoplaySpeed: 3000,\n });\n\n // slider in popup\n let openGalleryPopupBtn = $('.js-open-gallery-popup');\n\n $(openGalleryPopupBtn).on('click', function(e) {\n e.preventDefault();\n myLazyLoad.loadAll();\n let popupSlider = $('.js-popup-gallery-slider');\n let popupSliderThumbs = $('.js-popup-gallery-thumbnails');\n let activeSlide = parseInt(sliderHeroBooking.find('.slick-active').attr('data-slick-index'));\n let popupSliderCounter = $('.js-popup-gallery-counter');\n\n function initNewSlider({ newClass, wrapEl, slider, closeBtn }) {\n let newSlider = sliderHeroBooking\n .find('.slick-slide')\n .not('.slick-cloned')\n .find('.slider-slide')\n .clone()\n .addClass(newClass)\n .wrap(wrapEl)\n .parent();\n if(closeBtn) {\n newSlider.find('.popup__close').removeClass('is-hidden');\n }\n slider.html(newSlider);\n }\n\n initNewSlider({\n newClass: 'popup-slide__inner',\n wrapEl: '
    ',\n slider: popupSlider,\n closeBtn: true\n });\n initNewSlider({\n newClass: 'slide-thumb__inner',\n wrapEl: '
    ',\n slider: popupSliderThumbs\n });\n\n\n popupSlider.on('init reInit afterChange', function(event, slick, currentSlide, nextSlide) {\n //currentSlide is undefined on init -- set it to 0 in this case (currentSlide is 0 based)\n var i = (currentSlide ? currentSlide : 0) + 1;\n popupSliderCounter.text(i + '/' + slick.slideCount);\n });\n\n\n\n popupSlider.slick({\n initialSlide: activeSlide,\n asNavFor: popupSliderThumbs,\n slidesToShow: 1,\n slidesToScroll: 1,\n prevArrow: commonPrevArrow,\n nextArrow: commonNextArrow,\n });\n\n popupSliderThumbs.slick({\n asNavFor: popupSlider,\n initialSlide: 0,\n slidesToShow: 4,\n slidesToScroll: 1,\n focusOnSelect: true,\n centerMode: true,\n infinite: true\n });\n\n let bodyHiddenStatus = 0;\n $('.js-popup-overlay, .js-close-popup').on('click', function(e) {\n e.stopPropagation();\n\n $(popupSlider).slick('unslick');\n $(popupSliderThumbs).slick('unslick');\n\n let parent = $(this).parents('.js-popup');\n parent.fadeOut(200);\n if (parent.attr('data-popup') === 'popup-gallery') {\n PubSub.publish('close-popup-gallery');\n };\n\n if (bodyHiddenStatus === 1) {\n bodyHiddenStatus = 0;\n } else {\n BODY.removeClass(ISHIDDEN);\n removeBodyHidden();\n };\n });\n\n });\n\n\n\n // for arrows outside slider wrapper\n function sliderArrows(slider, block) {\n for(let i=0; i .btn')\n\n submitBtn.on('click', function() {\n sessionStorage.setItem('message', $('#message_content').val());\n })\n\n if (sessionStorage.getItem('message')){\n $('#message_content').val(sessionStorage.getItem('message'))\n }\n\n if (document.referrer.includes('/messages/') && window.location.href.includes('/listings/')) {\n sessionStorage.clear();\n }\n}\n","// TODO refactore or remove it\nexport function submitFormStatus() {\n $('#status').on('change', function(){\n $('form').submit();\n })\n}","export function submitSearchChatForm() {\n $('#search').keypress(function(e){\n if(e.which == 13){\n $('form[name=search_form]').submit();\n }\n });\n}","export function tabs() {\n const tab = document.querySelectorAll('.js-tab');\n\n for (let i = 0; i < tab.length; i++) {\n tab[i].addEventListener('click', function(e) {\n e.preventDefault();\n\n let tabData = this.dataset.targetTab;\n let target = document.querySelector('[data-tab=\"' + tabData + '\"]');\n\n let tabTargetItemElse = document.querySelectorAll(\n '.js-tabs-item:not([data-tab=\"' + tabData + '\"])'\n );\n tabTargetItemElse = [...tabTargetItemElse];\n\n let tabElse = document.querySelectorAll(\n '.js-tab:not([data-target-tab=\"' + tabData + '\"])'\n );\n tabElse = [...tabElse];\n\n for (let j = 0; j < tabTargetItemElse.length; j++) {\n tabTargetItemElse[j].classList.remove('is-active');\n }\n for (let j = 0; j < tabElse.length; j++) {\n tabElse[j].classList.remove('is-active');\n }\n this.classList.add('is-active');\n target.classList.add('is-active');\n });\n }\n}\n","import { numberWithCommas } from './numberWithCommas.js';\n\nexport function textareaCounter() {\n let counters = $('.js-textarea-counter');\n if (counters.length > 0) {\n let textarea = counters.closest('.js-textarea').find('textarea, input');\n let textareaCountAmount = +textarea.data('max-count');\n $(counters).text(numberWithCommas((textareaCountAmount - $(textarea).val().length)));\n $(textarea).on('input', function() {\n $(counters).text(numberWithCommas((textareaCountAmount - $(this).val().length)));\n });\n }\n}\n","export function timeZoneDetector() {\n if ($('#user_time_zone').length) {\n $('#user_time_zone').val(jstz.determine().name())\n }\n}\n","export function toggleContent() {\n $('.js-toggle').each(function () {\n let $this = $(this);\n let buttonInitialText = $this.text();\n let buttonAlternativeText = $this.data('alternative-text');\n\n $this.click(function (e) {\n e.preventDefault();\n let target = $this.parent().find('.js-toggle-target');\n\n if (target.hasClass('is-open')) {\n target.removeClass('is-open');\n $this.text(buttonInitialText).removeClass('is-open');\n } else {\n target.addClass('is-open');\n $this.text(buttonAlternativeText).addClass('is-open');\n }\n });\n });\n}","export function toggleMapSwitch() {\n let toggleBtn = $('.js-toggle-map');\n if(toggleBtn.length) {\n $(toggleBtn).on('click', function() {\n let href = $(this).data('map-href');\n if(href) {\n window.location.href = href;\n } \n });\n }\n}\n","export function togglePayout() {\n let toggleBtn = $('.js-payout-delete-toggle');\n toggleBtn.on('click', function() {\n toggleBtn.css('display', 'none');\n $('.js-payout-delete-form').css('display', 'block');\n });\n}\n","export function toggleWishList() {\n $('.like-btn').on('click', function(){\n var like_btn = $(this);\n var listing_id = like_btn.attr('data-listing-id');\n if(like_btn.hasClass('is-active')){\n $.ajax({\n type: \"POST\",\n url: '/remove_from_favorite_list',\n data: { listing_id: listing_id },\n complete: function(data){\n if (data.status == 201){\n like_btn.removeClass('is-active')\n }\n }\n });\n }else{\n $.ajax({\n type: \"POST\",\n url: '/add_to_favorite_list',\n data: { listing_id: listing_id },\n complete: function(data){\n if (data.status == 201){\n like_btn.addClass('is-active')\n }\n }\n });\n }\n\n })\n}\n","import { validateDonation } from './validateDonation.js'\n\nexport function validateBenefiting() {\n let validationSource = $('.js-validation-source');\n\n if ($('.js-benefiting-organization').length) {\n let validationTarget = $('.js-validate-benefiting');\n let userId = +validationSource.data('user-id');\n let select = $('.js-select');\n let inputTarget = $('.js-validation-target');\n\n select.on('custom-select:change', function () {\n if (+select.find('option:selected').val() === userId) {\n validationTarget.addClass('hidden');\n inputTarget.val(inputTarget.attr('min'));\n } else {\n validateDonation();\n validationTarget.removeClass('hidden');\n }\n });\n }\n}","import { scrollTo } from './scrollTo.js'\n\nexport function validateBooking() {\n let eventTypeInput = $('.js-select');\n let peopleInput = $('.js-requested-people');\n let messageInput = $('.js-booking-message');\n let errorMsg = 'This field is required';\n let errorMsgMaxPeople = 'Please enter number less than ';\n let eventTypeInputWrapper = eventTypeInput.closest('.select');\n let peopleInputWrapper = peopleInput.closest('.field_secondary');\n let messageInputWrapper = messageInput.closest('.user-description__textarea');\n let preventMultipleScroll = [];\n\n function validateField(element, wrapper) {\n if (!element.val().length) {\n if (!wrapper.hasClass('is-error')) {\n wrapper.addClass('is-error').append(`
    ${errorMsg}
    `);\n }\n if (!preventMultipleScroll.length) {\n scrollTo(wrapper, 400);\n }\n preventMultipleScroll.push('1');\n } else if (+element.val() > +element.attr('max')) {\n if (!wrapper.hasClass('is-error')) {\n wrapper.addClass('is-error').append(`
    ${errorMsgMaxPeople + element.attr('max')}
    `);\n }\n if (!preventMultipleScroll.length) {\n scrollTo(wrapper, 400);\n }\n preventMultipleScroll.push('1');\n } else {\n wrapper.removeClass('is-error').find('.js-validation-error').remove();\n }\n }\n\n validateField(eventTypeInput, eventTypeInputWrapper);\n validateField(peopleInput, peopleInputWrapper);\n validateField(messageInput, messageInputWrapper);\n\n peopleInput.on('input', function () {\n validateField(peopleInput, peopleInputWrapper);\n });\n\n messageInput.on('input', function () {\n validateField(messageInput, messageInputWrapper);\n });\n\n eventTypeInput.on('custom-select:change', function () {\n validateField(eventTypeInput, eventTypeInputWrapper);\n });\n\n if (preventMultipleScroll.length) {\n return false\n } else {\n return true\n }\n}","export function validateDonation() {\n let donationEl = $('.js-validate_donation');\n\n let minDonationValue = +donationEl.data('min-donation');\n let nextBtn = $('.js-next-button');\n let inputEl = $('.js-validation-target');\n\n nextBtn.on('click', function (e) {\n e.preventDefault();\n\n if (inputEl.val() < minDonationValue) {\n let errorMessage = `Must be greater than or equal to ${minDonationValue}`;\n\n if ($('.js-donation-error').length) {\n $('.js-donation-error').text(errorMessage);\n } else {\n donationEl.append(`
    ${errorMessage}
    `);\n }\n donationEl.addClass('is-error')\n } else {\n $('.js-donation-error').remove();\n donationEl.removeClass('is-error');\n $('form').submit();\n }\n });\n}\n","export const validateEmptyMessage = () => {\n let submit = document.querySelector('.js-message-submit');\n let errorBlock = $('.js-counter-error');\n\n if (submit) {\n submit.onclick = e => {\n if (document.querySelector('.js-message-input').value.length < 1 && document.querySelector('.js-file-upload-result').value.length < 1) {\n $('.counter__error').addClass('has-error');\n errorBlock.html('Message can not be blank.');\n e.preventDefault()\n }\n }\n }\n}\n","export function video() {\n var tag = document.createElement('script');\n tag.src = 'https://www.youtube.com/iframe_api';\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n\n function callPlayer(frame_id, func, args) {\n if (window.jQuery && frame_id instanceof jQuery)\n frame_id = frame_id.get(0).id;\n var iframe = document.getElementById(frame_id);\n if (iframe && iframe.tagName.toUpperCase() !== 'IFRAME') {\n iframe = iframe.getElementsByTagName('iframe')[0];\n }\n\n // When the player is not ready yet, add the event to a queue\n // Each frame_id is associated with an own queue.\n // Each queue has three possible states:\n // undefined = uninitialised / array = queue / 0 = ready\n if (!callPlayer.queue)\n callPlayer.queue = {};\n var queue = callPlayer.queue[frame_id],\n domReady = document.readyState === 'complete';\n\n if (domReady && !iframe) {\n // DOM is ready and iframe does not exist. Log a message\n window.console &&\n console.log('callPlayer: Frame not found; id=' + frame_id);\n if (queue)\n clearInterval(queue.poller);\n } else if (func === 'listening') {\n // Sending the \"listener\" message to the frame, to request status updates\n if (iframe && iframe.contentWindow) {\n func = '{\"event\":\"listening\",\"id\":' + JSON.stringify('' + frame_id) + '}';\n iframe.contentWindow.postMessage(func, '*');\n }\n } else if (!domReady || iframe && (!iframe.contentWindow || queue && !queue.ready) ||\n (!queue || !queue.ready) && typeof func === 'function'\n ) {\n if (!queue)\n queue = callPlayer.queue[frame_id] = [];\n queue.push([func, args]);\n if (!('poller' in queue)) {\n // keep polling until the document and frame is ready\n queue.poller = setInterval(\n function() {\n callPlayer(frame_id, 'listening');\n },\n 250\n );\n // Add a global \"message\" event listener, to catch status updates:\n messageEvent(\n 1,\n function runOnceReady(e) {\n if (!iframe) {\n iframe = document.getElementById(frame_id);\n if (!iframe)\n return;\n if (iframe.tagName.toUpperCase() !== 'IFRAME') {\n iframe = iframe.getElementsByTagName('iframe')[0];\n if (!iframe)\n return;\n }\n }\n if (e.source === iframe.contentWindow) {\n // Assume that the player is ready if we receive a\n // message from the iframe\n clearInterval(queue.poller);\n queue.ready = true;\n messageEvent(0, runOnceReady);\n // .. and release the queue:\n while (tmp = queue.shift()) {\n callPlayer(frame_id, tmp[0], tmp[1]);\n }\n }\n },\n false\n );\n }\n } else if (iframe && iframe.contentWindow) {\n // When a function is supplied, just call it (like \"onYouTubePlayerReady\")\n if (func.call)\n return func();\n // Frame exists, send message\n iframe.contentWindow.postMessage(\n JSON.stringify({\n 'event': 'command',\n 'func': func,\n 'args': args || [],\n 'id': frame_id\n }),\n '*'\n );\n }\n /* IE8 does not support addEventListener... */\n function messageEvent(add, listener) {\n var w3 = add ? window.addEventListener : window.removeEventListener;\n w3\n ?\n w3('message', listener, !1) :\n (add ? window.attachEvent : window.detachEvent)('onmessage', listener);\n }\n }\n\n function onYouTubeIframeAPIReady() {\n $('.js-video').each(function(index, el) {\n let id = $(this).attr('id');\n let video = $(this).data('video'); \n \n let player = new YT.Player(id, {\n height: '100%',\n width: '100%',\n videoId: video,\n // youtube video id\n playerVars: {\n 'autoplay': 0,\n 'rel': 0,\n 'showinfo': 0,\n 'loop': 1,\n 'controls': 1\n },\n events: {\n 'onStateChange': onPlayerStateChange,\n 'onReady': onPlayerReady\n }\n });\n });\n\n $('.js-video-in-popup').each(function(index, el) {\n $('body').on('click', '.js-autoplay-video', function(event) {\n event.preventDefault();\n \n let id = $(this).closest('.js-popup-video').data('video-id'); \n let video = $(this).closest('.js-popup-video').data('popup-video'); \n\n let popupVideo = $('.js-video-in-popup'); \n popupVideo[0].setAttribute('data-video', video);\n popupVideo[0].setAttribute('id', id);\n \n \n let player = new YT.Player(id, {\n height: '100%',\n width: '100%',\n videoId: video,\n // youtube video id\n playerVars: {\n 'autoplay': 1,\n 'rel': 0,\n 'showinfo': 0,\n 'loop': 1,\n 'controls': 1\n },\n events: {\n 'onStateChange': onPlayerStateChange,\n 'onReady': onPlayerReady\n }\n }); \n });\n });\n }\n\n function onPlayerStateChange(event) {\n if (event.data === YT.PlayerState.ENDED) {\n $(event.target.a).next().fadeIn('normal');\n $(event.target.a).parent().find('.js-start-video').show();\n $(event.target.a).parent().find('.js-video-bg').show();\n }\n if (event.data === 2) {\n $(event.target.a).next().fadeIn('normal');\n $(event.target.a).parent().find('.js-start-video').show();\n $(event.target.a).parent().find('.js-video-bg').show();\n }\n }\n\n function onPlayerReady() {\n $('body').on('click', '.js-start-video', function(event) {\n event.preventDefault();\n $(this).closest('.video').find('.js-start-video').hide();\n $(this).closest('.video').find('.js-video-bg').hide();\n let idd = $(this).parent().find('.js-video').attr('id');\n \n $(`#${idd}`).show();\n callPlayer(idd, 'playVideo');\n $(this).closest('.video').removeClass('is-preview');\n });\n\n }\n\n window.onload = () => {\n onYouTubeIframeAPIReady();\n\n const p = document.getElementById('player');\n $(p).hide();\n $('.video').addClass('is-bg');\n };\n}\n","export function viewportHeight() {\n function calcVH() {\n var vH = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n let el = document.getElementById('messenger');\n if(el) {\n el.setAttribute('style', 'height:' + vH + 'px;');\n }\n }\n calcVH();\n window.addEventListener('onorientationchange', calcVH, true);\n var scrollTimeout;\n var throttle = 200;\n $(window).on('resize', function() {\n if (!scrollTimeout) {\n scrollTimeout = setTimeout(function() {\n calcVH();\n scrollTimeout = null;\n }, throttle);\n }\n });\n\n \n}\n","export const env = {\n STRIPE_PUBLISHABLE_KEY: \"pk_live_0I7uVZYmtBOjJ6zFtSVE0sIr\",\n MUUCHIT_UPLIFT_FEE_PERCENT: \"15\",\n MUUCHIT_ADMIN_EMAIL: \"hello@muuchit.com\",\n GOOGLE_MAPS_API_KEY: \"AIzaSyCk4TQAtoZg9HFhMWmUykTyvHMvakkg2c4\",\n RECAPTCHA_SITE_KEY: \"6Lf7ZpoUAAAAAOlJ_fJB8um5di5jpn47sD0Sn8tZ\",\n INITIAL_BOOKING_EXPIRATION_TIME_IN_MINUTES: \"15\",\n TWILIO_PHONE_MASK: \"000-000-0000\"\n}\n","export default function isTouchDevice() {\n return 'ontouchstart' in window \n || navigator.maxTouchPoints;\n };","/**\n * @name InfoBox\n * @version 1.1.19 [April 6, 2018]\n * @author Gary Little (inspired by proof-of-concept code from Pamela Fox of Google)\n * @copyright Copyright 2010 Gary Little [gary at luxcentral.com]\n * @fileoverview InfoBox extends the Google Maps JavaScript API V3 OverlayView class.\n *

    \n * An InfoBox behaves like a google.maps.InfoWindow, but it supports several\n * additional properties for advanced styling. An InfoBox can also be used as a map label.\n *

    \n * An InfoBox also fires the same events as a google.maps.InfoWindow.\n */\n\n/*!\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*jslint browser:true */\n/*global google */\n\n/**\n * @name InfoBoxOptions\n * @class This class represents the optional parameter passed to the {@link InfoBox} constructor.\n * @property {string|Node} content The content of the InfoBox (plain text or an HTML DOM node).\n * @property {boolean} [disableAutoPan=false] Disable auto-pan on open.\n * @property {number} maxWidth The maximum width (in pixels) of the InfoBox. Set to 0 if no maximum.\n * @property {Size} pixelOffset The offset (in pixels) from the top left corner of the InfoBox\n * (or the bottom left corner if the alignBottom property is true)\n * to the map pixel corresponding to position.\n * @property {LatLng} position The geographic location at which to display the InfoBox.\n * @property {number} zIndex The CSS z-index style value for the InfoBox.\n * Note: This value overrides a zIndex setting specified in the boxStyle property.\n * @property {string} [boxClass=\"infoBox\"] The name of the CSS class defining the styles for the InfoBox container.\n * @property {Object} [boxStyle] An object literal whose properties define specific CSS\n * style values to be applied to the InfoBox. Style values defined here override those that may\n * be defined in the boxClass style sheet. If this property is changed after the\n * InfoBox has been created, all previously set styles (except those defined in the style sheet)\n * are removed from the InfoBox before the new style values are applied.\n * @property {string} closeBoxMargin The CSS margin style value for the close box.\n * The default is \"2px\" (a 2-pixel margin on all sides).\n * @property {string} closeBoxTitle The tool tip for the close box. The default is \" Close \".\n * @property {string} closeBoxURL The URL of the image representing the close box.\n * Note: The default is the URL for Google's standard close box.\n * Set this property to \"\" if no close box is required.\n * @property {Size} infoBoxClearance Minimum offset (in pixels) from the InfoBox to the\n * map edge after an auto-pan.\n * @property {boolean} [isHidden=false] Hide the InfoBox on open.\n * [Deprecated in favor of the visible property.]\n * @property {boolean} [visible=true] Show the InfoBox on open.\n * @property {boolean} alignBottom Align the bottom left corner of the InfoBox to the position\n * location (default is false which means that the top left corner of the InfoBox is aligned).\n * @property {string} pane The pane where the InfoBox is to appear (default is \"floatPane\").\n * Set the pane to \"mapPane\" if the InfoBox is being used as a map label.\n * Valid pane names are the property names for the google.maps.MapPanes object.\n * @property {boolean} enableEventPropagation Propagate mousedown, mousemove, mouseover, mouseout,\n * mouseup, click, dblclick, touchstart, touchend, touchmove, and contextmenu events in the InfoBox\n * (default is false to mimic the behavior of a google.maps.InfoWindow). Set\n * this property to true if the InfoBox is being used as a map label.\n */\n\n/**\n * Creates an InfoBox with the options specified in {@link InfoBoxOptions}.\n * Call InfoBox.open to add the box to the map.\n * @constructor\n * @param {InfoBoxOptions} [optOpts]\n */\nfunction InfoBox(optOpts) {\n optOpts = optOpts || {};\n \n google.maps.OverlayView.apply(this, arguments);\n \n // Standard options (in common with google.maps.InfoWindow):\n //\n this.content_ = optOpts.content || '';\n this.disableAutoPan_ = optOpts.disableAutoPan || false;\n this.maxWidth_ = optOpts.maxWidth || 0;\n this.pixelOffset_ = optOpts.pixelOffset || new google.maps.Size(0, 0);\n this.position_ = optOpts.position || new google.maps.LatLng(0, 0);\n this.zIndex_ = optOpts.zIndex || null;\n \n // Additional options (unique to InfoBox):\n //\n this.boxClass_ = optOpts.boxClass || 'infoBox';\n this.boxStyle_ = optOpts.boxStyle || {};\n this.closeBoxMargin_ = optOpts.closeBoxMargin || '2px';\n this.closeBoxURL_ = optOpts.closeBoxURL || '//www.google.com/intl/en_us/mapfiles/close.gif';\n if (optOpts.closeBoxURL === '') {\n this.closeBoxURL_ = '';\n }\n this.closeBoxTitle_ = optOpts.closeBoxTitle || ' Close ';\n this.infoBoxClearance_ = optOpts.infoBoxClearance || new google.maps.Size(1, 1);\n \n if (typeof optOpts.visible === 'undefined') {\n if (typeof optOpts.isHidden === 'undefined') {\n optOpts.visible = true;\n } else {\n optOpts.visible = !optOpts.isHidden;\n }\n }\n this.isHidden_ = !optOpts.visible;\n \n this.alignBottom_ = optOpts.alignBottom || false;\n this.pane_ = optOpts.pane || 'floatPane';\n this.enableEventPropagation_ = optOpts.enableEventPropagation || false;\n \n this.div_ = null;\n this.closeListener_ = null;\n this.moveListener_ = null;\n this.contextListener_ = null;\n this.eventListeners_ = null;\n this.fixedWidthSet_ = null;\n}\n \n/* InfoBox extends OverlayView in the Google Maps API v3.\n */\nInfoBox.prototype = new google.maps.OverlayView();\n \n/**\n * Creates the DIV representing the InfoBox.\n * @private\n */\nInfoBox.prototype.createInfoBoxDiv_ = function() {\n \n var i;\n var events;\n var bw;\n var me = this;\n \n // This handler prevents an event in the InfoBox from being passed on to the map.\n //\n var cancelHandler = function(e) {\n e.cancelBubble = true;\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n };\n \n // This handler ignores the current event in the InfoBox and conditionally prevents\n // the event from being passed on to the map. It is used for the contextmenu event.\n //\n var ignoreHandler = function(e) {\n \n e.returnValue = false;\n \n if (e.preventDefault) {\n \n e.preventDefault();\n }\n \n if (!me.enableEventPropagation_) {\n \n cancelHandler(e);\n }\n };\n \n if (!this.div_) {\n \n this.div_ = document.createElement('div');\n \n this.setBoxStyle_();\n \n if (typeof this.content_.nodeType === 'undefined') {\n this.div_.innerHTML = this.getCloseBoxImg_() + this.content_;\n } else {\n this.div_.innerHTML = this.getCloseBoxImg_();\n this.div_.appendChild(this.content_);\n }\n \n // Add the InfoBox DIV to the DOM\n this.getPanes()[this.pane_].appendChild(this.div_);\n \n this.addClickHandler_();\n \n if (this.div_.style.width) {\n \n this.fixedWidthSet_ = true;\n \n } else {\n \n if (this.maxWidth_ !== 0 && this.div_.offsetWidth > this.maxWidth_) {\n \n this.div_.style.width = this.maxWidth_;\n this.div_.style.overflow = 'auto';\n this.fixedWidthSet_ = true;\n \n } else { // The following code is needed to overcome problems with MSIE\n \n bw = this.getBoxWidths_();\n \n this.div_.style.width = (this.div_.offsetWidth - bw.left - bw.right) + 'px';\n this.fixedWidthSet_ = false;\n }\n }\n \n this.panBox_(this.disableAutoPan_);\n \n if (!this.enableEventPropagation_) {\n \n this.eventListeners_ = [];\n \n // Cancel event propagation.\n //\n // Note: mousemove not included (to resolve Issue 152)\n events = ['mousedown', 'mouseover', 'mouseout', 'mouseup',\n 'click', 'dblclick', 'touchstart', 'touchend', 'touchmove'];\n \n for (i = 0; i < events.length; i++) {\n \n this.eventListeners_.push(google.maps.event.addDomListener(this.div_, events[i], cancelHandler));\n }\n \n // Workaround for Google bug that causes the cursor to change to a pointer\n // when the mouse moves over a marker underneath InfoBox.\n this.eventListeners_.push(google.maps.event.addDomListener(this.div_, 'mouseover', function(e) {\n this.style.cursor = 'default';\n }));\n }\n \n this.contextListener_ = google.maps.event.addDomListener(this.div_, 'contextmenu', ignoreHandler);\n \n /**\n * This event is fired when the DIV containing the InfoBox's content is attached to the DOM.\n * @name InfoBox#domready\n * @event\n */\n google.maps.event.trigger(this, 'domready');\n }\n};\n \n/**\n * Returns the HTML tag for the close box.\n * @private\n */\nInfoBox.prototype.getCloseBoxImg_ = function() {\n \n var img = '';\n \n if (this.closeBoxURL_ !== '') {\n \n img = '\";\n }\n \n return img;\n};\n \n/**\n * Adds the click handler to the InfoBox close box.\n * @private\n */\nInfoBox.prototype.addClickHandler_ = function() {\n \n var closeBox;\n \n if (this.closeBoxURL_ !== '') {\n \n closeBox = this.div_.firstChild;\n this.closeListener_ = google.maps.event.addDomListener(closeBox, 'click', this.getCloseClickHandler_());\n \n } else {\n \n this.closeListener_ = null;\n }\n};\n \n/**\n * Returns the function to call when the user clicks the close box of an InfoBox.\n * @private\n */\nInfoBox.prototype.getCloseClickHandler_ = function() {\n \n var me = this;\n \n return function(e) {\n \n // 1.0.3 fix: Always prevent propagation of a close box click to the map:\n e.cancelBubble = true;\n \n if (e.stopPropagation) {\n \n e.stopPropagation();\n }\n \n /**\n * This event is fired when the InfoBox's close box is clicked.\n * @name InfoBox#closeclick\n * @event\n */\n google.maps.event.trigger(me, 'closeclick');\n \n me.close();\n };\n};\n \n/**\n * Pans the map so that the InfoBox appears entirely within the map's visible area.\n * @private\n */\nInfoBox.prototype.panBox_ = function(disablePan) {\n \n var map;\n var bounds;\n var xOffset = 0, yOffset = 0;\n \n if (!disablePan) {\n \n map = this.getMap();\n \n if (map instanceof google.maps.Map) { // Only pan if attached to map, not panorama\n \n if (!map.getBounds().contains(this.position_)) {\n // Marker not in visible area of map, so set center\n // of map to the marker position first.\n map.setCenter(this.position_);\n }\n \n var iwOffsetX = this.pixelOffset_.width;\n var iwOffsetY = this.pixelOffset_.height;\n var iwWidth = this.div_.offsetWidth;\n var iwHeight = this.div_.offsetHeight;\n var padX = this.infoBoxClearance_.width;\n var padY = this.infoBoxClearance_.height;\n \n if (map.panToBounds.length === 2) {\n // Using projection.fromLatLngToContainerPixel to compute the infowindow position\n // does not work correctly anymore for JS Maps API v3.32 and above if there is a\n // previous synchronous call that causes the map to animate (e.g. setCenter when\n // the position is not within bounds). Hence, we are using panToBounds with\n // padding instead, which works synchronously.\n var padding = {left: 0, right: 0, top: 0, bottom: 0};\n padding.left = -iwOffsetX + padX;\n padding.right = iwOffsetX + iwWidth + padX;\n if (this.alignBottom_) {\n padding.top = -iwOffsetY + padY + iwHeight;\n padding.bottom = iwOffsetY + padY;\n } else {\n padding.top = -iwOffsetY + padY;\n padding.bottom = iwOffsetY + iwHeight + padY;\n }\n map.panToBounds(new google.maps.LatLngBounds(this.position_), padding);\n } else {\n var mapDiv = map.getDiv();\n var mapWidth = mapDiv.offsetWidth;\n var mapHeight = mapDiv.offsetHeight;\n var pixPosition = this.getProjection().fromLatLngToContainerPixel(this.position_);\n \n if (pixPosition.x < (-iwOffsetX + padX)) {\n xOffset = pixPosition.x + iwOffsetX - padX;\n } else if ((pixPosition.x + iwWidth + iwOffsetX + padX) > mapWidth) {\n xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;\n }\n if (this.alignBottom_) {\n if (pixPosition.y < (-iwOffsetY + padY + iwHeight)) {\n yOffset = pixPosition.y + iwOffsetY - padY - iwHeight;\n } else if ((pixPosition.y + iwOffsetY + padY) > mapHeight) {\n yOffset = pixPosition.y + iwOffsetY + padY - mapHeight;\n }\n } else {\n if (pixPosition.y < (-iwOffsetY + padY)) {\n yOffset = pixPosition.y + iwOffsetY - padY;\n } else if ((pixPosition.y + iwHeight + iwOffsetY + padY) > mapHeight) {\n yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;\n }\n }\n \n if (!(xOffset === 0 && yOffset === 0)) {\n \n // Move the map to the shifted center.\n //\n var c = map.getCenter();\n map.panBy(xOffset, yOffset);\n }\n }\n }\n }\n};\n \n/**\n * Sets the style of the InfoBox by setting the style sheet and applying\n * other specific styles requested.\n * @private\n */\nInfoBox.prototype.setBoxStyle_ = function() {\n \n var i, boxStyle;\n \n if (this.div_) {\n \n // Apply style values from the style sheet defined in the boxClass parameter:\n this.div_.className = this.boxClass_;\n \n // Clear existing inline style values:\n this.div_.style.cssText = '';\n \n // Apply style values defined in the boxStyle parameter:\n boxStyle = this.boxStyle_;\n for (i in boxStyle) {\n \n if (boxStyle.hasOwnProperty(i)) {\n \n this.div_.style[i] = boxStyle[i];\n }\n }\n \n // Fix for iOS disappearing InfoBox problem.\n // See http://stackoverflow.com/questions/9229535/google-maps-markers-disappear-at-certain-zoom-level-only-on-iphone-ipad\n // Required: use \"matrix\" technique to specify transforms in order to avoid this bug.\n if ((typeof this.div_.style.WebkitTransform === 'undefined') || (this.div_.style.WebkitTransform.indexOf('translateZ') === -1 && this.div_.style.WebkitTransform.indexOf('matrix') === -1)) {\n \n this.div_.style.WebkitTransform = 'translateZ(0)';\n }\n \n // Fix up opacity style for benefit of MSIE:\n //\n if (typeof this.div_.style.opacity !== 'undefined' && this.div_.style.opacity !== '') {\n // See http://www.quirksmode.org/css/opacity.html\n this.div_.style.MsFilter = '\"progid:DXImageTransform.Microsoft.Alpha(Opacity=' + (this.div_.style.opacity * 100) + ')\"';\n this.div_.style.filter = 'alpha(opacity=' + (this.div_.style.opacity * 100) + ')';\n }\n \n // Apply required styles:\n //\n this.div_.style.position = 'absolute';\n this.div_.style.visibility = 'hidden';\n if (this.zIndex_ !== null) {\n \n this.div_.style.zIndex = this.zIndex_;\n }\n }\n};\n \n/**\n * Get the widths of the borders of the InfoBox.\n * @private\n * @return {Object} widths object (top, bottom left, right)\n */\nInfoBox.prototype.getBoxWidths_ = function() {\n \n var computedStyle;\n var bw = {top: 0, bottom: 0, left: 0, right: 0};\n var box = this.div_;\n \n if (document.defaultView && document.defaultView.getComputedStyle) {\n \n computedStyle = box.ownerDocument.defaultView.getComputedStyle(box, '');\n \n if (computedStyle) {\n \n // The computed styles are always in pixel units (good!)\n bw.top = parseInt(computedStyle.borderTopWidth, 10) || 0;\n bw.bottom = parseInt(computedStyle.borderBottomWidth, 10) || 0;\n bw.left = parseInt(computedStyle.borderLeftWidth, 10) || 0;\n bw.right = parseInt(computedStyle.borderRightWidth, 10) || 0;\n }\n \n } else if (document.documentElement.currentStyle) { // MSIE\n \n if (box.currentStyle) {\n \n // The current styles may not be in pixel units, but assume they are (bad!)\n bw.top = parseInt(box.currentStyle.borderTopWidth, 10) || 0;\n bw.bottom = parseInt(box.currentStyle.borderBottomWidth, 10) || 0;\n bw.left = parseInt(box.currentStyle.borderLeftWidth, 10) || 0;\n bw.right = parseInt(box.currentStyle.borderRightWidth, 10) || 0;\n }\n }\n \n return bw;\n};\n \n/**\n * Invoked when close is called. Do not call it directly.\n */\nInfoBox.prototype.onRemove = function() {\n \n if (this.div_) {\n \n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n};\n \n/**\n * Draws the InfoBox based on the current map projection and zoom level.\n */\nInfoBox.prototype.draw = function() {\n \n this.createInfoBoxDiv_();\n \n var pixPosition = this.getProjection().fromLatLngToDivPixel(this.position_);\n \n this.div_.style.left = (pixPosition.x + this.pixelOffset_.width) + 'px';\n \n if (this.alignBottom_) {\n this.div_.style.bottom = -(pixPosition.y + this.pixelOffset_.height) + 'px';\n } else {\n this.div_.style.top = (pixPosition.y + this.pixelOffset_.height) + 'px';\n }\n \n if (this.isHidden_) {\n \n this.div_.style.visibility = 'hidden';\n \n } else {\n \n this.div_.style.visibility = 'visible';\n }\n};\n \n/**\n * Sets the options for the InfoBox. Note that changes to the maxWidth,\n * closeBoxMargin, closeBoxTitle, closeBoxURL, and\n * enableEventPropagation properties have no affect until the current\n * InfoBox is closed and a new one is opened.\n * @param {InfoBoxOptions} optOpts\n */\nInfoBox.prototype.setOptions = function(optOpts) {\n if (typeof optOpts.boxClass !== 'undefined') { // Must be first\n \n this.boxClass_ = optOpts.boxClass;\n this.setBoxStyle_();\n }\n if (typeof optOpts.boxStyle !== 'undefined') { // Must be second\n \n this.boxStyle_ = optOpts.boxStyle;\n this.setBoxStyle_();\n }\n if (typeof optOpts.content !== 'undefined') {\n \n this.setContent(optOpts.content);\n }\n if (typeof optOpts.disableAutoPan !== 'undefined') {\n \n this.disableAutoPan_ = optOpts.disableAutoPan;\n }\n if (typeof optOpts.maxWidth !== 'undefined') {\n \n this.maxWidth_ = optOpts.maxWidth;\n }\n if (typeof optOpts.pixelOffset !== 'undefined') {\n \n this.pixelOffset_ = optOpts.pixelOffset;\n }\n if (typeof optOpts.alignBottom !== 'undefined') {\n \n this.alignBottom_ = optOpts.alignBottom;\n }\n if (typeof optOpts.position !== 'undefined') {\n \n this.setPosition(optOpts.position);\n }\n if (typeof optOpts.zIndex !== 'undefined') {\n \n this.setZIndex(optOpts.zIndex);\n }\n if (typeof optOpts.closeBoxMargin !== 'undefined') {\n \n this.closeBoxMargin_ = optOpts.closeBoxMargin;\n }\n if (typeof optOpts.closeBoxURL !== 'undefined') {\n \n this.closeBoxURL_ = optOpts.closeBoxURL;\n }\n if (typeof optOpts.closeBoxTitle !== 'undefined') {\n \n this.closeBoxTitle_ = optOpts.closeBoxTitle;\n }\n if (typeof optOpts.infoBoxClearance !== 'undefined') {\n \n this.infoBoxClearance_ = optOpts.infoBoxClearance;\n }\n if (typeof optOpts.isHidden !== 'undefined') {\n \n this.isHidden_ = optOpts.isHidden;\n }\n if (typeof optOpts.visible !== 'undefined') {\n \n this.isHidden_ = !optOpts.visible;\n }\n if (typeof optOpts.enableEventPropagation !== 'undefined') {\n \n this.enableEventPropagation_ = optOpts.enableEventPropagation;\n }\n \n if (this.div_) {\n \n this.draw();\n }\n};\n \n/**\n * Sets the content of the InfoBox.\n * The content can be plain text or an HTML DOM node.\n * @param {string|Node} content\n */\nInfoBox.prototype.setContent = function(content) {\n this.content_ = content;\n \n if (this.div_) {\n \n if (this.closeListener_) {\n \n google.maps.event.removeListener(this.closeListener_);\n this.closeListener_ = null;\n }\n \n // Odd code required to make things work with MSIE.\n //\n if (!this.fixedWidthSet_) {\n \n this.div_.style.width = '';\n }\n \n if (typeof content.nodeType === 'undefined') {\n this.div_.innerHTML = this.getCloseBoxImg_() + content;\n } else {\n this.div_.innerHTML = this.getCloseBoxImg_();\n this.div_.appendChild(content);\n }\n \n // Perverse code required to make things work with MSIE.\n // (Ensures the close box does, in fact, float to the right.)\n //\n if (!this.fixedWidthSet_) {\n this.div_.style.width = this.div_.offsetWidth + 'px';\n if (typeof content.nodeType === 'undefined') {\n this.div_.innerHTML = this.getCloseBoxImg_() + content;\n } else {\n this.div_.innerHTML = this.getCloseBoxImg_();\n this.div_.appendChild(content);\n }\n }\n \n this.addClickHandler_();\n }\n \n /**\n * This event is fired when the content of the InfoBox changes.\n * @name InfoBox#content_changed\n * @event\n */\n google.maps.event.trigger(this, 'content_changed');\n};\n \n/**\n * Sets the geographic location of the InfoBox.\n * @param {LatLng} latlng\n */\nInfoBox.prototype.setPosition = function(latlng) {\n \n this.position_ = latlng;\n \n if (this.div_) {\n \n this.draw();\n }\n \n /**\n * This event is fired when the position of the InfoBox changes.\n * @name InfoBox#position_changed\n * @event\n */\n google.maps.event.trigger(this, 'position_changed');\n};\n \n/**\n * Sets the zIndex style for the InfoBox.\n * @param {number} index\n */\nInfoBox.prototype.setZIndex = function(index) {\n \n this.zIndex_ = index;\n \n if (this.div_) {\n \n this.div_.style.zIndex = index;\n }\n \n /**\n * This event is fired when the zIndex of the InfoBox changes.\n * @name InfoBox#zindex_changed\n * @event\n */\n google.maps.event.trigger(this, 'zindex_changed');\n};\n \n/**\n * Sets the visibility of the InfoBox.\n * @param {boolean} isVisible\n */\nInfoBox.prototype.setVisible = function(isVisible) {\n \n this.isHidden_ = !isVisible;\n if (this.div_) {\n this.div_.style.visibility = (this.isHidden_ ? 'hidden' : 'visible');\n }\n};\n \n/**\n * Returns the content of the InfoBox.\n * @returns {string}\n */\nInfoBox.prototype.getContent = function() {\n \n return this.content_;\n};\n \n/**\n * Returns the geographic location of the InfoBox.\n * @returns {LatLng}\n */\nInfoBox.prototype.getPosition = function() {\n \n return this.position_;\n};\n \n/**\n * Returns the zIndex for the InfoBox.\n * @returns {number}\n */\nInfoBox.prototype.getZIndex = function() {\n \n return this.zIndex_;\n};\n \n/**\n * Returns a flag indicating whether the InfoBox is visible.\n * @returns {boolean}\n */\nInfoBox.prototype.getVisible = function() {\n \n var isVisible;\n \n if ((typeof this.getMap() === 'undefined') || (this.getMap() === null)) {\n isVisible = false;\n } else {\n isVisible = !this.isHidden_;\n }\n return isVisible;\n};\n \n/**\n * Returns the width of the InfoBox in pixels.\n * @returns {number}\n */\nInfoBox.prototype.getWidth = function() {\n var width = null;\n \n if (this.div_) {\n width = this.div_.offsetWidth;\n }\n \n return width;\n};\n \n/**\n * Returns the height of the InfoBox in pixels.\n * @returns {number}\n */\nInfoBox.prototype.getHeight = function() {\n var height = null;\n \n if (this.div_) {\n height = this.div_.offsetHeight;\n }\n \n return height;\n};\n \n/**\n * Shows the InfoBox. [Deprecated; use setVisible instead.]\n */\nInfoBox.prototype.show = function() {\n \n this.isHidden_ = false;\n if (this.div_) {\n this.div_.style.visibility = 'visible';\n }\n};\n \n/**\n * Hides the InfoBox. [Deprecated; use setVisible instead.]\n */\nInfoBox.prototype.hide = function() {\n \n this.isHidden_ = true;\n if (this.div_) {\n this.div_.style.visibility = 'hidden';\n }\n};\n \n/**\n * Adds the InfoBox to the specified map or Street View panorama. If anchor\n * (usually a google.maps.Marker) is specified, the position\n * of the InfoBox is set to the position of the anchor. If the\n * anchor is dragged to a new location, the InfoBox moves as well.\n * @param {Map|StreetViewPanorama} map\n * @param {MVCObject} [anchor]\n */\nInfoBox.prototype.open = function(map, anchor) {\n \n var me = this;\n \n if (anchor) {\n \n this.setPosition(anchor.getPosition()); // BUG FIX 2/17/2018: needed for v3.32\n this.moveListener_ = google.maps.event.addListener(anchor, 'position_changed', function() {\n me.setPosition(this.getPosition());\n });\n }\n \n this.setMap(map);\n \n if (this.div_) {\n \n this.panBox_(this.disableAutoPan_); // BUG FIX 2/17/2018: add missing parameter\n }\n};\n \n/**\n * Removes the InfoBox from the map.\n */\nInfoBox.prototype.close = function() {\n \n var i;\n \n if (this.closeListener_) {\n \n google.maps.event.removeListener(this.closeListener_);\n this.closeListener_ = null;\n }\n \n if (this.eventListeners_) {\n \n for (i = 0; i < this.eventListeners_.length; i++) {\n \n google.maps.event.removeListener(this.eventListeners_[i]);\n }\n this.eventListeners_ = null;\n }\n \n if (this.moveListener_) {\n \n google.maps.event.removeListener(this.moveListener_);\n this.moveListener_ = null;\n }\n \n if (this.contextListener_) {\n \n google.maps.event.removeListener(this.contextListener_);\n this.contextListener_ = null;\n }\n \n this.setMap(null);\n};\n\n\nmodule.exports = InfoBox;\n","// add all images to manifest.js from app/packs/img folder\nconst img = require.context('../img', true);\nconst media = require.context('../media', true);\n\nimport \"./envVariables.js.erb\"\nimport \"../redesign-stylesheets/app\"\nimport 'uppy/dist/uppy.min.css'\nimport 'tinymce/skins/ui/oxide/skin.css'\nimport 'jquery-validation'\nimport \"./app\"\n","// extracted by mini-css-extract-plugin","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate) {\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n }\n\n ;\n\n var debounced = function debounced() {\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function () {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n debounced.flush = function () {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n}\n\n; // Adds compatibility for ES modules\n\ndebounce.debounce = debounce;\nmodule.exports = debounce;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* flatpickr v4.6.3, @license MIT */\n(function (global, factory) {\n (typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, global.flatpickr = factory());\n})(this, function () {\n 'use strict';\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\n\n var _assign = function __assign() {\n _assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return _assign.apply(this, arguments);\n };\n\n var HOOKS = [\"onChange\", \"onClose\", \"onDayCreate\", \"onDestroy\", \"onKeyDown\", \"onMonthChange\", \"onOpen\", \"onParseConfig\", \"onReady\", \"onValueUpdate\", \"onYearChange\", \"onPreCalendarPosition\"];\n var defaults = {\n _disable: [],\n _enable: [],\n allowInput: false,\n altFormat: \"F j, Y\",\n altInput: false,\n altInputClass: \"form-control input\",\n animate: (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\" && window.navigator.userAgent.indexOf(\"MSIE\") === -1,\n ariaDateFormat: \"F j, Y\",\n clickOpens: true,\n closeOnSelect: true,\n conjunction: \", \",\n dateFormat: \"Y-m-d\",\n defaultHour: 12,\n defaultMinute: 0,\n defaultSeconds: 0,\n disable: [],\n disableMobile: false,\n enable: [],\n enableSeconds: false,\n enableTime: false,\n errorHandler: function errorHandler(err) {\n return typeof console !== \"undefined\" && console.warn(err);\n },\n getWeek: function getWeek(givenDate) {\n var date = new Date(givenDate.getTime());\n date.setHours(0, 0, 0, 0); // Thursday in current week decides the year.\n\n date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7); // January 4 is always in week 1.\n\n var week1 = new Date(date.getFullYear(), 0, 4); // Adjust to Thursday in week 1 and count number of weeks from date to week1.\n\n return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7);\n },\n hourIncrement: 1,\n ignoredFocusElements: [],\n inline: false,\n locale: \"default\",\n minuteIncrement: 5,\n mode: \"single\",\n monthSelectorType: \"dropdown\",\n nextArrow: \"\",\n noCalendar: false,\n now: new Date(),\n onChange: [],\n onClose: [],\n onDayCreate: [],\n onDestroy: [],\n onKeyDown: [],\n onMonthChange: [],\n onOpen: [],\n onParseConfig: [],\n onReady: [],\n onValueUpdate: [],\n onYearChange: [],\n onPreCalendarPosition: [],\n plugins: [],\n position: \"auto\",\n positionElement: undefined,\n prevArrow: \"\",\n shorthandCurrentMonth: false,\n showMonths: 1,\n \"static\": false,\n time_24hr: false,\n weekNumbers: false,\n wrap: false\n };\n var english = {\n weekdays: {\n shorthand: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n longhand: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]\n },\n months: {\n shorthand: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n longhand: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n },\n daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],\n firstDayOfWeek: 0,\n ordinal: function ordinal(nth) {\n var s = nth % 100;\n if (s > 3 && s < 21) return \"th\";\n\n switch (s % 10) {\n case 1:\n return \"st\";\n\n case 2:\n return \"nd\";\n\n case 3:\n return \"rd\";\n\n default:\n return \"th\";\n }\n },\n rangeSeparator: \" to \",\n weekAbbreviation: \"Wk\",\n scrollTitle: \"Scroll to increment\",\n toggleTitle: \"Click to toggle\",\n amPM: [\"AM\", \"PM\"],\n yearAriaLabel: \"Year\",\n hourAriaLabel: \"Hour\",\n minuteAriaLabel: \"Minute\",\n time_24hr: false\n };\n\n var pad = function pad(number) {\n return (\"0\" + number).slice(-2);\n };\n\n var _int = function _int(bool) {\n return bool === true ? 1 : 0;\n };\n /* istanbul ignore next */\n\n\n function debounce(func, wait, immediate) {\n if (immediate === void 0) {\n immediate = false;\n }\n\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n timeout !== null && clearTimeout(timeout);\n timeout = window.setTimeout(function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n }\n\n var arrayify = function arrayify(obj) {\n return obj instanceof Array ? obj : [obj];\n };\n\n function toggleClass(elem, className, bool) {\n if (bool === true) return elem.classList.add(className);\n elem.classList.remove(className);\n }\n\n function createElement(tag, className, content) {\n var e = window.document.createElement(tag);\n className = className || \"\";\n content = content || \"\";\n e.className = className;\n if (content !== undefined) e.textContent = content;\n return e;\n }\n\n function clearNode(node) {\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n }\n\n function findParent(node, condition) {\n if (condition(node)) return node;else if (node.parentNode) return findParent(node.parentNode, condition);\n return undefined; // nothing found\n }\n\n function createNumberInput(inputClassName, opts) {\n var wrapper = createElement(\"div\", \"numInputWrapper\"),\n numInput = createElement(\"input\", \"numInput \" + inputClassName),\n arrowUp = createElement(\"span\", \"arrowUp\"),\n arrowDown = createElement(\"span\", \"arrowDown\");\n\n if (navigator.userAgent.indexOf(\"MSIE 9.0\") === -1) {\n numInput.type = \"number\";\n } else {\n numInput.type = \"text\";\n numInput.pattern = \"\\\\d*\";\n }\n\n if (opts !== undefined) for (var key in opts) {\n numInput.setAttribute(key, opts[key]);\n }\n wrapper.appendChild(numInput);\n wrapper.appendChild(arrowUp);\n wrapper.appendChild(arrowDown);\n return wrapper;\n }\n\n function getEventTarget(event) {\n if (typeof event.composedPath === \"function\") {\n var path = event.composedPath();\n return path[0];\n }\n\n return event.target;\n }\n\n var doNothing = function doNothing() {\n return undefined;\n };\n\n var monthToStr = function monthToStr(monthNumber, shorthand, locale) {\n return locale.months[shorthand ? \"shorthand\" : \"longhand\"][monthNumber];\n };\n\n var revFormat = {\n D: doNothing,\n F: function F(dateObj, monthName, locale) {\n dateObj.setMonth(locale.months.longhand.indexOf(monthName));\n },\n G: function G(dateObj, hour) {\n dateObj.setHours(parseFloat(hour));\n },\n H: function H(dateObj, hour) {\n dateObj.setHours(parseFloat(hour));\n },\n J: function J(dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n K: function K(dateObj, amPM, locale) {\n dateObj.setHours(dateObj.getHours() % 12 + 12 * _int(new RegExp(locale.amPM[1], \"i\").test(amPM)));\n },\n M: function M(dateObj, shortMonth, locale) {\n dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth));\n },\n S: function S(dateObj, seconds) {\n dateObj.setSeconds(parseFloat(seconds));\n },\n U: function U(_, unixSeconds) {\n return new Date(parseFloat(unixSeconds) * 1000);\n },\n W: function W(dateObj, weekNum, locale) {\n var weekNumber = parseInt(weekNum);\n var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0);\n date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek);\n return date;\n },\n Y: function Y(dateObj, year) {\n dateObj.setFullYear(parseFloat(year));\n },\n Z: function Z(_, ISODate) {\n return new Date(ISODate);\n },\n d: function d(dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n h: function h(dateObj, hour) {\n dateObj.setHours(parseFloat(hour));\n },\n i: function i(dateObj, minutes) {\n dateObj.setMinutes(parseFloat(minutes));\n },\n j: function j(dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n l: doNothing,\n m: function m(dateObj, month) {\n dateObj.setMonth(parseFloat(month) - 1);\n },\n n: function n(dateObj, month) {\n dateObj.setMonth(parseFloat(month) - 1);\n },\n s: function s(dateObj, seconds) {\n dateObj.setSeconds(parseFloat(seconds));\n },\n u: function u(_, unixMillSeconds) {\n return new Date(parseFloat(unixMillSeconds));\n },\n w: doNothing,\n y: function y(dateObj, year) {\n dateObj.setFullYear(2000 + parseFloat(year));\n }\n };\n var tokenRegex = {\n D: \"(\\\\w+)\",\n F: \"(\\\\w+)\",\n G: \"(\\\\d\\\\d|\\\\d)\",\n H: \"(\\\\d\\\\d|\\\\d)\",\n J: \"(\\\\d\\\\d|\\\\d)\\\\w+\",\n K: \"\",\n M: \"(\\\\w+)\",\n S: \"(\\\\d\\\\d|\\\\d)\",\n U: \"(.+)\",\n W: \"(\\\\d\\\\d|\\\\d)\",\n Y: \"(\\\\d{4})\",\n Z: \"(.+)\",\n d: \"(\\\\d\\\\d|\\\\d)\",\n h: \"(\\\\d\\\\d|\\\\d)\",\n i: \"(\\\\d\\\\d|\\\\d)\",\n j: \"(\\\\d\\\\d|\\\\d)\",\n l: \"(\\\\w+)\",\n m: \"(\\\\d\\\\d|\\\\d)\",\n n: \"(\\\\d\\\\d|\\\\d)\",\n s: \"(\\\\d\\\\d|\\\\d)\",\n u: \"(.+)\",\n w: \"(\\\\d\\\\d|\\\\d)\",\n y: \"(\\\\d{2})\"\n };\n var formats = {\n // get the date in UTC\n Z: function Z(date) {\n return date.toISOString();\n },\n // weekday name, short, e.g. Thu\n D: function D(date, locale, options) {\n return locale.weekdays.shorthand[formats.w(date, locale, options)];\n },\n // full month name e.g. January\n F: function F(date, locale, options) {\n return monthToStr(formats.n(date, locale, options) - 1, false, locale);\n },\n // padded hour 1-12\n G: function G(date, locale, options) {\n return pad(formats.h(date, locale, options));\n },\n // hours with leading zero e.g. 03\n H: function H(date) {\n return pad(date.getHours());\n },\n // day (1-30) with ordinal suffix e.g. 1st, 2nd\n J: function J(date, locale) {\n return locale.ordinal !== undefined ? date.getDate() + locale.ordinal(date.getDate()) : date.getDate();\n },\n // AM/PM\n K: function K(date, locale) {\n return locale.amPM[_int(date.getHours() > 11)];\n },\n // shorthand month e.g. Jan, Sep, Oct, etc\n M: function M(date, locale) {\n return monthToStr(date.getMonth(), true, locale);\n },\n // seconds 00-59\n S: function S(date) {\n return pad(date.getSeconds());\n },\n // unix timestamp\n U: function U(date) {\n return date.getTime() / 1000;\n },\n W: function W(date, _, options) {\n return options.getWeek(date);\n },\n // full year e.g. 2016\n Y: function Y(date) {\n return date.getFullYear();\n },\n // day in month, padded (01-30)\n d: function d(date) {\n return pad(date.getDate());\n },\n // hour from 1-12 (am/pm)\n h: function h(date) {\n return date.getHours() % 12 ? date.getHours() % 12 : 12;\n },\n // minutes, padded with leading zero e.g. 09\n i: function i(date) {\n return pad(date.getMinutes());\n },\n // day in month (1-30)\n j: function j(date) {\n return date.getDate();\n },\n // weekday name, full, e.g. Thursday\n l: function l(date, locale) {\n return locale.weekdays.longhand[date.getDay()];\n },\n // padded month number (01-12)\n m: function m(date) {\n return pad(date.getMonth() + 1);\n },\n // the month number (1-12)\n n: function n(date) {\n return date.getMonth() + 1;\n },\n // seconds 0-59\n s: function s(date) {\n return date.getSeconds();\n },\n // Unix Milliseconds\n u: function u(date) {\n return date.getTime();\n },\n // number of the day of the week\n w: function w(date) {\n return date.getDay();\n },\n // last two digits of year e.g. 16 for 2016\n y: function y(date) {\n return String(date.getFullYear()).substring(2);\n }\n };\n\n var createDateFormatter = function createDateFormatter(_a) {\n var _b = _a.config,\n config = _b === void 0 ? defaults : _b,\n _c = _a.l10n,\n l10n = _c === void 0 ? english : _c;\n return function (dateObj, frmt, overrideLocale) {\n var locale = overrideLocale || l10n;\n\n if (config.formatDate !== undefined) {\n return config.formatDate(dateObj, frmt, locale);\n }\n\n return frmt.split(\"\").map(function (c, i, arr) {\n return formats[c] && arr[i - 1] !== \"\\\\\" ? formats[c](dateObj, locale, config) : c !== \"\\\\\" ? c : \"\";\n }).join(\"\");\n };\n };\n\n var createDateParser = function createDateParser(_a) {\n var _b = _a.config,\n config = _b === void 0 ? defaults : _b,\n _c = _a.l10n,\n l10n = _c === void 0 ? english : _c;\n return function (date, givenFormat, timeless, customLocale) {\n if (date !== 0 && !date) return undefined;\n var locale = customLocale || l10n;\n var parsedDate;\n var dateOrig = date;\n if (date instanceof Date) parsedDate = new Date(date.getTime());else if (typeof date !== \"string\" && date.toFixed !== undefined // timestamp\n ) // create a copy\n parsedDate = new Date(date);else if (typeof date === \"string\") {\n // date string\n var format = givenFormat || (config || defaults).dateFormat;\n var datestr = String(date).trim();\n\n if (datestr === \"today\") {\n parsedDate = new Date();\n timeless = true;\n } else if (/Z$/.test(datestr) || /GMT$/.test(datestr) // datestrings w/ timezone\n ) parsedDate = new Date(date);else if (config && config.parseDate) parsedDate = config.parseDate(date, format);else {\n parsedDate = !config || !config.noCalendar ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0) : new Date(new Date().setHours(0, 0, 0, 0));\n var matched = void 0,\n ops = [];\n\n for (var i = 0, matchIndex = 0, regexStr = \"\"; i < format.length; i++) {\n var token_1 = format[i];\n var isBackSlash = token_1 === \"\\\\\";\n var escaped = format[i - 1] === \"\\\\\" || isBackSlash;\n\n if (tokenRegex[token_1] && !escaped) {\n regexStr += tokenRegex[token_1];\n var match = new RegExp(regexStr).exec(date);\n\n if (match && (matched = true)) {\n ops[token_1 !== \"Y\" ? \"push\" : \"unshift\"]({\n fn: revFormat[token_1],\n val: match[++matchIndex]\n });\n }\n } else if (!isBackSlash) regexStr += \".\"; // don't really care\n\n\n ops.forEach(function (_a) {\n var fn = _a.fn,\n val = _a.val;\n return parsedDate = fn(parsedDate, val, locale) || parsedDate;\n });\n }\n\n parsedDate = matched ? parsedDate : undefined;\n }\n }\n /* istanbul ignore next */\n\n if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) {\n config.errorHandler(new Error(\"Invalid date provided: \" + dateOrig));\n return undefined;\n }\n\n if (timeless === true) parsedDate.setHours(0, 0, 0, 0);\n return parsedDate;\n };\n };\n /**\n * Compute the difference in dates, measured in ms\n */\n\n\n function compareDates(date1, date2, timeless) {\n if (timeless === void 0) {\n timeless = true;\n }\n\n if (timeless !== false) {\n return new Date(date1.getTime()).setHours(0, 0, 0, 0) - new Date(date2.getTime()).setHours(0, 0, 0, 0);\n }\n\n return date1.getTime() - date2.getTime();\n }\n\n var isBetween = function isBetween(ts, ts1, ts2) {\n return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2);\n };\n\n var duration = {\n DAY: 86400000\n };\n\n if (typeof Object.assign !== \"function\") {\n Object.assign = function (target) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n if (!target) {\n throw TypeError(\"Cannot convert undefined or null to object\");\n }\n\n var _loop_1 = function _loop_1(source) {\n if (source) {\n Object.keys(source).forEach(function (key) {\n return target[key] = source[key];\n });\n }\n };\n\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var source = args_1[_a];\n\n _loop_1(source);\n }\n\n return target;\n };\n }\n\n var DEBOUNCED_CHANGE_MS = 300;\n\n function FlatpickrInstance(element, instanceConfig) {\n var self = {\n config: _assign({}, defaults, flatpickr.defaultConfig),\n l10n: english\n };\n self.parseDate = createDateParser({\n config: self.config,\n l10n: self.l10n\n });\n self._handlers = [];\n self.pluginElements = [];\n self.loadedPlugins = [];\n self._bind = bind;\n self._setHoursFromDate = setHoursFromDate;\n self._positionCalendar = positionCalendar;\n self.changeMonth = changeMonth;\n self.changeYear = changeYear;\n self.clear = clear;\n self.close = close;\n self._createElement = createElement;\n self.destroy = destroy;\n self.isEnabled = isEnabled;\n self.jumpToDate = jumpToDate;\n self.open = open;\n self.redraw = redraw;\n self.set = set;\n self.setDate = setDate;\n self.toggle = toggle;\n\n function setupHelperFunctions() {\n self.utils = {\n getDaysInMonth: function getDaysInMonth(month, yr) {\n if (month === void 0) {\n month = self.currentMonth;\n }\n\n if (yr === void 0) {\n yr = self.currentYear;\n }\n\n if (month === 1 && (yr % 4 === 0 && yr % 100 !== 0 || yr % 400 === 0)) return 29;\n return self.l10n.daysInMonth[month];\n }\n };\n }\n\n function init() {\n self.element = self.input = element;\n self.isOpen = false;\n parseConfig();\n setupLocale();\n setupInputs();\n setupDates();\n setupHelperFunctions();\n if (!self.isMobile) build();\n bindEvents();\n\n if (self.selectedDates.length || self.config.noCalendar) {\n if (self.config.enableTime) {\n setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj || self.config.minDate : undefined);\n }\n\n updateValue(false);\n }\n\n setCalendarWidth();\n self.showTimeInput = self.selectedDates.length > 0 || self.config.noCalendar;\n var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n /* TODO: investigate this further\n Currently, there is weird positioning behavior in safari causing pages\n to scroll up. https://github.com/chmln/flatpickr/issues/563\n However, most browsers are not Safari and positioning is expensive when used\n in scale. https://github.com/chmln/flatpickr/issues/1096\n */\n\n if (!self.isMobile && isSafari) {\n positionCalendar();\n }\n\n triggerEvent(\"onReady\");\n }\n\n function bindToInstance(fn) {\n return fn.bind(self);\n }\n\n function setCalendarWidth() {\n var config = self.config;\n if (config.weekNumbers === false && config.showMonths === 1) return;else if (config.noCalendar !== true) {\n window.requestAnimationFrame(function () {\n if (self.calendarContainer !== undefined) {\n self.calendarContainer.style.visibility = \"hidden\";\n self.calendarContainer.style.display = \"block\";\n }\n\n if (self.daysContainer !== undefined) {\n var daysWidth = (self.days.offsetWidth + 1) * config.showMonths;\n self.daysContainer.style.width = daysWidth + \"px\";\n self.calendarContainer.style.width = daysWidth + (self.weekWrapper !== undefined ? self.weekWrapper.offsetWidth : 0) + \"px\";\n self.calendarContainer.style.removeProperty(\"visibility\");\n self.calendarContainer.style.removeProperty(\"display\");\n }\n });\n }\n }\n /**\n * The handler for all events targeting the time inputs\n */\n\n\n function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }\n\n function ampm2military(hour, amPM) {\n return hour % 12 + 12 * _int(amPM === self.l10n.amPM[1]);\n }\n\n function military2ampm(hour) {\n switch (hour % 24) {\n case 0:\n case 12:\n return 12;\n\n default:\n return hour % 12;\n }\n }\n /**\n * Syncs the selected date object time with user's time input\n */\n\n\n function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined) return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24,\n minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60,\n seconds = self.secondElement !== undefined ? (parseInt(self.secondElement.value, 10) || 0) % 60 : 0;\n\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n\n var limitMinHours = self.config.minTime !== undefined || self.config.minDate && self.minDateHasTime && self.latestSelectedDateObj && compareDates(self.latestSelectedDateObj, self.config.minDate, true) === 0;\n var limitMaxHours = self.config.maxTime !== undefined || self.config.maxDate && self.maxDateHasTime && self.latestSelectedDateObj && compareDates(self.latestSelectedDateObj, self.config.maxDate, true) === 0;\n\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined ? self.config.maxTime : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours()) minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes()) seconds = Math.min(seconds, maxTime.getSeconds());\n }\n\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined ? self.config.minTime : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours()) minutes = Math.max(minutes, minTime.getMinutes());\n if (minutes === minTime.getMinutes()) seconds = Math.max(seconds, minTime.getSeconds());\n }\n\n setHours(hours, minutes, seconds);\n }\n /**\n * Syncs time input values with a date\n */\n\n\n function setHoursFromDate(dateObj) {\n var date = dateObj || self.latestSelectedDateObj;\n if (date) setHours(date.getHours(), date.getMinutes(), date.getSeconds());\n }\n\n function setDefaultHours() {\n var hours = self.config.defaultHour;\n var minutes = self.config.defaultMinute;\n var seconds = self.config.defaultSeconds;\n\n if (self.config.minDate !== undefined) {\n var minHr = self.config.minDate.getHours();\n var minMinutes = self.config.minDate.getMinutes();\n hours = Math.max(hours, minHr);\n if (hours === minHr) minutes = Math.max(minMinutes, minutes);\n if (hours === minHr && minutes === minMinutes) seconds = self.config.minDate.getSeconds();\n }\n\n if (self.config.maxDate !== undefined) {\n var maxHr = self.config.maxDate.getHours();\n var maxMinutes = self.config.maxDate.getMinutes();\n hours = Math.min(hours, maxHr);\n if (hours === maxHr) minutes = Math.min(maxMinutes, minutes);\n if (hours === maxHr && minutes === maxMinutes) seconds = self.config.maxDate.getSeconds();\n }\n\n setHours(hours, minutes, seconds);\n }\n /**\n * Sets the hours, minutes, and optionally seconds\n * of the latest selected date object and the\n * corresponding time inputs\n * @param {Number} hours the hour. whether its military\n * or am-pm gets inferred from config\n * @param {Number} minutes the minutes\n * @param {Number} seconds the seconds (optional)\n */\n\n\n function setHours(hours, minutes, seconds) {\n if (self.latestSelectedDateObj !== undefined) {\n self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0);\n }\n\n if (!self.hourElement || !self.minuteElement || self.isMobile) return;\n self.hourElement.value = pad(!self.config.time_24hr ? (12 + hours) % 12 + 12 * _int(hours % 12 === 0) : hours);\n self.minuteElement.value = pad(minutes);\n if (self.amPM !== undefined) self.amPM.textContent = self.l10n.amPM[_int(hours >= 12)];\n if (self.secondElement !== undefined) self.secondElement.value = pad(seconds);\n }\n /**\n * Handles the year input and incrementing events\n * @param {Event} event the keyup or increment event\n */\n\n\n function onYearInput(event) {\n var year = parseInt(event.target.value) + (event.delta || 0);\n\n if (year / 1000 > 1 || event.key === \"Enter\" && !/[^\\d]/.test(year.toString())) {\n changeYear(year);\n }\n }\n /**\n * Essentially addEventListener + tracking\n * @param {Element} element the element to addEventListener to\n * @param {String} event the event name\n * @param {Function} handler the event handler\n */\n\n\n function bind(element, event, handler, options) {\n if (event instanceof Array) return event.forEach(function (ev) {\n return bind(element, ev, handler, options);\n });\n if (element instanceof Array) return element.forEach(function (el) {\n return bind(el, event, handler, options);\n });\n element.addEventListener(event, handler, options);\n\n self._handlers.push({\n element: element,\n event: event,\n handler: handler,\n options: options\n });\n }\n /**\n * A mousedown handler which mimics click.\n * Minimizes latency, since we don't need to wait for mouseup in most cases.\n * Also, avoids handling right clicks.\n *\n * @param {Function} handler the event handler\n */\n\n\n function onClick(handler) {\n return function (evt) {\n evt.which === 1 && handler(evt);\n };\n }\n\n function triggerChange() {\n triggerEvent(\"onChange\");\n }\n /**\n * Adds all the necessary event listeners\n */\n\n\n function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n\n if (self.isMobile) {\n setupMobile();\n return;\n }\n\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent)) bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\") onMouseOver(e.target);\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config[\"static\"]) bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined) bind(window.document, \"touchstart\", documentClick);else bind(window.document, \"mousedown\", onClick(documentClick));\n bind(window.document, \"focus\", documentClick, {\n capture: true\n });\n\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"mousedown\", onClick(self.open));\n }\n\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"mousedown\", onClick(selectDate));\n }\n\n if (self.timeContainer !== undefined && self.minuteElement !== undefined && self.hourElement !== undefined) {\n var selText = function selText(e) {\n return e.target.select();\n };\n\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, {\n capture: true\n });\n bind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined) bind(self.secondElement, \"focus\", function () {\n return self.secondElement && self.secondElement.select();\n });\n\n if (self.amPM !== undefined) {\n bind(self.amPM, \"mousedown\", onClick(function (e) {\n updateTime(e);\n triggerChange();\n }));\n }\n }\n }\n /**\n * Set the calendar view to a particular date.\n * @param {Date} jumpDate the date to set the view to\n * @param {boolean} triggerChange if change events should be triggered\n */\n\n\n function jumpToDate(jumpDate, triggerChange) {\n var jumpTo = jumpDate !== undefined ? 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);\n var oldYear = self.currentYear;\n var oldMonth = self.currentMonth;\n\n try {\n if (jumpTo !== undefined) {\n self.currentYear = jumpTo.getFullYear();\n self.currentMonth = jumpTo.getMonth();\n }\n } catch (e) {\n /* istanbul ignore next */\n e.message = \"Invalid date supplied: \" + jumpTo;\n self.config.errorHandler(e);\n }\n\n if (triggerChange && self.currentYear !== oldYear) {\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n\n if (triggerChange && (self.currentYear !== oldYear || self.currentMonth !== oldMonth)) {\n triggerEvent(\"onMonthChange\");\n }\n\n self.redraw();\n }\n /**\n * The up/down arrow handler for time inputs\n * @param {Event} e the click event\n */\n\n\n function timeIncrement(e) {\n if (~e.target.className.indexOf(\"arrow\")) incrementNumInput(e, e.target.classList.contains(\"arrowUp\") ? 1 : -1);\n }\n /**\n * Increments/decrements the value of input associ-\n * ated with the up/down arrow by dispatching an\n * \"increment\" event on the input.\n *\n * @param {Event} e the click event\n * @param {Number} delta the diff (usually 1 or -1)\n * @param {Element} inputElem the input element\n */\n\n\n function incrementNumInput(e, delta, inputElem) {\n var target = e && e.target;\n var input = inputElem || target && target.parentNode && target.parentNode.firstChild;\n var event = createEvent(\"increment\");\n event.delta = delta;\n input && input.dispatchEvent(event);\n }\n\n function build() {\n var fragment = window.document.createDocumentFragment();\n self.calendarContainer = createElement(\"div\", \"flatpickr-calendar\");\n self.calendarContainer.tabIndex = -1;\n\n if (!self.config.noCalendar) {\n fragment.appendChild(buildMonthNav());\n self.innerContainer = createElement(\"div\", \"flatpickr-innerContainer\");\n\n if (self.config.weekNumbers) {\n var _a = buildWeeks(),\n weekWrapper = _a.weekWrapper,\n weekNumbers = _a.weekNumbers;\n\n self.innerContainer.appendChild(weekWrapper);\n self.weekNumbers = weekNumbers;\n self.weekWrapper = weekWrapper;\n }\n\n self.rContainer = createElement(\"div\", \"flatpickr-rContainer\");\n self.rContainer.appendChild(buildWeekdays());\n\n if (!self.daysContainer) {\n self.daysContainer = createElement(\"div\", \"flatpickr-days\");\n self.daysContainer.tabIndex = -1;\n }\n\n buildDays();\n self.rContainer.appendChild(self.daysContainer);\n self.innerContainer.appendChild(self.rContainer);\n fragment.appendChild(self.innerContainer);\n }\n\n if (self.config.enableTime) {\n fragment.appendChild(buildTime());\n }\n\n toggleClass(self.calendarContainer, \"rangeMode\", self.config.mode === \"range\");\n toggleClass(self.calendarContainer, \"animate\", self.config.animate === true);\n toggleClass(self.calendarContainer, \"multiMonth\", self.config.showMonths > 1);\n self.calendarContainer.appendChild(fragment);\n var customAppend = self.config.appendTo !== undefined && self.config.appendTo.nodeType !== undefined;\n\n if (self.config.inline || self.config[\"static\"]) {\n self.calendarContainer.classList.add(self.config.inline ? \"inline\" : \"static\");\n\n if (self.config.inline) {\n if (!customAppend && self.element.parentNode) self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);else if (self.config.appendTo !== undefined) self.config.appendTo.appendChild(self.calendarContainer);\n }\n\n if (self.config[\"static\"]) {\n var wrapper = createElement(\"div\", \"flatpickr-wrapper\");\n if (self.element.parentNode) self.element.parentNode.insertBefore(wrapper, self.element);\n wrapper.appendChild(self.element);\n if (self.altInput) wrapper.appendChild(self.altInput);\n wrapper.appendChild(self.calendarContainer);\n }\n }\n\n if (!self.config[\"static\"] && !self.config.inline) (self.config.appendTo !== undefined ? self.config.appendTo : window.document.body).appendChild(self.calendarContainer);\n }\n\n function createDay(className, date, dayNumber, i) {\n var dateIsEnabled = isEnabled(date, true),\n dayElement = createElement(\"span\", \"flatpickr-day \" + className, date.getDate().toString());\n dayElement.dateObj = date;\n dayElement.$i = i;\n dayElement.setAttribute(\"aria-label\", self.formatDate(date, self.config.ariaDateFormat));\n\n if (className.indexOf(\"hidden\") === -1 && compareDates(date, self.now) === 0) {\n self.todayDateElem = dayElement;\n dayElement.classList.add(\"today\");\n dayElement.setAttribute(\"aria-current\", \"date\");\n }\n\n if (dateIsEnabled) {\n dayElement.tabIndex = -1;\n\n if (isDateSelected(date)) {\n dayElement.classList.add(\"selected\");\n self.selectedDateElem = dayElement;\n\n if (self.config.mode === \"range\") {\n toggleClass(dayElement, \"startRange\", self.selectedDates[0] && compareDates(date, self.selectedDates[0], true) === 0);\n toggleClass(dayElement, \"endRange\", self.selectedDates[1] && compareDates(date, self.selectedDates[1], true) === 0);\n if (className === \"nextMonthDay\") dayElement.classList.add(\"inRange\");\n }\n }\n } else {\n dayElement.classList.add(\"flatpickr-disabled\");\n }\n\n if (self.config.mode === \"range\") {\n if (isDateInRange(date) && !isDateSelected(date)) dayElement.classList.add(\"inRange\");\n }\n\n if (self.weekNumbers && self.config.showMonths === 1 && className !== \"prevMonthDay\" && dayNumber % 7 === 1) {\n self.weekNumbers.insertAdjacentHTML(\"beforeend\", \"\" + self.config.getWeek(date) + \"\");\n }\n\n triggerEvent(\"onDayCreate\", dayElement);\n return dayElement;\n }\n\n function focusOnDayElem(targetNode) {\n targetNode.focus();\n if (self.config.mode === \"range\") onMouseOver(targetNode);\n }\n\n function getFirstAvailableDay(delta) {\n var startMonth = delta > 0 ? 0 : self.config.showMonths - 1;\n var endMonth = delta > 0 ? self.config.showMonths : -1;\n\n for (var m = startMonth; m != endMonth; m += delta) {\n var month = self.daysContainer.children[m];\n var startIndex = delta > 0 ? 0 : month.children.length - 1;\n var endIndex = delta > 0 ? month.children.length : -1;\n\n for (var i = startIndex; i != endIndex; i += delta) {\n var c = month.children[i];\n if (c.className.indexOf(\"hidden\") === -1 && isEnabled(c.dateObj)) return c;\n }\n }\n\n return undefined;\n }\n\n function getNextAvailableDay(current, delta) {\n var givenMonth = current.className.indexOf(\"Month\") === -1 ? current.dateObj.getMonth() : self.currentMonth;\n var endMonth = delta > 0 ? self.config.showMonths : -1;\n var loopDelta = delta > 0 ? 1 : -1;\n\n for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) {\n var month = self.daysContainer.children[m];\n var startIndex = givenMonth - self.currentMonth === m ? current.$i + delta : delta < 0 ? month.children.length - 1 : 0;\n var numMonthDays = month.children.length;\n\n for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) {\n var c = month.children[i];\n if (c.className.indexOf(\"hidden\") === -1 && isEnabled(c.dateObj) && Math.abs(current.$i - i) >= Math.abs(delta)) return focusOnDayElem(c);\n }\n }\n\n self.changeMonth(loopDelta);\n focusOnDay(getFirstAvailableDay(loopDelta), 0);\n return undefined;\n }\n\n function focusOnDay(current, offset) {\n var dayFocused = isInView(document.activeElement || document.body);\n var startElem = current !== undefined ? current : dayFocused ? document.activeElement : self.selectedDateElem !== undefined && isInView(self.selectedDateElem) ? self.selectedDateElem : self.todayDateElem !== undefined && isInView(self.todayDateElem) ? self.todayDateElem : getFirstAvailableDay(offset > 0 ? 1 : -1);\n if (startElem === undefined) return self._input.focus();\n if (!dayFocused) return focusOnDayElem(startElem);\n getNextAvailableDay(startElem, offset);\n }\n\n function buildMonthDays(year, month) {\n var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7;\n var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12);\n var daysInMonth = self.utils.getDaysInMonth(month),\n days = window.document.createDocumentFragment(),\n isMultiMonth = self.config.showMonths > 1,\n prevMonthDayClass = isMultiMonth ? \"prevMonthDay hidden\" : \"prevMonthDay\",\n nextMonthDayClass = isMultiMonth ? \"nextMonthDay hidden\" : \"nextMonthDay\";\n var dayNumber = prevMonthDays + 1 - firstOfMonth,\n dayIndex = 0; // prepend days from the ending of previous month\n\n for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) {\n days.appendChild(createDay(prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex));\n } // Start at 1 since there is no 0th day\n\n\n for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) {\n days.appendChild(createDay(\"\", new Date(year, month, dayNumber), dayNumber, dayIndex));\n } // append days from the next month\n\n\n for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth && (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) {\n days.appendChild(createDay(nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex));\n } //updateNavigationCurrentMonth();\n\n\n var dayContainer = createElement(\"div\", \"dayContainer\");\n dayContainer.appendChild(days);\n return dayContainer;\n }\n\n function buildDays() {\n if (self.daysContainer === undefined) {\n return;\n }\n\n clearNode(self.daysContainer); // TODO: week numbers for each month\n\n if (self.weekNumbers) clearNode(self.weekNumbers);\n var frag = document.createDocumentFragment();\n\n for (var i = 0; i < self.config.showMonths; i++) {\n var d = new Date(self.currentYear, self.currentMonth, 1);\n d.setMonth(self.currentMonth + i);\n frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));\n }\n\n self.daysContainer.appendChild(frag);\n self.days = self.daysContainer.firstChild;\n\n if (self.config.mode === \"range\" && self.selectedDates.length === 1) {\n onMouseOver();\n }\n }\n\n function buildMonthSwitch() {\n if (self.config.showMonths > 1 || self.config.monthSelectorType !== \"dropdown\") return;\n\n var shouldBuildMonth = function shouldBuildMonth(month) {\n if (self.config.minDate !== undefined && self.currentYear === self.config.minDate.getFullYear() && month < self.config.minDate.getMonth()) {\n return false;\n }\n\n return !(self.config.maxDate !== undefined && self.currentYear === self.config.maxDate.getFullYear() && month > self.config.maxDate.getMonth());\n };\n\n self.monthsDropdownContainer.tabIndex = -1;\n self.monthsDropdownContainer.innerHTML = \"\";\n\n for (var i = 0; i < 12; i++) {\n if (!shouldBuildMonth(i)) continue;\n var month = createElement(\"option\", \"flatpickr-monthDropdown-month\");\n month.value = new Date(self.currentYear, i).getMonth().toString();\n month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n);\n month.tabIndex = -1;\n\n if (self.currentMonth === i) {\n month.selected = true;\n }\n\n self.monthsDropdownContainer.appendChild(month);\n }\n }\n\n function buildMonth() {\n var container = createElement(\"div\", \"flatpickr-month\");\n var monthNavFragment = window.document.createDocumentFragment();\n var monthElement;\n\n if (self.config.showMonths > 1 || self.config.monthSelectorType === \"static\") {\n monthElement = createElement(\"span\", \"cur-month\");\n } else {\n self.monthsDropdownContainer = createElement(\"select\", \"flatpickr-monthDropdown-months\");\n bind(self.monthsDropdownContainer, \"change\", function (e) {\n var target = e.target;\n var selectedMonth = parseInt(target.value, 10);\n self.changeMonth(selectedMonth - self.currentMonth);\n triggerEvent(\"onMonthChange\");\n });\n buildMonthSwitch();\n monthElement = self.monthsDropdownContainer;\n }\n\n var yearInput = createNumberInput(\"cur-year\", {\n tabindex: \"-1\"\n });\n var yearElement = yearInput.getElementsByTagName(\"input\")[0];\n yearElement.setAttribute(\"aria-label\", self.l10n.yearAriaLabel);\n\n if (self.config.minDate) {\n yearElement.setAttribute(\"min\", self.config.minDate.getFullYear().toString());\n }\n\n if (self.config.maxDate) {\n yearElement.setAttribute(\"max\", self.config.maxDate.getFullYear().toString());\n yearElement.disabled = !!self.config.minDate && self.config.minDate.getFullYear() === self.config.maxDate.getFullYear();\n }\n\n var currentMonth = createElement(\"div\", \"flatpickr-current-month\");\n currentMonth.appendChild(monthElement);\n currentMonth.appendChild(yearInput);\n monthNavFragment.appendChild(currentMonth);\n container.appendChild(monthNavFragment);\n return {\n container: container,\n yearElement: yearElement,\n monthElement: monthElement\n };\n }\n\n function buildMonths() {\n clearNode(self.monthNav);\n self.monthNav.appendChild(self.prevMonthNav);\n\n if (self.config.showMonths) {\n self.yearElements = [];\n self.monthElements = [];\n }\n\n for (var m = self.config.showMonths; m--;) {\n var month = buildMonth();\n self.yearElements.push(month.yearElement);\n self.monthElements.push(month.monthElement);\n self.monthNav.appendChild(month.container);\n }\n\n self.monthNav.appendChild(self.nextMonthNav);\n }\n\n function buildMonthNav() {\n self.monthNav = createElement(\"div\", \"flatpickr-months\");\n self.yearElements = [];\n self.monthElements = [];\n self.prevMonthNav = createElement(\"span\", \"flatpickr-prev-month\");\n self.prevMonthNav.innerHTML = self.config.prevArrow;\n self.nextMonthNav = createElement(\"span\", \"flatpickr-next-month\");\n self.nextMonthNav.innerHTML = self.config.nextArrow;\n buildMonths();\n Object.defineProperty(self, \"_hidePrevMonthArrow\", {\n get: function get() {\n return self.__hidePrevMonthArrow;\n },\n set: function set(bool) {\n if (self.__hidePrevMonthArrow !== bool) {\n toggleClass(self.prevMonthNav, \"flatpickr-disabled\", bool);\n self.__hidePrevMonthArrow = bool;\n }\n }\n });\n Object.defineProperty(self, \"_hideNextMonthArrow\", {\n get: function get() {\n return self.__hideNextMonthArrow;\n },\n set: function set(bool) {\n if (self.__hideNextMonthArrow !== bool) {\n toggleClass(self.nextMonthNav, \"flatpickr-disabled\", bool);\n self.__hideNextMonthArrow = bool;\n }\n }\n });\n self.currentYearElement = self.yearElements[0];\n updateNavigationCurrentMonth();\n return self.monthNav;\n }\n\n function buildTime() {\n self.calendarContainer.classList.add(\"hasTime\");\n if (self.config.noCalendar) self.calendarContainer.classList.add(\"noCalendar\");\n self.timeContainer = createElement(\"div\", \"flatpickr-time\");\n self.timeContainer.tabIndex = -1;\n var separator = createElement(\"span\", \"flatpickr-time-separator\", \":\");\n var hourInput = createNumberInput(\"flatpickr-hour\", {\n \"aria-label\": self.l10n.hourAriaLabel\n });\n self.hourElement = hourInput.getElementsByTagName(\"input\")[0];\n var minuteInput = createNumberInput(\"flatpickr-minute\", {\n \"aria-label\": self.l10n.minuteAriaLabel\n });\n self.minuteElement = minuteInput.getElementsByTagName(\"input\")[0];\n self.hourElement.tabIndex = self.minuteElement.tabIndex = -1;\n self.hourElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getHours() : self.config.time_24hr ? self.config.defaultHour : military2ampm(self.config.defaultHour));\n self.minuteElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getMinutes() : self.config.defaultMinute);\n self.hourElement.setAttribute(\"step\", self.config.hourIncrement.toString());\n self.minuteElement.setAttribute(\"step\", self.config.minuteIncrement.toString());\n self.hourElement.setAttribute(\"min\", self.config.time_24hr ? \"0\" : \"1\");\n self.hourElement.setAttribute(\"max\", self.config.time_24hr ? \"23\" : \"12\");\n self.minuteElement.setAttribute(\"min\", \"0\");\n self.minuteElement.setAttribute(\"max\", \"59\");\n self.timeContainer.appendChild(hourInput);\n self.timeContainer.appendChild(separator);\n self.timeContainer.appendChild(minuteInput);\n if (self.config.time_24hr) self.timeContainer.classList.add(\"time24hr\");\n\n if (self.config.enableSeconds) {\n self.timeContainer.classList.add(\"hasSeconds\");\n var secondInput = createNumberInput(\"flatpickr-second\");\n self.secondElement = secondInput.getElementsByTagName(\"input\")[0];\n self.secondElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getSeconds() : self.config.defaultSeconds);\n self.secondElement.setAttribute(\"step\", self.minuteElement.getAttribute(\"step\"));\n self.secondElement.setAttribute(\"min\", \"0\");\n self.secondElement.setAttribute(\"max\", \"59\");\n self.timeContainer.appendChild(createElement(\"span\", \"flatpickr-time-separator\", \":\"));\n self.timeContainer.appendChild(secondInput);\n }\n\n if (!self.config.time_24hr) {\n // add self.amPM if appropriate\n self.amPM = createElement(\"span\", \"flatpickr-am-pm\", self.l10n.amPM[_int((self.latestSelectedDateObj ? self.hourElement.value : self.config.defaultHour) > 11)]);\n self.amPM.title = self.l10n.toggleTitle;\n self.amPM.tabIndex = -1;\n self.timeContainer.appendChild(self.amPM);\n }\n\n return self.timeContainer;\n }\n\n function buildWeekdays() {\n if (!self.weekdayContainer) self.weekdayContainer = createElement(\"div\", \"flatpickr-weekdays\");else clearNode(self.weekdayContainer);\n\n for (var i = self.config.showMonths; i--;) {\n var container = createElement(\"div\", \"flatpickr-weekdaycontainer\");\n self.weekdayContainer.appendChild(container);\n }\n\n updateWeekdays();\n return self.weekdayContainer;\n }\n\n function updateWeekdays() {\n if (!self.weekdayContainer) {\n return;\n }\n\n var firstDayOfWeek = self.l10n.firstDayOfWeek;\n var weekdays = self.l10n.weekdays.shorthand.slice();\n\n if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) {\n weekdays = weekdays.splice(firstDayOfWeek, weekdays.length).concat(weekdays.splice(0, firstDayOfWeek));\n }\n\n for (var i = self.config.showMonths; i--;) {\n self.weekdayContainer.children[i].innerHTML = \"\\n \\n \" + weekdays.join(\"\") + \"\\n \\n \";\n }\n }\n /* istanbul ignore next */\n\n\n function buildWeeks() {\n self.calendarContainer.classList.add(\"hasWeeks\");\n var weekWrapper = createElement(\"div\", \"flatpickr-weekwrapper\");\n weekWrapper.appendChild(createElement(\"span\", \"flatpickr-weekday\", self.l10n.weekAbbreviation));\n var weekNumbers = createElement(\"div\", \"flatpickr-weeks\");\n weekWrapper.appendChild(weekNumbers);\n return {\n weekWrapper: weekWrapper,\n weekNumbers: weekNumbers\n };\n }\n\n function changeMonth(value, isOffset) {\n if (isOffset === void 0) {\n isOffset = true;\n }\n\n var delta = isOffset ? value : value - self.currentMonth;\n if (delta < 0 && self._hidePrevMonthArrow === true || delta > 0 && self._hideNextMonthArrow === true) return;\n self.currentMonth += delta;\n\n if (self.currentMonth < 0 || self.currentMonth > 11) {\n self.currentYear += self.currentMonth > 11 ? 1 : -1;\n self.currentMonth = (self.currentMonth + 12) % 12;\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n\n buildDays();\n triggerEvent(\"onMonthChange\");\n updateNavigationCurrentMonth();\n }\n\n function clear(triggerChangeEvent, toInitial) {\n if (triggerChangeEvent === void 0) {\n triggerChangeEvent = true;\n }\n\n if (toInitial === void 0) {\n toInitial = true;\n }\n\n self.input.value = \"\";\n if (self.altInput !== undefined) self.altInput.value = \"\";\n if (self.mobileInput !== undefined) self.mobileInput.value = \"\";\n self.selectedDates = [];\n self.latestSelectedDateObj = undefined;\n\n if (toInitial === true) {\n self.currentYear = self._initialDate.getFullYear();\n self.currentMonth = self._initialDate.getMonth();\n }\n\n self.showTimeInput = false;\n\n if (self.config.enableTime === true) {\n setDefaultHours();\n }\n\n self.redraw();\n if (triggerChangeEvent) // triggerChangeEvent is true (default) or an Event\n triggerEvent(\"onChange\");\n }\n\n function close() {\n self.isOpen = false;\n\n if (!self.isMobile) {\n if (self.calendarContainer !== undefined) {\n self.calendarContainer.classList.remove(\"open\");\n }\n\n if (self._input !== undefined) {\n self._input.classList.remove(\"active\");\n }\n }\n\n triggerEvent(\"onClose\");\n }\n\n function destroy() {\n if (self.config !== undefined) triggerEvent(\"onDestroy\");\n\n for (var i = self._handlers.length; i--;) {\n var h = self._handlers[i];\n h.element.removeEventListener(h.event, h.handler, h.options);\n }\n\n self._handlers = [];\n\n if (self.mobileInput) {\n if (self.mobileInput.parentNode) self.mobileInput.parentNode.removeChild(self.mobileInput);\n self.mobileInput = undefined;\n } else if (self.calendarContainer && self.calendarContainer.parentNode) {\n if (self.config[\"static\"] && self.calendarContainer.parentNode) {\n var wrapper = self.calendarContainer.parentNode;\n wrapper.lastChild && wrapper.removeChild(wrapper.lastChild);\n\n if (wrapper.parentNode) {\n while (wrapper.firstChild) {\n wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper);\n }\n\n wrapper.parentNode.removeChild(wrapper);\n }\n } else self.calendarContainer.parentNode.removeChild(self.calendarContainer);\n }\n\n if (self.altInput) {\n self.input.type = \"text\";\n if (self.altInput.parentNode) self.altInput.parentNode.removeChild(self.altInput);\n delete self.altInput;\n }\n\n if (self.input) {\n self.input.type = self.input._type;\n self.input.classList.remove(\"flatpickr-input\");\n self.input.removeAttribute(\"readonly\");\n self.input.value = \"\";\n }\n\n [\"_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) {\n try {\n delete self[k];\n } catch (_) {}\n });\n }\n\n function isCalendarElem(elem) {\n if (self.config.appendTo && self.config.appendTo.contains(elem)) return true;\n return self.calendarContainer.contains(elem);\n }\n\n function documentClick(e) {\n if (self.isOpen && !self.config.inline) {\n var eventTarget_1 = getEventTarget(e);\n var isCalendarElement = isCalendarElem(eventTarget_1);\n var isInput = eventTarget_1 === self.input || eventTarget_1 === self.altInput || self.element.contains(eventTarget_1) || // web components\n // e.path is not present in all browsers. circumventing typechecks\n e.path && e.path.indexOf && (~e.path.indexOf(self.input) || ~e.path.indexOf(self.altInput));\n var lostFocus = e.type === \"blur\" ? isInput && e.relatedTarget && !isCalendarElem(e.relatedTarget) : !isInput && !isCalendarElement && !isCalendarElem(e.relatedTarget);\n var isIgnored = !self.config.ignoredFocusElements.some(function (elem) {\n return elem.contains(eventTarget_1);\n });\n\n if (lostFocus && isIgnored) {\n if (self.timeContainer !== undefined && self.minuteElement !== undefined && self.hourElement !== undefined) {\n updateTime();\n }\n\n self.close();\n\n if (self.config.mode === \"range\" && self.selectedDates.length === 1) {\n self.clear(false);\n self.redraw();\n }\n }\n }\n }\n\n function changeYear(newYear) {\n if (!newYear || self.config.minDate && newYear < self.config.minDate.getFullYear() || self.config.maxDate && newYear > self.config.maxDate.getFullYear()) return;\n var newYearNum = newYear,\n isNewYear = self.currentYear !== newYearNum;\n self.currentYear = newYearNum || self.currentYear;\n\n if (self.config.maxDate && self.currentYear === self.config.maxDate.getFullYear()) {\n self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth);\n } else if (self.config.minDate && self.currentYear === self.config.minDate.getFullYear()) {\n self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth);\n }\n\n if (isNewYear) {\n self.redraw();\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n }\n\n function isEnabled(date, timeless) {\n if (timeless === void 0) {\n timeless = true;\n }\n\n var dateToCheck = self.parseDate(date, undefined, timeless); // timeless\n\n if (self.config.minDate && dateToCheck && compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0 || self.config.maxDate && dateToCheck && compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0) return false;\n if (self.config.enable.length === 0 && self.config.disable.length === 0) return true;\n if (dateToCheck === undefined) return false;\n var bool = self.config.enable.length > 0,\n array = bool ? self.config.enable : self.config.disable;\n\n for (var i = 0, d = void 0; i < array.length; i++) {\n d = array[i];\n if (typeof d === \"function\" && d(dateToCheck) // disabled by function\n ) return bool;else if (d instanceof Date && dateToCheck !== undefined && d.getTime() === dateToCheck.getTime()) // disabled by date\n return bool;else if (typeof d === \"string\" && dateToCheck !== undefined) {\n // disabled by date string\n var parsed = self.parseDate(d, undefined, true);\n return parsed && parsed.getTime() === dateToCheck.getTime() ? bool : !bool;\n } else if ( // disabled by range\n _typeof(d) === \"object\" && dateToCheck !== undefined && d.from && d.to && dateToCheck.getTime() >= d.from.getTime() && dateToCheck.getTime() <= d.to.getTime()) return bool;\n }\n\n return !bool;\n }\n\n function isInView(elem) {\n if (self.daysContainer !== undefined) return elem.className.indexOf(\"hidden\") === -1 && self.daysContainer.contains(elem);\n return false;\n }\n\n function onKeyDown(e) {\n // e.key e.keyCode\n // \"Backspace\" 8\n // \"Tab\" 9\n // \"Enter\" 13\n // \"Escape\" (IE \"Esc\") 27\n // \"ArrowLeft\" (IE \"Left\") 37\n // \"ArrowUp\" (IE \"Up\") 38\n // \"ArrowRight\" (IE \"Right\") 39\n // \"ArrowDown\" (IE \"Down\") 40\n // \"Delete\" (IE \"Del\") 46\n var isInput = e.target === self._input;\n var allowInput = self.config.allowInput;\n var allowKeydown = self.isOpen && (!allowInput || !isInput);\n var allowInlineKeydown = self.config.inline && isInput && !allowInput;\n\n if (e.keyCode === 13 && isInput) {\n if (allowInput) {\n self.setDate(self._input.value, true, e.target === self.altInput ? self.config.altFormat : self.config.dateFormat);\n return e.target.blur();\n } else {\n self.open();\n }\n } else if (isCalendarElem(e.target) || allowKeydown || allowInlineKeydown) {\n var isTimeObj = !!self.timeContainer && self.timeContainer.contains(e.target);\n\n switch (e.keyCode) {\n case 13:\n if (isTimeObj) {\n e.preventDefault();\n updateTime();\n focusAndClose();\n } else selectDate(e);\n\n break;\n\n case 27:\n // escape\n e.preventDefault();\n focusAndClose();\n break;\n\n case 8:\n case 46:\n if (isInput && !self.config.allowInput) {\n e.preventDefault();\n self.clear();\n }\n\n break;\n\n case 37:\n case 39:\n if (!isTimeObj && !isInput) {\n e.preventDefault();\n\n if (self.daysContainer !== undefined && (allowInput === false || document.activeElement && isInView(document.activeElement))) {\n var delta_1 = e.keyCode === 39 ? 1 : -1;\n if (!e.ctrlKey) focusOnDay(undefined, delta_1);else {\n e.stopPropagation();\n changeMonth(delta_1);\n focusOnDay(getFirstAvailableDay(1), 0);\n }\n }\n } else if (self.hourElement) self.hourElement.focus();\n\n break;\n\n case 38:\n case 40:\n e.preventDefault();\n var delta = e.keyCode === 40 ? 1 : -1;\n\n if (self.daysContainer && e.target.$i !== undefined || e.target === self.input || e.target === self.altInput) {\n if (e.ctrlKey) {\n e.stopPropagation();\n changeYear(self.currentYear - delta);\n focusOnDay(getFirstAvailableDay(1), 0);\n } else if (!isTimeObj) focusOnDay(undefined, delta * 7);\n } else if (e.target === self.currentYearElement) {\n changeYear(self.currentYear - delta);\n } else if (self.config.enableTime) {\n if (!isTimeObj && self.hourElement) self.hourElement.focus();\n updateTime(e);\n\n self._debouncedChange();\n }\n\n break;\n\n case 9:\n if (isTimeObj) {\n var elems = [self.hourElement, self.minuteElement, self.secondElement, self.amPM].concat(self.pluginElements).filter(function (x) {\n return x;\n });\n var i = elems.indexOf(e.target);\n\n if (i !== -1) {\n var target = elems[i + (e.shiftKey ? -1 : 1)];\n e.preventDefault();\n\n (target || self._input).focus();\n }\n } else if (!self.config.noCalendar && self.daysContainer && self.daysContainer.contains(e.target) && e.shiftKey) {\n e.preventDefault();\n\n self._input.focus();\n }\n\n break;\n\n default:\n break;\n }\n }\n\n if (self.amPM !== undefined && e.target === self.amPM) {\n switch (e.key) {\n case self.l10n.amPM[0].charAt(0):\n case self.l10n.amPM[0].charAt(0).toLowerCase():\n self.amPM.textContent = self.l10n.amPM[0];\n setHoursFromInputs();\n updateValue();\n break;\n\n case self.l10n.amPM[1].charAt(0):\n case self.l10n.amPM[1].charAt(0).toLowerCase():\n self.amPM.textContent = self.l10n.amPM[1];\n setHoursFromInputs();\n updateValue();\n break;\n }\n }\n\n if (isInput || isCalendarElem(e.target)) {\n triggerEvent(\"onKeyDown\", e);\n }\n }\n\n function onMouseOver(elem) {\n if (self.selectedDates.length !== 1 || elem && (!elem.classList.contains(\"flatpickr-day\") || elem.classList.contains(\"flatpickr-disabled\"))) return;\n var hoverDate = elem ? elem.dateObj.getTime() : self.days.firstElementChild.dateObj.getTime(),\n initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(),\n rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()),\n rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime());\n var containsDisabled = false;\n var minRange = 0,\n maxRange = 0;\n\n for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) {\n if (!isEnabled(new Date(t), true)) {\n containsDisabled = containsDisabled || t > rangeStartDate && t < rangeEndDate;\n if (t < initialDate && (!minRange || t > minRange)) minRange = t;else if (t > initialDate && (!maxRange || t < maxRange)) maxRange = t;\n }\n }\n\n for (var m = 0; m < self.config.showMonths; m++) {\n var month = self.daysContainer.children[m];\n\n var _loop_1 = function _loop_1(i, l) {\n var dayElem = month.children[i],\n date = dayElem.dateObj;\n var timestamp = date.getTime();\n var outOfRange = minRange > 0 && timestamp < minRange || maxRange > 0 && timestamp > maxRange;\n\n if (outOfRange) {\n dayElem.classList.add(\"notAllowed\");\n [\"inRange\", \"startRange\", \"endRange\"].forEach(function (c) {\n dayElem.classList.remove(c);\n });\n return \"continue\";\n } else if (containsDisabled && !outOfRange) return \"continue\";\n\n [\"startRange\", \"inRange\", \"endRange\", \"notAllowed\"].forEach(function (c) {\n dayElem.classList.remove(c);\n });\n\n if (elem !== undefined) {\n elem.classList.add(hoverDate <= self.selectedDates[0].getTime() ? \"startRange\" : \"endRange\");\n if (initialDate < hoverDate && timestamp === initialDate) dayElem.classList.add(\"startRange\");else if (initialDate > hoverDate && timestamp === initialDate) dayElem.classList.add(\"endRange\");\n if (timestamp >= minRange && (maxRange === 0 || timestamp <= maxRange) && isBetween(timestamp, initialDate, hoverDate)) dayElem.classList.add(\"inRange\");\n }\n };\n\n for (var i = 0, l = month.children.length; i < l; i++) {\n _loop_1(i, l);\n }\n }\n }\n\n function onResize() {\n if (self.isOpen && !self.config[\"static\"] && !self.config.inline) positionCalendar();\n }\n\n function setDefaultTime() {\n self.setDate(self.config.minDate !== undefined ? new Date(self.config.minDate.getTime()) : new Date(), true);\n setDefaultHours();\n updateValue();\n }\n\n function open(e, positionElement) {\n if (positionElement === void 0) {\n positionElement = self._positionElement;\n }\n\n if (self.isMobile === true) {\n if (e) {\n e.preventDefault();\n e.target && e.target.blur();\n }\n\n if (self.mobileInput !== undefined) {\n self.mobileInput.focus();\n self.mobileInput.click();\n }\n\n triggerEvent(\"onOpen\");\n return;\n }\n\n if (self._input.disabled || self.config.inline) return;\n var wasOpen = self.isOpen;\n self.isOpen = true;\n\n if (!wasOpen) {\n self.calendarContainer.classList.add(\"open\");\n\n self._input.classList.add(\"active\");\n\n triggerEvent(\"onOpen\");\n positionCalendar(positionElement);\n }\n\n if (self.config.enableTime === true && self.config.noCalendar === true) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n\n if (self.config.allowInput === false && (e === undefined || !self.timeContainer.contains(e.relatedTarget))) {\n setTimeout(function () {\n return self.hourElement.select();\n }, 50);\n }\n }\n }\n\n function minMaxDateSetter(type) {\n return function (date) {\n var dateObj = self.config[\"_\" + type + \"Date\"] = self.parseDate(date, self.config.dateFormat);\n var inverseDateObj = self.config[\"_\" + (type === \"min\" ? \"max\" : \"min\") + \"Date\"];\n\n if (dateObj !== undefined) {\n self[type === \"min\" ? \"minDateHasTime\" : \"maxDateHasTime\"] = dateObj.getHours() > 0 || dateObj.getMinutes() > 0 || dateObj.getSeconds() > 0;\n }\n\n if (self.selectedDates) {\n self.selectedDates = self.selectedDates.filter(function (d) {\n return isEnabled(d);\n });\n if (!self.selectedDates.length && type === \"min\") setHoursFromDate(dateObj);\n updateValue();\n }\n\n if (self.daysContainer) {\n redraw();\n if (dateObj !== undefined) self.currentYearElement[type] = dateObj.getFullYear().toString();else self.currentYearElement.removeAttribute(type);\n self.currentYearElement.disabled = !!inverseDateObj && dateObj !== undefined && inverseDateObj.getFullYear() === dateObj.getFullYear();\n }\n };\n }\n\n function parseConfig() {\n var boolOpts = [\"wrap\", \"weekNumbers\", \"allowInput\", \"clickOpens\", \"time_24hr\", \"enableTime\", \"noCalendar\", \"altInput\", \"shorthandCurrentMonth\", \"inline\", \"static\", \"enableSeconds\", \"disableMobile\"];\n\n var userConfig = _assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {})));\n\n var formats = {};\n self.config.parseDate = userConfig.parseDate;\n self.config.formatDate = userConfig.formatDate;\n Object.defineProperty(self.config, \"enable\", {\n get: function get() {\n return self.config._enable;\n },\n set: function set(dates) {\n self.config._enable = parseDateRules(dates);\n }\n });\n Object.defineProperty(self.config, \"disable\", {\n get: function get() {\n return self.config._disable;\n },\n set: function set(dates) {\n self.config._disable = parseDateRules(dates);\n }\n });\n var timeMode = userConfig.mode === \"time\";\n\n if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) {\n var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaults.dateFormat;\n formats.dateFormat = userConfig.noCalendar || timeMode ? \"H:i\" + (userConfig.enableSeconds ? \":S\" : \"\") : defaultDateFormat + \" H:i\" + (userConfig.enableSeconds ? \":S\" : \"\");\n }\n\n if (userConfig.altInput && (userConfig.enableTime || timeMode) && !userConfig.altFormat) {\n var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaults.altFormat;\n formats.altFormat = userConfig.noCalendar || timeMode ? \"h:i\" + (userConfig.enableSeconds ? \":S K\" : \" K\") : defaultAltFormat + (\" h:i\" + (userConfig.enableSeconds ? \":S\" : \"\") + \" K\");\n }\n\n if (!userConfig.altInputClass) {\n self.config.altInputClass = self.input.className + \" \" + self.config.altInputClass;\n }\n\n Object.defineProperty(self.config, \"minDate\", {\n get: function get() {\n return self.config._minDate;\n },\n set: minMaxDateSetter(\"min\")\n });\n Object.defineProperty(self.config, \"maxDate\", {\n get: function get() {\n return self.config._maxDate;\n },\n set: minMaxDateSetter(\"max\")\n });\n\n var minMaxTimeSetter = function minMaxTimeSetter(type) {\n return function (val) {\n self.config[type === \"min\" ? \"_minTime\" : \"_maxTime\"] = self.parseDate(val, \"H:i:S\");\n };\n };\n\n Object.defineProperty(self.config, \"minTime\", {\n get: function get() {\n return self.config._minTime;\n },\n set: minMaxTimeSetter(\"min\")\n });\n Object.defineProperty(self.config, \"maxTime\", {\n get: function get() {\n return self.config._maxTime;\n },\n set: minMaxTimeSetter(\"max\")\n });\n\n if (userConfig.mode === \"time\") {\n self.config.noCalendar = true;\n self.config.enableTime = true;\n }\n\n Object.assign(self.config, formats, userConfig);\n\n for (var i = 0; i < boolOpts.length; i++) {\n self.config[boolOpts[i]] = self.config[boolOpts[i]] === true || self.config[boolOpts[i]] === \"true\";\n }\n\n HOOKS.filter(function (hook) {\n return self.config[hook] !== undefined;\n }).forEach(function (hook) {\n self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance);\n });\n self.isMobile = !self.config.disableMobile && !self.config.inline && self.config.mode === \"single\" && !self.config.disable.length && !self.config.enable.length && !self.config.weekNumbers && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n\n for (var i = 0; i < self.config.plugins.length; i++) {\n var pluginConf = self.config.plugins[i](self) || {};\n\n for (var key in pluginConf) {\n if (HOOKS.indexOf(key) > -1) {\n self.config[key] = arrayify(pluginConf[key]).map(bindToInstance).concat(self.config[key]);\n } else if (typeof userConfig[key] === \"undefined\") self.config[key] = pluginConf[key];\n }\n }\n\n triggerEvent(\"onParseConfig\");\n }\n\n function setupLocale() {\n if (_typeof(self.config.locale) !== \"object\" && typeof flatpickr.l10ns[self.config.locale] === \"undefined\") self.config.errorHandler(new Error(\"flatpickr: invalid locale \" + self.config.locale));\n self.l10n = _assign({}, flatpickr.l10ns[\"default\"], _typeof(self.config.locale) === \"object\" ? self.config.locale : self.config.locale !== \"default\" ? flatpickr.l10ns[self.config.locale] : undefined);\n tokenRegex.K = \"(\" + self.l10n.amPM[0] + \"|\" + self.l10n.amPM[1] + \"|\" + self.l10n.amPM[0].toLowerCase() + \"|\" + self.l10n.amPM[1].toLowerCase() + \")\";\n\n var userConfig = _assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {})));\n\n if (userConfig.time_24hr === undefined && flatpickr.defaultConfig.time_24hr === undefined) {\n self.config.time_24hr = self.l10n.time_24hr;\n }\n\n self.formatDate = createDateFormatter(self);\n self.parseDate = createDateParser({\n config: self.config,\n l10n: self.l10n\n });\n }\n\n function positionCalendar(customPositionElement) {\n if (self.calendarContainer === undefined) return;\n triggerEvent(\"onPreCalendarPosition\");\n var positionElement = customPositionElement || self._positionElement;\n var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, function (acc, child) {\n return acc + child.offsetHeight;\n }, 0),\n calendarWidth = self.calendarContainer.offsetWidth,\n configPos = self.config.position.split(\" \"),\n configPosVertical = configPos[0],\n configPosHorizontal = configPos.length > 1 ? configPos[1] : null,\n inputBounds = positionElement.getBoundingClientRect(),\n distanceFromBottom = window.innerHeight - inputBounds.bottom,\n showOnTop = configPosVertical === \"above\" || configPosVertical !== \"below\" && distanceFromBottom < calendarHeight && inputBounds.top > calendarHeight;\n var top = window.pageYOffset + inputBounds.top + (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2);\n toggleClass(self.calendarContainer, \"arrowTop\", !showOnTop);\n toggleClass(self.calendarContainer, \"arrowBottom\", showOnTop);\n if (self.config.inline) return;\n var left = window.pageXOffset + inputBounds.left - (configPosHorizontal != null && configPosHorizontal === \"center\" ? (calendarWidth - inputBounds.width) / 2 : 0);\n var right = window.document.body.offsetWidth - (window.pageXOffset + inputBounds.right);\n var rightMost = left + calendarWidth > window.document.body.offsetWidth;\n var centerMost = right + calendarWidth > window.document.body.offsetWidth;\n toggleClass(self.calendarContainer, \"rightMost\", rightMost);\n if (self.config[\"static\"]) return;\n self.calendarContainer.style.top = top + \"px\";\n\n if (!rightMost) {\n self.calendarContainer.style.left = left + \"px\";\n self.calendarContainer.style.right = \"auto\";\n } else if (!centerMost) {\n self.calendarContainer.style.left = \"auto\";\n self.calendarContainer.style.right = right + \"px\";\n } else {\n var doc = document.styleSheets[0]; // some testing environments don't have css support\n\n if (doc === undefined) return;\n var bodyWidth = window.document.body.offsetWidth;\n var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2);\n var centerBefore = \".flatpickr-calendar.centerMost:before\";\n var centerAfter = \".flatpickr-calendar.centerMost:after\";\n var centerIndex = doc.cssRules.length;\n var centerStyle = \"{left:\" + inputBounds.left + \"px;right:auto;}\";\n toggleClass(self.calendarContainer, \"rightMost\", false);\n toggleClass(self.calendarContainer, \"centerMost\", true);\n doc.insertRule(centerBefore + \",\" + centerAfter + centerStyle, centerIndex);\n self.calendarContainer.style.left = centerLeft + \"px\";\n self.calendarContainer.style.right = \"auto\";\n }\n }\n\n function redraw() {\n if (self.config.noCalendar || self.isMobile) return;\n updateNavigationCurrentMonth();\n buildDays();\n }\n\n function focusAndClose() {\n self._input.focus();\n\n if (window.navigator.userAgent.indexOf(\"MSIE\") !== -1 || navigator.msMaxTouchPoints !== undefined) {\n // hack - bugs in the way IE handles focus keeps the calendar open\n setTimeout(self.close, 0);\n } else {\n self.close();\n }\n }\n\n function selectDate(e) {\n e.preventDefault();\n e.stopPropagation();\n\n var isSelectable = function isSelectable(day) {\n return day.classList && day.classList.contains(\"flatpickr-day\") && !day.classList.contains(\"flatpickr-disabled\") && !day.classList.contains(\"notAllowed\");\n };\n\n var t = findParent(e.target, isSelectable);\n if (t === undefined) return;\n var target = t;\n var selectedDate = self.latestSelectedDateObj = new Date(target.dateObj.getTime());\n var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth || selectedDate.getMonth() > self.currentMonth + self.config.showMonths - 1) && self.config.mode !== \"range\";\n self.selectedDateElem = target;\n if (self.config.mode === \"single\") self.selectedDates = [selectedDate];else if (self.config.mode === \"multiple\") {\n var selectedIndex = isDateSelected(selectedDate);\n if (selectedIndex) self.selectedDates.splice(parseInt(selectedIndex), 1);else self.selectedDates.push(selectedDate);\n } else if (self.config.mode === \"range\") {\n if (self.selectedDates.length === 2) {\n self.clear(false, false);\n }\n\n self.latestSelectedDateObj = selectedDate;\n self.selectedDates.push(selectedDate); // unless selecting same date twice, sort ascendingly\n\n if (compareDates(selectedDate, self.selectedDates[0], true) !== 0) self.selectedDates.sort(function (a, b) {\n return a.getTime() - b.getTime();\n });\n }\n setHoursFromInputs();\n\n if (shouldChangeMonth) {\n var isNewYear = self.currentYear !== selectedDate.getFullYear();\n self.currentYear = selectedDate.getFullYear();\n self.currentMonth = selectedDate.getMonth();\n\n if (isNewYear) {\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n\n triggerEvent(\"onMonthChange\");\n }\n\n updateNavigationCurrentMonth();\n buildDays();\n updateValue();\n if (self.config.enableTime) setTimeout(function () {\n return self.showTimeInput = true;\n }, 50); // maintain focus\n\n if (!shouldChangeMonth && self.config.mode !== \"range\" && self.config.showMonths === 1) focusOnDayElem(target);else if (self.selectedDateElem !== undefined && self.hourElement === undefined) {\n self.selectedDateElem && self.selectedDateElem.focus();\n }\n if (self.hourElement !== undefined) self.hourElement !== undefined && self.hourElement.focus();\n\n if (self.config.closeOnSelect) {\n var single = self.config.mode === \"single\" && !self.config.enableTime;\n var range = self.config.mode === \"range\" && self.selectedDates.length === 2 && !self.config.enableTime;\n\n if (single || range) {\n focusAndClose();\n }\n }\n\n triggerChange();\n }\n\n var CALLBACKS = {\n locale: [setupLocale, updateWeekdays],\n showMonths: [buildMonths, setCalendarWidth, buildWeekdays],\n minDate: [jumpToDate],\n maxDate: [jumpToDate]\n };\n\n function set(option, value) {\n if (option !== null && _typeof(option) === \"object\") {\n Object.assign(self.config, option);\n\n for (var key in option) {\n if (CALLBACKS[key] !== undefined) CALLBACKS[key].forEach(function (x) {\n return x();\n });\n }\n } else {\n self.config[option] = value;\n if (CALLBACKS[option] !== undefined) CALLBACKS[option].forEach(function (x) {\n return x();\n });else if (HOOKS.indexOf(option) > -1) self.config[option] = arrayify(value);\n }\n\n self.redraw();\n updateValue(false);\n }\n\n function setSelectedDate(inputDate, format) {\n var dates = [];\n if (inputDate instanceof Array) dates = inputDate.map(function (d) {\n return self.parseDate(d, format);\n });else if (inputDate instanceof Date || typeof inputDate === \"number\") dates = [self.parseDate(inputDate, format)];else if (typeof inputDate === \"string\") {\n switch (self.config.mode) {\n case \"single\":\n case \"time\":\n dates = [self.parseDate(inputDate, format)];\n break;\n\n case \"multiple\":\n dates = inputDate.split(self.config.conjunction).map(function (date) {\n return self.parseDate(date, format);\n });\n break;\n\n case \"range\":\n dates = inputDate.split(self.l10n.rangeSeparator).map(function (date) {\n return self.parseDate(date, format);\n });\n break;\n\n default:\n break;\n }\n } else self.config.errorHandler(new Error(\"Invalid date supplied: \" + JSON.stringify(inputDate)));\n self.selectedDates = dates.filter(function (d) {\n return d instanceof Date && isEnabled(d, false);\n });\n if (self.config.mode === \"range\") self.selectedDates.sort(function (a, b) {\n return a.getTime() - b.getTime();\n });\n }\n\n function setDate(date, triggerChange, format) {\n if (triggerChange === void 0) {\n triggerChange = false;\n }\n\n if (format === void 0) {\n format = self.config.dateFormat;\n }\n\n if (date !== 0 && !date || date instanceof Array && date.length === 0) return self.clear(triggerChange);\n setSelectedDate(date, format);\n self.showTimeInput = self.selectedDates.length > 0;\n self.latestSelectedDateObj = self.selectedDates[self.selectedDates.length - 1];\n self.redraw();\n jumpToDate();\n setHoursFromDate();\n\n if (self.selectedDates.length === 0) {\n self.clear(false);\n }\n\n updateValue(triggerChange);\n if (triggerChange) triggerEvent(\"onChange\");\n }\n\n function parseDateRules(arr) {\n return arr.slice().map(function (rule) {\n if (typeof rule === \"string\" || typeof rule === \"number\" || rule instanceof Date) {\n return self.parseDate(rule, undefined, true);\n } else if (rule && _typeof(rule) === \"object\" && rule.from && rule.to) return {\n from: self.parseDate(rule.from, undefined),\n to: self.parseDate(rule.to, undefined)\n };\n\n return rule;\n }).filter(function (x) {\n return x;\n }); // remove falsy values\n }\n\n function setupDates() {\n self.selectedDates = [];\n self.now = self.parseDate(self.config.now) || new Date(); // Workaround IE11 setting placeholder as the input's value\n\n var preloadedDate = self.config.defaultDate || ((self.input.nodeName === \"INPUT\" || self.input.nodeName === \"TEXTAREA\") && self.input.placeholder && self.input.value === self.input.placeholder ? null : self.input.value);\n if (preloadedDate) setSelectedDate(preloadedDate, self.config.dateFormat);\n self._initialDate = self.selectedDates.length > 0 ? 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;\n self.currentYear = self._initialDate.getFullYear();\n self.currentMonth = self._initialDate.getMonth();\n if (self.selectedDates.length > 0) self.latestSelectedDateObj = self.selectedDates[0];\n if (self.config.minTime !== undefined) self.config.minTime = self.parseDate(self.config.minTime, \"H:i\");\n if (self.config.maxTime !== undefined) self.config.maxTime = self.parseDate(self.config.maxTime, \"H:i\");\n self.minDateHasTime = !!self.config.minDate && (self.config.minDate.getHours() > 0 || self.config.minDate.getMinutes() > 0 || self.config.minDate.getSeconds() > 0);\n self.maxDateHasTime = !!self.config.maxDate && (self.config.maxDate.getHours() > 0 || self.config.maxDate.getMinutes() > 0 || self.config.maxDate.getSeconds() > 0);\n Object.defineProperty(self, \"showTimeInput\", {\n get: function get() {\n return self._showTimeInput;\n },\n set: function set(bool) {\n self._showTimeInput = bool;\n if (self.calendarContainer) toggleClass(self.calendarContainer, \"showTimeInput\", bool);\n self.isOpen && positionCalendar();\n }\n });\n }\n\n function setupInputs() {\n self.input = self.config.wrap ? element.querySelector(\"[data-input]\") : element;\n /* istanbul ignore next */\n\n if (!self.input) {\n self.config.errorHandler(new Error(\"Invalid input element specified\"));\n return;\n } // hack: store previous type to restore it after destroy()\n\n\n self.input._type = self.input.type;\n self.input.type = \"text\";\n self.input.classList.add(\"flatpickr-input\");\n self._input = self.input;\n\n if (self.config.altInput) {\n // replicate self.element\n self.altInput = createElement(self.input.nodeName, self.config.altInputClass);\n self._input = self.altInput;\n self.altInput.placeholder = self.input.placeholder;\n self.altInput.disabled = self.input.disabled;\n self.altInput.required = self.input.required;\n self.altInput.tabIndex = self.input.tabIndex;\n self.altInput.type = \"text\";\n self.input.setAttribute(\"type\", \"hidden\");\n if (!self.config[\"static\"] && self.input.parentNode) self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling);\n }\n\n if (!self.config.allowInput) self._input.setAttribute(\"readonly\", \"readonly\");\n self._positionElement = self.config.positionElement || self._input;\n }\n\n function setupMobile() {\n var inputType = self.config.enableTime ? self.config.noCalendar ? \"time\" : \"datetime-local\" : \"date\";\n self.mobileInput = createElement(\"input\", self.input.className + \" flatpickr-mobile\");\n self.mobileInput.step = self.input.getAttribute(\"step\") || \"any\";\n self.mobileInput.tabIndex = 1;\n self.mobileInput.type = inputType;\n self.mobileInput.disabled = self.input.disabled;\n self.mobileInput.required = self.input.required;\n self.mobileInput.placeholder = self.input.placeholder;\n self.mobileFormatStr = inputType === \"datetime-local\" ? \"Y-m-d\\\\TH:i:S\" : inputType === \"date\" ? \"Y-m-d\" : \"H:i:S\";\n\n if (self.selectedDates.length > 0) {\n self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr);\n }\n\n if (self.config.minDate) self.mobileInput.min = self.formatDate(self.config.minDate, \"Y-m-d\");\n if (self.config.maxDate) self.mobileInput.max = self.formatDate(self.config.maxDate, \"Y-m-d\");\n self.input.type = \"hidden\";\n if (self.altInput !== undefined) self.altInput.type = \"hidden\";\n\n try {\n if (self.input.parentNode) self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling);\n } catch (_a) {}\n\n bind(self.mobileInput, \"change\", function (e) {\n self.setDate(e.target.value, false, self.mobileFormatStr);\n triggerEvent(\"onChange\");\n triggerEvent(\"onClose\");\n });\n }\n\n function toggle(e) {\n if (self.isOpen === true) return self.close();\n self.open(e);\n }\n\n function triggerEvent(event, data) {\n // If the instance has been destroyed already, all hooks have been removed\n if (self.config === undefined) return;\n var hooks = self.config[event];\n\n if (hooks !== undefined && hooks.length > 0) {\n for (var i = 0; hooks[i] && i < hooks.length; i++) {\n hooks[i](self.selectedDates, self.input.value, self, data);\n }\n }\n\n if (event === \"onChange\") {\n self.input.dispatchEvent(createEvent(\"change\")); // many front-end frameworks bind to the input event\n\n self.input.dispatchEvent(createEvent(\"input\"));\n }\n }\n\n function createEvent(name) {\n var e = document.createEvent(\"Event\");\n e.initEvent(name, true, true);\n return e;\n }\n\n function isDateSelected(date) {\n for (var i = 0; i < self.selectedDates.length; i++) {\n if (compareDates(self.selectedDates[i], date) === 0) return \"\" + i;\n }\n\n return false;\n }\n\n function isDateInRange(date) {\n if (self.config.mode !== \"range\" || self.selectedDates.length < 2) return false;\n return compareDates(date, self.selectedDates[0]) >= 0 && compareDates(date, self.selectedDates[1]) <= 0;\n }\n\n function updateNavigationCurrentMonth() {\n if (self.config.noCalendar || self.isMobile || !self.monthNav) return;\n self.yearElements.forEach(function (yearElement, i) {\n var d = new Date(self.currentYear, self.currentMonth, 1);\n d.setMonth(self.currentMonth + i);\n\n if (self.config.showMonths > 1 || self.config.monthSelectorType === \"static\") {\n self.monthElements[i].textContent = monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + \" \";\n } else {\n self.monthsDropdownContainer.value = d.getMonth().toString();\n }\n\n yearElement.value = d.getFullYear().toString();\n });\n self._hidePrevMonthArrow = self.config.minDate !== undefined && (self.currentYear === self.config.minDate.getFullYear() ? self.currentMonth <= self.config.minDate.getMonth() : self.currentYear < self.config.minDate.getFullYear());\n self._hideNextMonthArrow = self.config.maxDate !== undefined && (self.currentYear === self.config.maxDate.getFullYear() ? self.currentMonth + 1 > self.config.maxDate.getMonth() : self.currentYear > self.config.maxDate.getFullYear());\n }\n\n function getDateStr(format) {\n return self.selectedDates.map(function (dObj) {\n return self.formatDate(dObj, format);\n }).filter(function (d, i, arr) {\n return self.config.mode !== \"range\" || self.config.enableTime || arr.indexOf(d) === i;\n }).join(self.config.mode !== \"range\" ? self.config.conjunction : self.l10n.rangeSeparator);\n }\n /**\n * Updates the values of inputs associated with the calendar\n */\n\n\n function updateValue(triggerChange) {\n if (triggerChange === void 0) {\n triggerChange = true;\n }\n\n if (self.mobileInput !== undefined && self.mobileFormatStr) {\n self.mobileInput.value = self.latestSelectedDateObj !== undefined ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr) : \"\";\n }\n\n self.input.value = getDateStr(self.config.dateFormat);\n\n if (self.altInput !== undefined) {\n self.altInput.value = getDateStr(self.config.altFormat);\n }\n\n if (triggerChange !== false) triggerEvent(\"onValueUpdate\");\n }\n\n function onMonthNavClick(e) {\n var isPrevMonth = self.prevMonthNav.contains(e.target);\n var isNextMonth = self.nextMonthNav.contains(e.target);\n\n if (isPrevMonth || isNextMonth) {\n changeMonth(isPrevMonth ? -1 : 1);\n } else if (self.yearElements.indexOf(e.target) >= 0) {\n e.target.select();\n } else if (e.target.classList.contains(\"arrowUp\")) {\n self.changeYear(self.currentYear + 1);\n } else if (e.target.classList.contains(\"arrowDown\")) {\n self.changeYear(self.currentYear - 1);\n }\n }\n\n function timeWrapper(e) {\n e.preventDefault();\n var isKeyDown = e.type === \"keydown\",\n input = e.target;\n\n if (self.amPM !== undefined && e.target === self.amPM) {\n self.amPM.textContent = self.l10n.amPM[_int(self.amPM.textContent === self.l10n.amPM[0])];\n }\n\n var min = parseFloat(input.getAttribute(\"min\")),\n max = parseFloat(input.getAttribute(\"max\")),\n step = parseFloat(input.getAttribute(\"step\")),\n curValue = parseInt(input.value, 10),\n delta = e.delta || (isKeyDown ? e.which === 38 ? 1 : -1 : 0);\n var newValue = curValue + step * delta;\n\n if (typeof input.value !== \"undefined\" && input.value.length === 2) {\n var isHourElem = input === self.hourElement,\n isMinuteElem = input === self.minuteElement;\n\n if (newValue < min) {\n newValue = max + newValue + _int(!isHourElem) + (_int(isHourElem) && _int(!self.amPM));\n if (isMinuteElem) incrementNumInput(undefined, -1, self.hourElement);\n } else if (newValue > max) {\n newValue = input === self.hourElement ? newValue - max - _int(!self.amPM) : min;\n if (isMinuteElem) incrementNumInput(undefined, 1, self.hourElement);\n }\n\n if (self.amPM && isHourElem && (step === 1 ? newValue + curValue === 23 : Math.abs(newValue - curValue) > step)) {\n self.amPM.textContent = self.l10n.amPM[_int(self.amPM.textContent === self.l10n.amPM[0])];\n }\n\n input.value = pad(newValue);\n }\n }\n\n init();\n return self;\n }\n /* istanbul ignore next */\n\n\n function _flatpickr(nodeList, config) {\n // static list\n var nodes = Array.prototype.slice.call(nodeList).filter(function (x) {\n return x instanceof HTMLElement;\n });\n var instances = [];\n\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n\n try {\n if (node.getAttribute(\"data-fp-omit\") !== null) continue;\n\n if (node._flatpickr !== undefined) {\n node._flatpickr.destroy();\n\n node._flatpickr = undefined;\n }\n\n node._flatpickr = FlatpickrInstance(node, config || {});\n instances.push(node._flatpickr);\n } catch (e) {\n console.error(e);\n }\n }\n\n return instances.length === 1 ? instances[0] : instances;\n }\n /* istanbul ignore next */\n\n\n if (typeof HTMLElement !== \"undefined\" && typeof HTMLCollection !== \"undefined\" && typeof NodeList !== \"undefined\") {\n // browser env\n HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) {\n return _flatpickr(this, config);\n };\n\n HTMLElement.prototype.flatpickr = function (config) {\n return _flatpickr([this], config);\n };\n }\n /* istanbul ignore next */\n\n\n var flatpickr = function flatpickr(selector, config) {\n if (typeof selector === \"string\") {\n return _flatpickr(window.document.querySelectorAll(selector), config);\n } else if (selector instanceof Node) {\n return _flatpickr([selector], config);\n } else {\n return _flatpickr(selector, config);\n }\n };\n /* istanbul ignore next */\n\n\n flatpickr.defaultConfig = {};\n flatpickr.l10ns = {\n en: _assign({}, english),\n \"default\": _assign({}, english)\n };\n\n flatpickr.localize = function (l10n) {\n flatpickr.l10ns[\"default\"] = _assign({}, flatpickr.l10ns[\"default\"], l10n);\n };\n\n flatpickr.setDefaults = function (config) {\n flatpickr.defaultConfig = _assign({}, flatpickr.defaultConfig, config);\n };\n\n flatpickr.parseDate = createDateParser({});\n flatpickr.formatDate = createDateFormatter({});\n flatpickr.compareDates = compareDates;\n /* istanbul ignore next */\n\n if (typeof jQuery !== \"undefined\" && typeof jQuery.fn !== \"undefined\") {\n jQuery.fn.flatpickr = function (config) {\n return _flatpickr(this, config);\n };\n } // eslint-disable-next-line @typescript-eslint/camelcase\n\n\n Date.prototype.fp_incr = function (days) {\n return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === \"string\" ? parseInt(days, 10) : days));\n };\n\n if (typeof window !== \"undefined\") {\n window.flatpickr = flatpickr;\n }\n\n return flatpickr;\n});","function _typeof2(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof2(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nfunction _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}\n\nfunction set(target, property, value, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.set) {\n set = Reflect.set;\n } else {\n set = function set(target, property, value, receiver) {\n var base = _superPropBase(target, property);\n\n var desc;\n\n if (base) {\n desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.set) {\n desc.set.call(receiver, value);\n return true;\n } else if (!desc.writable) {\n return false;\n }\n }\n\n desc = Object.getOwnPropertyDescriptor(receiver, property);\n\n if (desc) {\n if (!desc.writable) {\n return false;\n }\n\n desc.value = value;\n Object.defineProperty(receiver, property, desc);\n } else {\n _defineProperty(receiver, property, value);\n }\n\n return true;\n };\n }\n\n return set(target, property, value, receiver);\n}\n\nfunction _set(target, property, value, receiver, isStrict) {\n var s = set(target, property, value, receiver || target);\n\n if (!s && isStrict) {\n throw new Error('failed to set property');\n }\n\n return value;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n/** Checks if value is string */\n\n\nfunction isString(str) {\n return typeof str === 'string' || str instanceof String;\n}\n/**\r\n Direction\r\n @prop {string} NONE\r\n @prop {string} LEFT\r\n @prop {string} FORCE_LEFT\r\n @prop {string} RIGHT\r\n @prop {string} FORCE_RIGHT\r\n*/\n\n\nvar DIRECTION = {\n NONE: 'NONE',\n LEFT: 'LEFT',\n FORCE_LEFT: 'FORCE_LEFT',\n RIGHT: 'RIGHT',\n FORCE_RIGHT: 'FORCE_RIGHT'\n /**\r\n Direction\r\n @enum {string}\r\n */\n\n};\n/** */\n\nfunction forceDirection(direction) {\n switch (direction) {\n case DIRECTION.LEFT:\n return DIRECTION.FORCE_LEFT;\n\n case DIRECTION.RIGHT:\n return DIRECTION.FORCE_RIGHT;\n\n default:\n return direction;\n }\n}\n/** Escapes regular expression control chars */\n\n\nfunction escapeRegExp(str) {\n return str.replace(/([.*+?^=!:${}()|[\\]/\\\\])/g, '\\\\$1');\n} // cloned from https://github.com/epoberezkin/fast-deep-equal with small changes\n\n\nfunction objectIncludes(b, a) {\n if (a === b) return true;\n var arrA = Array.isArray(a),\n arrB = Array.isArray(b),\n i;\n\n if (arrA && arrB) {\n if (a.length != b.length) return false;\n\n for (i = 0; i < a.length; i++) {\n if (!objectIncludes(a[i], b[i])) return false;\n }\n\n return true;\n }\n\n if (arrA != arrB) return false;\n\n if (a && b && _typeof(a) === 'object' && _typeof(b) === 'object') {\n var dateA = a instanceof Date,\n dateB = b instanceof Date;\n if (dateA && dateB) return a.getTime() == b.getTime();\n if (dateA != dateB) return false;\n var regexpA = a instanceof RegExp,\n regexpB = b instanceof RegExp;\n if (regexpA && regexpB) return a.toString() == b.toString();\n if (regexpA != regexpB) return false;\n var keys = Object.keys(a); // if (keys.length !== Object.keys(b).length) return false;\n\n for (i = 0; i < keys.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n }\n\n for (i = 0; i < keys.length; i++) {\n if (!objectIncludes(b[keys[i]], a[keys[i]])) return false;\n }\n\n return true;\n } else if (a && b && typeof a === 'function' && typeof b === 'function') {\n return a.toString() === b.toString();\n }\n\n return false;\n}\n/* eslint-disable no-undef */\n\n\nvar g = typeof window !== 'undefined' && window || typeof global !== 'undefined' && global.global === global && global || typeof self !== 'undefined' && self.self === self && self || {};\n/* eslint-enable no-undef */\n\n/** Selection range */\n\n/** Provides details of changing input */\n\nvar ActionDetails = /*#__PURE__*/function () {\n /** Current input value */\n\n /** Current cursor position */\n\n /** Old input value */\n\n /** Old selection */\n function ActionDetails(value, cursorPos, oldValue, oldSelection) {\n _classCallCheck(this, ActionDetails);\n\n this.value = value;\n this.cursorPos = cursorPos;\n this.oldValue = oldValue;\n this.oldSelection = oldSelection; // double check if left part was changed (autofilling, other non-standard input triggers)\n\n while (this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos)) {\n --this.oldSelection.start;\n }\n }\n /**\r\n Start changing position\r\n @readonly\r\n */\n\n\n _createClass(ActionDetails, [{\n key: \"startChangePos\",\n get: function get() {\n return Math.min(this.cursorPos, this.oldSelection.start);\n }\n /**\r\n Inserted symbols count\r\n @readonly\r\n */\n\n }, {\n key: \"insertedCount\",\n get: function get() {\n return this.cursorPos - this.startChangePos;\n }\n /**\r\n Inserted symbols\r\n @readonly\r\n */\n\n }, {\n key: \"inserted\",\n get: function get() {\n return this.value.substr(this.startChangePos, this.insertedCount);\n }\n /**\r\n Removed symbols count\r\n @readonly\r\n */\n\n }, {\n key: \"removedCount\",\n get: function get() {\n // Math.max for opposite operation\n return Math.max(this.oldSelection.end - this.startChangePos || // for Delete\n this.oldValue.length - this.value.length, 0);\n }\n /**\r\n Removed symbols\r\n @readonly\r\n */\n\n }, {\n key: \"removed\",\n get: function get() {\n return this.oldValue.substr(this.startChangePos, this.removedCount);\n }\n /**\r\n Unchanged head symbols\r\n @readonly\r\n */\n\n }, {\n key: \"head\",\n get: function get() {\n return this.value.substring(0, this.startChangePos);\n }\n /**\r\n Unchanged tail symbols\r\n @readonly\r\n */\n\n }, {\n key: \"tail\",\n get: function get() {\n return this.value.substring(this.startChangePos + this.insertedCount);\n }\n /**\r\n Remove direction\r\n @readonly\r\n */\n\n }, {\n key: \"removeDirection\",\n get: function get() {\n if (!this.removedCount || this.insertedCount) return DIRECTION.NONE; // align right if delete at right or if range removed (event with backspace)\n\n return this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos ? DIRECTION.RIGHT : DIRECTION.LEFT;\n }\n }]);\n\n return ActionDetails;\n}();\n/**\r\n Provides details of changing model value\r\n @param {Object} [details]\r\n @param {string} [details.inserted] - Inserted symbols\r\n @param {boolean} [details.skip] - Can skip chars\r\n @param {number} [details.removeCount] - Removed symbols count\r\n @param {number} [details.tailShift] - Additional offset if any changes occurred before tail\r\n*/\n\n\nvar ChangeDetails = /*#__PURE__*/function () {\n /** Inserted symbols */\n\n /** Can skip chars */\n\n /** Additional offset if any changes occurred before tail */\n\n /** Raw inserted is used by dynamic mask */\n function ChangeDetails(details) {\n _classCallCheck(this, ChangeDetails);\n\n Object.assign(this, {\n inserted: '',\n rawInserted: '',\n skip: false,\n tailShift: 0\n }, details);\n }\n /**\r\n Aggregate changes\r\n @returns {ChangeDetails} `this`\r\n */\n\n\n _createClass(ChangeDetails, [{\n key: \"aggregate\",\n value: function aggregate(details) {\n this.rawInserted += details.rawInserted;\n this.skip = this.skip || details.skip;\n this.inserted += details.inserted;\n this.tailShift += details.tailShift;\n return this;\n }\n /** Total offset considering all changes */\n\n }, {\n key: \"offset\",\n get: function get() {\n return this.tailShift + this.inserted.length;\n }\n }]);\n\n return ChangeDetails;\n}();\n/** Provides details of continuous extracted tail */\n\n\nvar ContinuousTailDetails = /*#__PURE__*/function () {\n /** Tail value as string */\n\n /** Tail start position */\n\n /** Start position */\n function ContinuousTailDetails() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var stop = arguments.length > 2 ? arguments[2] : undefined;\n\n _classCallCheck(this, ContinuousTailDetails);\n\n this.value = value;\n this.from = from;\n this.stop = stop;\n }\n\n _createClass(ContinuousTailDetails, [{\n key: \"toString\",\n value: function toString() {\n return this.value;\n }\n }, {\n key: \"extend\",\n value: function extend(tail) {\n this.value += String(tail);\n }\n }, {\n key: \"appendTo\",\n value: function appendTo(masked) {\n return masked.append(this.toString(), {\n tail: true\n }).aggregate(masked._appendPlaceholder());\n }\n }, {\n key: \"shiftBefore\",\n value: function shiftBefore(pos) {\n if (this.from >= pos || !this.value.length) return '';\n var shiftChar = this.value[0];\n this.value = this.value.slice(1);\n return shiftChar;\n }\n }, {\n key: \"state\",\n get: function get() {\n return {\n value: this.value,\n from: this.from,\n stop: this.stop\n };\n },\n set: function set(state) {\n Object.assign(this, state);\n }\n }]);\n\n return ContinuousTailDetails;\n}();\n/** Provides common masking stuff */\n\n\nvar Masked = /*#__PURE__*/function () {\n // $Shape; TODO after fix https://github.com/facebook/flow/issues/4773\n\n /** @type {Mask} */\n\n /** */\n // $FlowFixMe no ideas\n\n /** Transforms value before mask processing */\n\n /** Validates if value is acceptable */\n\n /** Does additional processing in the end of editing */\n\n /** Enable characters overwriting */\n\n /** */\n function Masked(opts) {\n _classCallCheck(this, Masked);\n\n this._value = '';\n\n this._update(opts);\n\n this.isInitialized = true;\n }\n /** Sets and applies new options */\n\n\n _createClass(Masked, [{\n key: \"updateOptions\",\n value: function updateOptions(opts) {\n if (!Object.keys(opts).length) return;\n this.withValueRefresh(this._update.bind(this, opts));\n }\n /**\r\n Sets new options\r\n @protected\r\n */\n\n }, {\n key: \"_update\",\n value: function _update(opts) {\n Object.assign(this, opts);\n }\n /** Mask state */\n\n }, {\n key: \"reset\",\n\n /** Resets value */\n value: function reset() {\n this._value = '';\n }\n /** */\n\n }, {\n key: \"resolve\",\n\n /** Resolve new value */\n value: function resolve(value) {\n this.reset();\n this.append(value, {\n input: true\n }, '');\n this.doCommit();\n return this.value;\n }\n /** */\n\n }, {\n key: \"nearestInputPos\",\n\n /** Finds nearest input position in direction */\n value: function nearestInputPos(cursorPos, direction) {\n return cursorPos;\n }\n /** Extracts value in range considering flags */\n\n }, {\n key: \"extractInput\",\n value: function extractInput() {\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n return this.value.slice(fromPos, toPos);\n }\n /** Extracts tail in range */\n\n }, {\n key: \"extractTail\",\n value: function extractTail() {\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n return new ContinuousTailDetails(this.extractInput(fromPos, toPos), fromPos);\n }\n /** Appends tail */\n // $FlowFixMe no ideas\n\n }, {\n key: \"appendTail\",\n value: function appendTail(tail) {\n if (isString(tail)) tail = new ContinuousTailDetails(String(tail));\n return tail.appendTo(this);\n }\n /** Appends char */\n\n }, {\n key: \"_appendCharRaw\",\n value: function _appendCharRaw(ch) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n ch = this.doPrepare(ch, flags);\n if (!ch) return new ChangeDetails();\n this._value += ch;\n return new ChangeDetails({\n inserted: ch,\n rawInserted: ch\n });\n }\n /** Appends char */\n\n }, {\n key: \"_appendChar\",\n value: function _appendChar(ch) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var checkTail = arguments.length > 2 ? arguments[2] : undefined;\n var consistentState = this.state;\n\n var details = this._appendCharRaw(ch, flags);\n\n if (details.inserted) {\n var consistentTail;\n var appended = this.doValidate(flags) !== false;\n\n if (appended && checkTail != null) {\n // validation ok, check tail\n var beforeTailState = this.state;\n\n if (this.overwrite) {\n consistentTail = checkTail.state;\n checkTail.shiftBefore(this.value.length);\n }\n\n var tailDetails = this.appendTail(checkTail);\n appended = tailDetails.rawInserted === checkTail.toString(); // if ok, rollback state after tail\n\n if (appended && tailDetails.inserted) this.state = beforeTailState;\n } // revert all if something went wrong\n\n\n if (!appended) {\n details.rawInserted = details.inserted = '';\n this.state = consistentState;\n if (checkTail && consistentTail) checkTail.state = consistentTail;\n }\n }\n\n return details;\n }\n /** Appends optional placeholder at end */\n\n }, {\n key: \"_appendPlaceholder\",\n value: function _appendPlaceholder() {\n return new ChangeDetails();\n }\n /** Appends symbols considering flags */\n // $FlowFixMe no ideas\n\n }, {\n key: \"append\",\n value: function append(str, flags, tail) {\n if (!isString(str)) throw new Error('value should be string');\n var details = new ChangeDetails();\n var checkTail = isString(tail) ? new ContinuousTailDetails(String(tail)) : tail;\n if (flags.tail) flags._beforeTailState = this.state;\n\n for (var ci = 0; ci < str.length; ++ci) {\n details.aggregate(this._appendChar(str[ci], flags, checkTail));\n } // append tail but aggregate only tailShift\n\n\n if (checkTail != null) {\n details.tailShift += this.appendTail(checkTail).tailShift; // TODO it's a good idea to clear state after appending ends\n // but it causes bugs when one append calls another (when dynamic dispatch set rawInputValue)\n // this._resetBeforeTailState();\n }\n\n return details;\n }\n /** */\n\n }, {\n key: \"remove\",\n value: function remove() {\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n this._value = this.value.slice(0, fromPos) + this.value.slice(toPos);\n return new ChangeDetails();\n }\n /** Calls function and reapplies current value */\n\n }, {\n key: \"withValueRefresh\",\n value: function withValueRefresh(fn) {\n if (this._refreshing || !this.isInitialized) return fn();\n this._refreshing = true;\n var unmasked = this.unmaskedValue;\n var value = this.value;\n var ret = fn(); // try to update with raw value first to keep fixed chars\n\n if (this.resolve(value) !== value) {\n // or fallback to unmasked\n this.unmaskedValue = unmasked;\n }\n\n delete this._refreshing;\n return ret;\n }\n /**\r\n Prepares string before mask processing\r\n @protected\r\n */\n\n }, {\n key: \"doPrepare\",\n value: function doPrepare(str) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.prepare ? this.prepare(str, this, flags) : str;\n }\n /**\r\n Validates if value is acceptable\r\n @protected\r\n */\n\n }, {\n key: \"doValidate\",\n value: function doValidate(flags) {\n return (!this.validate || this.validate(this.value, this, flags)) && (!this.parent || this.parent.doValidate(flags));\n }\n /**\r\n Does additional processing in the end of editing\r\n @protected\r\n */\n\n }, {\n key: \"doCommit\",\n value: function doCommit() {\n if (this.commit) this.commit(this.value, this);\n }\n /** */\n\n }, {\n key: \"splice\",\n value: function splice(start, deleteCount, inserted, removeDirection) {\n var tailPos = start + deleteCount;\n var tail = this.extractTail(tailPos);\n var startChangePos = this.nearestInputPos(start, removeDirection);\n var changeDetails = new ChangeDetails({\n tailShift: startChangePos - start // adjust tailShift if start was aligned\n\n }).aggregate(this.remove(startChangePos)).aggregate(this.append(inserted, {\n input: true\n }, tail));\n return changeDetails;\n }\n }, {\n key: \"state\",\n get: function get() {\n return {\n _value: this.value\n };\n },\n set: function set(state) {\n this._value = state._value;\n }\n }, {\n key: \"value\",\n get: function get() {\n return this._value;\n },\n set: function set(value) {\n this.resolve(value);\n }\n }, {\n key: \"unmaskedValue\",\n get: function get() {\n return this.value;\n },\n set: function set(value) {\n this.reset();\n this.append(value, {}, '');\n this.doCommit();\n }\n /** */\n\n }, {\n key: \"typedValue\",\n get: function get() {\n return this.unmaskedValue;\n },\n set: function set(value) {\n this.unmaskedValue = value;\n }\n /** Value that includes raw user input */\n\n }, {\n key: \"rawInputValue\",\n get: function get() {\n return this.extractInput(0, this.value.length, {\n raw: true\n });\n },\n set: function set(value) {\n this.reset();\n this.append(value, {\n raw: true\n }, '');\n this.doCommit();\n }\n /** */\n\n }, {\n key: \"isComplete\",\n get: function get() {\n return true;\n }\n }]);\n\n return Masked;\n}();\n/** Get Masked class by mask type */\n\n\nfunction maskedClass(mask) {\n if (mask == null) {\n throw new Error('mask property should be defined');\n }\n\n if (mask instanceof RegExp) return g.IMask.MaskedRegExp;\n if (isString(mask)) return g.IMask.MaskedPattern;\n if (mask instanceof Date || mask === Date) return g.IMask.MaskedDate;\n if (mask instanceof Number || typeof mask === 'number' || mask === Number) return g.IMask.MaskedNumber;\n if (Array.isArray(mask) || mask === Array) return g.IMask.MaskedDynamic; // $FlowFixMe\n\n if (mask.prototype instanceof g.IMask.Masked) return mask; // $FlowFixMe\n\n if (mask instanceof Function) return g.IMask.MaskedFunction;\n console.warn('Mask not found for mask', mask); // eslint-disable-line no-console\n\n return g.IMask.Masked;\n}\n/** Creates new {@link Masked} depending on mask type */\n\n\nfunction createMask(opts) {\n opts = Object.assign({}, opts);\n var mask = opts.mask;\n if (mask instanceof g.IMask.Masked) return mask;\n var MaskedClass = maskedClass(mask);\n return new MaskedClass(opts);\n}\n\nvar DEFAULT_INPUT_DEFINITIONS = {\n '0': /\\d/,\n 'a': /[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/,\n // http://stackoverflow.com/a/22075070\n '*': /./\n};\n/** */\n\nvar PatternInputDefinition = /*#__PURE__*/function () {\n /** */\n\n /** */\n\n /** */\n\n /** */\n\n /** */\n\n /** */\n function PatternInputDefinition(opts) {\n _classCallCheck(this, PatternInputDefinition);\n\n var mask = opts.mask,\n blockOpts = _objectWithoutProperties(opts, [\"mask\"]);\n\n this.masked = createMask({\n mask: mask\n });\n Object.assign(this, blockOpts);\n }\n\n _createClass(PatternInputDefinition, [{\n key: \"reset\",\n value: function reset() {\n this._isFilled = false;\n this.masked.reset();\n }\n }, {\n key: \"remove\",\n value: function remove() {\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n\n if (fromPos === 0 && toPos >= 1) {\n this._isFilled = false;\n return this.masked.remove(fromPos, toPos);\n }\n\n return new ChangeDetails();\n }\n }, {\n key: \"_appendChar\",\n value: function _appendChar(str) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (this._isFilled) return new ChangeDetails();\n var state = this.masked.state; // simulate input\n\n var details = this.masked._appendChar(str, flags);\n\n if (details.inserted && this.doValidate(flags) === false) {\n details.inserted = details.rawInserted = '';\n this.masked.state = state;\n }\n\n if (!details.inserted && !this.isOptional && !this.lazy && !flags.input) {\n details.inserted = this.placeholderChar;\n }\n\n details.skip = !details.inserted && !this.isOptional;\n this._isFilled = Boolean(details.inserted);\n return details;\n }\n }, {\n key: \"append\",\n value: function append() {\n var _this$masked;\n\n return (_this$masked = this.masked).append.apply(_this$masked, arguments);\n }\n }, {\n key: \"_appendPlaceholder\",\n value: function _appendPlaceholder() {\n var details = new ChangeDetails();\n if (this._isFilled || this.isOptional) return details;\n this._isFilled = true;\n details.inserted = this.placeholderChar;\n return details;\n }\n }, {\n key: \"extractTail\",\n value: function extractTail() {\n var _this$masked2;\n\n return (_this$masked2 = this.masked).extractTail.apply(_this$masked2, arguments);\n }\n }, {\n key: \"appendTail\",\n value: function appendTail() {\n var _this$masked3;\n\n return (_this$masked3 = this.masked).appendTail.apply(_this$masked3, arguments);\n }\n }, {\n key: \"extractInput\",\n value: function extractInput() {\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n var flags = arguments.length > 2 ? arguments[2] : undefined;\n return this.masked.extractInput(fromPos, toPos, flags);\n }\n }, {\n key: \"nearestInputPos\",\n value: function nearestInputPos(cursorPos) {\n var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIRECTION.NONE;\n var minPos = 0;\n var maxPos = this.value.length;\n var boundPos = Math.min(Math.max(cursorPos, minPos), maxPos);\n\n switch (direction) {\n case DIRECTION.LEFT:\n case DIRECTION.FORCE_LEFT:\n return this.isComplete ? boundPos : minPos;\n\n case DIRECTION.RIGHT:\n case DIRECTION.FORCE_RIGHT:\n return this.isComplete ? boundPos : maxPos;\n\n case DIRECTION.NONE:\n default:\n return boundPos;\n }\n }\n }, {\n key: \"doValidate\",\n value: function doValidate() {\n var _this$masked4, _this$parent;\n\n return (_this$masked4 = this.masked).doValidate.apply(_this$masked4, arguments) && (!this.parent || (_this$parent = this.parent).doValidate.apply(_this$parent, arguments));\n }\n }, {\n key: \"doCommit\",\n value: function doCommit() {\n this.masked.doCommit();\n }\n }, {\n key: \"value\",\n get: function get() {\n return this.masked.value || (this._isFilled && !this.isOptional ? this.placeholderChar : '');\n }\n }, {\n key: \"unmaskedValue\",\n get: function get() {\n return this.masked.unmaskedValue;\n }\n }, {\n key: \"isComplete\",\n get: function get() {\n return Boolean(this.masked.value) || this.isOptional;\n }\n }, {\n key: \"state\",\n get: function get() {\n return {\n masked: this.masked.state,\n _isFilled: this._isFilled\n };\n },\n set: function set(state) {\n this.masked.state = state.masked;\n this._isFilled = state._isFilled;\n }\n }]);\n\n return PatternInputDefinition;\n}();\n\nvar PatternFixedDefinition = /*#__PURE__*/function () {\n /** */\n\n /** */\n\n /** */\n\n /** */\n function PatternFixedDefinition(opts) {\n _classCallCheck(this, PatternFixedDefinition);\n\n Object.assign(this, opts);\n this._value = '';\n }\n\n _createClass(PatternFixedDefinition, [{\n key: \"reset\",\n value: function reset() {\n this._isRawInput = false;\n this._value = '';\n }\n }, {\n key: \"remove\",\n value: function remove() {\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this._value.length;\n this._value = this._value.slice(0, fromPos) + this._value.slice(toPos);\n if (!this._value) this._isRawInput = false;\n return new ChangeDetails();\n }\n }, {\n key: \"nearestInputPos\",\n value: function nearestInputPos(cursorPos) {\n var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIRECTION.NONE;\n var minPos = 0;\n var maxPos = this._value.length;\n\n switch (direction) {\n case DIRECTION.LEFT:\n case DIRECTION.FORCE_LEFT:\n return minPos;\n\n case DIRECTION.NONE:\n case DIRECTION.RIGHT:\n case DIRECTION.FORCE_RIGHT:\n default:\n return maxPos;\n }\n }\n }, {\n key: \"extractInput\",\n value: function extractInput() {\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this._value.length;\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return flags.raw && this._isRawInput && this._value.slice(fromPos, toPos) || '';\n }\n }, {\n key: \"_appendChar\",\n value: function _appendChar(str) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var details = new ChangeDetails();\n if (this._value) return details;\n var appended = this[\"char\"] === str[0];\n var isResolved = appended && (this.isUnmasking || flags.input || flags.raw) && !flags.tail;\n if (isResolved) details.rawInserted = this[\"char\"];\n this._value = details.inserted = this[\"char\"];\n this._isRawInput = isResolved && (flags.raw || flags.input);\n return details;\n }\n }, {\n key: \"_appendPlaceholder\",\n value: function _appendPlaceholder() {\n var details = new ChangeDetails();\n if (this._value) return details;\n this._value = details.inserted = this[\"char\"];\n return details;\n }\n }, {\n key: \"extractTail\",\n value: function extractTail() {\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n return new ContinuousTailDetails('');\n } // $FlowFixMe no ideas\n\n }, {\n key: \"appendTail\",\n value: function appendTail(tail) {\n if (isString(tail)) tail = new ContinuousTailDetails(String(tail));\n return tail.appendTo(this);\n }\n }, {\n key: \"append\",\n value: function append(str, flags, tail) {\n var details = this._appendChar(str, flags);\n\n if (tail != null) {\n details.tailShift += this.appendTail(tail).tailShift;\n }\n\n return details;\n }\n }, {\n key: \"doCommit\",\n value: function doCommit() {}\n }, {\n key: \"value\",\n get: function get() {\n return this._value;\n }\n }, {\n key: \"unmaskedValue\",\n get: function get() {\n return this.isUnmasking ? this.value : '';\n }\n }, {\n key: \"isComplete\",\n get: function get() {\n return true;\n }\n }, {\n key: \"state\",\n get: function get() {\n return {\n _value: this._value,\n _isRawInput: this._isRawInput\n };\n },\n set: function set(state) {\n Object.assign(this, state);\n }\n }]);\n\n return PatternFixedDefinition;\n}();\n\nvar ChunksTailDetails = /*#__PURE__*/function () {\n /** */\n function ChunksTailDetails() {\n var chunks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n _classCallCheck(this, ChunksTailDetails);\n\n this.chunks = chunks;\n this.from = from;\n }\n\n _createClass(ChunksTailDetails, [{\n key: \"toString\",\n value: function toString() {\n return this.chunks.map(String).join('');\n } // $FlowFixMe no ideas\n\n }, {\n key: \"extend\",\n value: function extend(tailChunk) {\n if (!String(tailChunk)) return;\n if (isString(tailChunk)) tailChunk = new ContinuousTailDetails(String(tailChunk));\n var lastChunk = this.chunks[this.chunks.length - 1];\n var extendLast = lastChunk && ( // if stops are same or tail has no stop\n lastChunk.stop === tailChunk.stop || tailChunk.stop == null) && // if tail chunk goes just after last chunk\n tailChunk.from === lastChunk.from + lastChunk.toString().length;\n\n if (tailChunk instanceof ContinuousTailDetails) {\n // check the ability to extend previous chunk\n if (extendLast) {\n // extend previous chunk\n lastChunk.extend(tailChunk.toString());\n } else {\n // append new chunk\n this.chunks.push(tailChunk);\n }\n } else if (tailChunk instanceof ChunksTailDetails) {\n if (tailChunk.stop == null) {\n // unwrap floating chunks to parent, keeping `from` pos\n var firstTailChunk;\n\n while (tailChunk.chunks.length && tailChunk.chunks[0].stop == null) {\n firstTailChunk = tailChunk.chunks.shift();\n firstTailChunk.from += tailChunk.from;\n this.extend(firstTailChunk);\n }\n } // if tail chunk still has value\n\n\n if (tailChunk.toString()) {\n // if chunks contains stops, then popup stop to container\n tailChunk.stop = tailChunk.blockIndex;\n this.chunks.push(tailChunk);\n }\n }\n }\n }, {\n key: \"appendTo\",\n value: function appendTo(masked) {\n if (!(masked instanceof g.IMask.MaskedPattern)) {\n var tail = new ContinuousTailDetails(this.toString());\n return tail.appendTo(masked);\n }\n\n var details = new ChangeDetails();\n\n for (var ci = 0; ci < this.chunks.length && !details.skip; ++ci) {\n var chunk = this.chunks[ci];\n\n var lastBlockIter = masked._mapPosToBlock(masked.value.length);\n\n var stop = chunk.stop;\n var chunkBlock = void 0;\n\n if (stop && ( // if block not found or stop is behind lastBlock\n !lastBlockIter || lastBlockIter.index <= stop)) {\n if (chunk instanceof ChunksTailDetails || // for continuous block also check if stop is exist\n masked._stops.indexOf(stop) >= 0) {\n details.aggregate(masked._appendPlaceholder(stop));\n }\n\n chunkBlock = chunk instanceof ChunksTailDetails && masked._blocks[stop];\n }\n\n if (chunkBlock) {\n var tailDetails = chunkBlock.appendTail(chunk);\n tailDetails.skip = false; // always ignore skip, it will be set on last\n\n details.aggregate(tailDetails);\n masked._value += tailDetails.inserted; // get not inserted chars\n\n var remainChars = chunk.toString().slice(tailDetails.rawInserted.length);\n if (remainChars) details.aggregate(masked.append(remainChars, {\n tail: true\n }));\n } else {\n details.aggregate(masked.append(chunk.toString(), {\n tail: true\n }));\n }\n }\n\n return details;\n }\n }, {\n key: \"shiftBefore\",\n value: function shiftBefore(pos) {\n if (this.from >= pos || !this.chunks.length) return '';\n var chunkShiftPos = pos - this.from;\n var ci = 0;\n\n while (ci < this.chunks.length) {\n var chunk = this.chunks[ci];\n var shiftChar = chunk.shiftBefore(chunkShiftPos);\n\n if (chunk.toString()) {\n // chunk still contains value\n // but not shifted - means no more available chars to shift\n if (!shiftChar) break;\n ++ci;\n } else {\n // clean if chunk has no value\n this.chunks.splice(ci, 1);\n }\n\n if (shiftChar) return shiftChar;\n }\n\n return '';\n }\n }, {\n key: \"state\",\n get: function get() {\n return {\n chunks: this.chunks.map(function (c) {\n return c.state;\n }),\n from: this.from,\n stop: this.stop,\n blockIndex: this.blockIndex\n };\n },\n set: function set(state) {\n var chunks = state.chunks,\n props = _objectWithoutProperties(state, [\"chunks\"]);\n\n Object.assign(this, props);\n this.chunks = chunks.map(function (cstate) {\n var chunk = \"chunks\" in cstate ? new ChunksTailDetails() : new ContinuousTailDetails(); // $FlowFixMe already checked above\n\n chunk.state = cstate;\n return chunk;\n });\n }\n }]);\n\n return ChunksTailDetails;\n}();\n/**\r\n Pattern mask\r\n @param {Object} opts\r\n @param {Object} opts.blocks\r\n @param {Object} opts.definitions\r\n @param {string} opts.placeholderChar\r\n @param {boolean} opts.lazy\r\n*/\n\n\nvar MaskedPattern = /*#__PURE__*/function (_Masked) {\n _inherits(MaskedPattern, _Masked);\n /** */\n\n /** */\n\n /** Single char for empty input */\n\n /** Show placeholder only when needed */\n\n\n function MaskedPattern() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, MaskedPattern); // TODO type $Shape={} does not work\n\n\n opts.definitions = Object.assign({}, DEFAULT_INPUT_DEFINITIONS, opts.definitions);\n return _possibleConstructorReturn(this, _getPrototypeOf(MaskedPattern).call(this, Object.assign({}, MaskedPattern.DEFAULTS, {}, opts)));\n }\n /**\r\n @override\r\n @param {Object} opts\r\n */\n\n\n _createClass(MaskedPattern, [{\n key: \"_update\",\n value: function _update() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n opts.definitions = Object.assign({}, this.definitions, opts.definitions);\n\n _get(_getPrototypeOf(MaskedPattern.prototype), \"_update\", this).call(this, opts);\n\n this._rebuildMask();\n }\n /** */\n\n }, {\n key: \"_rebuildMask\",\n value: function _rebuildMask() {\n var _this = this;\n\n var defs = this.definitions;\n this._blocks = [];\n this._stops = [];\n this._maskedBlocks = {};\n var pattern = this.mask;\n if (!pattern || !defs) return;\n var unmaskingBlock = false;\n var optionalBlock = false;\n\n for (var i = 0; i < pattern.length; ++i) {\n if (this.blocks) {\n var _ret = function () {\n var p = pattern.slice(i);\n var bNames = Object.keys(_this.blocks).filter(function (bName) {\n return p.indexOf(bName) === 0;\n }); // order by key length\n\n bNames.sort(function (a, b) {\n return b.length - a.length;\n }); // use block name with max length\n\n var bName = bNames[0];\n\n if (bName) {\n var maskedBlock = createMask(Object.assign({\n parent: _this,\n lazy: _this.lazy,\n placeholderChar: _this.placeholderChar,\n overwrite: _this.overwrite\n }, _this.blocks[bName]));\n\n if (maskedBlock) {\n _this._blocks.push(maskedBlock); // store block index\n\n\n if (!_this._maskedBlocks[bName]) _this._maskedBlocks[bName] = [];\n\n _this._maskedBlocks[bName].push(_this._blocks.length - 1);\n }\n\n i += bName.length - 1;\n return \"continue\";\n }\n }();\n\n if (_ret === \"continue\") continue;\n }\n\n var _char = pattern[i];\n\n var _isInput = (_char in defs);\n\n if (_char === MaskedPattern.STOP_CHAR) {\n this._stops.push(this._blocks.length);\n\n continue;\n }\n\n if (_char === '{' || _char === '}') {\n unmaskingBlock = !unmaskingBlock;\n continue;\n }\n\n if (_char === '[' || _char === ']') {\n optionalBlock = !optionalBlock;\n continue;\n }\n\n if (_char === MaskedPattern.ESCAPE_CHAR) {\n ++i;\n _char = pattern[i];\n if (!_char) break;\n _isInput = false;\n }\n\n var def = _isInput ? new PatternInputDefinition({\n parent: this,\n lazy: this.lazy,\n placeholderChar: this.placeholderChar,\n mask: defs[_char],\n isOptional: optionalBlock\n }) : new PatternFixedDefinition({\n \"char\": _char,\n isUnmasking: unmaskingBlock\n });\n\n this._blocks.push(def);\n }\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"reset\",\n\n /**\r\n @override\r\n */\n value: function reset() {\n _get(_getPrototypeOf(MaskedPattern.prototype), \"reset\", this).call(this);\n\n this._blocks.forEach(function (b) {\n return b.reset();\n });\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"doCommit\",\n\n /**\r\n @override\r\n */\n value: function doCommit() {\n this._blocks.forEach(function (b) {\n return b.doCommit();\n });\n\n _get(_getPrototypeOf(MaskedPattern.prototype), \"doCommit\", this).call(this);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"appendTail\",\n\n /**\r\n @override\r\n */\n value: function appendTail(tail) {\n return _get(_getPrototypeOf(MaskedPattern.prototype), \"appendTail\", this).call(this, tail).aggregate(this._appendPlaceholder());\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"_appendCharRaw\",\n value: function _appendCharRaw(ch) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n ch = this.doPrepare(ch, flags);\n\n var blockIter = this._mapPosToBlock(this.value.length);\n\n var details = new ChangeDetails();\n if (!blockIter) return details;\n\n for (var bi = blockIter.index;; ++bi) {\n var _block = this._blocks[bi];\n if (!_block) break;\n\n var blockDetails = _block._appendChar(ch, flags);\n\n var skip = blockDetails.skip;\n details.aggregate(blockDetails);\n if (skip || blockDetails.rawInserted) break; // go next char\n }\n\n return details;\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"extractTail\",\n value: function extractTail() {\n var _this2 = this;\n\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n var chunkTail = new ChunksTailDetails();\n if (fromPos === toPos) return chunkTail;\n\n this._forEachBlocksInRange(fromPos, toPos, function (b, bi, bFromPos, bToPos) {\n var blockChunk = b.extractTail(bFromPos, bToPos);\n blockChunk.stop = _this2._findStopBefore(bi);\n blockChunk.from = _this2._blockStartPos(bi);\n if (blockChunk instanceof ChunksTailDetails) blockChunk.blockIndex = bi;\n chunkTail.extend(blockChunk);\n });\n\n return chunkTail;\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"extractInput\",\n value: function extractInput() {\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (fromPos === toPos) return '';\n var input = '';\n\n this._forEachBlocksInRange(fromPos, toPos, function (b, _, fromPos, toPos) {\n input += b.extractInput(fromPos, toPos, flags);\n });\n\n return input;\n }\n }, {\n key: \"_findStopBefore\",\n value: function _findStopBefore(blockIndex) {\n var stopBefore;\n\n for (var si = 0; si < this._stops.length; ++si) {\n var stop = this._stops[si];\n if (stop <= blockIndex) stopBefore = stop;else break;\n }\n\n return stopBefore;\n }\n /** Appends placeholder depending on laziness */\n\n }, {\n key: \"_appendPlaceholder\",\n value: function _appendPlaceholder(toBlockIndex) {\n var _this3 = this;\n\n var details = new ChangeDetails();\n if (this.lazy && toBlockIndex == null) return details;\n\n var startBlockIter = this._mapPosToBlock(this.value.length);\n\n if (!startBlockIter) return details;\n var startBlockIndex = startBlockIter.index;\n var endBlockIndex = toBlockIndex != null ? toBlockIndex : this._blocks.length;\n\n this._blocks.slice(startBlockIndex, endBlockIndex).forEach(function (b) {\n if (!b.lazy || toBlockIndex != null) {\n // $FlowFixMe `_blocks` may not be present\n var args = b._blocks != null ? [b._blocks.length] : [];\n\n var bDetails = b._appendPlaceholder.apply(b, args);\n\n _this3._value += bDetails.inserted;\n details.aggregate(bDetails);\n }\n });\n\n return details;\n }\n /** Finds block in pos */\n\n }, {\n key: \"_mapPosToBlock\",\n value: function _mapPosToBlock(pos) {\n var accVal = '';\n\n for (var bi = 0; bi < this._blocks.length; ++bi) {\n var _block2 = this._blocks[bi];\n var blockStartPos = accVal.length;\n accVal += _block2.value;\n\n if (pos <= accVal.length) {\n return {\n index: bi,\n offset: pos - blockStartPos\n };\n }\n }\n }\n /** */\n\n }, {\n key: \"_blockStartPos\",\n value: function _blockStartPos(blockIndex) {\n return this._blocks.slice(0, blockIndex).reduce(function (pos, b) {\n return pos += b.value.length;\n }, 0);\n }\n /** */\n\n }, {\n key: \"_forEachBlocksInRange\",\n value: function _forEachBlocksInRange(fromPos) {\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n var fn = arguments.length > 2 ? arguments[2] : undefined;\n\n var fromBlockIter = this._mapPosToBlock(fromPos);\n\n if (fromBlockIter) {\n var toBlockIter = this._mapPosToBlock(toPos); // process first block\n\n\n var isSameBlock = toBlockIter && fromBlockIter.index === toBlockIter.index;\n var fromBlockStartPos = fromBlockIter.offset;\n var fromBlockEndPos = toBlockIter && isSameBlock ? toBlockIter.offset : this._blocks[fromBlockIter.index].value.length;\n fn(this._blocks[fromBlockIter.index], fromBlockIter.index, fromBlockStartPos, fromBlockEndPos);\n\n if (toBlockIter && !isSameBlock) {\n // process intermediate blocks\n for (var bi = fromBlockIter.index + 1; bi < toBlockIter.index; ++bi) {\n fn(this._blocks[bi], bi, 0, this._blocks[bi].value.length);\n } // process last block\n\n\n fn(this._blocks[toBlockIter.index], toBlockIter.index, 0, toBlockIter.offset);\n }\n }\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"remove\",\n value: function remove() {\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n\n var removeDetails = _get(_getPrototypeOf(MaskedPattern.prototype), \"remove\", this).call(this, fromPos, toPos);\n\n this._forEachBlocksInRange(fromPos, toPos, function (b, _, bFromPos, bToPos) {\n removeDetails.aggregate(b.remove(bFromPos, bToPos));\n });\n\n return removeDetails;\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"nearestInputPos\",\n value: function nearestInputPos(cursorPos) {\n var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIRECTION.NONE; // TODO refactor - extract alignblock\n\n var beginBlockData = this._mapPosToBlock(cursorPos) || {\n index: 0,\n offset: 0\n };\n var beginBlockOffset = beginBlockData.offset,\n beginBlockIndex = beginBlockData.index;\n var beginBlock = this._blocks[beginBlockIndex];\n if (!beginBlock) return cursorPos;\n var beginBlockCursorPos = beginBlockOffset; // if position inside block - try to adjust it\n\n if (beginBlockCursorPos !== 0 && beginBlockCursorPos < beginBlock.value.length) {\n beginBlockCursorPos = beginBlock.nearestInputPos(beginBlockOffset, forceDirection(direction));\n }\n\n var cursorAtRight = beginBlockCursorPos === beginBlock.value.length;\n var cursorAtLeft = beginBlockCursorPos === 0; // cursor is INSIDE first block (not at bounds)\n\n if (!cursorAtLeft && !cursorAtRight) return this._blockStartPos(beginBlockIndex) + beginBlockCursorPos;\n var searchBlockIndex = cursorAtRight ? beginBlockIndex + 1 : beginBlockIndex;\n\n if (direction === DIRECTION.NONE) {\n // NONE direction used to calculate start input position if no chars were removed\n // FOR NONE:\n // -\n // input|any\n // ->\n // any|input\n // <-\n // filled-input|any\n // check if first block at left is input\n if (searchBlockIndex > 0) {\n var blockIndexAtLeft = searchBlockIndex - 1;\n var blockAtLeft = this._blocks[blockIndexAtLeft];\n var blockInputPos = blockAtLeft.nearestInputPos(0, DIRECTION.NONE); // is input\n\n if (!blockAtLeft.value.length || blockInputPos !== blockAtLeft.value.length) {\n return this._blockStartPos(searchBlockIndex);\n }\n } // ->\n\n\n var firstInputAtRight = searchBlockIndex;\n\n for (var bi = firstInputAtRight; bi < this._blocks.length; ++bi) {\n var blockAtRight = this._blocks[bi];\n\n var _blockInputPos = blockAtRight.nearestInputPos(0, DIRECTION.NONE);\n\n if (!blockAtRight.value.length || _blockInputPos !== blockAtRight.value.length) {\n return this._blockStartPos(bi) + _blockInputPos;\n }\n } // <-\n // find first non-fixed symbol\n\n\n for (var _bi = searchBlockIndex - 1; _bi >= 0; --_bi) {\n var _block3 = this._blocks[_bi];\n\n var _blockInputPos2 = _block3.nearestInputPos(0, DIRECTION.NONE); // is input\n\n\n if (!_block3.value.length || _blockInputPos2 !== _block3.value.length) {\n return this._blockStartPos(_bi) + _block3.value.length;\n }\n }\n\n return cursorPos;\n }\n\n if (direction === DIRECTION.LEFT || direction === DIRECTION.FORCE_LEFT) {\n // -\n // any|filled-input\n // <-\n // any|first not empty is not-len-aligned\n // not-0-aligned|any\n // ->\n // any|not-len-aligned or end\n // check if first block at right is filled input\n var firstFilledBlockIndexAtRight;\n\n for (var _bi2 = searchBlockIndex; _bi2 < this._blocks.length; ++_bi2) {\n if (this._blocks[_bi2].value) {\n firstFilledBlockIndexAtRight = _bi2;\n break;\n }\n }\n\n if (firstFilledBlockIndexAtRight != null) {\n var filledBlock = this._blocks[firstFilledBlockIndexAtRight];\n\n var _blockInputPos3 = filledBlock.nearestInputPos(0, DIRECTION.RIGHT);\n\n if (_blockInputPos3 === 0 && filledBlock.unmaskedValue.length) {\n // filled block is input\n return this._blockStartPos(firstFilledBlockIndexAtRight) + _blockInputPos3;\n }\n } // <-\n // find this vars\n\n\n var firstFilledInputBlockIndex = -1;\n var firstEmptyInputBlockIndex; // TODO consider nested empty inputs\n\n for (var _bi3 = searchBlockIndex - 1; _bi3 >= 0; --_bi3) {\n var _block4 = this._blocks[_bi3];\n\n var _blockInputPos4 = _block4.nearestInputPos(_block4.value.length, DIRECTION.FORCE_LEFT);\n\n if (!_block4.value || _blockInputPos4 !== 0) firstEmptyInputBlockIndex = _bi3;\n\n if (_blockInputPos4 !== 0) {\n if (_blockInputPos4 !== _block4.value.length) {\n // aligned inside block - return immediately\n return this._blockStartPos(_bi3) + _blockInputPos4;\n } else {\n // found filled\n firstFilledInputBlockIndex = _bi3;\n break;\n }\n }\n }\n\n if (direction === DIRECTION.LEFT) {\n // try find first empty input before start searching position only when not forced\n for (var _bi4 = firstFilledInputBlockIndex + 1; _bi4 <= Math.min(searchBlockIndex, this._blocks.length - 1); ++_bi4) {\n var _block5 = this._blocks[_bi4];\n\n var _blockInputPos5 = _block5.nearestInputPos(0, DIRECTION.NONE);\n\n var blockAlignedPos = this._blockStartPos(_bi4) + _blockInputPos5;\n\n if (blockAlignedPos > cursorPos) break; // if block is not lazy input\n\n if (_blockInputPos5 !== _block5.value.length) return blockAlignedPos;\n }\n } // process overflow\n\n\n if (firstFilledInputBlockIndex >= 0) {\n return this._blockStartPos(firstFilledInputBlockIndex) + this._blocks[firstFilledInputBlockIndex].value.length;\n } // for lazy if has aligned left inside fixed and has came to the start - use start position\n\n\n if (direction === DIRECTION.FORCE_LEFT || this.lazy && !this.extractInput() && !isInput(this._blocks[searchBlockIndex])) {\n return 0;\n }\n\n if (firstEmptyInputBlockIndex != null) {\n return this._blockStartPos(firstEmptyInputBlockIndex);\n } // find first input\n\n\n for (var _bi5 = searchBlockIndex; _bi5 < this._blocks.length; ++_bi5) {\n var _block6 = this._blocks[_bi5];\n\n var _blockInputPos6 = _block6.nearestInputPos(0, DIRECTION.NONE); // is input\n\n\n if (!_block6.value.length || _blockInputPos6 !== _block6.value.length) {\n return this._blockStartPos(_bi5) + _blockInputPos6;\n }\n }\n\n return 0;\n }\n\n if (direction === DIRECTION.RIGHT || direction === DIRECTION.FORCE_RIGHT) {\n // ->\n // any|not-len-aligned and filled\n // any|not-len-aligned\n // <-\n // not-0-aligned or start|any\n var firstInputBlockAlignedIndex;\n var firstInputBlockAlignedPos;\n\n for (var _bi6 = searchBlockIndex; _bi6 < this._blocks.length; ++_bi6) {\n var _block7 = this._blocks[_bi6];\n\n var _blockInputPos7 = _block7.nearestInputPos(0, DIRECTION.NONE);\n\n if (_blockInputPos7 !== _block7.value.length) {\n firstInputBlockAlignedPos = this._blockStartPos(_bi6) + _blockInputPos7;\n firstInputBlockAlignedIndex = _bi6;\n break;\n }\n }\n\n if (firstInputBlockAlignedIndex != null && firstInputBlockAlignedPos != null) {\n for (var _bi7 = firstInputBlockAlignedIndex; _bi7 < this._blocks.length; ++_bi7) {\n var _block8 = this._blocks[_bi7];\n\n var _blockInputPos8 = _block8.nearestInputPos(0, DIRECTION.FORCE_RIGHT);\n\n if (_blockInputPos8 !== _block8.value.length) {\n return this._blockStartPos(_bi7) + _blockInputPos8;\n }\n }\n\n return direction === DIRECTION.FORCE_RIGHT ? this.value.length : firstInputBlockAlignedPos;\n }\n\n for (var _bi8 = Math.min(searchBlockIndex, this._blocks.length - 1); _bi8 >= 0; --_bi8) {\n var _block9 = this._blocks[_bi8];\n\n var _blockInputPos9 = _block9.nearestInputPos(_block9.value.length, DIRECTION.LEFT);\n\n if (_blockInputPos9 !== 0) {\n var alignedPos = this._blockStartPos(_bi8) + _blockInputPos9;\n\n if (alignedPos >= cursorPos) return alignedPos;\n break;\n }\n }\n }\n\n return cursorPos;\n }\n /** Get block by name */\n\n }, {\n key: \"maskedBlock\",\n value: function maskedBlock(name) {\n return this.maskedBlocks(name)[0];\n }\n /** Get all blocks by name */\n\n }, {\n key: \"maskedBlocks\",\n value: function maskedBlocks(name) {\n var _this4 = this;\n\n var indices = this._maskedBlocks[name];\n if (!indices) return [];\n return indices.map(function (gi) {\n return _this4._blocks[gi];\n });\n }\n }, {\n key: \"state\",\n get: function get() {\n return Object.assign({}, _get(_getPrototypeOf(MaskedPattern.prototype), \"state\", this), {\n _blocks: this._blocks.map(function (b) {\n return b.state;\n })\n });\n },\n set: function set(state) {\n var _blocks = state._blocks,\n maskedState = _objectWithoutProperties(state, [\"_blocks\"]);\n\n this._blocks.forEach(function (b, bi) {\n return b.state = _blocks[bi];\n });\n\n _set(_getPrototypeOf(MaskedPattern.prototype), \"state\", maskedState, this, true);\n }\n }, {\n key: \"isComplete\",\n get: function get() {\n return this._blocks.every(function (b) {\n return b.isComplete;\n });\n }\n }, {\n key: \"unmaskedValue\",\n get: function get() {\n return this._blocks.reduce(function (str, b) {\n return str += b.unmaskedValue;\n }, '');\n },\n set: function set(unmaskedValue) {\n _set(_getPrototypeOf(MaskedPattern.prototype), \"unmaskedValue\", unmaskedValue, this, true);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"value\",\n get: function get() {\n // TODO return _value when not in change?\n return this._blocks.reduce(function (str, b) {\n return str += b.value;\n }, '');\n },\n set: function set(value) {\n _set(_getPrototypeOf(MaskedPattern.prototype), \"value\", value, this, true);\n }\n }]);\n\n return MaskedPattern;\n}(Masked);\n\nMaskedPattern.DEFAULTS = {\n lazy: true,\n placeholderChar: '_'\n};\nMaskedPattern.STOP_CHAR = '`';\nMaskedPattern.ESCAPE_CHAR = '\\\\';\nMaskedPattern.InputDefinition = PatternInputDefinition;\nMaskedPattern.FixedDefinition = PatternFixedDefinition;\n\nfunction isInput(block) {\n if (!block) return false;\n var value = block.value;\n return !value || block.nearestInputPos(0, DIRECTION.NONE) !== value.length;\n}\n/** Pattern which accepts ranges */\n\n\nvar MaskedRange = /*#__PURE__*/function (_MaskedPattern) {\n _inherits(MaskedRange, _MaskedPattern);\n\n function MaskedRange() {\n _classCallCheck(this, MaskedRange);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MaskedRange).apply(this, arguments));\n }\n\n _createClass(MaskedRange, [{\n key: \"_update\",\n\n /**\r\n @override\r\n */\n value: function _update(opts) {\n // TODO type\n opts = Object.assign({\n to: this.to || 0,\n from: this.from || 0\n }, opts);\n var maxLength = String(opts.to).length;\n if (opts.maxLength != null) maxLength = Math.max(maxLength, opts.maxLength);\n opts.maxLength = maxLength;\n var fromStr = String(opts.from).padStart(maxLength, '0');\n var toStr = String(opts.to).padStart(maxLength, '0');\n var sameCharsCount = 0;\n\n while (sameCharsCount < toStr.length && toStr[sameCharsCount] === fromStr[sameCharsCount]) {\n ++sameCharsCount;\n }\n\n opts.mask = toStr.slice(0, sameCharsCount).replace(/0/g, '\\\\0') + '0'.repeat(maxLength - sameCharsCount);\n\n _get(_getPrototypeOf(MaskedRange.prototype), \"_update\", this).call(this, opts);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"boundaries\",\n value: function boundaries(str) {\n var minstr = '';\n var maxstr = '';\n\n var _ref = str.match(/^(\\D*)(\\d*)(\\D*)/) || [],\n _ref2 = _slicedToArray(_ref, 3),\n placeholder = _ref2[1],\n num = _ref2[2];\n\n if (num) {\n minstr = '0'.repeat(placeholder.length) + num;\n maxstr = '9'.repeat(placeholder.length) + num;\n }\n\n minstr = minstr.padEnd(this.maxLength, '0');\n maxstr = maxstr.padEnd(this.maxLength, '9');\n return [minstr, maxstr];\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"doPrepare\",\n value: function doPrepare(str) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n str = _get(_getPrototypeOf(MaskedRange.prototype), \"doPrepare\", this).call(this, str, flags).replace(/\\D/g, '');\n if (!this.autofix) return str;\n var fromStr = String(this.from).padStart(this.maxLength, '0');\n var toStr = String(this.to).padStart(this.maxLength, '0');\n var val = this.value;\n var prepStr = '';\n\n for (var ci = 0; ci < str.length; ++ci) {\n var nextVal = val + prepStr + str[ci];\n\n var _this$boundaries = this.boundaries(nextVal),\n _this$boundaries2 = _slicedToArray(_this$boundaries, 2),\n minstr = _this$boundaries2[0],\n maxstr = _this$boundaries2[1];\n\n if (Number(maxstr) < this.from) prepStr += fromStr[nextVal.length - 1];else if (Number(minstr) > this.to) prepStr += toStr[nextVal.length - 1];else prepStr += str[ci];\n }\n\n return prepStr;\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"doValidate\",\n value: function doValidate() {\n var _get2;\n\n var str = this.value;\n var firstNonZero = str.search(/[^0]/);\n if (firstNonZero === -1 && str.length <= this._matchFrom) return true;\n\n var _this$boundaries3 = this.boundaries(str),\n _this$boundaries4 = _slicedToArray(_this$boundaries3, 2),\n minstr = _this$boundaries4[0],\n maxstr = _this$boundaries4[1];\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return this.from <= Number(maxstr) && Number(minstr) <= this.to && (_get2 = _get(_getPrototypeOf(MaskedRange.prototype), \"doValidate\", this)).call.apply(_get2, [this].concat(args));\n }\n }, {\n key: \"_matchFrom\",\n\n /**\r\n Optionally sets max length of pattern.\r\n Used when pattern length is longer then `to` param length. Pads zeros at start in this case.\r\n */\n\n /** Min bound */\n\n /** Max bound */\n\n /** */\n get: function get() {\n return this.maxLength - String(this.from).length;\n }\n }, {\n key: \"isComplete\",\n get: function get() {\n return _get(_getPrototypeOf(MaskedRange.prototype), \"isComplete\", this) && Boolean(this.value);\n }\n }]);\n\n return MaskedRange;\n}(MaskedPattern);\n/** Date mask */\n\n\nvar MaskedDate = /*#__PURE__*/function (_MaskedPattern) {\n _inherits(MaskedDate, _MaskedPattern);\n /** Parse string to Date */\n\n /** Format Date to string */\n\n /** Pattern mask for date according to {@link MaskedDate#format} */\n\n /** Start date */\n\n /** End date */\n\n /** */\n\n /**\r\n @param {Object} opts\r\n */\n\n\n function MaskedDate(opts) {\n _classCallCheck(this, MaskedDate);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MaskedDate).call(this, Object.assign({}, MaskedDate.DEFAULTS, {}, opts)));\n }\n /**\r\n @override\r\n */\n\n\n _createClass(MaskedDate, [{\n key: \"_update\",\n value: function _update(opts) {\n if (opts.mask === Date) delete opts.mask;\n if (opts.pattern) opts.mask = opts.pattern;\n var blocks = opts.blocks;\n opts.blocks = Object.assign({}, MaskedDate.GET_DEFAULT_BLOCKS()); // adjust year block\n\n if (opts.min) opts.blocks.Y.from = opts.min.getFullYear();\n if (opts.max) opts.blocks.Y.to = opts.max.getFullYear();\n\n if (opts.min && opts.max && opts.blocks.Y.from === opts.blocks.Y.to) {\n opts.blocks.m.from = opts.min.getMonth() + 1;\n opts.blocks.m.to = opts.max.getMonth() + 1;\n\n if (opts.blocks.m.from === opts.blocks.m.to) {\n opts.blocks.d.from = opts.min.getDate();\n opts.blocks.d.to = opts.max.getDate();\n }\n }\n\n Object.assign(opts.blocks, blocks); // add autofix\n\n Object.keys(opts.blocks).forEach(function (bk) {\n var b = opts.blocks[bk];\n if (!('autofix' in b)) b.autofix = opts.autofix;\n });\n\n _get(_getPrototypeOf(MaskedDate.prototype), \"_update\", this).call(this, opts);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"doValidate\",\n value: function doValidate() {\n var _get2;\n\n var date = this.date;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return (_get2 = _get(_getPrototypeOf(MaskedDate.prototype), \"doValidate\", this)).call.apply(_get2, [this].concat(args)) && (!this.isComplete || this.isDateExist(this.value) && date != null && (this.min == null || this.min <= date) && (this.max == null || date <= this.max));\n }\n /** Checks if date is exists */\n\n }, {\n key: \"isDateExist\",\n value: function isDateExist(str) {\n return this.format(this.parse(str)) === str;\n }\n /** Parsed Date */\n\n }, {\n key: \"date\",\n get: function get() {\n return this.isComplete ? this.parse(this.value) : null;\n },\n set: function set(date) {\n this.value = this.format(date);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"typedValue\",\n get: function get() {\n return this.date;\n },\n set: function set(value) {\n this.date = value;\n }\n }]);\n\n return MaskedDate;\n}(MaskedPattern);\n\nMaskedDate.DEFAULTS = {\n pattern: 'd{.}`m{.}`Y',\n format: function format(date) {\n var day = String(date.getDate()).padStart(2, '0');\n var month = String(date.getMonth() + 1).padStart(2, '0');\n var year = date.getFullYear();\n return [day, month, year].join('.');\n },\n parse: function parse(str) {\n var _str$split = str.split('.'),\n _str$split2 = _slicedToArray(_str$split, 3),\n day = _str$split2[0],\n month = _str$split2[1],\n year = _str$split2[2];\n\n return new Date(year, month - 1, day);\n }\n};\n\nMaskedDate.GET_DEFAULT_BLOCKS = function () {\n return {\n d: {\n mask: MaskedRange,\n from: 1,\n to: 31,\n maxLength: 2\n },\n m: {\n mask: MaskedRange,\n from: 1,\n to: 12,\n maxLength: 2\n },\n Y: {\n mask: MaskedRange,\n from: 1900,\n to: 9999\n }\n };\n};\n/**\r\n Generic element API to use with mask\r\n @interface\r\n*/\n\n\nvar MaskElement = /*#__PURE__*/function () {\n function MaskElement() {\n _classCallCheck(this, MaskElement);\n }\n\n _createClass(MaskElement, [{\n key: \"select\",\n\n /** Safely sets element selection */\n value: function select(start, end) {\n if (start == null || end == null || start === this.selectionStart && end === this.selectionEnd) return;\n\n try {\n this._unsafeSelect(start, end);\n } catch (e) {}\n }\n /** Should be overriden in subclasses */\n\n }, {\n key: \"_unsafeSelect\",\n value: function _unsafeSelect(start, end) {}\n /** Should be overriden in subclasses */\n\n }, {\n key: \"bindEvents\",\n\n /** Should be overriden in subclasses */\n value: function bindEvents(handlers) {}\n /** Should be overriden in subclasses */\n\n }, {\n key: \"unbindEvents\",\n value: function unbindEvents() {}\n }, {\n key: \"selectionStart\",\n\n /** */\n\n /** */\n\n /** */\n\n /** Safely returns selection start */\n get: function get() {\n var start;\n\n try {\n start = this._unsafeSelectionStart;\n } catch (e) {}\n\n return start != null ? start : this.value.length;\n }\n /** Safely returns selection end */\n\n }, {\n key: \"selectionEnd\",\n get: function get() {\n var end;\n\n try {\n end = this._unsafeSelectionEnd;\n } catch (e) {}\n\n return end != null ? end : this.value.length;\n }\n }, {\n key: \"isActive\",\n get: function get() {\n return false;\n }\n }]);\n\n return MaskElement;\n}();\n/** Bridge between HTMLElement and {@link Masked} */\n\n\nvar HTMLMaskElement = /*#__PURE__*/function (_MaskElement) {\n _inherits(HTMLMaskElement, _MaskElement);\n /** Mapping between HTMLElement events and mask internal events */\n\n /** HTMLElement to use mask on */\n\n /**\r\n @param {HTMLInputElement|HTMLTextAreaElement} input\r\n */\n\n\n function HTMLMaskElement(input) {\n var _this;\n\n _classCallCheck(this, HTMLMaskElement);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(HTMLMaskElement).call(this));\n _this.input = input;\n _this._handlers = {};\n return _this;\n }\n /**\r\n Is element in focus\r\n @readonly\r\n */\n\n\n _createClass(HTMLMaskElement, [{\n key: \"_unsafeSelect\",\n\n /**\r\n Sets HTMLElement selection\r\n @override\r\n */\n value: function _unsafeSelect(start, end) {\n this.input.setSelectionRange(start, end);\n }\n /**\r\n HTMLElement value\r\n @override\r\n */\n\n }, {\n key: \"bindEvents\",\n\n /**\r\n Binds HTMLElement events to mask internal events\r\n @override\r\n */\n value: function bindEvents(handlers) {\n var _this2 = this;\n\n Object.keys(handlers).forEach(function (event) {\n return _this2._toggleEventHandler(HTMLMaskElement.EVENTS_MAP[event], handlers[event]);\n });\n }\n /**\r\n Unbinds HTMLElement events to mask internal events\r\n @override\r\n */\n\n }, {\n key: \"unbindEvents\",\n value: function unbindEvents() {\n var _this3 = this;\n\n Object.keys(this._handlers).forEach(function (event) {\n return _this3._toggleEventHandler(event);\n });\n }\n /** */\n\n }, {\n key: \"_toggleEventHandler\",\n value: function _toggleEventHandler(event, handler) {\n if (this._handlers[event]) {\n this.input.removeEventListener(event, this._handlers[event]);\n delete this._handlers[event];\n }\n\n if (handler) {\n this.input.addEventListener(event, handler);\n this._handlers[event] = handler;\n }\n }\n }, {\n key: \"isActive\",\n get: function get() {\n return this.input === document.activeElement;\n }\n /**\r\n Returns HTMLElement selection start\r\n @override\r\n */\n\n }, {\n key: \"_unsafeSelectionStart\",\n get: function get() {\n return this.input.selectionStart;\n }\n /**\r\n Returns HTMLElement selection end\r\n @override\r\n */\n\n }, {\n key: \"_unsafeSelectionEnd\",\n get: function get() {\n return this.input.selectionEnd;\n }\n }, {\n key: \"value\",\n get: function get() {\n return this.input.value;\n },\n set: function set(value) {\n this.input.value = value;\n }\n }]);\n\n return HTMLMaskElement;\n}(MaskElement);\n\nHTMLMaskElement.EVENTS_MAP = {\n selectionChange: 'keydown',\n input: 'input',\n drop: 'drop',\n click: 'click',\n focus: 'focus',\n commit: 'blur'\n};\n/** Listens to element events and controls changes between element and {@link Masked} */\n\nvar InputMask = /*#__PURE__*/function () {\n /**\r\n View element\r\n @readonly\r\n */\n\n /**\r\n Internal {@link Masked} model\r\n @readonly\r\n */\n\n /**\r\n @param {MaskElement|HTMLInputElement|HTMLTextAreaElement} el\r\n @param {Object} opts\r\n */\n function InputMask(el, opts) {\n _classCallCheck(this, InputMask);\n\n this.el = el instanceof MaskElement ? el : new HTMLMaskElement(el);\n this.masked = createMask(opts);\n this._listeners = {};\n this._value = '';\n this._unmaskedValue = '';\n this._saveSelection = this._saveSelection.bind(this);\n this._onInput = this._onInput.bind(this);\n this._onChange = this._onChange.bind(this);\n this._onDrop = this._onDrop.bind(this);\n this._onFocus = this._onFocus.bind(this);\n this.alignCursor = this.alignCursor.bind(this);\n this.alignCursorFriendly = this.alignCursorFriendly.bind(this);\n\n this._bindEvents(); // refresh\n\n\n this.updateValue();\n\n this._onChange();\n }\n /** Read or update mask */\n\n\n _createClass(InputMask, [{\n key: \"maskEquals\",\n value: function maskEquals(mask) {\n return mask == null || mask === this.masked.mask || mask === Date && this.masked instanceof MaskedDate;\n }\n }, {\n key: \"_bindEvents\",\n\n /**\r\n Starts listening to element events\r\n @protected\r\n */\n value: function _bindEvents() {\n this.el.bindEvents({\n selectionChange: this._saveSelection,\n input: this._onInput,\n drop: this._onDrop,\n click: this.alignCursorFriendly,\n focus: this._onFocus,\n commit: this._onChange\n });\n }\n /**\r\n Stops listening to element events\r\n @protected\r\n */\n\n }, {\n key: \"_unbindEvents\",\n value: function _unbindEvents() {\n this.el.unbindEvents();\n }\n /**\r\n Fires custom event\r\n @protected\r\n */\n\n }, {\n key: \"_fireEvent\",\n value: function _fireEvent(ev) {\n var listeners = this._listeners[ev];\n if (!listeners) return;\n listeners.forEach(function (l) {\n return l();\n });\n }\n /**\r\n Current selection start\r\n @readonly\r\n */\n\n }, {\n key: \"_saveSelection\",\n\n /**\r\n Stores current selection\r\n @protected\r\n */\n value: function _saveSelection()\n /* ev */\n {\n if (this.value !== this.el.value) {\n console.warn('Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly.'); // eslint-disable-line no-console\n }\n\n this._selection = {\n start: this.selectionStart,\n end: this.cursorPos\n };\n }\n /** Syncronizes model value from view */\n\n }, {\n key: \"updateValue\",\n value: function updateValue() {\n this.masked.value = this.el.value;\n this._value = this.masked.value;\n }\n /** Syncronizes view from model value, fires change events */\n\n }, {\n key: \"updateControl\",\n value: function updateControl() {\n var newUnmaskedValue = this.masked.unmaskedValue;\n var newValue = this.masked.value;\n var isChanged = this.unmaskedValue !== newUnmaskedValue || this.value !== newValue;\n this._unmaskedValue = newUnmaskedValue;\n this._value = newValue;\n if (this.el.value !== newValue) this.el.value = newValue;\n if (isChanged) this._fireChangeEvents();\n }\n /** Updates options with deep equal check, recreates @{link Masked} model if mask type changes */\n\n }, {\n key: \"updateOptions\",\n value: function updateOptions(opts) {\n var mask = opts.mask,\n restOpts = _objectWithoutProperties(opts, [\"mask\"]);\n\n var updateMask = !this.maskEquals(mask);\n var updateOpts = !objectIncludes(this.masked, restOpts);\n if (updateMask) this.mask = mask;\n if (updateOpts) this.masked.updateOptions(restOpts);\n if (updateMask || updateOpts) this.updateControl();\n }\n /** Updates cursor */\n\n }, {\n key: \"updateCursor\",\n value: function updateCursor(cursorPos) {\n if (cursorPos == null) return;\n this.cursorPos = cursorPos; // also queue change cursor for mobile browsers\n\n this._delayUpdateCursor(cursorPos);\n }\n /**\r\n Delays cursor update to support mobile browsers\r\n @private\r\n */\n\n }, {\n key: \"_delayUpdateCursor\",\n value: function _delayUpdateCursor(cursorPos) {\n var _this = this;\n\n this._abortUpdateCursor();\n\n this._changingCursorPos = cursorPos;\n this._cursorChanging = setTimeout(function () {\n if (!_this.el) return; // if was destroyed\n\n _this.cursorPos = _this._changingCursorPos;\n\n _this._abortUpdateCursor();\n }, 10);\n }\n /**\r\n Fires custom events\r\n @protected\r\n */\n\n }, {\n key: \"_fireChangeEvents\",\n value: function _fireChangeEvents() {\n this._fireEvent('accept');\n\n if (this.masked.isComplete) this._fireEvent('complete');\n }\n /**\r\n Aborts delayed cursor update\r\n @private\r\n */\n\n }, {\n key: \"_abortUpdateCursor\",\n value: function _abortUpdateCursor() {\n if (this._cursorChanging) {\n clearTimeout(this._cursorChanging);\n delete this._cursorChanging;\n }\n }\n /** Aligns cursor to nearest available position */\n\n }, {\n key: \"alignCursor\",\n value: function alignCursor() {\n this.cursorPos = this.masked.nearestInputPos(this.cursorPos, DIRECTION.LEFT);\n }\n /** Aligns cursor only if selection is empty */\n\n }, {\n key: \"alignCursorFriendly\",\n value: function alignCursorFriendly() {\n if (this.selectionStart !== this.cursorPos) return; // skip if range is selected\n\n this.alignCursor();\n }\n /** Adds listener on custom event */\n\n }, {\n key: \"on\",\n value: function on(ev, handler) {\n if (!this._listeners[ev]) this._listeners[ev] = [];\n\n this._listeners[ev].push(handler);\n\n return this;\n }\n /** Removes custom event listener */\n\n }, {\n key: \"off\",\n value: function off(ev, handler) {\n if (!this._listeners[ev]) return this;\n\n if (!handler) {\n delete this._listeners[ev];\n return this;\n }\n\n var hIndex = this._listeners[ev].indexOf(handler);\n\n if (hIndex >= 0) this._listeners[ev].splice(hIndex, 1);\n return this;\n }\n /** Handles view input event */\n\n }, {\n key: \"_onInput\",\n value: function _onInput() {\n this._abortUpdateCursor(); // fix strange IE behavior\n\n\n if (!this._selection) return this.updateValue();\n var details = new ActionDetails( // new state\n this.el.value, this.cursorPos, // old state\n this.value, this._selection);\n var oldRawValue = this.masked.rawInputValue;\n var offset = this.masked.splice(details.startChangePos, details.removed.length, details.inserted, details.removeDirection).offset; // force align in remove direction only if no input chars were removed\n // otherwise we still need to align with NONE (to get out from fixed symbols for instance)\n\n var removeDirection = oldRawValue === this.masked.rawInputValue ? details.removeDirection : DIRECTION.NONE;\n var cursorPos = this.masked.nearestInputPos(details.startChangePos + offset, removeDirection);\n this.updateControl();\n this.updateCursor(cursorPos);\n }\n /** Handles view change event and commits model value */\n\n }, {\n key: \"_onChange\",\n value: function _onChange() {\n if (this.value !== this.el.value) {\n this.updateValue();\n }\n\n this.masked.doCommit();\n this.updateControl();\n\n this._saveSelection();\n }\n /** Handles view drop event, prevents by default */\n\n }, {\n key: \"_onDrop\",\n value: function _onDrop(ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n /** Restore last selection on focus */\n\n }, {\n key: \"_onFocus\",\n value: function _onFocus(ev) {\n if (this.selectionStart !== this.cursorPos) return; // skip if range is selected\n\n if (this._selection) this.cursorPos = this._selection.end;\n this.alignCursorFriendly();\n }\n /** Unbind view events and removes element reference */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this._unbindEvents(); // $FlowFixMe why not do so?\n\n\n this._listeners.length = 0;\n delete this.el;\n }\n }, {\n key: \"mask\",\n get: function get() {\n return this.masked.mask;\n },\n set: function set(mask) {\n if (this.maskEquals(mask)) return;\n\n if (this.masked.constructor === maskedClass(mask)) {\n this.masked.updateOptions({\n mask: mask\n });\n return;\n }\n\n var masked = createMask({\n mask: mask\n });\n masked.unmaskedValue = this.masked.unmaskedValue;\n this.masked = masked;\n }\n /** Raw value */\n\n }, {\n key: \"value\",\n get: function get() {\n return this._value;\n },\n set: function set(str) {\n this.masked.value = str;\n this.updateControl();\n this.alignCursor();\n }\n /** Unmasked value */\n\n }, {\n key: \"unmaskedValue\",\n get: function get() {\n return this._unmaskedValue;\n },\n set: function set(str) {\n this.masked.unmaskedValue = str;\n this.updateControl();\n this.alignCursor();\n }\n /** Typed unmasked value */\n\n }, {\n key: \"typedValue\",\n get: function get() {\n return this.masked.typedValue;\n },\n set: function set(val) {\n this.masked.typedValue = val;\n this.updateControl();\n this.alignCursor();\n }\n }, {\n key: \"selectionStart\",\n get: function get() {\n return this._cursorChanging ? this._changingCursorPos : this.el.selectionStart;\n }\n /** Current cursor position */\n\n }, {\n key: \"cursorPos\",\n get: function get() {\n return this._cursorChanging ? this._changingCursorPos : this.el.selectionEnd;\n },\n set: function set(pos) {\n if (!this.el.isActive) return;\n this.el.select(pos, pos);\n\n this._saveSelection();\n }\n }]);\n\n return InputMask;\n}();\n/** Pattern which validates enum values */\n\n\nvar MaskedEnum = /*#__PURE__*/function (_MaskedPattern) {\n _inherits(MaskedEnum, _MaskedPattern);\n\n function MaskedEnum() {\n _classCallCheck(this, MaskedEnum);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MaskedEnum).apply(this, arguments));\n }\n\n _createClass(MaskedEnum, [{\n key: \"_update\",\n\n /**\r\n @override\r\n @param {Object} opts\r\n */\n value: function _update(opts) {\n // TODO type\n if (opts[\"enum\"]) opts.mask = '*'.repeat(opts[\"enum\"][0].length);\n\n _get(_getPrototypeOf(MaskedEnum.prototype), \"_update\", this).call(this, opts);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"doValidate\",\n value: function doValidate() {\n var _this = this,\n _get2;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return this[\"enum\"].some(function (e) {\n return e.indexOf(_this.unmaskedValue) >= 0;\n }) && (_get2 = _get(_getPrototypeOf(MaskedEnum.prototype), \"doValidate\", this)).call.apply(_get2, [this].concat(args));\n }\n }]);\n\n return MaskedEnum;\n}(MaskedPattern);\n/**\r\n Number mask\r\n @param {Object} opts\r\n @param {string} opts.radix - Single char\r\n @param {string} opts.thousandsSeparator - Single char\r\n @param {Array} opts.mapToRadix - Array of single chars\r\n @param {number} opts.min\r\n @param {number} opts.max\r\n @param {number} opts.scale - Digits after point\r\n @param {boolean} opts.signed - Allow negative\r\n @param {boolean} opts.normalizeZeros - Flag to remove leading and trailing zeros in the end of editing\r\n @param {boolean} opts.padFractionalZeros - Flag to pad trailing zeros after point in the end of editing\r\n*/\n\n\nvar MaskedNumber = /*#__PURE__*/function (_Masked) {\n _inherits(MaskedNumber, _Masked);\n /** Single char */\n\n /** Single char */\n\n /** Array of single chars */\n\n /** */\n\n /** */\n\n /** Digits after point */\n\n /** */\n\n /** Flag to remove leading and trailing zeros in the end of editing */\n\n /** Flag to pad trailing zeros after point in the end of editing */\n\n\n function MaskedNumber(opts) {\n _classCallCheck(this, MaskedNumber);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MaskedNumber).call(this, Object.assign({}, MaskedNumber.DEFAULTS, {}, opts)));\n }\n /**\r\n @override\r\n */\n\n\n _createClass(MaskedNumber, [{\n key: \"_update\",\n value: function _update(opts) {\n _get(_getPrototypeOf(MaskedNumber.prototype), \"_update\", this).call(this, opts);\n\n this._updateRegExps();\n }\n /** */\n\n }, {\n key: \"_updateRegExps\",\n value: function _updateRegExps() {\n // use different regexp to process user input (more strict, input suffix) and tail shifting\n var start = '^' + (this.allowNegative ? '[+|\\\\-]?' : '');\n var midInput = '(0|([1-9]+\\\\d*))?';\n var mid = '\\\\d*';\n var end = (this.scale ? '(' + escapeRegExp(this.radix) + '\\\\d{0,' + this.scale + '})?' : '') + '$';\n this._numberRegExpInput = new RegExp(start + midInput + end);\n this._numberRegExp = new RegExp(start + mid + end);\n this._mapToRadixRegExp = new RegExp('[' + this.mapToRadix.map(escapeRegExp).join('') + ']', 'g');\n this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(this.thousandsSeparator), 'g');\n }\n /** */\n\n }, {\n key: \"_removeThousandsSeparators\",\n value: function _removeThousandsSeparators(value) {\n return value.replace(this._thousandsSeparatorRegExp, '');\n }\n /** */\n\n }, {\n key: \"_insertThousandsSeparators\",\n value: function _insertThousandsSeparators(value) {\n // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript\n var parts = value.split(this.radix);\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, this.thousandsSeparator);\n return parts.join(this.radix);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"doPrepare\",\n value: function doPrepare(str) {\n var _get2;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return (_get2 = _get(_getPrototypeOf(MaskedNumber.prototype), \"doPrepare\", this)).call.apply(_get2, [this, this._removeThousandsSeparators(str.replace(this._mapToRadixRegExp, this.radix))].concat(args));\n }\n /** */\n\n }, {\n key: \"_separatorsCount\",\n value: function _separatorsCount(to) {\n var extendOnSeparators = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var count = 0;\n\n for (var pos = 0; pos < to; ++pos) {\n if (this._value.indexOf(this.thousandsSeparator, pos) === pos) {\n ++count;\n if (extendOnSeparators) to += this.thousandsSeparator.length;\n }\n }\n\n return count;\n }\n /** */\n\n }, {\n key: \"_separatorsCountFromSlice\",\n value: function _separatorsCountFromSlice() {\n var slice = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._value;\n return this._separatorsCount(this._removeThousandsSeparators(slice).length, true);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"extractInput\",\n value: function extractInput() {\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n var flags = arguments.length > 2 ? arguments[2] : undefined;\n\n var _this$_adjustRangeWit = this._adjustRangeWithSeparators(fromPos, toPos);\n\n var _this$_adjustRangeWit2 = _slicedToArray(_this$_adjustRangeWit, 2);\n\n fromPos = _this$_adjustRangeWit2[0];\n toPos = _this$_adjustRangeWit2[1];\n return this._removeThousandsSeparators(_get(_getPrototypeOf(MaskedNumber.prototype), \"extractInput\", this).call(this, fromPos, toPos, flags));\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"_appendCharRaw\",\n value: function _appendCharRaw(ch) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!this.thousandsSeparator) return _get(_getPrototypeOf(MaskedNumber.prototype), \"_appendCharRaw\", this).call(this, ch, flags);\n var prevBeforeTailValue = flags.tail && flags._beforeTailState ? flags._beforeTailState._value : this._value;\n\n var prevBeforeTailSeparatorsCount = this._separatorsCountFromSlice(prevBeforeTailValue);\n\n this._value = this._removeThousandsSeparators(this.value);\n\n var appendDetails = _get(_getPrototypeOf(MaskedNumber.prototype), \"_appendCharRaw\", this).call(this, ch, flags);\n\n this._value = this._insertThousandsSeparators(this._value);\n var beforeTailValue = flags.tail && flags._beforeTailState ? flags._beforeTailState._value : this._value;\n\n var beforeTailSeparatorsCount = this._separatorsCountFromSlice(beforeTailValue);\n\n appendDetails.tailShift += (beforeTailSeparatorsCount - prevBeforeTailSeparatorsCount) * this.thousandsSeparator.length;\n return appendDetails;\n }\n /** */\n\n }, {\n key: \"_findSeparatorAround\",\n value: function _findSeparatorAround(pos) {\n if (this.thousandsSeparator) {\n var searchFrom = pos - this.thousandsSeparator.length + 1;\n var separatorPos = this.value.indexOf(this.thousandsSeparator, searchFrom);\n if (separatorPos <= pos) return separatorPos;\n }\n\n return -1;\n }\n }, {\n key: \"_adjustRangeWithSeparators\",\n value: function _adjustRangeWithSeparators(from, to) {\n var separatorAroundFromPos = this._findSeparatorAround(from);\n\n if (separatorAroundFromPos >= 0) from = separatorAroundFromPos;\n\n var separatorAroundToPos = this._findSeparatorAround(to);\n\n if (separatorAroundToPos >= 0) to = separatorAroundToPos + this.thousandsSeparator.length;\n return [from, to];\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"remove\",\n value: function remove() {\n var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;\n\n var _this$_adjustRangeWit3 = this._adjustRangeWithSeparators(fromPos, toPos);\n\n var _this$_adjustRangeWit4 = _slicedToArray(_this$_adjustRangeWit3, 2);\n\n fromPos = _this$_adjustRangeWit4[0];\n toPos = _this$_adjustRangeWit4[1];\n var valueBeforePos = this.value.slice(0, fromPos);\n var valueAfterPos = this.value.slice(toPos);\n\n var prevBeforeTailSeparatorsCount = this._separatorsCount(valueBeforePos.length);\n\n this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(valueBeforePos + valueAfterPos));\n\n var beforeTailSeparatorsCount = this._separatorsCountFromSlice(valueBeforePos);\n\n return new ChangeDetails({\n tailShift: (beforeTailSeparatorsCount - prevBeforeTailSeparatorsCount) * this.thousandsSeparator.length\n });\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"nearestInputPos\",\n value: function nearestInputPos(cursorPos, direction) {\n if (!this.thousandsSeparator) return cursorPos;\n\n switch (direction) {\n case DIRECTION.NONE:\n case DIRECTION.LEFT:\n case DIRECTION.FORCE_LEFT:\n {\n var separatorAtLeftPos = this._findSeparatorAround(cursorPos - 1);\n\n if (separatorAtLeftPos >= 0) {\n var separatorAtLeftEndPos = separatorAtLeftPos + this.thousandsSeparator.length;\n\n if (cursorPos < separatorAtLeftEndPos || this.value.length <= separatorAtLeftEndPos || direction === DIRECTION.FORCE_LEFT) {\n return separatorAtLeftPos;\n }\n }\n\n break;\n }\n\n case DIRECTION.RIGHT:\n case DIRECTION.FORCE_RIGHT:\n {\n var separatorAtRightPos = this._findSeparatorAround(cursorPos);\n\n if (separatorAtRightPos >= 0) {\n return separatorAtRightPos + this.thousandsSeparator.length;\n }\n }\n }\n\n return cursorPos;\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"doValidate\",\n value: function doValidate(flags) {\n var regexp = flags.input ? this._numberRegExpInput : this._numberRegExp; // validate as string\n\n var valid = regexp.test(this._removeThousandsSeparators(this.value));\n\n if (valid) {\n // validate as number\n var number = this.number;\n valid = valid && !isNaN(number) && ( // check min bound for negative values\n this.min == null || this.min >= 0 || this.min <= this.number) && ( // check max bound for positive values\n this.max == null || this.max <= 0 || this.number <= this.max);\n }\n\n return valid && _get(_getPrototypeOf(MaskedNumber.prototype), \"doValidate\", this).call(this, flags);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"doCommit\",\n value: function doCommit() {\n if (this.value) {\n var number = this.number;\n var validnum = number; // check bounds\n\n if (this.min != null) validnum = Math.max(validnum, this.min);\n if (this.max != null) validnum = Math.min(validnum, this.max);\n if (validnum !== number) this.unmaskedValue = String(validnum);\n var formatted = this.value;\n if (this.normalizeZeros) formatted = this._normalizeZeros(formatted);\n if (this.padFractionalZeros) formatted = this._padFractionalZeros(formatted);\n this._value = formatted;\n }\n\n _get(_getPrototypeOf(MaskedNumber.prototype), \"doCommit\", this).call(this);\n }\n /** */\n\n }, {\n key: \"_normalizeZeros\",\n value: function _normalizeZeros(value) {\n var parts = this._removeThousandsSeparators(value).split(this.radix); // remove leading zeros\n\n\n parts[0] = parts[0].replace(/^(\\D*)(0*)(\\d*)/, function (match, sign, zeros, num) {\n return sign + num;\n }); // add leading zero\n\n if (value.length && !/\\d$/.test(parts[0])) parts[0] = parts[0] + '0';\n\n if (parts.length > 1) {\n parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros\n\n if (!parts[1].length) parts.length = 1; // remove fractional\n }\n\n return this._insertThousandsSeparators(parts.join(this.radix));\n }\n /** */\n\n }, {\n key: \"_padFractionalZeros\",\n value: function _padFractionalZeros(value) {\n if (!value) return value;\n var parts = value.split(this.radix);\n if (parts.length < 2) parts.push('');\n parts[1] = parts[1].padEnd(this.scale, '0');\n return parts.join(this.radix);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"unmaskedValue\",\n get: function get() {\n return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, '.');\n },\n set: function set(unmaskedValue) {\n _set(_getPrototypeOf(MaskedNumber.prototype), \"unmaskedValue\", unmaskedValue.replace('.', this.radix), this, true);\n }\n /** Parsed Number */\n\n }, {\n key: \"number\",\n get: function get() {\n return Number(this.unmaskedValue);\n },\n set: function set(number) {\n this.unmaskedValue = String(number);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"typedValue\",\n get: function get() {\n return this.number;\n },\n set: function set(value) {\n this.number = value;\n }\n /**\r\n Is negative allowed\r\n @readonly\r\n */\n\n }, {\n key: \"allowNegative\",\n get: function get() {\n return this.signed || this.min != null && this.min < 0 || this.max != null && this.max < 0;\n }\n }]);\n\n return MaskedNumber;\n}(Masked);\n\nMaskedNumber.DEFAULTS = {\n radix: ',',\n thousandsSeparator: '',\n mapToRadix: ['.'],\n scale: 2,\n signed: false,\n normalizeZeros: true,\n padFractionalZeros: false\n};\n/** Masking by RegExp */\n\nvar MaskedRegExp = /*#__PURE__*/function (_Masked) {\n _inherits(MaskedRegExp, _Masked);\n\n function MaskedRegExp() {\n _classCallCheck(this, MaskedRegExp);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MaskedRegExp).apply(this, arguments));\n }\n\n _createClass(MaskedRegExp, [{\n key: \"_update\",\n\n /**\r\n @override\r\n @param {Object} opts\r\n */\n value: function _update(opts) {\n if (opts.mask) opts.validate = function (value) {\n return value.search(opts.mask) >= 0;\n };\n\n _get(_getPrototypeOf(MaskedRegExp.prototype), \"_update\", this).call(this, opts);\n }\n }]);\n\n return MaskedRegExp;\n}(Masked);\n/** Masking by custom Function */\n\n\nvar MaskedFunction = /*#__PURE__*/function (_Masked) {\n _inherits(MaskedFunction, _Masked);\n\n function MaskedFunction() {\n _classCallCheck(this, MaskedFunction);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MaskedFunction).apply(this, arguments));\n }\n\n _createClass(MaskedFunction, [{\n key: \"_update\",\n\n /**\r\n @override\r\n @param {Object} opts\r\n */\n value: function _update(opts) {\n if (opts.mask) opts.validate = opts.mask;\n\n _get(_getPrototypeOf(MaskedFunction.prototype), \"_update\", this).call(this, opts);\n }\n }]);\n\n return MaskedFunction;\n}(Masked);\n/** Dynamic mask for choosing apropriate mask in run-time */\n\n\nvar MaskedDynamic = /*#__PURE__*/function (_Masked) {\n _inherits(MaskedDynamic, _Masked);\n /** Currently chosen mask */\n\n /** Compliled {@link Masked} options */\n\n /** Chooses {@link Masked} depending on input value */\n\n /**\r\n @param {Object} opts\r\n */\n\n\n function MaskedDynamic(opts) {\n var _this;\n\n _classCallCheck(this, MaskedDynamic);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(MaskedDynamic).call(this, Object.assign({}, MaskedDynamic.DEFAULTS, {}, opts)));\n _this.currentMask = null;\n return _this;\n }\n /**\r\n @override\r\n */\n\n\n _createClass(MaskedDynamic, [{\n key: \"_update\",\n value: function _update(opts) {\n _get(_getPrototypeOf(MaskedDynamic.prototype), \"_update\", this).call(this, opts);\n\n if ('mask' in opts) {\n // mask could be totally dynamic with only `dispatch` option\n this.compiledMasks = Array.isArray(opts.mask) ? opts.mask.map(function (m) {\n return createMask(m);\n }) : [];\n }\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"_appendCharRaw\",\n value: function _appendCharRaw() {\n var details = this._applyDispatch.apply(this, arguments);\n\n if (this.currentMask) {\n var _this$currentMask;\n\n details.aggregate((_this$currentMask = this.currentMask)._appendChar.apply(_this$currentMask, arguments));\n }\n\n return details;\n }\n }, {\n key: \"_applyDispatch\",\n value: function _applyDispatch() {\n var appended = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var prevValueBeforeTail = flags.tail && flags._beforeTailState != null ? flags._beforeTailState._value : this.value;\n var inputValue = this.rawInputValue;\n var insertValue = flags.tail && flags._beforeTailState != null ? // $FlowFixMe - tired to fight with type system\n flags._beforeTailState._rawInputValue : inputValue;\n var tailValue = inputValue.slice(insertValue.length);\n var prevMask = this.currentMask;\n var details = new ChangeDetails();\n var prevMaskState = prevMask && prevMask.state; // clone flags to prevent overwriting `_beforeTailState`\n\n this.currentMask = this.doDispatch(appended, Object.assign({}, flags)); // restore state after dispatch\n\n if (this.currentMask) {\n if (this.currentMask !== prevMask) {\n // if mask changed reapply input\n this.currentMask.reset(); // $FlowFixMe - it's ok, we don't change current mask above\n\n var d = this.currentMask.append(insertValue, {\n raw: true\n });\n details.tailShift = d.inserted.length - prevValueBeforeTail.length;\n\n if (tailValue) {\n // $FlowFixMe - it's ok, we don't change current mask above\n details.tailShift += this.currentMask.append(tailValue, {\n raw: true,\n tail: true\n }).tailShift;\n }\n } else {\n // Dispatch can do something bad with state, so\n // restore prev mask state\n this.currentMask.state = prevMaskState;\n }\n }\n\n return details;\n }\n }, {\n key: \"_appendPlaceholder\",\n value: function _appendPlaceholder() {\n var details = this._applyDispatch.apply(this, arguments);\n\n if (this.currentMask) {\n details.aggregate(this.currentMask._appendPlaceholder());\n }\n\n return details;\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"doDispatch\",\n value: function doDispatch(appended) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.dispatch(appended, this, flags);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"doValidate\",\n value: function doValidate() {\n var _get2, _this$currentMask2;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return (_get2 = _get(_getPrototypeOf(MaskedDynamic.prototype), \"doValidate\", this)).call.apply(_get2, [this].concat(args)) && (!this.currentMask || (_this$currentMask2 = this.currentMask).doValidate.apply(_this$currentMask2, args));\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"reset\",\n value: function reset() {\n if (this.currentMask) this.currentMask.reset();\n this.compiledMasks.forEach(function (m) {\n return m.reset();\n });\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"remove\",\n\n /**\r\n @override\r\n */\n value: function remove() {\n var details = new ChangeDetails();\n\n if (this.currentMask) {\n var _this$currentMask3;\n\n details.aggregate((_this$currentMask3 = this.currentMask).remove.apply(_this$currentMask3, arguments)) // update with dispatch\n .aggregate(this._applyDispatch());\n }\n\n return details;\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"extractInput\",\n\n /**\r\n @override\r\n */\n value: function extractInput() {\n var _this$currentMask4;\n\n return this.currentMask ? (_this$currentMask4 = this.currentMask).extractInput.apply(_this$currentMask4, arguments) : '';\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"extractTail\",\n value: function extractTail() {\n var _this$currentMask5, _get3;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return this.currentMask ? (_this$currentMask5 = this.currentMask).extractTail.apply(_this$currentMask5, args) : (_get3 = _get(_getPrototypeOf(MaskedDynamic.prototype), \"extractTail\", this)).call.apply(_get3, [this].concat(args));\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"doCommit\",\n value: function doCommit() {\n if (this.currentMask) this.currentMask.doCommit();\n\n _get(_getPrototypeOf(MaskedDynamic.prototype), \"doCommit\", this).call(this);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"nearestInputPos\",\n value: function nearestInputPos() {\n var _this$currentMask6, _get4;\n\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return this.currentMask ? (_this$currentMask6 = this.currentMask).nearestInputPos.apply(_this$currentMask6, args) : (_get4 = _get(_getPrototypeOf(MaskedDynamic.prototype), \"nearestInputPos\", this)).call.apply(_get4, [this].concat(args));\n }\n }, {\n key: \"value\",\n get: function get() {\n return this.currentMask ? this.currentMask.value : '';\n },\n set: function set(value) {\n _set(_getPrototypeOf(MaskedDynamic.prototype), \"value\", value, this, true);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"unmaskedValue\",\n get: function get() {\n return this.currentMask ? this.currentMask.unmaskedValue : '';\n },\n set: function set(unmaskedValue) {\n _set(_getPrototypeOf(MaskedDynamic.prototype), \"unmaskedValue\", unmaskedValue, this, true);\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"typedValue\",\n get: function get() {\n return this.currentMask ? this.currentMask.typedValue : '';\n } // probably typedValue should not be used with dynamic\n ,\n set: function set(value) {\n var unmaskedValue = String(value); // double check it\n\n if (this.currentMask) {\n this.currentMask.typedValue = value;\n unmaskedValue = this.currentMask.unmaskedValue;\n }\n\n this.unmaskedValue = unmaskedValue;\n }\n /**\r\n @override\r\n */\n\n }, {\n key: \"isComplete\",\n get: function get() {\n return !!this.currentMask && this.currentMask.isComplete;\n }\n }, {\n key: \"state\",\n get: function get() {\n return Object.assign({}, _get(_getPrototypeOf(MaskedDynamic.prototype), \"state\", this), {\n _rawInputValue: this.rawInputValue,\n compiledMasks: this.compiledMasks.map(function (m) {\n return m.state;\n }),\n currentMaskRef: this.currentMask,\n currentMask: this.currentMask && this.currentMask.state\n });\n },\n set: function set(state) {\n var compiledMasks = state.compiledMasks,\n currentMaskRef = state.currentMaskRef,\n currentMask = state.currentMask,\n maskedState = _objectWithoutProperties(state, [\"compiledMasks\", \"currentMaskRef\", \"currentMask\"]);\n\n this.compiledMasks.forEach(function (m, mi) {\n return m.state = compiledMasks[mi];\n });\n\n if (currentMaskRef != null) {\n this.currentMask = currentMaskRef;\n this.currentMask.state = currentMask;\n }\n\n _set(_getPrototypeOf(MaskedDynamic.prototype), \"state\", maskedState, this, true);\n }\n }, {\n key: \"overwrite\",\n get: function get() {\n return this.currentMask ? this.currentMask.overwrite : _get(_getPrototypeOf(MaskedDynamic.prototype), \"overwrite\", this);\n },\n set: function set(overwrite) {\n console.warn('\"overwrite\" option is not available in dynamic mask, use this option in siblings');\n }\n }]);\n\n return MaskedDynamic;\n}(Masked);\n\nMaskedDynamic.DEFAULTS = {\n dispatch: function dispatch(appended, masked, flags) {\n if (!masked.compiledMasks.length) return;\n var inputValue = masked.rawInputValue; // simulate input\n\n var inputs = masked.compiledMasks.map(function (m, index) {\n m.reset();\n m.append(inputValue, {\n raw: true\n });\n m.append(appended, flags);\n var weight = m.rawInputValue.length;\n return {\n weight: weight,\n index: index\n };\n }); // pop masks with longer values first\n\n inputs.sort(function (i1, i2) {\n return i2.weight - i1.weight;\n });\n return masked.compiledMasks[inputs[0].index];\n }\n};\n/**\r\n * Applies mask on element.\r\n * @constructor\r\n * @param {HTMLInputElement|HTMLTextAreaElement|MaskElement} el - Element to apply mask\r\n * @param {Object} opts - Custom mask options\r\n * @return {InputMask}\r\n */\n\nfunction IMask(el) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // currently available only for input-like elements\n\n return new InputMask(el, opts);\n}\n/** {@link InputMask} */\n\n\nIMask.InputMask = InputMask;\n/** {@link Masked} */\n\nIMask.Masked = Masked;\n/** {@link MaskedPattern} */\n\nIMask.MaskedPattern = MaskedPattern;\n/** {@link MaskedEnum} */\n\nIMask.MaskedEnum = MaskedEnum;\n/** {@link MaskedRange} */\n\nIMask.MaskedRange = MaskedRange;\n/** {@link MaskedNumber} */\n\nIMask.MaskedNumber = MaskedNumber;\n/** {@link MaskedDate} */\n\nIMask.MaskedDate = MaskedDate;\n/** {@link MaskedRegExp} */\n\nIMask.MaskedRegExp = MaskedRegExp;\n/** {@link MaskedFunction} */\n\nIMask.MaskedFunction = MaskedFunction;\n/** {@link MaskedDynamic} */\n\nIMask.MaskedDynamic = MaskedDynamic;\n/** {@link createMask} */\n\nIMask.createMask = createMask;\n/** {@link MaskElement} */\n\nIMask.MaskElement = MaskElement;\n/** {@link HTMLMaskElement} */\n\nIMask.HTMLMaskElement = HTMLMaskElement;\ng.IMask = IMask;\nexport default IMask;\nexport { HTMLMaskElement, InputMask, MaskElement, Masked, MaskedDate, MaskedDynamic, MaskedEnum, MaskedFunction, MaskedNumber, MaskedPattern, MaskedRange, MaskedRegExp, createMask };","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*!\r\n * jQuery Validation Plugin v1.19.2\r\n *\r\n * https://jqueryvalidation.org/\r\n *\r\n * Copyright (c) 2020 Jörn Zaefferer\r\n * Released under the MIT license\r\n */\n(function (factory) {\n if (typeof define === \"function\" && define.amd) {\n define([\"jquery\"], factory);\n } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === \"object\" && module.exports) {\n module.exports = factory(require(\"jquery\"));\n } else {\n factory(jQuery);\n }\n})(function ($) {\n $.extend($.fn, {\n // https://jqueryvalidation.org/validate/\n validate: function validate(options) {\n // If nothing is selected, return nothing; can't chain anyway\n if (!this.length) {\n if (options && options.debug && window.console) {\n console.warn(\"Nothing selected, can't validate, returning nothing.\");\n }\n\n return;\n } // Check if a validator for this form was already created\n\n\n var validator = $.data(this[0], \"validator\");\n\n if (validator) {\n return validator;\n } // Add novalidate tag if HTML5.\n\n\n this.attr(\"novalidate\", \"novalidate\");\n validator = new $.validator(options, this[0]);\n $.data(this[0], \"validator\", validator);\n\n if (validator.settings.onsubmit) {\n this.on(\"click.validate\", \":submit\", function (event) {\n // Track the used submit button to properly handle scripted\n // submits later.\n validator.submitButton = event.currentTarget; // Allow suppressing validation by adding a cancel class to the submit button\n\n if ($(this).hasClass(\"cancel\")) {\n validator.cancelSubmit = true;\n } // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button\n\n\n if ($(this).attr(\"formnovalidate\") !== undefined) {\n validator.cancelSubmit = true;\n }\n }); // Validate the form on submit\n\n this.on(\"submit.validate\", function (event) {\n if (validator.settings.debug) {\n // Prevent form submit to be able to see console output\n event.preventDefault();\n }\n\n function handle() {\n var hidden, result; // Insert a hidden input as a replacement for the missing submit button\n // The hidden input is inserted in two cases:\n // - A user defined a `submitHandler`\n // - There was a pending request due to `remote` method and `stopRequest()`\n // was called to submit the form in case it's valid\n\n if (validator.submitButton && (validator.settings.submitHandler || validator.formSubmitted)) {\n hidden = $(\"\").attr(\"name\", validator.submitButton.name).val($(validator.submitButton).val()).appendTo(validator.currentForm);\n }\n\n if (validator.settings.submitHandler && !validator.settings.debug) {\n result = validator.settings.submitHandler.call(validator, validator.currentForm, event);\n\n if (hidden) {\n // And clean up afterwards; thanks to no-block-scope, hidden can be referenced\n hidden.remove();\n }\n\n if (result !== undefined) {\n return result;\n }\n\n return false;\n }\n\n return true;\n } // Prevent submit for invalid forms or custom submit handlers\n\n\n if (validator.cancelSubmit) {\n validator.cancelSubmit = false;\n return handle();\n }\n\n if (validator.form()) {\n if (validator.pendingRequest) {\n validator.formSubmitted = true;\n return false;\n }\n\n return handle();\n } else {\n validator.focusInvalid();\n return false;\n }\n });\n }\n\n return validator;\n },\n // https://jqueryvalidation.org/valid/\n valid: function valid() {\n var valid, validator, errorList;\n\n if ($(this[0]).is(\"form\")) {\n valid = this.validate().form();\n } else {\n errorList = [];\n valid = true;\n validator = $(this[0].form).validate();\n this.each(function () {\n valid = validator.element(this) && valid;\n\n if (!valid) {\n errorList = errorList.concat(validator.errorList);\n }\n });\n validator.errorList = errorList;\n }\n\n return valid;\n },\n // https://jqueryvalidation.org/rules/\n rules: function rules(command, argument) {\n var element = this[0],\n isContentEditable = typeof this.attr(\"contenteditable\") !== \"undefined\" && this.attr(\"contenteditable\") !== \"false\",\n settings,\n staticRules,\n existingRules,\n data,\n param,\n filtered; // If nothing is selected, return empty object; can't chain anyway\n\n if (element == null) {\n return;\n }\n\n if (!element.form && isContentEditable) {\n element.form = this.closest(\"form\")[0];\n element.name = this.attr(\"name\");\n }\n\n if (element.form == null) {\n return;\n }\n\n if (command) {\n settings = $.data(element.form, \"validator\").settings;\n staticRules = settings.rules;\n existingRules = $.validator.staticRules(element);\n\n switch (command) {\n case \"add\":\n $.extend(existingRules, $.validator.normalizeRule(argument)); // Remove messages from rules, but allow them to be set separately\n\n delete existingRules.messages;\n staticRules[element.name] = existingRules;\n\n if (argument.messages) {\n settings.messages[element.name] = $.extend(settings.messages[element.name], argument.messages);\n }\n\n break;\n\n case \"remove\":\n if (!argument) {\n delete staticRules[element.name];\n return existingRules;\n }\n\n filtered = {};\n $.each(argument.split(/\\s/), function (index, method) {\n filtered[method] = existingRules[method];\n delete existingRules[method];\n });\n return filtered;\n }\n }\n\n data = $.validator.normalizeRules($.extend({}, $.validator.classRules(element), $.validator.attributeRules(element), $.validator.dataRules(element), $.validator.staticRules(element)), element); // Make sure required is at front\n\n if (data.required) {\n param = data.required;\n delete data.required;\n data = $.extend({\n required: param\n }, data);\n } // Make sure remote is at back\n\n\n if (data.remote) {\n param = data.remote;\n delete data.remote;\n data = $.extend(data, {\n remote: param\n });\n }\n\n return data;\n }\n }); // JQuery trim is deprecated, provide a trim method based on String.prototype.trim\n\n var trim = function trim(str) {\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim#Polyfill\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, \"\");\n }; // Custom selectors\n\n\n $.extend($.expr.pseudos || $.expr[\":\"], {\n // '|| $.expr[ \":\" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support\n // https://jqueryvalidation.org/blank-selector/\n blank: function blank(a) {\n return !trim(\"\" + $(a).val());\n },\n // https://jqueryvalidation.org/filled-selector/\n filled: function filled(a) {\n var val = $(a).val();\n return val !== null && !!trim(\"\" + val);\n },\n // https://jqueryvalidation.org/unchecked-selector/\n unchecked: function unchecked(a) {\n return !$(a).prop(\"checked\");\n }\n }); // Constructor for validator\n\n $.validator = function (options, form) {\n this.settings = $.extend(true, {}, $.validator.defaults, options);\n this.currentForm = form;\n this.init();\n }; // https://jqueryvalidation.org/jQuery.validator.format/\n\n\n $.validator.format = function (source, params) {\n if (arguments.length === 1) {\n return function () {\n var args = $.makeArray(arguments);\n args.unshift(source);\n return $.validator.format.apply(this, args);\n };\n }\n\n if (params === undefined) {\n return source;\n }\n\n if (arguments.length > 2 && params.constructor !== Array) {\n params = $.makeArray(arguments).slice(1);\n }\n\n if (params.constructor !== Array) {\n params = [params];\n }\n\n $.each(params, function (i, n) {\n source = source.replace(new RegExp(\"\\\\{\" + i + \"\\\\}\", \"g\"), function () {\n return n;\n });\n });\n return source;\n };\n\n $.extend($.validator, {\n defaults: {\n messages: {},\n groups: {},\n rules: {},\n errorClass: \"error\",\n pendingClass: \"pending\",\n validClass: \"valid\",\n errorElement: \"label\",\n focusCleanup: false,\n focusInvalid: true,\n errorContainer: $([]),\n errorLabelContainer: $([]),\n onsubmit: true,\n ignore: \":hidden\",\n ignoreTitle: false,\n onfocusin: function onfocusin(element) {\n this.lastActive = element; // Hide error label and remove error class on focus if enabled\n\n if (this.settings.focusCleanup) {\n if (this.settings.unhighlight) {\n this.settings.unhighlight.call(this, element, this.settings.errorClass, this.settings.validClass);\n }\n\n this.hideThese(this.errorsFor(element));\n }\n },\n onfocusout: function onfocusout(element) {\n if (!this.checkable(element) && (element.name in this.submitted || !this.optional(element))) {\n this.element(element);\n }\n },\n onkeyup: function onkeyup(element, event) {\n // Avoid revalidate the field when pressing one of the following keys\n // Shift => 16\n // Ctrl => 17\n // Alt => 18\n // Caps lock => 20\n // End => 35\n // Home => 36\n // Left arrow => 37\n // Up arrow => 38\n // Right arrow => 39\n // Down arrow => 40\n // Insert => 45\n // Num lock => 144\n // AltGr key => 225\n var excludedKeys = [16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225];\n\n if (event.which === 9 && this.elementValue(element) === \"\" || $.inArray(event.keyCode, excludedKeys) !== -1) {\n return;\n } else if (element.name in this.submitted || element.name in this.invalid) {\n this.element(element);\n }\n },\n onclick: function onclick(element) {\n // Click on selects, radiobuttons and checkboxes\n if (element.name in this.submitted) {\n this.element(element); // Or option elements, check parent select in that case\n } else if (element.parentNode.name in this.submitted) {\n this.element(element.parentNode);\n }\n },\n highlight: function highlight(element, errorClass, validClass) {\n if (element.type === \"radio\") {\n this.findByName(element.name).addClass(errorClass).removeClass(validClass);\n } else {\n $(element).addClass(errorClass).removeClass(validClass);\n }\n },\n unhighlight: function unhighlight(element, errorClass, validClass) {\n if (element.type === \"radio\") {\n this.findByName(element.name).removeClass(errorClass).addClass(validClass);\n } else {\n $(element).removeClass(errorClass).addClass(validClass);\n }\n }\n },\n // https://jqueryvalidation.org/jQuery.validator.setDefaults/\n setDefaults: function setDefaults(settings) {\n $.extend($.validator.defaults, settings);\n },\n messages: {\n required: \"This field is required.\",\n remote: \"Please fix this field.\",\n email: \"Please enter a valid email address.\",\n url: \"Please enter a valid URL.\",\n date: \"Please enter a valid date.\",\n dateISO: \"Please enter a valid date (ISO).\",\n number: \"Please enter a valid number.\",\n digits: \"Please enter only digits.\",\n equalTo: \"Please enter the same value again.\",\n maxlength: $.validator.format(\"Please enter no more than {0} characters.\"),\n minlength: $.validator.format(\"Please enter at least {0} characters.\"),\n rangelength: $.validator.format(\"Please enter a value between {0} and {1} characters long.\"),\n range: $.validator.format(\"Please enter a value between {0} and {1}.\"),\n max: $.validator.format(\"Please enter a value less than or equal to {0}.\"),\n min: $.validator.format(\"Please enter a value greater than or equal to {0}.\"),\n step: $.validator.format(\"Please enter a multiple of {0}.\")\n },\n autoCreateRanges: false,\n prototype: {\n init: function init() {\n this.labelContainer = $(this.settings.errorLabelContainer);\n this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm);\n this.containers = $(this.settings.errorContainer).add(this.settings.errorLabelContainer);\n this.submitted = {};\n this.valueCache = {};\n this.pendingRequest = 0;\n this.pending = {};\n this.invalid = {};\n this.reset();\n var currentForm = this.currentForm,\n groups = this.groups = {},\n rules;\n $.each(this.settings.groups, function (key, value) {\n if (typeof value === \"string\") {\n value = value.split(/\\s/);\n }\n\n $.each(value, function (index, name) {\n groups[name] = key;\n });\n });\n rules = this.settings.rules;\n $.each(rules, function (key, value) {\n rules[key] = $.validator.normalizeRule(value);\n });\n\n function delegate(event) {\n var isContentEditable = typeof $(this).attr(\"contenteditable\") !== \"undefined\" && $(this).attr(\"contenteditable\") !== \"false\"; // Set form expando on contenteditable\n\n if (!this.form && isContentEditable) {\n this.form = $(this).closest(\"form\")[0];\n this.name = $(this).attr(\"name\");\n } // Ignore the element if it belongs to another form. This will happen mainly\n // when setting the `form` attribute of an input to the id of another form.\n\n\n if (currentForm !== this.form) {\n return;\n }\n\n var validator = $.data(this.form, \"validator\"),\n eventType = \"on\" + event.type.replace(/^validate/, \"\"),\n settings = validator.settings;\n\n if (settings[eventType] && !$(this).is(settings.ignore)) {\n settings[eventType].call(validator, this, event);\n }\n }\n\n $(this.currentForm).on(\"focusin.validate focusout.validate keyup.validate\", \":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], \" + \"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], \" + \"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], \" + \"[type='radio'], [type='checkbox'], [contenteditable], [type='button']\", delegate) // Support: Chrome, oldIE\n // \"select\" is provided as event.target when clicking a option\n .on(\"click.validate\", \"select, option, [type='radio'], [type='checkbox']\", delegate);\n\n if (this.settings.invalidHandler) {\n $(this.currentForm).on(\"invalid-form.validate\", this.settings.invalidHandler);\n }\n },\n // https://jqueryvalidation.org/Validator.form/\n form: function form() {\n this.checkForm();\n $.extend(this.submitted, this.errorMap);\n this.invalid = $.extend({}, this.errorMap);\n\n if (!this.valid()) {\n $(this.currentForm).triggerHandler(\"invalid-form\", [this]);\n }\n\n this.showErrors();\n return this.valid();\n },\n checkForm: function checkForm() {\n this.prepareForm();\n\n for (var i = 0, elements = this.currentElements = this.elements(); elements[i]; i++) {\n this.check(elements[i]);\n }\n\n return this.valid();\n },\n // https://jqueryvalidation.org/Validator.element/\n element: function element(_element) {\n var cleanElement = this.clean(_element),\n checkElement = this.validationTargetFor(cleanElement),\n v = this,\n result = true,\n rs,\n group;\n\n if (checkElement === undefined) {\n delete this.invalid[cleanElement.name];\n } else {\n this.prepareElement(checkElement);\n this.currentElements = $(checkElement); // If this element is grouped, then validate all group elements already\n // containing a value\n\n group = this.groups[checkElement.name];\n\n if (group) {\n $.each(this.groups, function (name, testgroup) {\n if (testgroup === group && name !== checkElement.name) {\n cleanElement = v.validationTargetFor(v.clean(v.findByName(name)));\n\n if (cleanElement && cleanElement.name in v.invalid) {\n v.currentElements.push(cleanElement);\n result = v.check(cleanElement) && result;\n }\n }\n });\n }\n\n rs = this.check(checkElement) !== false;\n result = result && rs;\n\n if (rs) {\n this.invalid[checkElement.name] = false;\n } else {\n this.invalid[checkElement.name] = true;\n }\n\n if (!this.numberOfInvalids()) {\n // Hide error containers on last error\n this.toHide = this.toHide.add(this.containers);\n }\n\n this.showErrors(); // Add aria-invalid status for screen readers\n\n $(_element).attr(\"aria-invalid\", !rs);\n }\n\n return result;\n },\n // https://jqueryvalidation.org/Validator.showErrors/\n showErrors: function showErrors(errors) {\n if (errors) {\n var validator = this; // Add items to error list and map\n\n $.extend(this.errorMap, errors);\n this.errorList = $.map(this.errorMap, function (message, name) {\n return {\n message: message,\n element: validator.findByName(name)[0]\n };\n }); // Remove items from success list\n\n this.successList = $.grep(this.successList, function (element) {\n return !(element.name in errors);\n });\n }\n\n if (this.settings.showErrors) {\n this.settings.showErrors.call(this, this.errorMap, this.errorList);\n } else {\n this.defaultShowErrors();\n }\n },\n // https://jqueryvalidation.org/Validator.resetForm/\n resetForm: function resetForm() {\n if ($.fn.resetForm) {\n $(this.currentForm).resetForm();\n }\n\n this.invalid = {};\n this.submitted = {};\n this.prepareForm();\n this.hideErrors();\n var elements = this.elements().removeData(\"previousValue\").removeAttr(\"aria-invalid\");\n this.resetElements(elements);\n },\n resetElements: function resetElements(elements) {\n var i;\n\n if (this.settings.unhighlight) {\n for (i = 0; elements[i]; i++) {\n this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, \"\");\n this.findByName(elements[i].name).removeClass(this.settings.validClass);\n }\n } else {\n elements.removeClass(this.settings.errorClass).removeClass(this.settings.validClass);\n }\n },\n numberOfInvalids: function numberOfInvalids() {\n return this.objectLength(this.invalid);\n },\n objectLength: function objectLength(obj) {\n /* jshint unused: false */\n var count = 0,\n i;\n\n for (i in obj) {\n // This check allows counting elements with empty error\n // message as invalid elements\n if (obj[i] !== undefined && obj[i] !== null && obj[i] !== false) {\n count++;\n }\n }\n\n return count;\n },\n hideErrors: function hideErrors() {\n this.hideThese(this.toHide);\n },\n hideThese: function hideThese(errors) {\n errors.not(this.containers).text(\"\");\n this.addWrapper(errors).hide();\n },\n valid: function valid() {\n return this.size() === 0;\n },\n size: function size() {\n return this.errorList.length;\n },\n focusInvalid: function focusInvalid() {\n if (this.settings.focusInvalid) {\n try {\n $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(\":visible\").trigger(\"focus\") // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find\n .trigger(\"focusin\");\n } catch (e) {// Ignore IE throwing errors when focusing hidden elements\n }\n }\n },\n findLastActive: function findLastActive() {\n var lastActive = this.lastActive;\n return lastActive && $.grep(this.errorList, function (n) {\n return n.element.name === lastActive.name;\n }).length === 1 && lastActive;\n },\n elements: function elements() {\n var validator = this,\n rulesCache = {}; // Select all valid inputs inside the form (no submit or reset buttons)\n\n return $(this.currentForm).find(\"input, select, textarea, [contenteditable]\").not(\":submit, :reset, :image, :disabled\").not(this.settings.ignore).filter(function () {\n var name = this.name || $(this).attr(\"name\"); // For contenteditable\n\n var isContentEditable = typeof $(this).attr(\"contenteditable\") !== \"undefined\" && $(this).attr(\"contenteditable\") !== \"false\";\n\n if (!name && validator.settings.debug && window.console) {\n console.error(\"%o has no name assigned\", this);\n } // Set form expando on contenteditable\n\n\n if (isContentEditable) {\n this.form = $(this).closest(\"form\")[0];\n this.name = name;\n } // Ignore elements that belong to other/nested forms\n\n\n if (this.form !== validator.currentForm) {\n return false;\n } // Select only the first element for each name, and only those with rules specified\n\n\n if (name in rulesCache || !validator.objectLength($(this).rules())) {\n return false;\n }\n\n rulesCache[name] = true;\n return true;\n });\n },\n clean: function clean(selector) {\n return $(selector)[0];\n },\n errors: function errors() {\n var errorClass = this.settings.errorClass.split(\" \").join(\".\");\n return $(this.settings.errorElement + \".\" + errorClass, this.errorContext);\n },\n resetInternals: function resetInternals() {\n this.successList = [];\n this.errorList = [];\n this.errorMap = {};\n this.toShow = $([]);\n this.toHide = $([]);\n },\n reset: function reset() {\n this.resetInternals();\n this.currentElements = $([]);\n },\n prepareForm: function prepareForm() {\n this.reset();\n this.toHide = this.errors().add(this.containers);\n },\n prepareElement: function prepareElement(element) {\n this.reset();\n this.toHide = this.errorsFor(element);\n },\n elementValue: function elementValue(element) {\n var $element = $(element),\n type = element.type,\n isContentEditable = typeof $element.attr(\"contenteditable\") !== \"undefined\" && $element.attr(\"contenteditable\") !== \"false\",\n val,\n idx;\n\n if (type === \"radio\" || type === \"checkbox\") {\n return this.findByName(element.name).filter(\":checked\").val();\n } else if (type === \"number\" && typeof element.validity !== \"undefined\") {\n return element.validity.badInput ? \"NaN\" : $element.val();\n }\n\n if (isContentEditable) {\n val = $element.text();\n } else {\n val = $element.val();\n }\n\n if (type === \"file\") {\n // Modern browser (chrome & safari)\n if (val.substr(0, 12) === \"C:\\\\fakepath\\\\\") {\n return val.substr(12);\n } // Legacy browsers\n // Unix-based path\n\n\n idx = val.lastIndexOf(\"/\");\n\n if (idx >= 0) {\n return val.substr(idx + 1);\n } // Windows-based path\n\n\n idx = val.lastIndexOf(\"\\\\\");\n\n if (idx >= 0) {\n return val.substr(idx + 1);\n } // Just the file name\n\n\n return val;\n }\n\n if (typeof val === \"string\") {\n return val.replace(/\\r/g, \"\");\n }\n\n return val;\n },\n check: function check(element) {\n element = this.validationTargetFor(this.clean(element));\n var rules = $(element).rules(),\n rulesCount = $.map(rules, function (n, i) {\n return i;\n }).length,\n dependencyMismatch = false,\n val = this.elementValue(element),\n result,\n method,\n rule,\n normalizer; // Prioritize the local normalizer defined for this element over the global one\n // if the former exists, otherwise user the global one in case it exists.\n\n if (typeof rules.normalizer === \"function\") {\n normalizer = rules.normalizer;\n } else if (typeof this.settings.normalizer === \"function\") {\n normalizer = this.settings.normalizer;\n } // If normalizer is defined, then call it to retreive the changed value instead\n // of using the real one.\n // Note that `this` in the normalizer is `element`.\n\n\n if (normalizer) {\n val = normalizer.call(element, val); // Delete the normalizer from rules to avoid treating it as a pre-defined method.\n\n delete rules.normalizer;\n }\n\n for (method in rules) {\n rule = {\n method: method,\n parameters: rules[method]\n };\n\n try {\n result = $.validator.methods[method].call(this, val, element, rule.parameters); // If a method indicates that the field is optional and therefore valid,\n // don't mark it as valid when there are no other rules\n\n if (result === \"dependency-mismatch\" && rulesCount === 1) {\n dependencyMismatch = true;\n continue;\n }\n\n dependencyMismatch = false;\n\n if (result === \"pending\") {\n this.toHide = this.toHide.not(this.errorsFor(element));\n return;\n }\n\n if (!result) {\n this.formatAndAdd(element, rule);\n return false;\n }\n } catch (e) {\n if (this.settings.debug && window.console) {\n console.log(\"Exception occurred when checking element \" + element.id + \", check the '\" + rule.method + \"' method.\", e);\n }\n\n if (e instanceof TypeError) {\n e.message += \". Exception occurred when checking element \" + element.id + \", check the '\" + rule.method + \"' method.\";\n }\n\n throw e;\n }\n }\n\n if (dependencyMismatch) {\n return;\n }\n\n if (this.objectLength(rules)) {\n this.successList.push(element);\n }\n\n return true;\n },\n // Return the custom message for the given element and validation method\n // specified in the element's HTML5 data attribute\n // return the generic message if present and no method specific message is present\n customDataMessage: function customDataMessage(element, method) {\n return $(element).data(\"msg\" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase()) || $(element).data(\"msg\");\n },\n // Return the custom message for the given element name and validation method\n customMessage: function customMessage(name, method) {\n var m = this.settings.messages[name];\n return m && (m.constructor === String ? m : m[method]);\n },\n // Return the first defined argument, allowing empty strings\n findDefined: function findDefined() {\n for (var i = 0; i < arguments.length; i++) {\n if (arguments[i] !== undefined) {\n return arguments[i];\n }\n }\n\n return undefined;\n },\n // The second parameter 'rule' used to be a string, and extended to an object literal\n // of the following form:\n // rule = {\n // method: \"method name\",\n // parameters: \"the given method parameters\"\n // }\n //\n // The old behavior still supported, kept to maintain backward compatibility with\n // old code, and will be removed in the next major release.\n defaultMessage: function defaultMessage(element, rule) {\n if (typeof rule === \"string\") {\n rule = {\n method: rule\n };\n }\n\n var message = this.findDefined(this.customMessage(element.name, rule.method), this.customDataMessage(element, rule.method), // 'title' is never undefined, so handle empty string as undefined\n !this.settings.ignoreTitle && element.title || undefined, $.validator.messages[rule.method], \"Warning: No message defined for \" + element.name + \"\"),\n theregex = /\\$?\\{(\\d+)\\}/g;\n\n if (typeof message === \"function\") {\n message = message.call(this, rule.parameters, element);\n } else if (theregex.test(message)) {\n message = $.validator.format(message.replace(theregex, \"{$1}\"), rule.parameters);\n }\n\n return message;\n },\n formatAndAdd: function formatAndAdd(element, rule) {\n var message = this.defaultMessage(element, rule);\n this.errorList.push({\n message: message,\n element: element,\n method: rule.method\n });\n this.errorMap[element.name] = message;\n this.submitted[element.name] = message;\n },\n addWrapper: function addWrapper(toToggle) {\n if (this.settings.wrapper) {\n toToggle = toToggle.add(toToggle.parent(this.settings.wrapper));\n }\n\n return toToggle;\n },\n defaultShowErrors: function defaultShowErrors() {\n var i, elements, error;\n\n for (i = 0; this.errorList[i]; i++) {\n error = this.errorList[i];\n\n if (this.settings.highlight) {\n this.settings.highlight.call(this, error.element, this.settings.errorClass, this.settings.validClass);\n }\n\n this.showLabel(error.element, error.message);\n }\n\n if (this.errorList.length) {\n this.toShow = this.toShow.add(this.containers);\n }\n\n if (this.settings.success) {\n for (i = 0; this.successList[i]; i++) {\n this.showLabel(this.successList[i]);\n }\n }\n\n if (this.settings.unhighlight) {\n for (i = 0, elements = this.validElements(); elements[i]; i++) {\n this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, this.settings.validClass);\n }\n }\n\n this.toHide = this.toHide.not(this.toShow);\n this.hideErrors();\n this.addWrapper(this.toShow).show();\n },\n validElements: function validElements() {\n return this.currentElements.not(this.invalidElements());\n },\n invalidElements: function invalidElements() {\n return $(this.errorList).map(function () {\n return this.element;\n });\n },\n showLabel: function showLabel(element, message) {\n var place,\n group,\n errorID,\n v,\n error = this.errorsFor(element),\n elementID = this.idOrName(element),\n describedBy = $(element).attr(\"aria-describedby\");\n\n if (error.length) {\n // Refresh error/success class\n error.removeClass(this.settings.validClass).addClass(this.settings.errorClass); // Replace message on existing label\n\n error.html(message);\n } else {\n // Create error element\n error = $(\"<\" + this.settings.errorElement + \">\").attr(\"id\", elementID + \"-error\").addClass(this.settings.errorClass).html(message || \"\"); // Maintain reference to the element to be placed into the DOM\n\n place = error;\n\n if (this.settings.wrapper) {\n // Make sure the element is visible, even in IE\n // actually showing the wrapped element is handled elsewhere\n place = error.hide().show().wrap(\"<\" + this.settings.wrapper + \"/>\").parent();\n }\n\n if (this.labelContainer.length) {\n this.labelContainer.append(place);\n } else if (this.settings.errorPlacement) {\n this.settings.errorPlacement.call(this, place, $(element));\n } else {\n place.insertAfter(element);\n } // Link error back to the element\n\n\n if (error.is(\"label\")) {\n // If the error is a label, then associate using 'for'\n error.attr(\"for\", elementID); // If the element is not a child of an associated label, then it's necessary\n // to explicitly apply aria-describedby\n } else if (error.parents(\"label[for='\" + this.escapeCssMeta(elementID) + \"']\").length === 0) {\n errorID = error.attr(\"id\"); // Respect existing non-error aria-describedby\n\n if (!describedBy) {\n describedBy = errorID;\n } else if (!describedBy.match(new RegExp(\"\\\\b\" + this.escapeCssMeta(errorID) + \"\\\\b\"))) {\n // Add to end of list if not already present\n describedBy += \" \" + errorID;\n }\n\n $(element).attr(\"aria-describedby\", describedBy); // If this element is grouped, then assign to all elements in the same group\n\n group = this.groups[element.name];\n\n if (group) {\n v = this;\n $.each(v.groups, function (name, testgroup) {\n if (testgroup === group) {\n $(\"[name='\" + v.escapeCssMeta(name) + \"']\", v.currentForm).attr(\"aria-describedby\", error.attr(\"id\"));\n }\n });\n }\n }\n }\n\n if (!message && this.settings.success) {\n error.text(\"\");\n\n if (typeof this.settings.success === \"string\") {\n error.addClass(this.settings.success);\n } else {\n this.settings.success(error, element);\n }\n }\n\n this.toShow = this.toShow.add(error);\n },\n errorsFor: function errorsFor(element) {\n var name = this.escapeCssMeta(this.idOrName(element)),\n describer = $(element).attr(\"aria-describedby\"),\n selector = \"label[for='\" + name + \"'], label[for='\" + name + \"'] *\"; // 'aria-describedby' should directly reference the error element\n\n if (describer) {\n selector = selector + \", #\" + this.escapeCssMeta(describer).replace(/\\s+/g, \", #\");\n }\n\n return this.errors().filter(selector);\n },\n // See https://api.jquery.com/category/selectors/, for CSS\n // meta-characters that should be escaped in order to be used with JQuery\n // as a literal part of a name/id or any selector.\n escapeCssMeta: function escapeCssMeta(string) {\n return string.replace(/([\\\\!\"#$%&'()*+,./:;<=>?@\\[\\]^`{|}~])/g, \"\\\\$1\");\n },\n idOrName: function idOrName(element) {\n return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name);\n },\n validationTargetFor: function validationTargetFor(element) {\n // If radio/checkbox, validate first element in group instead\n if (this.checkable(element)) {\n element = this.findByName(element.name);\n } // Always apply ignore filter\n\n\n return $(element).not(this.settings.ignore)[0];\n },\n checkable: function checkable(element) {\n return /radio|checkbox/i.test(element.type);\n },\n findByName: function findByName(name) {\n return $(this.currentForm).find(\"[name='\" + this.escapeCssMeta(name) + \"']\");\n },\n getLength: function getLength(value, element) {\n switch (element.nodeName.toLowerCase()) {\n case \"select\":\n return $(\"option:selected\", element).length;\n\n case \"input\":\n if (this.checkable(element)) {\n return this.findByName(element.name).filter(\":checked\").length;\n }\n\n }\n\n return value.length;\n },\n depend: function depend(param, element) {\n return this.dependTypes[_typeof(param)] ? this.dependTypes[_typeof(param)](param, element) : true;\n },\n dependTypes: {\n \"boolean\": function boolean(param) {\n return param;\n },\n \"string\": function string(param, element) {\n return !!$(param, element.form).length;\n },\n \"function\": function _function(param, element) {\n return param(element);\n }\n },\n optional: function optional(element) {\n var val = this.elementValue(element);\n return !$.validator.methods.required.call(this, val, element) && \"dependency-mismatch\";\n },\n startRequest: function startRequest(element) {\n if (!this.pending[element.name]) {\n this.pendingRequest++;\n $(element).addClass(this.settings.pendingClass);\n this.pending[element.name] = true;\n }\n },\n stopRequest: function stopRequest(element, valid) {\n this.pendingRequest--; // Sometimes synchronization fails, make sure pendingRequest is never < 0\n\n if (this.pendingRequest < 0) {\n this.pendingRequest = 0;\n }\n\n delete this.pending[element.name];\n $(element).removeClass(this.settings.pendingClass);\n\n if (valid && this.pendingRequest === 0 && this.formSubmitted && this.form()) {\n $(this.currentForm).submit(); // Remove the hidden input that was used as a replacement for the\n // missing submit button. The hidden input is added by `handle()`\n // to ensure that the value of the used submit button is passed on\n // for scripted submits triggered by this method\n\n if (this.submitButton) {\n $(\"input:hidden[name='\" + this.submitButton.name + \"']\", this.currentForm).remove();\n }\n\n this.formSubmitted = false;\n } else if (!valid && this.pendingRequest === 0 && this.formSubmitted) {\n $(this.currentForm).triggerHandler(\"invalid-form\", [this]);\n this.formSubmitted = false;\n }\n },\n previousValue: function previousValue(element, method) {\n method = typeof method === \"string\" && method || \"remote\";\n return $.data(element, \"previousValue\") || $.data(element, \"previousValue\", {\n old: null,\n valid: true,\n message: this.defaultMessage(element, {\n method: method\n })\n });\n },\n // Cleans up all forms and elements, removes validator-specific events\n destroy: function destroy() {\n this.resetForm();\n $(this.currentForm).off(\".validate\").removeData(\"validator\").find(\".validate-equalTo-blur\").off(\".validate-equalTo\").removeClass(\"validate-equalTo-blur\").find(\".validate-lessThan-blur\").off(\".validate-lessThan\").removeClass(\"validate-lessThan-blur\").find(\".validate-lessThanEqual-blur\").off(\".validate-lessThanEqual\").removeClass(\"validate-lessThanEqual-blur\").find(\".validate-greaterThanEqual-blur\").off(\".validate-greaterThanEqual\").removeClass(\"validate-greaterThanEqual-blur\").find(\".validate-greaterThan-blur\").off(\".validate-greaterThan\").removeClass(\"validate-greaterThan-blur\");\n }\n },\n classRuleSettings: {\n required: {\n required: true\n },\n email: {\n email: true\n },\n url: {\n url: true\n },\n date: {\n date: true\n },\n dateISO: {\n dateISO: true\n },\n number: {\n number: true\n },\n digits: {\n digits: true\n },\n creditcard: {\n creditcard: true\n }\n },\n addClassRules: function addClassRules(className, rules) {\n if (className.constructor === String) {\n this.classRuleSettings[className] = rules;\n } else {\n $.extend(this.classRuleSettings, className);\n }\n },\n classRules: function classRules(element) {\n var rules = {},\n classes = $(element).attr(\"class\");\n\n if (classes) {\n $.each(classes.split(\" \"), function () {\n if (this in $.validator.classRuleSettings) {\n $.extend(rules, $.validator.classRuleSettings[this]);\n }\n });\n }\n\n return rules;\n },\n normalizeAttributeRule: function normalizeAttributeRule(rules, type, method, value) {\n // Convert the value to a number for number inputs, and for text for backwards compability\n // allows type=\"date\" and others to be compared as strings\n if (/min|max|step/.test(method) && (type === null || /number|range|text/.test(type))) {\n value = Number(value); // Support Opera Mini, which returns NaN for undefined minlength\n\n if (isNaN(value)) {\n value = undefined;\n }\n }\n\n if (value || value === 0) {\n rules[method] = value;\n } else if (type === method && type !== \"range\") {\n // Exception: the jquery validate 'range' method\n // does not test for the html5 'range' type\n rules[method] = true;\n }\n },\n attributeRules: function attributeRules(element) {\n var rules = {},\n $element = $(element),\n type = element.getAttribute(\"type\"),\n method,\n value;\n\n for (method in $.validator.methods) {\n // Support for in both html5 and older browsers\n if (method === \"required\") {\n value = element.getAttribute(method); // Some browsers return an empty string for the required attribute\n // and non-HTML5 browsers might have required=\"\" markup\n\n if (value === \"\") {\n value = true;\n } // Force non-HTML5 browsers to return bool\n\n\n value = !!value;\n } else {\n value = $element.attr(method);\n }\n\n this.normalizeAttributeRule(rules, type, method, value);\n } // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs\n\n\n if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) {\n delete rules.maxlength;\n }\n\n return rules;\n },\n dataRules: function dataRules(element) {\n var rules = {},\n $element = $(element),\n type = element.getAttribute(\"type\"),\n method,\n value;\n\n for (method in $.validator.methods) {\n value = $element.data(\"rule\" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase()); // Cast empty attributes like `data-rule-required` to `true`\n\n if (value === \"\") {\n value = true;\n }\n\n this.normalizeAttributeRule(rules, type, method, value);\n }\n\n return rules;\n },\n staticRules: function staticRules(element) {\n var rules = {},\n validator = $.data(element.form, \"validator\");\n\n if (validator.settings.rules) {\n rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {};\n }\n\n return rules;\n },\n normalizeRules: function normalizeRules(rules, element) {\n // Handle dependency check\n $.each(rules, function (prop, val) {\n // Ignore rule when param is explicitly false, eg. required:false\n if (val === false) {\n delete rules[prop];\n return;\n }\n\n if (val.param || val.depends) {\n var keepRule = true;\n\n switch (_typeof(val.depends)) {\n case \"string\":\n keepRule = !!$(val.depends, element.form).length;\n break;\n\n case \"function\":\n keepRule = val.depends.call(element, element);\n break;\n }\n\n if (keepRule) {\n rules[prop] = val.param !== undefined ? val.param : true;\n } else {\n $.data(element.form, \"validator\").resetElements($(element));\n delete rules[prop];\n }\n }\n }); // Evaluate parameters\n\n $.each(rules, function (rule, parameter) {\n rules[rule] = $.isFunction(parameter) && rule !== \"normalizer\" ? parameter(element) : parameter;\n }); // Clean number parameters\n\n $.each([\"minlength\", \"maxlength\"], function () {\n if (rules[this]) {\n rules[this] = Number(rules[this]);\n }\n });\n $.each([\"rangelength\", \"range\"], function () {\n var parts;\n\n if (rules[this]) {\n if ($.isArray(rules[this])) {\n rules[this] = [Number(rules[this][0]), Number(rules[this][1])];\n } else if (typeof rules[this] === \"string\") {\n parts = rules[this].replace(/[\\[\\]]/g, \"\").split(/[\\s,]+/);\n rules[this] = [Number(parts[0]), Number(parts[1])];\n }\n }\n });\n\n if ($.validator.autoCreateRanges) {\n // Auto-create ranges\n if (rules.min != null && rules.max != null) {\n rules.range = [rules.min, rules.max];\n delete rules.min;\n delete rules.max;\n }\n\n if (rules.minlength != null && rules.maxlength != null) {\n rules.rangelength = [rules.minlength, rules.maxlength];\n delete rules.minlength;\n delete rules.maxlength;\n }\n }\n\n return rules;\n },\n // Converts a simple string to a {string: true} rule, e.g., \"required\" to {required:true}\n normalizeRule: function normalizeRule(data) {\n if (typeof data === \"string\") {\n var transformed = {};\n $.each(data.split(/\\s/), function () {\n transformed[this] = true;\n });\n data = transformed;\n }\n\n return data;\n },\n // https://jqueryvalidation.org/jQuery.validator.addMethod/\n addMethod: function addMethod(name, method, message) {\n $.validator.methods[name] = method;\n $.validator.messages[name] = message !== undefined ? message : $.validator.messages[name];\n\n if (method.length < 3) {\n $.validator.addClassRules(name, $.validator.normalizeRule(name));\n }\n },\n // https://jqueryvalidation.org/jQuery.validator.methods/\n methods: {\n // https://jqueryvalidation.org/required-method/\n required: function required(value, element, param) {\n // Check if dependency is met\n if (!this.depend(param, element)) {\n return \"dependency-mismatch\";\n }\n\n if (element.nodeName.toLowerCase() === \"select\") {\n // Could be an array for select-multiple or a string, both are fine this way\n var val = $(element).val();\n return val && val.length > 0;\n }\n\n if (this.checkable(element)) {\n return this.getLength(value, element) > 0;\n }\n\n return value !== undefined && value !== null && value.length > 0;\n },\n // https://jqueryvalidation.org/email-method/\n email: function email(value, element) {\n // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address\n // Retrieved 2014-01-14\n // If you have a problem with this implementation, report a bug against the above spec\n // Or use custom methods to implement your own email validation\n return this.optional(element) || /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);\n },\n // https://jqueryvalidation.org/url-method/\n url: function url(value, element) {\n // Copyright (c) 2010-2013 Diego Perini, MIT licensed\n // https://gist.github.com/dperini/729294\n // see also https://mathiasbynens.be/demo/url-regex\n // modified to allow protocol-relative URLs\n return this.optional(element) || /^(?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})).?)(?::\\d{2,5})?(?:[/?#]\\S*)?$/i.test(value);\n },\n // https://jqueryvalidation.org/date-method/\n date: function () {\n var called = false;\n return function (value, element) {\n if (!called) {\n called = true;\n\n if (this.settings.debug && window.console) {\n console.warn(\"The `date` method is deprecated and will be removed in version '2.0.0'.\\n\" + \"Please don't use it, since it relies on the Date constructor, which\\n\" + \"behaves very differently across browsers and locales. Use `dateISO`\\n\" + \"instead or one of the locale specific methods in `localizations/`\\n\" + \"and `additional-methods.js`.\");\n }\n }\n\n return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString());\n };\n }(),\n // https://jqueryvalidation.org/dateISO-method/\n dateISO: function dateISO(value, element) {\n return this.optional(element) || /^\\d{4}[\\/\\-](0?[1-9]|1[012])[\\/\\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);\n },\n // https://jqueryvalidation.org/number-method/\n number: function number(value, element) {\n return this.optional(element) || /^(?:-?\\d+|-?\\d{1,3}(?:,\\d{3})+)?(?:\\.\\d+)?$/.test(value);\n },\n // https://jqueryvalidation.org/digits-method/\n digits: function digits(value, element) {\n return this.optional(element) || /^\\d+$/.test(value);\n },\n // https://jqueryvalidation.org/minlength-method/\n minlength: function minlength(value, element, param) {\n var length = $.isArray(value) ? value.length : this.getLength(value, element);\n return this.optional(element) || length >= param;\n },\n // https://jqueryvalidation.org/maxlength-method/\n maxlength: function maxlength(value, element, param) {\n var length = $.isArray(value) ? value.length : this.getLength(value, element);\n return this.optional(element) || length <= param;\n },\n // https://jqueryvalidation.org/rangelength-method/\n rangelength: function rangelength(value, element, param) {\n var length = $.isArray(value) ? value.length : this.getLength(value, element);\n return this.optional(element) || length >= param[0] && length <= param[1];\n },\n // https://jqueryvalidation.org/min-method/\n min: function min(value, element, param) {\n return this.optional(element) || value >= param;\n },\n // https://jqueryvalidation.org/max-method/\n max: function max(value, element, param) {\n return this.optional(element) || value <= param;\n },\n // https://jqueryvalidation.org/range-method/\n range: function range(value, element, param) {\n return this.optional(element) || value >= param[0] && value <= param[1];\n },\n // https://jqueryvalidation.org/step-method/\n step: function step(value, element, param) {\n var type = $(element).attr(\"type\"),\n errorMessage = \"Step attribute on input type \" + type + \" is not supported.\",\n supportedTypes = [\"text\", \"number\", \"range\"],\n re = new RegExp(\"\\\\b\" + type + \"\\\\b\"),\n notSupported = type && !re.test(supportedTypes.join()),\n decimalPlaces = function decimalPlaces(num) {\n var match = (\"\" + num).match(/(?:\\.(\\d+))?$/);\n\n if (!match) {\n return 0;\n } // Number of digits right of decimal point.\n\n\n return match[1] ? match[1].length : 0;\n },\n toInt = function toInt(num) {\n return Math.round(num * Math.pow(10, decimals));\n },\n valid = true,\n decimals; // Works only for text, number and range input types\n // TODO find a way to support input types date, datetime, datetime-local, month, time and week\n\n\n if (notSupported) {\n throw new Error(errorMessage);\n }\n\n decimals = decimalPlaces(param); // Value can't have too many decimals\n\n if (decimalPlaces(value) > decimals || toInt(value) % toInt(param) !== 0) {\n valid = false;\n }\n\n return this.optional(element) || valid;\n },\n // https://jqueryvalidation.org/equalTo-method/\n equalTo: function equalTo(value, element, param) {\n // Bind to the blur event of the target in order to revalidate whenever the target field is updated\n var target = $(param);\n\n if (this.settings.onfocusout && target.not(\".validate-equalTo-blur\").length) {\n target.addClass(\"validate-equalTo-blur\").on(\"blur.validate-equalTo\", function () {\n $(element).valid();\n });\n }\n\n return value === target.val();\n },\n // https://jqueryvalidation.org/remote-method/\n remote: function remote(value, element, param, method) {\n if (this.optional(element)) {\n return \"dependency-mismatch\";\n }\n\n method = typeof method === \"string\" && method || \"remote\";\n var previous = this.previousValue(element, method),\n validator,\n data,\n optionDataString;\n\n if (!this.settings.messages[element.name]) {\n this.settings.messages[element.name] = {};\n }\n\n previous.originalMessage = previous.originalMessage || this.settings.messages[element.name][method];\n this.settings.messages[element.name][method] = previous.message;\n param = typeof param === \"string\" && {\n url: param\n } || param;\n optionDataString = $.param($.extend({\n data: value\n }, param.data));\n\n if (previous.old === optionDataString) {\n return previous.valid;\n }\n\n previous.old = optionDataString;\n validator = this;\n this.startRequest(element);\n data = {};\n data[element.name] = value;\n $.ajax($.extend(true, {\n mode: \"abort\",\n port: \"validate\" + element.name,\n dataType: \"json\",\n data: data,\n context: validator.currentForm,\n success: function success(response) {\n var valid = response === true || response === \"true\",\n errors,\n message,\n submitted;\n validator.settings.messages[element.name][method] = previous.originalMessage;\n\n if (valid) {\n submitted = validator.formSubmitted;\n validator.resetInternals();\n validator.toHide = validator.errorsFor(element);\n validator.formSubmitted = submitted;\n validator.successList.push(element);\n validator.invalid[element.name] = false;\n validator.showErrors();\n } else {\n errors = {};\n message = response || validator.defaultMessage(element, {\n method: method,\n parameters: value\n });\n errors[element.name] = previous.message = message;\n validator.invalid[element.name] = true;\n validator.showErrors(errors);\n }\n\n previous.valid = valid;\n validator.stopRequest(element, valid);\n }\n }, param));\n return \"pending\";\n }\n }\n }); // Ajax mode: abort\n // usage: $.ajax({ mode: \"abort\"[, port: \"uniqueport\"]});\n // if mode:\"abort\" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()\n\n var pendingRequests = {},\n ajax; // Use a prefilter if available (1.5+)\n\n if ($.ajaxPrefilter) {\n $.ajaxPrefilter(function (settings, _, xhr) {\n var port = settings.port;\n\n if (settings.mode === \"abort\") {\n if (pendingRequests[port]) {\n pendingRequests[port].abort();\n }\n\n pendingRequests[port] = xhr;\n }\n });\n } else {\n // Proxy ajax\n ajax = $.ajax;\n\n $.ajax = function (settings) {\n var mode = (\"mode\" in settings ? settings : $.ajaxSettings).mode,\n port = (\"port\" in settings ? settings : $.ajaxSettings).port;\n\n if (mode === \"abort\") {\n if (pendingRequests[port]) {\n pendingRequests[port].abort();\n }\n\n pendingRequests[port] = ajax.apply(this, arguments);\n return pendingRequests[port];\n }\n\n return ajax.apply(this, arguments);\n };\n }\n\n return $;\n});","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*!\n * jQuery JavaScript Library v3.5.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2020-05-04T22:49Z\n */\n(function (global, factory) {\n \"use strict\";\n\n if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === \"object\" && _typeof(module.exports) === \"object\") {\n // For CommonJS and CommonJS-like environments where a proper `window`\n // is present, execute the factory and get jQuery.\n // For environments that do not have a `window` with a `document`\n // (such as Node.js), expose a factory as module.exports.\n // This accentuates the need for the creation of a real `window`.\n // e.g. var jQuery = require(\"jquery\")(window);\n // See ticket #14549 for more info.\n module.exports = global.document ? factory(global, true) : function (w) {\n if (!w.document) {\n throw new Error(\"jQuery requires a window with a document\");\n }\n\n return factory(w);\n };\n } else {\n factory(global);\n } // Pass this if window is not defined yet\n\n})(typeof window !== \"undefined\" ? window : this, function (window, noGlobal) {\n // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n // enough that all such attempts are guarded in a try block.\n \"use strict\";\n\n var arr = [];\n var getProto = Object.getPrototypeOf;\n var _slice = arr.slice;\n var flat = arr.flat ? function (array) {\n return arr.flat.call(array);\n } : function (array) {\n return arr.concat.apply([], array);\n };\n var push = arr.push;\n var indexOf = arr.indexOf;\n var class2type = {};\n var toString = class2type.toString;\n var hasOwn = class2type.hasOwnProperty;\n var fnToString = hasOwn.toString;\n var ObjectFunctionString = fnToString.call(Object);\n var support = {};\n\n var isFunction = function isFunction(obj) {\n // Support: Chrome <=57, Firefox <=52\n // In some browsers, typeof returns \"function\" for HTML elements\n // (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n // We don't want to classify *any* DOM node as a function.\n return typeof obj === \"function\" && typeof obj.nodeType !== \"number\";\n };\n\n var isWindow = function isWindow(obj) {\n return obj != null && obj === obj.window;\n };\n\n var document = window.document;\n var preservedScriptAttributes = {\n type: true,\n src: true,\n nonce: true,\n noModule: true\n };\n\n function DOMEval(code, node, doc) {\n doc = doc || document;\n var i,\n val,\n script = doc.createElement(\"script\");\n script.text = code;\n\n if (node) {\n for (i in preservedScriptAttributes) {\n // Support: Firefox 64+, Edge 18+\n // Some browsers don't support the \"nonce\" property on scripts.\n // On the other hand, just using `getAttribute` is not enough as\n // the `nonce` attribute is reset to an empty string whenever it\n // becomes browsing-context connected.\n // See https://github.com/whatwg/html/issues/2369\n // See https://html.spec.whatwg.org/#nonce-attributes\n // The `node.getAttribute` check was added for the sake of\n // `jQuery.globalEval` so that it can fake a nonce-containing node\n // via an object.\n val = node[i] || node.getAttribute && node.getAttribute(i);\n\n if (val) {\n script.setAttribute(i, val);\n }\n }\n }\n\n doc.head.appendChild(script).parentNode.removeChild(script);\n }\n\n function toType(obj) {\n if (obj == null) {\n return obj + \"\";\n } // Support: Android <=2.3 only (functionish RegExp)\n\n\n return _typeof(obj) === \"object\" || typeof obj === \"function\" ? class2type[toString.call(obj)] || \"object\" : _typeof(obj);\n }\n /* global Symbol */\n // Defining this global in .eslintrc.json would create a danger of using the global\n // unguarded in another place, it seems safer to define global only for this module\n\n\n var version = \"3.5.1\",\n // Define a local copy of jQuery\n jQuery = function jQuery(selector, context) {\n // The jQuery object is actually just the init constructor 'enhanced'\n // Need init if jQuery is called (just allow error to be thrown if not included)\n return new jQuery.fn.init(selector, context);\n };\n\n jQuery.fn = jQuery.prototype = {\n // The current version of jQuery being used\n jquery: version,\n constructor: jQuery,\n // The default length of a jQuery object is 0\n length: 0,\n toArray: function toArray() {\n return _slice.call(this);\n },\n // Get the Nth element in the matched element set OR\n // Get the whole matched element set as a clean array\n get: function get(num) {\n // Return all the elements in a clean array\n if (num == null) {\n return _slice.call(this);\n } // Return just the one element from the set\n\n\n return num < 0 ? this[num + this.length] : this[num];\n },\n // Take an array of elements and push it onto the stack\n // (returning the new matched element set)\n pushStack: function pushStack(elems) {\n // Build a new jQuery matched element set\n var ret = jQuery.merge(this.constructor(), elems); // Add the old object onto the stack (as a reference)\n\n ret.prevObject = this; // Return the newly-formed element set\n\n return ret;\n },\n // Execute a callback for every element in the matched set.\n each: function each(callback) {\n return jQuery.each(this, callback);\n },\n map: function map(callback) {\n return this.pushStack(jQuery.map(this, function (elem, i) {\n return callback.call(elem, i, elem);\n }));\n },\n slice: function slice() {\n return this.pushStack(_slice.apply(this, arguments));\n },\n first: function first() {\n return this.eq(0);\n },\n last: function last() {\n return this.eq(-1);\n },\n even: function even() {\n return this.pushStack(jQuery.grep(this, function (_elem, i) {\n return (i + 1) % 2;\n }));\n },\n odd: function odd() {\n return this.pushStack(jQuery.grep(this, function (_elem, i) {\n return i % 2;\n }));\n },\n eq: function eq(i) {\n var len = this.length,\n j = +i + (i < 0 ? len : 0);\n return this.pushStack(j >= 0 && j < len ? [this[j]] : []);\n },\n end: function end() {\n return this.prevObject || this.constructor();\n },\n // For internal use only.\n // Behaves like an Array's method, not like a jQuery method.\n push: push,\n sort: arr.sort,\n splice: arr.splice\n };\n\n jQuery.extend = jQuery.fn.extend = function () {\n var options,\n name,\n src,\n copy,\n copyIsArray,\n clone,\n target = arguments[0] || {},\n i = 1,\n length = arguments.length,\n deep = false; // Handle a deep copy situation\n\n if (typeof target === \"boolean\") {\n deep = target; // Skip the boolean and the target\n\n target = arguments[i] || {};\n i++;\n } // Handle case when target is a string or something (possible in deep copy)\n\n\n if (_typeof(target) !== \"object\" && !isFunction(target)) {\n target = {};\n } // Extend jQuery itself if only one argument is passed\n\n\n if (i === length) {\n target = this;\n i--;\n }\n\n for (; i < length; i++) {\n // Only deal with non-null/undefined values\n if ((options = arguments[i]) != null) {\n // Extend the base object\n for (name in options) {\n copy = options[name]; // Prevent Object.prototype pollution\n // Prevent never-ending loop\n\n if (name === \"__proto__\" || target === copy) {\n continue;\n } // Recurse if we're merging plain objects or arrays\n\n\n if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {\n src = target[name]; // Ensure proper type for the source value\n\n if (copyIsArray && !Array.isArray(src)) {\n clone = [];\n } else if (!copyIsArray && !jQuery.isPlainObject(src)) {\n clone = {};\n } else {\n clone = src;\n }\n\n copyIsArray = false; // Never move original objects, clone them\n\n target[name] = jQuery.extend(deep, clone, copy); // Don't bring in undefined values\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n } // Return the modified object\n\n\n return target;\n };\n\n jQuery.extend({\n // Unique for each copy of jQuery on the page\n expando: \"jQuery\" + (version + Math.random()).replace(/\\D/g, \"\"),\n // Assume jQuery is ready without the ready module\n isReady: true,\n error: function error(msg) {\n throw new Error(msg);\n },\n noop: function noop() {},\n isPlainObject: function isPlainObject(obj) {\n var proto, Ctor; // Detect obvious negatives\n // Use toString instead of jQuery.type to catch host objects\n\n if (!obj || toString.call(obj) !== \"[object Object]\") {\n return false;\n }\n\n proto = getProto(obj); // Objects with no prototype (e.g., `Object.create( null )`) are plain\n\n if (!proto) {\n return true;\n } // Objects with prototype are plain iff they were constructed by a global Object function\n\n\n Ctor = hasOwn.call(proto, \"constructor\") && proto.constructor;\n return typeof Ctor === \"function\" && fnToString.call(Ctor) === ObjectFunctionString;\n },\n isEmptyObject: function isEmptyObject(obj) {\n var name;\n\n for (name in obj) {\n return false;\n }\n\n return true;\n },\n // Evaluates a script in a provided context; falls back to the global one\n // if not specified.\n globalEval: function globalEval(code, options, doc) {\n DOMEval(code, {\n nonce: options && options.nonce\n }, doc);\n },\n each: function each(obj, callback) {\n var length,\n i = 0;\n\n if (isArrayLike(obj)) {\n length = obj.length;\n\n for (; i < length; i++) {\n if (callback.call(obj[i], i, obj[i]) === false) {\n break;\n }\n }\n } else {\n for (i in obj) {\n if (callback.call(obj[i], i, obj[i]) === false) {\n break;\n }\n }\n }\n\n return obj;\n },\n // results is for internal usage only\n makeArray: function makeArray(arr, results) {\n var ret = results || [];\n\n if (arr != null) {\n if (isArrayLike(Object(arr))) {\n jQuery.merge(ret, typeof arr === \"string\" ? [arr] : arr);\n } else {\n push.call(ret, arr);\n }\n }\n\n return ret;\n },\n inArray: function inArray(elem, arr, i) {\n return arr == null ? -1 : indexOf.call(arr, elem, i);\n },\n // Support: Android <=4.0 only, PhantomJS 1 only\n // push.apply(_, arraylike) throws on ancient WebKit\n merge: function merge(first, second) {\n var len = +second.length,\n j = 0,\n i = first.length;\n\n for (; j < len; j++) {\n first[i++] = second[j];\n }\n\n first.length = i;\n return first;\n },\n grep: function grep(elems, callback, invert) {\n var callbackInverse,\n matches = [],\n i = 0,\n length = elems.length,\n callbackExpect = !invert; // Go through the array, only saving the items\n // that pass the validator function\n\n for (; i < length; i++) {\n callbackInverse = !callback(elems[i], i);\n\n if (callbackInverse !== callbackExpect) {\n matches.push(elems[i]);\n }\n }\n\n return matches;\n },\n // arg is for internal usage only\n map: function map(elems, callback, arg) {\n var length,\n value,\n i = 0,\n ret = []; // Go through the array, translating each of the items to their new values\n\n if (isArrayLike(elems)) {\n length = elems.length;\n\n for (; i < length; i++) {\n value = callback(elems[i], i, arg);\n\n if (value != null) {\n ret.push(value);\n }\n } // Go through every key on the object,\n\n } else {\n for (i in elems) {\n value = callback(elems[i], i, arg);\n\n if (value != null) {\n ret.push(value);\n }\n }\n } // Flatten any nested arrays\n\n\n return flat(ret);\n },\n // A global GUID counter for objects\n guid: 1,\n // jQuery.support is not used in Core but other projects attach their\n // properties to it so it needs to exist.\n support: support\n });\n\n if (typeof Symbol === \"function\") {\n jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];\n } // Populate the class2type map\n\n\n jQuery.each(\"Boolean Number String Function Array Date RegExp Object Error Symbol\".split(\" \"), function (_i, name) {\n class2type[\"[object \" + name + \"]\"] = name.toLowerCase();\n });\n\n function isArrayLike(obj) {\n // Support: real iOS 8.2 only (not reproducible in simulator)\n // `in` check used to prevent JIT error (gh-2145)\n // hasOwn isn't used here due to false negatives\n // regarding Nodelist length in IE\n var length = !!obj && \"length\" in obj && obj.length,\n type = toType(obj);\n\n if (isFunction(obj) || isWindow(obj)) {\n return false;\n }\n\n return type === \"array\" || length === 0 || typeof length === \"number\" && length > 0 && length - 1 in obj;\n }\n\n var Sizzle =\n /*!\n * Sizzle CSS Selector Engine v2.3.5\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://js.foundation/\n *\n * Date: 2020-03-14\n */\n function (window) {\n var i,\n support,\n Expr,\n getText,\n isXML,\n tokenize,\n compile,\n select,\n outermostContext,\n sortInput,\n hasDuplicate,\n // Local document vars\n setDocument,\n document,\n docElem,\n documentIsHTML,\n rbuggyQSA,\n rbuggyMatches,\n matches,\n contains,\n // Instance-specific data\n expando = \"sizzle\" + 1 * new Date(),\n preferredDoc = window.document,\n dirruns = 0,\n done = 0,\n classCache = createCache(),\n tokenCache = createCache(),\n compilerCache = createCache(),\n nonnativeSelectorCache = createCache(),\n sortOrder = function sortOrder(a, b) {\n if (a === b) {\n hasDuplicate = true;\n }\n\n return 0;\n },\n // Instance methods\n hasOwn = {}.hasOwnProperty,\n arr = [],\n pop = arr.pop,\n pushNative = arr.push,\n push = arr.push,\n slice = arr.slice,\n // Use a stripped-down indexOf as it's faster than native\n // https://jsperf.com/thor-indexof-vs-for/5\n indexOf = function indexOf(list, elem) {\n var i = 0,\n len = list.length;\n\n for (; i < len; i++) {\n if (list[i] === elem) {\n return i;\n }\n }\n\n return -1;\n },\n booleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|\" + \"ismap|loop|multiple|open|readonly|required|scoped\",\n // Regular expressions\n // http://www.w3.org/TR/css3-selectors/#whitespace\n whitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n identifier = \"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace + \"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",\n // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n attributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace + // Operator (capture 2)\n \"*([*^$|!~]?=)\" + whitespace + // \"Attribute values must be CSS identifiers [capture 5]\n // or strings [capture 3 or capture 4]\"\n \"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" + whitespace + \"*\\\\]\",\n pseudos = \":(\" + identifier + \")(?:\\\\((\" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n // 1. quoted (capture 3; capture 4 or capture 5)\n \"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" + // 2. simple (capture 6)\n \"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" + // 3. anything else (capture 2)\n \".*\" + \")\\\\)|)\",\n // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n rwhitespace = new RegExp(whitespace + \"+\", \"g\"),\n rtrim = new RegExp(\"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\"),\n rcomma = new RegExp(\"^\" + whitespace + \"*,\" + whitespace + \"*\"),\n rcombinators = new RegExp(\"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\"),\n rdescend = new RegExp(whitespace + \"|>\"),\n rpseudo = new RegExp(pseudos),\n ridentifier = new RegExp(\"^\" + identifier + \"$\"),\n matchExpr = {\n \"ID\": new RegExp(\"^#(\" + identifier + \")\"),\n \"CLASS\": new RegExp(\"^\\\\.(\" + identifier + \")\"),\n \"TAG\": new RegExp(\"^(\" + identifier + \"|[*])\"),\n \"ATTR\": new RegExp(\"^\" + attributes),\n \"PSEUDO\": new RegExp(\"^\" + pseudos),\n \"CHILD\": new RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace + \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\"),\n \"bool\": new RegExp(\"^(?:\" + booleans + \")$\", \"i\"),\n // For use in libraries implementing .is()\n // We use this for POS matching in `select`\n \"needsContext\": new RegExp(\"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + whitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\")\n },\n rhtml = /HTML$/i,\n rinputs = /^(?:input|select|textarea|button)$/i,\n rheader = /^h\\d$/i,\n rnative = /^[^{]+\\{\\s*\\[native \\w/,\n // Easily-parseable/retrievable ID or TAG or CLASS selectors\n rquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n rsibling = /[+~]/,\n // CSS escapes\n // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n runescape = new RegExp(\"\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace + \"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\", \"g\"),\n funescape = function funescape(escape, nonHex) {\n var high = \"0x\" + escape.slice(1) - 0x10000;\n return nonHex ? // Strip the backslash prefix from a non-hex escape sequence\n nonHex : // Replace a hexadecimal escape sequence with the encoded Unicode code point\n // Support: IE <=11+\n // For values outside the Basic Multilingual Plane (BMP), manually construct a\n // surrogate pair\n high < 0 ? String.fromCharCode(high + 0x10000) : String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);\n },\n // CSS string/identifier serialization\n // https://drafts.csswg.org/cssom/#common-serializing-idioms\n rcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n fcssescape = function fcssescape(ch, asCodePoint) {\n if (asCodePoint) {\n // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n if (ch === \"\\0\") {\n return \"\\uFFFD\";\n } // Control characters and (dependent upon position) numbers get escaped as code points\n\n\n return ch.slice(0, -1) + \"\\\\\" + ch.charCodeAt(ch.length - 1).toString(16) + \" \";\n } // Other potentially-special ASCII characters get backslash-escaped\n\n\n return \"\\\\\" + ch;\n },\n // Used for iframes\n // See setDocument()\n // Removing the function wrapper causes a \"Permission Denied\"\n // error in IE\n unloadHandler = function unloadHandler() {\n setDocument();\n },\n inDisabledFieldset = addCombinator(function (elem) {\n return elem.disabled === true && elem.nodeName.toLowerCase() === \"fieldset\";\n }, {\n dir: \"parentNode\",\n next: \"legend\"\n }); // Optimize for push.apply( _, NodeList )\n\n\n try {\n push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes); // Support: Android<4.0\n // Detect silently failing push.apply\n // eslint-disable-next-line no-unused-expressions\n\n arr[preferredDoc.childNodes.length].nodeType;\n } catch (e) {\n push = {\n apply: arr.length ? // Leverage slice if possible\n function (target, els) {\n pushNative.apply(target, slice.call(els));\n } : // Support: IE<9\n // Otherwise append directly\n function (target, els) {\n var j = target.length,\n i = 0; // Can't trust NodeList.length\n\n while (target[j++] = els[i++]) {}\n\n target.length = j - 1;\n }\n };\n }\n\n function Sizzle(selector, context, results, seed) {\n var m,\n i,\n elem,\n nid,\n match,\n groups,\n newSelector,\n newContext = context && context.ownerDocument,\n // nodeType defaults to 9, since context defaults to document\n nodeType = context ? context.nodeType : 9;\n results = results || []; // Return early from calls with invalid selector or context\n\n if (typeof selector !== \"string\" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {\n return results;\n } // Try to shortcut find operations (as opposed to filters) in HTML documents\n\n\n if (!seed) {\n setDocument(context);\n context = context || document;\n\n if (documentIsHTML) {\n // If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n // (excepting DocumentFragment context, where the methods don't exist)\n if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {\n // ID selector\n if (m = match[1]) {\n // Document context\n if (nodeType === 9) {\n if (elem = context.getElementById(m)) {\n // Support: IE, Opera, Webkit\n // TODO: identify versions\n // getElementById can match elements by name instead of ID\n if (elem.id === m) {\n results.push(elem);\n return results;\n }\n } else {\n return results;\n } // Element context\n\n } else {\n // Support: IE, Opera, Webkit\n // TODO: identify versions\n // getElementById can match elements by name instead of ID\n if (newContext && (elem = newContext.getElementById(m)) && contains(context, elem) && elem.id === m) {\n results.push(elem);\n return results;\n }\n } // Type selector\n\n } else if (match[2]) {\n push.apply(results, context.getElementsByTagName(selector));\n return results; // Class selector\n } else if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) {\n push.apply(results, context.getElementsByClassName(m));\n return results;\n }\n } // Take advantage of querySelectorAll\n\n\n if (support.qsa && !nonnativeSelectorCache[selector + \" \"] && (!rbuggyQSA || !rbuggyQSA.test(selector)) && ( // Support: IE 8 only\n // Exclude object elements\n nodeType !== 1 || context.nodeName.toLowerCase() !== \"object\")) {\n newSelector = selector;\n newContext = context; // qSA considers elements outside a scoping root when evaluating child or\n // descendant combinators, which is not what we want.\n // In such cases, we work around the behavior by prefixing every selector in the\n // list with an ID selector referencing the scope context.\n // The technique has to be used as well when a leading combinator is used\n // as such selectors are not recognized by querySelectorAll.\n // Thanks to Andrew Dupont for this technique.\n\n if (nodeType === 1 && (rdescend.test(selector) || rcombinators.test(selector))) {\n // Expand context for sibling selectors\n newContext = rsibling.test(selector) && testContext(context.parentNode) || context; // We can use :scope instead of the ID hack if the browser\n // supports it & if we're not changing the context.\n\n if (newContext !== context || !support.scope) {\n // Capture the context ID, setting it first if necessary\n if (nid = context.getAttribute(\"id\")) {\n nid = nid.replace(rcssescape, fcssescape);\n } else {\n context.setAttribute(\"id\", nid = expando);\n }\n } // Prefix every selector in the list\n\n\n groups = tokenize(selector);\n i = groups.length;\n\n while (i--) {\n groups[i] = (nid ? \"#\" + nid : \":scope\") + \" \" + toSelector(groups[i]);\n }\n\n newSelector = groups.join(\",\");\n }\n\n try {\n push.apply(results, newContext.querySelectorAll(newSelector));\n return results;\n } catch (qsaError) {\n nonnativeSelectorCache(selector, true);\n } finally {\n if (nid === expando) {\n context.removeAttribute(\"id\");\n }\n }\n }\n }\n } // All others\n\n\n return select(selector.replace(rtrim, \"$1\"), context, results, seed);\n }\n /**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\n\n\n function createCache() {\n var keys = [];\n\n function cache(key, value) {\n // Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n if (keys.push(key + \" \") > Expr.cacheLength) {\n // Only keep the most recent entries\n delete cache[keys.shift()];\n }\n\n return cache[key + \" \"] = value;\n }\n\n return cache;\n }\n /**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\n\n\n function markFunction(fn) {\n fn[expando] = true;\n return fn;\n }\n /**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\n\n\n function assert(fn) {\n var el = document.createElement(\"fieldset\");\n\n try {\n return !!fn(el);\n } catch (e) {\n return false;\n } finally {\n // Remove from its parent by default\n if (el.parentNode) {\n el.parentNode.removeChild(el);\n } // release memory in IE\n\n\n el = null;\n }\n }\n /**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\n\n\n function addHandle(attrs, handler) {\n var arr = attrs.split(\"|\"),\n i = arr.length;\n\n while (i--) {\n Expr.attrHandle[arr[i]] = handler;\n }\n }\n /**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\n\n\n function siblingCheck(a, b) {\n var cur = b && a,\n diff = cur && a.nodeType === 1 && b.nodeType === 1 && a.sourceIndex - b.sourceIndex; // Use IE sourceIndex if available on both nodes\n\n if (diff) {\n return diff;\n } // Check if b follows a\n\n\n if (cur) {\n while (cur = cur.nextSibling) {\n if (cur === b) {\n return -1;\n }\n }\n }\n\n return a ? 1 : -1;\n }\n /**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\n\n\n function createInputPseudo(type) {\n return function (elem) {\n var name = elem.nodeName.toLowerCase();\n return name === \"input\" && elem.type === type;\n };\n }\n /**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\n\n\n function createButtonPseudo(type) {\n return function (elem) {\n var name = elem.nodeName.toLowerCase();\n return (name === \"input\" || name === \"button\") && elem.type === type;\n };\n }\n /**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\n\n\n function createDisabledPseudo(disabled) {\n // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n return function (elem) {\n // Only certain elements can match :enabled or :disabled\n // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n if (\"form\" in elem) {\n // Check for inherited disabledness on relevant non-disabled elements:\n // * listed form-associated elements in a disabled fieldset\n // https://html.spec.whatwg.org/multipage/forms.html#category-listed\n // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n // * option elements in a disabled optgroup\n // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n // All such elements have a \"form\" property.\n if (elem.parentNode && elem.disabled === false) {\n // Option elements defer to a parent optgroup if present\n if (\"label\" in elem) {\n if (\"label\" in elem.parentNode) {\n return elem.parentNode.disabled === disabled;\n } else {\n return elem.disabled === disabled;\n }\n } // Support: IE 6 - 11\n // Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\n\n return elem.isDisabled === disabled || // Where there is no isDisabled, check manually\n\n /* jshint -W018 */\n elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;\n }\n\n return elem.disabled === disabled; // Try to winnow out elements that can't be disabled before trusting the disabled property.\n // Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n // even exist on them, let alone have a boolean value.\n } else if (\"label\" in elem) {\n return elem.disabled === disabled;\n } // Remaining elements are neither :enabled nor :disabled\n\n\n return false;\n };\n }\n /**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\n\n\n function createPositionalPseudo(fn) {\n return markFunction(function (argument) {\n argument = +argument;\n return markFunction(function (seed, matches) {\n var j,\n matchIndexes = fn([], seed.length, argument),\n i = matchIndexes.length; // Match elements found at the specified indexes\n\n while (i--) {\n if (seed[j = matchIndexes[i]]) {\n seed[j] = !(matches[j] = seed[j]);\n }\n }\n });\n });\n }\n /**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\n\n\n function testContext(context) {\n return context && typeof context.getElementsByTagName !== \"undefined\" && context;\n } // Expose support vars for convenience\n\n\n support = Sizzle.support = {};\n /**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\n\n isXML = Sizzle.isXML = function (elem) {\n var namespace = elem.namespaceURI,\n docElem = (elem.ownerDocument || elem).documentElement; // Support: IE <=8\n // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes\n // https://bugs.jquery.com/ticket/4833\n\n return !rhtml.test(namespace || docElem && docElem.nodeName || \"HTML\");\n };\n /**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\n\n\n setDocument = Sizzle.setDocument = function (node) {\n var hasCompare,\n subWindow,\n doc = node ? node.ownerDocument || node : preferredDoc; // Return early if doc is invalid or already selected\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n\n if (doc == document || doc.nodeType !== 9 || !doc.documentElement) {\n return document;\n } // Update global variables\n\n\n document = doc;\n docElem = document.documentElement;\n documentIsHTML = !isXML(document); // Support: IE 9 - 11+, Edge 12 - 18+\n // Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n\n if (preferredDoc != document && (subWindow = document.defaultView) && subWindow.top !== subWindow) {\n // Support: IE 11, Edge\n if (subWindow.addEventListener) {\n subWindow.addEventListener(\"unload\", unloadHandler, false); // Support: IE 9 - 10 only\n } else if (subWindow.attachEvent) {\n subWindow.attachEvent(\"onunload\", unloadHandler);\n }\n } // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,\n // Safari 4 - 5 only, Opera <=11.6 - 12.x only\n // IE/Edge & older browsers don't support the :scope pseudo-class.\n // Support: Safari 6.0 only\n // Safari 6.0 supports :scope but it's an alias of :root there.\n\n\n support.scope = assert(function (el) {\n docElem.appendChild(el).appendChild(document.createElement(\"div\"));\n return typeof el.querySelectorAll !== \"undefined\" && !el.querySelectorAll(\":scope fieldset div\").length;\n });\n /* Attributes\n ---------------------------------------------------------------------- */\n // Support: IE<8\n // Verify that getAttribute really returns attributes and not properties\n // (excepting IE8 booleans)\n\n support.attributes = assert(function (el) {\n el.className = \"i\";\n return !el.getAttribute(\"className\");\n });\n /* getElement(s)By*\n ---------------------------------------------------------------------- */\n // Check if getElementsByTagName(\"*\") returns only elements\n\n support.getElementsByTagName = assert(function (el) {\n el.appendChild(document.createComment(\"\"));\n return !el.getElementsByTagName(\"*\").length;\n }); // Support: IE<9\n\n support.getElementsByClassName = rnative.test(document.getElementsByClassName); // Support: IE<10\n // Check if getElementById returns elements by name\n // The broken getElementById methods don't pick up programmatically-set names,\n // so use a roundabout getElementsByName test\n\n support.getById = assert(function (el) {\n docElem.appendChild(el).id = expando;\n return !document.getElementsByName || !document.getElementsByName(expando).length;\n }); // ID filter and find\n\n if (support.getById) {\n Expr.filter[\"ID\"] = function (id) {\n var attrId = id.replace(runescape, funescape);\n return function (elem) {\n return elem.getAttribute(\"id\") === attrId;\n };\n };\n\n Expr.find[\"ID\"] = function (id, context) {\n if (typeof context.getElementById !== \"undefined\" && documentIsHTML) {\n var elem = context.getElementById(id);\n return elem ? [elem] : [];\n }\n };\n } else {\n Expr.filter[\"ID\"] = function (id) {\n var attrId = id.replace(runescape, funescape);\n return function (elem) {\n var node = typeof elem.getAttributeNode !== \"undefined\" && elem.getAttributeNode(\"id\");\n return node && node.value === attrId;\n };\n }; // Support: IE 6 - 7 only\n // getElementById is not reliable as a find shortcut\n\n\n Expr.find[\"ID\"] = function (id, context) {\n if (typeof context.getElementById !== \"undefined\" && documentIsHTML) {\n var node,\n i,\n elems,\n elem = context.getElementById(id);\n\n if (elem) {\n // Verify the id attribute\n node = elem.getAttributeNode(\"id\");\n\n if (node && node.value === id) {\n return [elem];\n } // Fall back on getElementsByName\n\n\n elems = context.getElementsByName(id);\n i = 0;\n\n while (elem = elems[i++]) {\n node = elem.getAttributeNode(\"id\");\n\n if (node && node.value === id) {\n return [elem];\n }\n }\n }\n\n return [];\n }\n };\n } // Tag\n\n\n Expr.find[\"TAG\"] = support.getElementsByTagName ? function (tag, context) {\n if (typeof context.getElementsByTagName !== \"undefined\") {\n return context.getElementsByTagName(tag); // DocumentFragment nodes don't have gEBTN\n } else if (support.qsa) {\n return context.querySelectorAll(tag);\n }\n } : function (tag, context) {\n var elem,\n tmp = [],\n i = 0,\n // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n results = context.getElementsByTagName(tag); // Filter out possible comments\n\n if (tag === \"*\") {\n while (elem = results[i++]) {\n if (elem.nodeType === 1) {\n tmp.push(elem);\n }\n }\n\n return tmp;\n }\n\n return results;\n }; // Class\n\n Expr.find[\"CLASS\"] = support.getElementsByClassName && function (className, context) {\n if (typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML) {\n return context.getElementsByClassName(className);\n }\n };\n /* QSA/matchesSelector\n ---------------------------------------------------------------------- */\n // QSA and matchesSelector support\n // matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\n\n rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21)\n // We allow this because of a bug in IE8/9 that throws an error\n // whenever `document.activeElement` is accessed on an iframe\n // So, we allow :focus to pass through QSA all the time to avoid the IE error\n // See https://bugs.jquery.com/ticket/13378\n\n rbuggyQSA = [];\n\n if (support.qsa = rnative.test(document.querySelectorAll)) {\n // Build QSA regex\n // Regex strategy adopted from Diego Perini\n assert(function (el) {\n var input; // Select is set to empty string on purpose\n // This is to test IE's treatment of not explicitly\n // setting a boolean content attribute,\n // since its presence should be enough\n // https://bugs.jquery.com/ticket/12359\n\n docElem.appendChild(el).innerHTML = \"\" + \"\"; // Support: IE8, Opera 11-12.16\n // Nothing should be selected when empty strings follow ^= or $= or *=\n // The test attribute must be unknown in Opera but \"safe\" for WinRT\n // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\n if (el.querySelectorAll(\"[msallowcapture^='']\").length) {\n rbuggyQSA.push(\"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\");\n } // Support: IE8\n // Boolean attributes and \"value\" are not treated correctly\n\n\n if (!el.querySelectorAll(\"[selected]\").length) {\n rbuggyQSA.push(\"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\");\n } // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\n\n if (!el.querySelectorAll(\"[id~=\" + expando + \"-]\").length) {\n rbuggyQSA.push(\"~=\");\n } // Support: IE 11+, Edge 15 - 18+\n // IE 11/Edge don't find elements on a `[name='']` query in some cases.\n // Adding a temporary attribute to the document before the selection works\n // around the issue.\n // Interestingly, IE 10 & older don't seem to have the issue.\n\n\n input = document.createElement(\"input\");\n input.setAttribute(\"name\", \"\");\n el.appendChild(input);\n\n if (!el.querySelectorAll(\"[name='']\").length) {\n rbuggyQSA.push(\"\\\\[\" + whitespace + \"*name\" + whitespace + \"*=\" + whitespace + \"*(?:''|\\\"\\\")\");\n } // Webkit/Opera - :checked should return selected option elements\n // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n // IE8 throws error here and will not see later tests\n\n\n if (!el.querySelectorAll(\":checked\").length) {\n rbuggyQSA.push(\":checked\");\n } // Support: Safari 8+, iOS 8+\n // https://bugs.webkit.org/show_bug.cgi?id=136851\n // In-page `selector#id sibling-combinator selector` fails\n\n\n if (!el.querySelectorAll(\"a#\" + expando + \"+*\").length) {\n rbuggyQSA.push(\".#.+[+~]\");\n } // Support: Firefox <=3.6 - 5 only\n // Old Firefox doesn't throw on a badly-escaped identifier.\n\n\n el.querySelectorAll(\"\\\\\\f\");\n rbuggyQSA.push(\"[\\\\r\\\\n\\\\f]\");\n });\n assert(function (el) {\n el.innerHTML = \"\" + \"\"; // Support: Windows 8 Native Apps\n // The type and name attributes are restricted during .innerHTML assignment\n\n var input = document.createElement(\"input\");\n input.setAttribute(\"type\", \"hidden\");\n el.appendChild(input).setAttribute(\"name\", \"D\"); // Support: IE8\n // Enforce case-sensitivity of name attribute\n\n if (el.querySelectorAll(\"[name=d]\").length) {\n rbuggyQSA.push(\"name\" + whitespace + \"*[*^$|!~]?=\");\n } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n // IE8 throws error here and will not see later tests\n\n\n if (el.querySelectorAll(\":enabled\").length !== 2) {\n rbuggyQSA.push(\":enabled\", \":disabled\");\n } // Support: IE9-11+\n // IE's :disabled selector does not pick up the children of disabled fieldsets\n\n\n docElem.appendChild(el).disabled = true;\n\n if (el.querySelectorAll(\":disabled\").length !== 2) {\n rbuggyQSA.push(\":enabled\", \":disabled\");\n } // Support: Opera 10 - 11 only\n // Opera 10-11 does not throw on post-comma invalid pseudos\n\n\n el.querySelectorAll(\"*,:x\");\n rbuggyQSA.push(\",.*:\");\n });\n }\n\n if (support.matchesSelector = rnative.test(matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)) {\n assert(function (el) {\n // Check to see if it's possible to do matchesSelector\n // on a disconnected node (IE 9)\n support.disconnectedMatch = matches.call(el, \"*\"); // This should fail with an exception\n // Gecko does not error, returns false instead\n\n matches.call(el, \"[s!='']:x\");\n rbuggyMatches.push(\"!=\", pseudos);\n });\n }\n\n rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join(\"|\"));\n rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join(\"|\"));\n /* Contains\n ---------------------------------------------------------------------- */\n\n hasCompare = rnative.test(docElem.compareDocumentPosition); // Element contains another\n // Purposefully self-exclusive\n // As in, an element does not contain itself\n\n contains = hasCompare || rnative.test(docElem.contains) ? function (a, b) {\n var adown = a.nodeType === 9 ? a.documentElement : a,\n bup = b && b.parentNode;\n return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));\n } : function (a, b) {\n if (b) {\n while (b = b.parentNode) {\n if (b === a) {\n return true;\n }\n }\n }\n\n return false;\n };\n /* Sorting\n ---------------------------------------------------------------------- */\n // Document order sorting\n\n sortOrder = hasCompare ? function (a, b) {\n // Flag for duplicate removal\n if (a === b) {\n hasDuplicate = true;\n return 0;\n } // Sort on method existence if only one input has compareDocumentPosition\n\n\n var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\n if (compare) {\n return compare;\n } // Calculate position if both inputs belong to the same document\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n\n\n compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : // Otherwise we know they are disconnected\n 1; // Disconnected nodes\n\n if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {\n // Choose the first element that is related to our preferred document\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n if (a == document || a.ownerDocument == preferredDoc && contains(preferredDoc, a)) {\n return -1;\n } // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n\n\n if (b == document || b.ownerDocument == preferredDoc && contains(preferredDoc, b)) {\n return 1;\n } // Maintain original order\n\n\n return sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0;\n }\n\n return compare & 4 ? -1 : 1;\n } : function (a, b) {\n // Exit early if the nodes are identical\n if (a === b) {\n hasDuplicate = true;\n return 0;\n }\n\n var cur,\n i = 0,\n aup = a.parentNode,\n bup = b.parentNode,\n ap = [a],\n bp = [b]; // Parentless nodes are either documents or disconnected\n\n if (!aup || !bup) {\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n\n /* eslint-disable eqeqeq */\n return a == document ? -1 : b == document ? 1 :\n /* eslint-enable eqeqeq */\n aup ? -1 : bup ? 1 : sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0; // If the nodes are siblings, we can do a quick check\n } else if (aup === bup) {\n return siblingCheck(a, b);\n } // Otherwise we need full lists of their ancestors for comparison\n\n\n cur = a;\n\n while (cur = cur.parentNode) {\n ap.unshift(cur);\n }\n\n cur = b;\n\n while (cur = cur.parentNode) {\n bp.unshift(cur);\n } // Walk down the tree looking for a discrepancy\n\n\n while (ap[i] === bp[i]) {\n i++;\n }\n\n return i ? // Do a sibling check if the nodes have a common ancestor\n siblingCheck(ap[i], bp[i]) : // Otherwise nodes in our document sort first\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n\n /* eslint-disable eqeqeq */\n ap[i] == preferredDoc ? -1 : bp[i] == preferredDoc ? 1 :\n /* eslint-enable eqeqeq */\n 0;\n };\n return document;\n };\n\n Sizzle.matches = function (expr, elements) {\n return Sizzle(expr, null, null, elements);\n };\n\n Sizzle.matchesSelector = function (elem, expr) {\n setDocument(elem);\n\n if (support.matchesSelector && documentIsHTML && !nonnativeSelectorCache[expr + \" \"] && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) {\n try {\n var ret = matches.call(elem, expr); // IE 9's matchesSelector returns false on disconnected nodes\n\n if (ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document\n // fragment in IE 9\n elem.document && elem.document.nodeType !== 11) {\n return ret;\n }\n } catch (e) {\n nonnativeSelectorCache(expr, true);\n }\n }\n\n return Sizzle(expr, document, null, [elem]).length > 0;\n };\n\n Sizzle.contains = function (context, elem) {\n // Set document vars if needed\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n if ((context.ownerDocument || context) != document) {\n setDocument(context);\n }\n\n return contains(context, elem);\n };\n\n Sizzle.attr = function (elem, name) {\n // Set document vars if needed\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n if ((elem.ownerDocument || elem) != document) {\n setDocument(elem);\n }\n\n var fn = Expr.attrHandle[name.toLowerCase()],\n // Don't get fooled by Object.prototype properties (jQuery #13807)\n val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined;\n return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;\n };\n\n Sizzle.escape = function (sel) {\n return (sel + \"\").replace(rcssescape, fcssescape);\n };\n\n Sizzle.error = function (msg) {\n throw new Error(\"Syntax error, unrecognized expression: \" + msg);\n };\n /**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\n\n\n Sizzle.uniqueSort = function (results) {\n var elem,\n duplicates = [],\n j = 0,\n i = 0; // Unless we *know* we can detect duplicates, assume their presence\n\n hasDuplicate = !support.detectDuplicates;\n sortInput = !support.sortStable && results.slice(0);\n results.sort(sortOrder);\n\n if (hasDuplicate) {\n while (elem = results[i++]) {\n if (elem === results[i]) {\n j = duplicates.push(i);\n }\n }\n\n while (j--) {\n results.splice(duplicates[j], 1);\n }\n } // Clear input after sorting to release objects\n // See https://github.com/jquery/sizzle/pull/225\n\n\n sortInput = null;\n return results;\n };\n /**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\n\n\n getText = Sizzle.getText = function (elem) {\n var node,\n ret = \"\",\n i = 0,\n nodeType = elem.nodeType;\n\n if (!nodeType) {\n // If no nodeType, this is expected to be an array\n while (node = elem[i++]) {\n // Do not traverse comment nodes\n ret += getText(node);\n }\n } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {\n // Use textContent for elements\n // innerText usage removed for consistency of new lines (jQuery #11153)\n if (typeof elem.textContent === \"string\") {\n return elem.textContent;\n } else {\n // Traverse its children\n for (elem = elem.firstChild; elem; elem = elem.nextSibling) {\n ret += getText(elem);\n }\n }\n } else if (nodeType === 3 || nodeType === 4) {\n return elem.nodeValue;\n } // Do not include comment or processing instruction nodes\n\n\n return ret;\n };\n\n Expr = Sizzle.selectors = {\n // Can be adjusted by the user\n cacheLength: 50,\n createPseudo: markFunction,\n match: matchExpr,\n attrHandle: {},\n find: {},\n relative: {\n \">\": {\n dir: \"parentNode\",\n first: true\n },\n \" \": {\n dir: \"parentNode\"\n },\n \"+\": {\n dir: \"previousSibling\",\n first: true\n },\n \"~\": {\n dir: \"previousSibling\"\n }\n },\n preFilter: {\n \"ATTR\": function ATTR(match) {\n match[1] = match[1].replace(runescape, funescape); // Move the given value to match[3] whether quoted or unquoted\n\n match[3] = (match[3] || match[4] || match[5] || \"\").replace(runescape, funescape);\n\n if (match[2] === \"~=\") {\n match[3] = \" \" + match[3] + \" \";\n }\n\n return match.slice(0, 4);\n },\n \"CHILD\": function CHILD(match) {\n /* matches from matchExpr[\"CHILD\"]\n \t1 type (only|nth|...)\n \t2 what (child|of-type)\n \t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n \t4 xn-component of xn+y argument ([+-]?\\d*n|)\n \t5 sign of xn-component\n \t6 x of xn-component\n \t7 sign of y-component\n \t8 y of y-component\n */\n match[1] = match[1].toLowerCase();\n\n if (match[1].slice(0, 3) === \"nth\") {\n // nth-* requires argument\n if (!match[3]) {\n Sizzle.error(match[0]);\n } // numeric x and y parameters for Expr.filter.CHILD\n // remember that false/true cast respectively to 0/1\n\n\n match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === \"even\" || match[3] === \"odd\"));\n match[5] = +(match[7] + match[8] || match[3] === \"odd\"); // other types prohibit arguments\n } else if (match[3]) {\n Sizzle.error(match[0]);\n }\n\n return match;\n },\n \"PSEUDO\": function PSEUDO(match) {\n var excess,\n unquoted = !match[6] && match[2];\n\n if (matchExpr[\"CHILD\"].test(match[0])) {\n return null;\n } // Accept quoted arguments as-is\n\n\n if (match[3]) {\n match[2] = match[4] || match[5] || \"\"; // Strip excess characters from unquoted arguments\n } else if (unquoted && rpseudo.test(unquoted) && ( // Get excess from tokenize (recursively)\n excess = tokenize(unquoted, true)) && ( // advance to the next closing parenthesis\n excess = unquoted.indexOf(\")\", unquoted.length - excess) - unquoted.length)) {\n // excess is a negative index\n match[0] = match[0].slice(0, excess);\n match[2] = unquoted.slice(0, excess);\n } // Return only captures needed by the pseudo filter method (type and argument)\n\n\n return match.slice(0, 3);\n }\n },\n filter: {\n \"TAG\": function TAG(nodeNameSelector) {\n var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();\n return nodeNameSelector === \"*\" ? function () {\n return true;\n } : function (elem) {\n return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n };\n },\n \"CLASS\": function CLASS(className) {\n var pattern = classCache[className + \" \"];\n return pattern || (pattern = new RegExp(\"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\")) && classCache(className, function (elem) {\n return pattern.test(typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== \"undefined\" && elem.getAttribute(\"class\") || \"\");\n });\n },\n \"ATTR\": function ATTR(name, operator, check) {\n return function (elem) {\n var result = Sizzle.attr(elem, name);\n\n if (result == null) {\n return operator === \"!=\";\n }\n\n if (!operator) {\n return true;\n }\n\n result += \"\";\n /* eslint-disable max-len */\n\n return operator === \"=\" ? result === check : operator === \"!=\" ? result !== check : operator === \"^=\" ? check && result.indexOf(check) === 0 : operator === \"*=\" ? check && result.indexOf(check) > -1 : operator === \"$=\" ? check && result.slice(-check.length) === check : operator === \"~=\" ? (\" \" + result.replace(rwhitespace, \" \") + \" \").indexOf(check) > -1 : operator === \"|=\" ? result === check || result.slice(0, check.length + 1) === check + \"-\" : false;\n /* eslint-enable max-len */\n };\n },\n \"CHILD\": function CHILD(type, what, _argument, first, last) {\n var simple = type.slice(0, 3) !== \"nth\",\n forward = type.slice(-4) !== \"last\",\n ofType = what === \"of-type\";\n return first === 1 && last === 0 ? // Shortcut for :nth-*(n)\n function (elem) {\n return !!elem.parentNode;\n } : function (elem, _context, xml) {\n var cache,\n uniqueCache,\n outerCache,\n node,\n nodeIndex,\n start,\n dir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n parent = elem.parentNode,\n name = ofType && elem.nodeName.toLowerCase(),\n useCache = !xml && !ofType,\n diff = false;\n\n if (parent) {\n // :(first|last|only)-(child|of-type)\n if (simple) {\n while (dir) {\n node = elem;\n\n while (node = node[dir]) {\n if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {\n return false;\n }\n } // Reverse direction for :only-* (if we haven't yet done so)\n\n\n start = dir = type === \"only\" && !start && \"nextSibling\";\n }\n\n return true;\n }\n\n start = [forward ? parent.firstChild : parent.lastChild]; // non-xml :nth-child(...) stores cache data on `parent`\n\n if (forward && useCache) {\n // Seek `elem` from a previously-cached index\n // ...in a gzip-friendly way\n node = parent;\n outerCache = node[expando] || (node[expando] = {}); // Support: IE <9 only\n // Defend against cloned attroperties (jQuery gh-1709)\n\n uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});\n cache = uniqueCache[type] || [];\n nodeIndex = cache[0] === dirruns && cache[1];\n diff = nodeIndex && cache[2];\n node = nodeIndex && parent.childNodes[nodeIndex];\n\n while (node = ++nodeIndex && node && node[dir] || ( // Fallback to seeking `elem` from the start\n diff = nodeIndex = 0) || start.pop()) {\n // When found, cache indexes on `parent` and break\n if (node.nodeType === 1 && ++diff && node === elem) {\n uniqueCache[type] = [dirruns, nodeIndex, diff];\n break;\n }\n }\n } else {\n // Use previously-cached element index if available\n if (useCache) {\n // ...in a gzip-friendly way\n node = elem;\n outerCache = node[expando] || (node[expando] = {}); // Support: IE <9 only\n // Defend against cloned attroperties (jQuery gh-1709)\n\n uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});\n cache = uniqueCache[type] || [];\n nodeIndex = cache[0] === dirruns && cache[1];\n diff = nodeIndex;\n } // xml :nth-child(...)\n // or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\n\n if (diff === false) {\n // Use the same loop as above to seek `elem` from the start\n while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {\n if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {\n // Cache the index of each encountered element\n if (useCache) {\n outerCache = node[expando] || (node[expando] = {}); // Support: IE <9 only\n // Defend against cloned attroperties (jQuery gh-1709)\n\n uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});\n uniqueCache[type] = [dirruns, diff];\n }\n\n if (node === elem) {\n break;\n }\n }\n }\n }\n } // Incorporate the offset, then check against cycle size\n\n\n diff -= last;\n return diff === first || diff % first === 0 && diff / first >= 0;\n }\n };\n },\n \"PSEUDO\": function PSEUDO(pseudo, argument) {\n // pseudo-class names are case-insensitive\n // http://www.w3.org/TR/selectors/#pseudo-classes\n // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n // Remember that setFilters inherits from pseudos\n var args,\n fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error(\"unsupported pseudo: \" + pseudo); // The user may use createPseudo to indicate that\n // arguments are needed to create the filter function\n // just as Sizzle does\n\n if (fn[expando]) {\n return fn(argument);\n } // But maintain support for old signatures\n\n\n if (fn.length > 1) {\n args = [pseudo, pseudo, \"\", argument];\n return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) {\n var idx,\n matched = fn(seed, argument),\n i = matched.length;\n\n while (i--) {\n idx = indexOf(seed, matched[i]);\n seed[idx] = !(matches[idx] = matched[i]);\n }\n }) : function (elem) {\n return fn(elem, 0, args);\n };\n }\n\n return fn;\n }\n },\n pseudos: {\n // Potentially complex pseudos\n \"not\": markFunction(function (selector) {\n // Trim the selector passed to compile\n // to avoid treating leading and trailing\n // spaces as combinators\n var input = [],\n results = [],\n matcher = compile(selector.replace(rtrim, \"$1\"));\n return matcher[expando] ? markFunction(function (seed, matches, _context, xml) {\n var elem,\n unmatched = matcher(seed, null, xml, []),\n i = seed.length; // Match elements unmatched by `matcher`\n\n while (i--) {\n if (elem = unmatched[i]) {\n seed[i] = !(matches[i] = elem);\n }\n }\n }) : function (elem, _context, xml) {\n input[0] = elem;\n matcher(input, null, xml, results); // Don't keep the element (issue #299)\n\n input[0] = null;\n return !results.pop();\n };\n }),\n \"has\": markFunction(function (selector) {\n return function (elem) {\n return Sizzle(selector, elem).length > 0;\n };\n }),\n \"contains\": markFunction(function (text) {\n text = text.replace(runescape, funescape);\n return function (elem) {\n return (elem.textContent || getText(elem)).indexOf(text) > -1;\n };\n }),\n // \"Whether an element is represented by a :lang() selector\n // is based solely on the element's language value\n // being equal to the identifier C,\n // or beginning with the identifier C immediately followed by \"-\".\n // The matching of C against the element's language value is performed case-insensitively.\n // The identifier C does not have to be a valid language name.\"\n // http://www.w3.org/TR/selectors/#lang-pseudo\n \"lang\": markFunction(function (lang) {\n // lang value must be a valid identifier\n if (!ridentifier.test(lang || \"\")) {\n Sizzle.error(\"unsupported lang: \" + lang);\n }\n\n lang = lang.replace(runescape, funescape).toLowerCase();\n return function (elem) {\n var elemLang;\n\n do {\n if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) {\n elemLang = elemLang.toLowerCase();\n return elemLang === lang || elemLang.indexOf(lang + \"-\") === 0;\n }\n } while ((elem = elem.parentNode) && elem.nodeType === 1);\n\n return false;\n };\n }),\n // Miscellaneous\n \"target\": function target(elem) {\n var hash = window.location && window.location.hash;\n return hash && hash.slice(1) === elem.id;\n },\n \"root\": function root(elem) {\n return elem === docElem;\n },\n \"focus\": function focus(elem) {\n return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n },\n // Boolean properties\n \"enabled\": createDisabledPseudo(false),\n \"disabled\": createDisabledPseudo(true),\n \"checked\": function checked(elem) {\n // In CSS3, :checked should return both checked and selected elements\n // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n var nodeName = elem.nodeName.toLowerCase();\n return nodeName === \"input\" && !!elem.checked || nodeName === \"option\" && !!elem.selected;\n },\n \"selected\": function selected(elem) {\n // Accessing this property makes selected-by-default\n // options in Safari work properly\n if (elem.parentNode) {\n // eslint-disable-next-line no-unused-expressions\n elem.parentNode.selectedIndex;\n }\n\n return elem.selected === true;\n },\n // Contents\n \"empty\": function empty(elem) {\n // http://www.w3.org/TR/selectors/#empty-pseudo\n // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n // but not by others (comment: 8; processing instruction: 7; etc.)\n // nodeType < 6 works because attributes (2) do not appear as children\n for (elem = elem.firstChild; elem; elem = elem.nextSibling) {\n if (elem.nodeType < 6) {\n return false;\n }\n }\n\n return true;\n },\n \"parent\": function parent(elem) {\n return !Expr.pseudos[\"empty\"](elem);\n },\n // Element/input types\n \"header\": function header(elem) {\n return rheader.test(elem.nodeName);\n },\n \"input\": function input(elem) {\n return rinputs.test(elem.nodeName);\n },\n \"button\": function button(elem) {\n var name = elem.nodeName.toLowerCase();\n return name === \"input\" && elem.type === \"button\" || name === \"button\";\n },\n \"text\": function text(elem) {\n var attr;\n return elem.nodeName.toLowerCase() === \"input\" && elem.type === \"text\" && ( // Support: IE<8\n // New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === \"text\");\n },\n // Position-in-collection\n \"first\": createPositionalPseudo(function () {\n return [0];\n }),\n \"last\": createPositionalPseudo(function (_matchIndexes, length) {\n return [length - 1];\n }),\n \"eq\": createPositionalPseudo(function (_matchIndexes, length, argument) {\n return [argument < 0 ? argument + length : argument];\n }),\n \"even\": createPositionalPseudo(function (matchIndexes, length) {\n var i = 0;\n\n for (; i < length; i += 2) {\n matchIndexes.push(i);\n }\n\n return matchIndexes;\n }),\n \"odd\": createPositionalPseudo(function (matchIndexes, length) {\n var i = 1;\n\n for (; i < length; i += 2) {\n matchIndexes.push(i);\n }\n\n return matchIndexes;\n }),\n \"lt\": createPositionalPseudo(function (matchIndexes, length, argument) {\n var i = argument < 0 ? argument + length : argument > length ? length : argument;\n\n for (; --i >= 0;) {\n matchIndexes.push(i);\n }\n\n return matchIndexes;\n }),\n \"gt\": createPositionalPseudo(function (matchIndexes, length, argument) {\n var i = argument < 0 ? argument + length : argument;\n\n for (; ++i < length;) {\n matchIndexes.push(i);\n }\n\n return matchIndexes;\n })\n }\n };\n Expr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"]; // Add button/input type pseudos\n\n for (i in {\n radio: true,\n checkbox: true,\n file: true,\n password: true,\n image: true\n }) {\n Expr.pseudos[i] = createInputPseudo(i);\n }\n\n for (i in {\n submit: true,\n reset: true\n }) {\n Expr.pseudos[i] = createButtonPseudo(i);\n } // Easy API for creating new setFilters\n\n\n function setFilters() {}\n\n setFilters.prototype = Expr.filters = Expr.pseudos;\n Expr.setFilters = new setFilters();\n\n tokenize = Sizzle.tokenize = function (selector, parseOnly) {\n var matched,\n match,\n tokens,\n type,\n soFar,\n groups,\n preFilters,\n cached = tokenCache[selector + \" \"];\n\n if (cached) {\n return parseOnly ? 0 : cached.slice(0);\n }\n\n soFar = selector;\n groups = [];\n preFilters = Expr.preFilter;\n\n while (soFar) {\n // Comma and first run\n if (!matched || (match = rcomma.exec(soFar))) {\n if (match) {\n // Don't consume trailing commas as valid\n soFar = soFar.slice(match[0].length) || soFar;\n }\n\n groups.push(tokens = []);\n }\n\n matched = false; // Combinators\n\n if (match = rcombinators.exec(soFar)) {\n matched = match.shift();\n tokens.push({\n value: matched,\n // Cast descendant combinators to space\n type: match[0].replace(rtrim, \" \")\n });\n soFar = soFar.slice(matched.length);\n } // Filters\n\n\n for (type in Expr.filter) {\n if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {\n matched = match.shift();\n tokens.push({\n value: matched,\n type: type,\n matches: match\n });\n soFar = soFar.slice(matched.length);\n }\n }\n\n if (!matched) {\n break;\n }\n } // Return the length of the invalid excess\n // if we're just parsing\n // Otherwise, throw an error or return tokens\n\n\n return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : // Cache the tokens\n tokenCache(selector, groups).slice(0);\n };\n\n function toSelector(tokens) {\n var i = 0,\n len = tokens.length,\n selector = \"\";\n\n for (; i < len; i++) {\n selector += tokens[i].value;\n }\n\n return selector;\n }\n\n function addCombinator(matcher, combinator, base) {\n var dir = combinator.dir,\n skip = combinator.next,\n key = skip || dir,\n checkNonElements = base && key === \"parentNode\",\n doneName = done++;\n return combinator.first ? // Check against closest ancestor/preceding element\n function (elem, context, xml) {\n while (elem = elem[dir]) {\n if (elem.nodeType === 1 || checkNonElements) {\n return matcher(elem, context, xml);\n }\n }\n\n return false;\n } : // Check against all ancestor/preceding elements\n function (elem, context, xml) {\n var oldCache,\n uniqueCache,\n outerCache,\n newCache = [dirruns, doneName]; // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\n if (xml) {\n while (elem = elem[dir]) {\n if (elem.nodeType === 1 || checkNonElements) {\n if (matcher(elem, context, xml)) {\n return true;\n }\n }\n }\n } else {\n while (elem = elem[dir]) {\n if (elem.nodeType === 1 || checkNonElements) {\n outerCache = elem[expando] || (elem[expando] = {}); // Support: IE <9 only\n // Defend against cloned attroperties (jQuery gh-1709)\n\n uniqueCache = outerCache[elem.uniqueID] || (outerCache[elem.uniqueID] = {});\n\n if (skip && skip === elem.nodeName.toLowerCase()) {\n elem = elem[dir] || elem;\n } else if ((oldCache = uniqueCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {\n // Assign to newCache so results back-propagate to previous elements\n return newCache[2] = oldCache[2];\n } else {\n // Reuse newcache so results back-propagate to previous elements\n uniqueCache[key] = newCache; // A match means we're done; a fail means we have to keep checking\n\n if (newCache[2] = matcher(elem, context, xml)) {\n return true;\n }\n }\n }\n }\n }\n\n return false;\n };\n }\n\n function elementMatcher(matchers) {\n return matchers.length > 1 ? function (elem, context, xml) {\n var i = matchers.length;\n\n while (i--) {\n if (!matchers[i](elem, context, xml)) {\n return false;\n }\n }\n\n return true;\n } : matchers[0];\n }\n\n function multipleContexts(selector, contexts, results) {\n var i = 0,\n len = contexts.length;\n\n for (; i < len; i++) {\n Sizzle(selector, contexts[i], results);\n }\n\n return results;\n }\n\n function condense(unmatched, map, filter, context, xml) {\n var elem,\n newUnmatched = [],\n i = 0,\n len = unmatched.length,\n mapped = map != null;\n\n for (; i < len; i++) {\n if (elem = unmatched[i]) {\n if (!filter || filter(elem, context, xml)) {\n newUnmatched.push(elem);\n\n if (mapped) {\n map.push(i);\n }\n }\n }\n }\n\n return newUnmatched;\n }\n\n function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {\n if (postFilter && !postFilter[expando]) {\n postFilter = setMatcher(postFilter);\n }\n\n if (postFinder && !postFinder[expando]) {\n postFinder = setMatcher(postFinder, postSelector);\n }\n\n return markFunction(function (seed, results, context, xml) {\n var temp,\n i,\n elem,\n preMap = [],\n postMap = [],\n preexisting = results.length,\n // Get initial elements from seed or context\n elems = seed || multipleContexts(selector || \"*\", context.nodeType ? [context] : context, []),\n // Prefilter to get matcher input, preserving a map for seed-results synchronization\n matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems,\n matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n postFinder || (seed ? preFilter : preexisting || postFilter) ? // ...intermediate processing is necessary\n [] : // ...otherwise use results directly\n results : matcherIn; // Find primary matches\n\n if (matcher) {\n matcher(matcherIn, matcherOut, context, xml);\n } // Apply postFilter\n\n\n if (postFilter) {\n temp = condense(matcherOut, postMap);\n postFilter(temp, [], context, xml); // Un-match failing elements by moving them back to matcherIn\n\n i = temp.length;\n\n while (i--) {\n if (elem = temp[i]) {\n matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);\n }\n }\n }\n\n if (seed) {\n if (postFinder || preFilter) {\n if (postFinder) {\n // Get the final matcherOut by condensing this intermediate into postFinder contexts\n temp = [];\n i = matcherOut.length;\n\n while (i--) {\n if (elem = matcherOut[i]) {\n // Restore matcherIn since elem is not yet a final match\n temp.push(matcherIn[i] = elem);\n }\n }\n\n postFinder(null, matcherOut = [], temp, xml);\n } // Move matched elements from seed to results to keep them synchronized\n\n\n i = matcherOut.length;\n\n while (i--) {\n if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) {\n seed[temp] = !(results[temp] = elem);\n }\n }\n } // Add elements to results, through postFinder if defined\n\n } else {\n matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);\n\n if (postFinder) {\n postFinder(null, results, matcherOut, xml);\n } else {\n push.apply(results, matcherOut);\n }\n }\n });\n }\n\n function matcherFromTokens(tokens) {\n var checkContext,\n matcher,\n j,\n len = tokens.length,\n leadingRelative = Expr.relative[tokens[0].type],\n implicitRelative = leadingRelative || Expr.relative[\" \"],\n i = leadingRelative ? 1 : 0,\n // The foundational matcher ensures that elements are reachable from top-level context(s)\n matchContext = addCombinator(function (elem) {\n return elem === checkContext;\n }, implicitRelative, true),\n matchAnyContext = addCombinator(function (elem) {\n return indexOf(checkContext, elem) > -1;\n }, implicitRelative, true),\n matchers = [function (elem, context, xml) {\n var ret = !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); // Avoid hanging onto element (issue #299)\n\n checkContext = null;\n return ret;\n }];\n\n for (; i < len; i++) {\n if (matcher = Expr.relative[tokens[i].type]) {\n matchers = [addCombinator(elementMatcher(matchers), matcher)];\n } else {\n matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches); // Return special upon seeing a positional matcher\n\n if (matcher[expando]) {\n // Find the next relative operator (if any) for proper handling\n j = ++i;\n\n for (; j < len; j++) {\n if (Expr.relative[tokens[j].type]) {\n break;\n }\n }\n\n return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*`\n tokens.slice(0, i - 1).concat({\n value: tokens[i - 2].type === \" \" ? \"*\" : \"\"\n })).replace(rtrim, \"$1\"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens));\n }\n\n matchers.push(matcher);\n }\n }\n\n return elementMatcher(matchers);\n }\n\n function matcherFromGroupMatchers(elementMatchers, setMatchers) {\n var bySet = setMatchers.length > 0,\n byElement = elementMatchers.length > 0,\n superMatcher = function superMatcher(seed, context, xml, results, outermost) {\n var elem,\n j,\n matcher,\n matchedCount = 0,\n i = \"0\",\n unmatched = seed && [],\n setMatched = [],\n contextBackup = outermostContext,\n // We must always have either seed elements or outermost context\n elems = seed || byElement && Expr.find[\"TAG\"](\"*\", outermost),\n // Use integer dirruns iff this is the outermost matcher\n dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1,\n len = elems.length;\n\n if (outermost) {\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n outermostContext = context == document || context || outermost;\n } // Add elements passing elementMatchers directly to results\n // Support: IE<9, Safari\n // Tolerate NodeList properties (IE: \"length\"; Safari: ) matching elements by id\n\n\n for (; i !== len && (elem = elems[i]) != null; i++) {\n if (byElement && elem) {\n j = 0; // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n\n if (!context && elem.ownerDocument != document) {\n setDocument(elem);\n xml = !documentIsHTML;\n }\n\n while (matcher = elementMatchers[j++]) {\n if (matcher(elem, context || document, xml)) {\n results.push(elem);\n break;\n }\n }\n\n if (outermost) {\n dirruns = dirrunsUnique;\n }\n } // Track unmatched elements for set filters\n\n\n if (bySet) {\n // They will have gone through all possible matchers\n if (elem = !matcher && elem) {\n matchedCount--;\n } // Lengthen the array for every element, matched or not\n\n\n if (seed) {\n unmatched.push(elem);\n }\n }\n } // `i` is now the count of elements visited above, and adding it to `matchedCount`\n // makes the latter nonnegative.\n\n\n matchedCount += i; // Apply set filters to unmatched elements\n // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n // equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n // no element matchers and no seed.\n // Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n // case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n // numerically zero.\n\n if (bySet && i !== matchedCount) {\n j = 0;\n\n while (matcher = setMatchers[j++]) {\n matcher(unmatched, setMatched, context, xml);\n }\n\n if (seed) {\n // Reintegrate element matches to eliminate the need for sorting\n if (matchedCount > 0) {\n while (i--) {\n if (!(unmatched[i] || setMatched[i])) {\n setMatched[i] = pop.call(results);\n }\n }\n } // Discard index placeholder values to get only actual matches\n\n\n setMatched = condense(setMatched);\n } // Add matches to results\n\n\n push.apply(results, setMatched); // Seedless set matches succeeding multiple successful matchers stipulate sorting\n\n if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {\n Sizzle.uniqueSort(results);\n }\n } // Override manipulation of globals by nested matchers\n\n\n if (outermost) {\n dirruns = dirrunsUnique;\n outermostContext = contextBackup;\n }\n\n return unmatched;\n };\n\n return bySet ? markFunction(superMatcher) : superMatcher;\n }\n\n compile = Sizzle.compile = function (selector, match\n /* Internal Use Only */\n ) {\n var i,\n setMatchers = [],\n elementMatchers = [],\n cached = compilerCache[selector + \" \"];\n\n if (!cached) {\n // Generate a function of recursive functions that can be used to check each element\n if (!match) {\n match = tokenize(selector);\n }\n\n i = match.length;\n\n while (i--) {\n cached = matcherFromTokens(match[i]);\n\n if (cached[expando]) {\n setMatchers.push(cached);\n } else {\n elementMatchers.push(cached);\n }\n } // Cache the compiled function\n\n\n cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers)); // Save selector and tokenization\n\n cached.selector = selector;\n }\n\n return cached;\n };\n /**\n * A low-level selection function that works with Sizzle's compiled\n * selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n * selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\n\n\n select = Sizzle.select = function (selector, context, results, seed) {\n var i,\n tokens,\n token,\n type,\n find,\n compiled = typeof selector === \"function\" && selector,\n match = !seed && tokenize(selector = compiled.selector || selector);\n results = results || []; // Try to minimize operations if there is only one selector in the list and no seed\n // (the latter of which guarantees us context)\n\n if (match.length === 1) {\n // Reduce context if the leading compound selector is an ID\n tokens = match[0] = match[0].slice(0);\n\n if (tokens.length > 2 && (token = tokens[0]).type === \"ID\" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {\n context = (Expr.find[\"ID\"](token.matches[0].replace(runescape, funescape), context) || [])[0];\n\n if (!context) {\n return results; // Precompiled matchers will still verify ancestry, so step up a level\n } else if (compiled) {\n context = context.parentNode;\n }\n\n selector = selector.slice(tokens.shift().value.length);\n } // Fetch a seed set for right-to-left matching\n\n\n i = matchExpr[\"needsContext\"].test(selector) ? 0 : tokens.length;\n\n while (i--) {\n token = tokens[i]; // Abort if we hit a combinator\n\n if (Expr.relative[type = token.type]) {\n break;\n }\n\n if (find = Expr.find[type]) {\n // Search, expanding context for leading sibling combinators\n if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) {\n // If seed is empty or no tokens remain, we can return early\n tokens.splice(i, 1);\n selector = seed.length && toSelector(tokens);\n\n if (!selector) {\n push.apply(results, seed);\n return results;\n }\n\n break;\n }\n }\n }\n } // Compile and execute a filtering function if one is not provided\n // Provide `match` to avoid retokenization if we modified the selector above\n\n\n (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, !context || rsibling.test(selector) && testContext(context.parentNode) || context);\n return results;\n }; // One-time assignments\n // Sort stability\n\n\n support.sortStable = expando.split(\"\").sort(sortOrder).join(\"\") === expando; // Support: Chrome 14-35+\n // Always assume duplicates if they aren't passed to the comparison function\n\n support.detectDuplicates = !!hasDuplicate; // Initialize against the default document\n\n setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n // Detached nodes confoundingly follow *each other*\n\n support.sortDetached = assert(function (el) {\n // Should return 1, but returns 4 (following)\n return el.compareDocumentPosition(document.createElement(\"fieldset\")) & 1;\n }); // Support: IE<8\n // Prevent attribute/property \"interpolation\"\n // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\n\n if (!assert(function (el) {\n el.innerHTML = \"\";\n return el.firstChild.getAttribute(\"href\") === \"#\";\n })) {\n addHandle(\"type|href|height|width\", function (elem, name, isXML) {\n if (!isXML) {\n return elem.getAttribute(name, name.toLowerCase() === \"type\" ? 1 : 2);\n }\n });\n } // Support: IE<9\n // Use defaultValue in place of getAttribute(\"value\")\n\n\n if (!support.attributes || !assert(function (el) {\n el.innerHTML = \"\";\n el.firstChild.setAttribute(\"value\", \"\");\n return el.firstChild.getAttribute(\"value\") === \"\";\n })) {\n addHandle(\"value\", function (elem, _name, isXML) {\n if (!isXML && elem.nodeName.toLowerCase() === \"input\") {\n return elem.defaultValue;\n }\n });\n } // Support: IE<9\n // Use getAttributeNode to fetch booleans when getAttribute lies\n\n\n if (!assert(function (el) {\n return el.getAttribute(\"disabled\") == null;\n })) {\n addHandle(booleans, function (elem, name, isXML) {\n var val;\n\n if (!isXML) {\n return elem[name] === true ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;\n }\n });\n }\n\n return Sizzle;\n }(window);\n\n jQuery.find = Sizzle;\n jQuery.expr = Sizzle.selectors; // Deprecated\n\n jQuery.expr[\":\"] = jQuery.expr.pseudos;\n jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\n jQuery.text = Sizzle.getText;\n jQuery.isXMLDoc = Sizzle.isXML;\n jQuery.contains = Sizzle.contains;\n jQuery.escapeSelector = Sizzle.escape;\n\n var dir = function dir(elem, _dir, until) {\n var matched = [],\n truncate = until !== undefined;\n\n while ((elem = elem[_dir]) && elem.nodeType !== 9) {\n if (elem.nodeType === 1) {\n if (truncate && jQuery(elem).is(until)) {\n break;\n }\n\n matched.push(elem);\n }\n }\n\n return matched;\n };\n\n var _siblings = function siblings(n, elem) {\n var matched = [];\n\n for (; n; n = n.nextSibling) {\n if (n.nodeType === 1 && n !== elem) {\n matched.push(n);\n }\n }\n\n return matched;\n };\n\n var rneedsContext = jQuery.expr.match.needsContext;\n\n function nodeName(elem, name) {\n return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n }\n\n ;\n var rsingleTag = /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i; // Implement the identical functionality for filter and not\n\n function winnow(elements, qualifier, not) {\n if (isFunction(qualifier)) {\n return jQuery.grep(elements, function (elem, i) {\n return !!qualifier.call(elem, i, elem) !== not;\n });\n } // Single element\n\n\n if (qualifier.nodeType) {\n return jQuery.grep(elements, function (elem) {\n return elem === qualifier !== not;\n });\n } // Arraylike of elements (jQuery, arguments, Array)\n\n\n if (typeof qualifier !== \"string\") {\n return jQuery.grep(elements, function (elem) {\n return indexOf.call(qualifier, elem) > -1 !== not;\n });\n } // Filtered directly for both simple and complex selectors\n\n\n return jQuery.filter(qualifier, elements, not);\n }\n\n jQuery.filter = function (expr, elems, not) {\n var elem = elems[0];\n\n if (not) {\n expr = \":not(\" + expr + \")\";\n }\n\n if (elems.length === 1 && elem.nodeType === 1) {\n return jQuery.find.matchesSelector(elem, expr) ? [elem] : [];\n }\n\n return jQuery.find.matches(expr, jQuery.grep(elems, function (elem) {\n return elem.nodeType === 1;\n }));\n };\n\n jQuery.fn.extend({\n find: function find(selector) {\n var i,\n ret,\n len = this.length,\n self = this;\n\n if (typeof selector !== \"string\") {\n return this.pushStack(jQuery(selector).filter(function () {\n for (i = 0; i < len; i++) {\n if (jQuery.contains(self[i], this)) {\n return true;\n }\n }\n }));\n }\n\n ret = this.pushStack([]);\n\n for (i = 0; i < len; i++) {\n jQuery.find(selector, self[i], ret);\n }\n\n return len > 1 ? jQuery.uniqueSort(ret) : ret;\n },\n filter: function filter(selector) {\n return this.pushStack(winnow(this, selector || [], false));\n },\n not: function not(selector) {\n return this.pushStack(winnow(this, selector || [], true));\n },\n is: function is(selector) {\n return !!winnow(this, // If this is a positional/relative selector, check membership in the returned set\n // so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n typeof selector === \"string\" && rneedsContext.test(selector) ? jQuery(selector) : selector || [], false).length;\n }\n }); // Initialize a jQuery object\n // A central reference to the root jQuery(document)\n\n var rootjQuery,\n // A simple way to check for HTML strings\n // Prioritize #id over to avoid XSS via location.hash (#9521)\n // Strict HTML recognition (#11290: must start with <)\n // Shortcut simple #id case for speed\n rquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n init = jQuery.fn.init = function (selector, context, root) {\n var match, elem; // HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\n if (!selector) {\n return this;\n } // Method init() accepts an alternate rootjQuery\n // so migrate can support jQuery.sub (gh-2101)\n\n\n root = root || rootjQuery; // Handle HTML strings\n\n if (typeof selector === \"string\") {\n if (selector[0] === \"<\" && selector[selector.length - 1] === \">\" && selector.length >= 3) {\n // Assume that strings that start and end with <> are HTML and skip the regex check\n match = [null, selector, null];\n } else {\n match = rquickExpr.exec(selector);\n } // Match html or make sure no context is specified for #id\n\n\n if (match && (match[1] || !context)) {\n // HANDLE: $(html) -> $(array)\n if (match[1]) {\n context = context instanceof jQuery ? context[0] : context; // Option to run scripts is true for back-compat\n // Intentionally let the error be thrown if parseHTML is not present\n\n jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, true)); // HANDLE: $(html, props)\n\n if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {\n for (match in context) {\n // Properties of context are called as methods if possible\n if (isFunction(this[match])) {\n this[match](context[match]); // ...and otherwise set as attributes\n } else {\n this.attr(match, context[match]);\n }\n }\n }\n\n return this; // HANDLE: $(#id)\n } else {\n elem = document.getElementById(match[2]);\n\n if (elem) {\n // Inject the element directly into the jQuery object\n this[0] = elem;\n this.length = 1;\n }\n\n return this;\n } // HANDLE: $(expr, $(...))\n\n } else if (!context || context.jquery) {\n return (context || root).find(selector); // HANDLE: $(expr, context)\n // (which is just equivalent to: $(context).find(expr)\n } else {\n return this.constructor(context).find(selector);\n } // HANDLE: $(DOMElement)\n\n } else if (selector.nodeType) {\n this[0] = selector;\n this.length = 1;\n return this; // HANDLE: $(function)\n // Shortcut for document ready\n } else if (isFunction(selector)) {\n return root.ready !== undefined ? root.ready(selector) : // Execute immediately if ready is not present\n selector(jQuery);\n }\n\n return jQuery.makeArray(selector, this);\n }; // Give the init function the jQuery prototype for later instantiation\n\n\n init.prototype = jQuery.fn; // Initialize central reference\n\n rootjQuery = jQuery(document);\n var rparentsprev = /^(?:parents|prev(?:Until|All))/,\n // Methods guaranteed to produce a unique set when starting from a unique set\n guaranteedUnique = {\n children: true,\n contents: true,\n next: true,\n prev: true\n };\n jQuery.fn.extend({\n has: function has(target) {\n var targets = jQuery(target, this),\n l = targets.length;\n return this.filter(function () {\n var i = 0;\n\n for (; i < l; i++) {\n if (jQuery.contains(this, targets[i])) {\n return true;\n }\n }\n });\n },\n closest: function closest(selectors, context) {\n var cur,\n i = 0,\n l = this.length,\n matched = [],\n targets = typeof selectors !== \"string\" && jQuery(selectors); // Positional selectors never match, since there's no _selection_ context\n\n if (!rneedsContext.test(selectors)) {\n for (; i < l; i++) {\n for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {\n // Always skip document fragments\n if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 : // Don't pass non-elements to Sizzle\n cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) {\n matched.push(cur);\n break;\n }\n }\n }\n }\n\n return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);\n },\n // Determine the position of an element within the set\n index: function index(elem) {\n // No argument, return index in parent\n if (!elem) {\n return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;\n } // Index in selector\n\n\n if (typeof elem === \"string\") {\n return indexOf.call(jQuery(elem), this[0]);\n } // Locate the position of the desired element\n\n\n return indexOf.call(this, // If it receives a jQuery object, the first element is used\n elem.jquery ? elem[0] : elem);\n },\n add: function add(selector, context) {\n return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(selector, context))));\n },\n addBack: function addBack(selector) {\n return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));\n }\n });\n\n function sibling(cur, dir) {\n while ((cur = cur[dir]) && cur.nodeType !== 1) {}\n\n return cur;\n }\n\n jQuery.each({\n parent: function parent(elem) {\n var parent = elem.parentNode;\n return parent && parent.nodeType !== 11 ? parent : null;\n },\n parents: function parents(elem) {\n return dir(elem, \"parentNode\");\n },\n parentsUntil: function parentsUntil(elem, _i, until) {\n return dir(elem, \"parentNode\", until);\n },\n next: function next(elem) {\n return sibling(elem, \"nextSibling\");\n },\n prev: function prev(elem) {\n return sibling(elem, \"previousSibling\");\n },\n nextAll: function nextAll(elem) {\n return dir(elem, \"nextSibling\");\n },\n prevAll: function prevAll(elem) {\n return dir(elem, \"previousSibling\");\n },\n nextUntil: function nextUntil(elem, _i, until) {\n return dir(elem, \"nextSibling\", until);\n },\n prevUntil: function prevUntil(elem, _i, until) {\n return dir(elem, \"previousSibling\", until);\n },\n siblings: function siblings(elem) {\n return _siblings((elem.parentNode || {}).firstChild, elem);\n },\n children: function children(elem) {\n return _siblings(elem.firstChild);\n },\n contents: function contents(elem) {\n if (elem.contentDocument != null && // Support: IE 11+\n // elements with no `data` attribute has an object\n // `contentDocument` with a `null` prototype.\n getProto(elem.contentDocument)) {\n return elem.contentDocument;\n } // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n // Treat the template element as a regular one in browsers that\n // don't support it.\n\n\n if (nodeName(elem, \"template\")) {\n elem = elem.content || elem;\n }\n\n return jQuery.merge([], elem.childNodes);\n }\n }, function (name, fn) {\n jQuery.fn[name] = function (until, selector) {\n var matched = jQuery.map(this, fn, until);\n\n if (name.slice(-5) !== \"Until\") {\n selector = until;\n }\n\n if (selector && typeof selector === \"string\") {\n matched = jQuery.filter(selector, matched);\n }\n\n if (this.length > 1) {\n // Remove duplicates\n if (!guaranteedUnique[name]) {\n jQuery.uniqueSort(matched);\n } // Reverse order for parents* and prev-derivatives\n\n\n if (rparentsprev.test(name)) {\n matched.reverse();\n }\n }\n\n return this.pushStack(matched);\n };\n });\n var rnothtmlwhite = /[^\\x20\\t\\r\\n\\f]+/g; // Convert String-formatted options into Object-formatted ones\n\n function createOptions(options) {\n var object = {};\n jQuery.each(options.match(rnothtmlwhite) || [], function (_, flag) {\n object[flag] = true;\n });\n return object;\n }\n /*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\n\n\n jQuery.Callbacks = function (options) {\n // Convert options from String-formatted to Object-formatted if needed\n // (we check in cache first)\n options = typeof options === \"string\" ? createOptions(options) : jQuery.extend({}, options);\n\n var // Flag to know if list is currently firing\n firing,\n // Last fire value for non-forgettable lists\n memory,\n // Flag to know if list was already fired\n _fired,\n // Flag to prevent firing\n _locked,\n // Actual callback list\n list = [],\n // Queue of execution data for repeatable lists\n queue = [],\n // Index of currently firing callback (modified by add/remove as needed)\n firingIndex = -1,\n // Fire callbacks\n fire = function fire() {\n // Enforce single-firing\n _locked = _locked || options.once; // Execute callbacks for all pending executions,\n // respecting firingIndex overrides and runtime changes\n\n _fired = firing = true;\n\n for (; queue.length; firingIndex = -1) {\n memory = queue.shift();\n\n while (++firingIndex < list.length) {\n // Run callback and check for early termination\n if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) {\n // Jump to end and forget the data so .add doesn't re-fire\n firingIndex = list.length;\n memory = false;\n }\n }\n } // Forget the data if we're done with it\n\n\n if (!options.memory) {\n memory = false;\n }\n\n firing = false; // Clean up if we're done firing for good\n\n if (_locked) {\n // Keep an empty list if we have data for future add calls\n if (memory) {\n list = []; // Otherwise, this object is spent\n } else {\n list = \"\";\n }\n }\n },\n // Actual Callbacks object\n self = {\n // Add a callback or a collection of callbacks to the list\n add: function add() {\n if (list) {\n // If we have memory from a past run, we should fire after adding\n if (memory && !firing) {\n firingIndex = list.length - 1;\n queue.push(memory);\n }\n\n (function add(args) {\n jQuery.each(args, function (_, arg) {\n if (isFunction(arg)) {\n if (!options.unique || !self.has(arg)) {\n list.push(arg);\n }\n } else if (arg && arg.length && toType(arg) !== \"string\") {\n // Inspect recursively\n add(arg);\n }\n });\n })(arguments);\n\n if (memory && !firing) {\n fire();\n }\n }\n\n return this;\n },\n // Remove a callback from the list\n remove: function remove() {\n jQuery.each(arguments, function (_, arg) {\n var index;\n\n while ((index = jQuery.inArray(arg, list, index)) > -1) {\n list.splice(index, 1); // Handle firing indexes\n\n if (index <= firingIndex) {\n firingIndex--;\n }\n }\n });\n return this;\n },\n // Check if a given callback is in the list.\n // If no argument is given, return whether or not list has callbacks attached.\n has: function has(fn) {\n return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0;\n },\n // Remove all callbacks from the list\n empty: function empty() {\n if (list) {\n list = [];\n }\n\n return this;\n },\n // Disable .fire and .add\n // Abort any current/pending executions\n // Clear all callbacks and values\n disable: function disable() {\n _locked = queue = [];\n list = memory = \"\";\n return this;\n },\n disabled: function disabled() {\n return !list;\n },\n // Disable .fire\n // Also disable .add unless we have memory (since it would have no effect)\n // Abort any pending executions\n lock: function lock() {\n _locked = queue = [];\n\n if (!memory && !firing) {\n list = memory = \"\";\n }\n\n return this;\n },\n locked: function locked() {\n return !!_locked;\n },\n // Call all callbacks with the given context and arguments\n fireWith: function fireWith(context, args) {\n if (!_locked) {\n args = args || [];\n args = [context, args.slice ? args.slice() : args];\n queue.push(args);\n\n if (!firing) {\n fire();\n }\n }\n\n return this;\n },\n // Call all the callbacks with the given arguments\n fire: function fire() {\n self.fireWith(this, arguments);\n return this;\n },\n // To know if the callbacks have already been called at least once\n fired: function fired() {\n return !!_fired;\n }\n };\n\n return self;\n };\n\n function Identity(v) {\n return v;\n }\n\n function Thrower(ex) {\n throw ex;\n }\n\n function adoptValue(value, resolve, reject, noValue) {\n var method;\n\n try {\n // Check for promise aspect first to privilege synchronous behavior\n if (value && isFunction(method = value.promise)) {\n method.call(value).done(resolve).fail(reject); // Other thenables\n } else if (value && isFunction(method = value.then)) {\n method.call(value, resolve, reject); // Other non-thenables\n } else {\n // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n // * false: [ value ].slice( 0 ) => resolve( value )\n // * true: [ value ].slice( 1 ) => resolve()\n resolve.apply(undefined, [value].slice(noValue));\n } // For Promises/A+, convert exceptions into rejections\n // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n // Deferred#then to conditionally suppress rejection.\n\n } catch (value) {\n // Support: Android 4.0 only\n // Strict mode functions invoked without .call/.apply get global-object context\n reject.apply(undefined, [value]);\n }\n }\n\n jQuery.extend({\n Deferred: function Deferred(func) {\n var tuples = [// action, add listener, callbacks,\n // ... .then handlers, argument index, [final state]\n [\"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\"]],\n _state = \"pending\",\n _promise = {\n state: function state() {\n return _state;\n },\n always: function always() {\n deferred.done(arguments).fail(arguments);\n return this;\n },\n \"catch\": function _catch(fn) {\n return _promise.then(null, fn);\n },\n // Keep pipe for back-compat\n pipe: function pipe()\n /* fnDone, fnFail, fnProgress */\n {\n var fns = arguments;\n return jQuery.Deferred(function (newDefer) {\n jQuery.each(tuples, function (_i, tuple) {\n // Map tuples (progress, done, fail) to arguments (done, fail, progress)\n var fn = isFunction(fns[tuple[4]]) && fns[tuple[4]]; // deferred.progress(function() { bind to newDefer or newDefer.notify })\n // deferred.done(function() { bind to newDefer or newDefer.resolve })\n // deferred.fail(function() { bind to newDefer or newDefer.reject })\n\n deferred[tuple[1]](function () {\n var returned = fn && fn.apply(this, arguments);\n\n if (returned && isFunction(returned.promise)) {\n returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);\n } else {\n newDefer[tuple[0] + \"With\"](this, fn ? [returned] : arguments);\n }\n });\n });\n fns = null;\n }).promise();\n },\n then: function then(onFulfilled, onRejected, onProgress) {\n var maxDepth = 0;\n\n function resolve(depth, deferred, handler, special) {\n return function () {\n var that = this,\n args = arguments,\n mightThrow = function mightThrow() {\n var returned, then; // Support: Promises/A+ section 2.3.3.3.3\n // https://promisesaplus.com/#point-59\n // Ignore double-resolution attempts\n\n if (depth < maxDepth) {\n return;\n }\n\n returned = handler.apply(that, args); // Support: Promises/A+ section 2.3.1\n // https://promisesaplus.com/#point-48\n\n if (returned === deferred.promise()) {\n throw new TypeError(\"Thenable self-resolution\");\n } // Support: Promises/A+ sections 2.3.3.1, 3.5\n // https://promisesaplus.com/#point-54\n // https://promisesaplus.com/#point-75\n // Retrieve `then` only once\n\n\n then = returned && ( // Support: Promises/A+ section 2.3.4\n // https://promisesaplus.com/#point-64\n // Only check objects and functions for thenability\n _typeof(returned) === \"object\" || typeof returned === \"function\") && returned.then; // Handle a returned thenable\n\n if (isFunction(then)) {\n // Special processors (notify) just wait for resolution\n if (special) {\n then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special)); // Normal processors (resolve) also hook into progress\n } else {\n // ...and disregard older resolution values\n maxDepth++;\n then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special), resolve(maxDepth, deferred, Identity, deferred.notifyWith));\n } // Handle all other returned values\n\n } else {\n // Only substitute handlers pass on context\n // and multiple values (non-spec behavior)\n if (handler !== Identity) {\n that = undefined;\n args = [returned];\n } // Process the value(s)\n // Default process is resolve\n\n\n (special || deferred.resolveWith)(that, args);\n }\n },\n // Only normal processors (resolve) catch and reject exceptions\n process = special ? mightThrow : function () {\n try {\n mightThrow();\n } catch (e) {\n if (jQuery.Deferred.exceptionHook) {\n jQuery.Deferred.exceptionHook(e, process.stackTrace);\n } // Support: Promises/A+ section 2.3.3.3.4.1\n // https://promisesaplus.com/#point-61\n // Ignore post-resolution exceptions\n\n\n if (depth + 1 >= maxDepth) {\n // Only substitute handlers pass on context\n // and multiple values (non-spec behavior)\n if (handler !== Thrower) {\n that = undefined;\n args = [e];\n }\n\n deferred.rejectWith(that, args);\n }\n }\n }; // Support: Promises/A+ section 2.3.3.3.1\n // https://promisesaplus.com/#point-57\n // Re-resolve promises immediately to dodge false rejection from\n // subsequent errors\n\n\n if (depth) {\n process();\n } else {\n // Call an optional hook to record the stack, in case of exception\n // since it's otherwise lost when execution goes async\n if (jQuery.Deferred.getStackHook) {\n process.stackTrace = jQuery.Deferred.getStackHook();\n }\n\n window.setTimeout(process);\n }\n };\n }\n\n return jQuery.Deferred(function (newDefer) {\n // progress_handlers.add( ... )\n tuples[0][3].add(resolve(0, newDefer, isFunction(onProgress) ? onProgress : Identity, newDefer.notifyWith)); // fulfilled_handlers.add( ... )\n\n tuples[1][3].add(resolve(0, newDefer, isFunction(onFulfilled) ? onFulfilled : Identity)); // rejected_handlers.add( ... )\n\n tuples[2][3].add(resolve(0, newDefer, isFunction(onRejected) ? onRejected : Thrower));\n }).promise();\n },\n // Get a promise for this deferred\n // If obj is provided, the promise aspect is added to the object\n promise: function promise(obj) {\n return obj != null ? jQuery.extend(obj, _promise) : _promise;\n }\n },\n deferred = {}; // Add list-specific methods\n\n jQuery.each(tuples, function (i, tuple) {\n var list = tuple[2],\n stateString = tuple[5]; // promise.progress = list.add\n // promise.done = list.add\n // promise.fail = list.add\n\n _promise[tuple[1]] = list.add; // Handle state\n\n if (stateString) {\n list.add(function () {\n // state = \"resolved\" (i.e., fulfilled)\n // state = \"rejected\"\n _state = stateString;\n }, // rejected_callbacks.disable\n // fulfilled_callbacks.disable\n tuples[3 - i][2].disable, // rejected_handlers.disable\n // fulfilled_handlers.disable\n tuples[3 - i][3].disable, // progress_callbacks.lock\n tuples[0][2].lock, // progress_handlers.lock\n tuples[0][3].lock);\n } // progress_handlers.fire\n // fulfilled_handlers.fire\n // rejected_handlers.fire\n\n\n list.add(tuple[3].fire); // deferred.notify = function() { deferred.notifyWith(...) }\n // deferred.resolve = function() { deferred.resolveWith(...) }\n // deferred.reject = function() { deferred.rejectWith(...) }\n\n deferred[tuple[0]] = function () {\n deferred[tuple[0] + \"With\"](this === deferred ? undefined : this, arguments);\n return this;\n }; // deferred.notifyWith = list.fireWith\n // deferred.resolveWith = list.fireWith\n // deferred.rejectWith = list.fireWith\n\n\n deferred[tuple[0] + \"With\"] = list.fireWith;\n }); // Make the deferred a promise\n\n _promise.promise(deferred); // Call given func if any\n\n\n if (func) {\n func.call(deferred, deferred);\n } // All done!\n\n\n return deferred;\n },\n // Deferred helper\n when: function when(singleValue) {\n var // count of uncompleted subordinates\n remaining = arguments.length,\n // count of unprocessed arguments\n i = remaining,\n // subordinate fulfillment data\n resolveContexts = Array(i),\n resolveValues = _slice.call(arguments),\n // the master Deferred\n master = jQuery.Deferred(),\n // subordinate callback factory\n updateFunc = function updateFunc(i) {\n return function (value) {\n resolveContexts[i] = this;\n resolveValues[i] = arguments.length > 1 ? _slice.call(arguments) : value;\n\n if (! --remaining) {\n master.resolveWith(resolveContexts, resolveValues);\n }\n };\n }; // Single- and empty arguments are adopted like Promise.resolve\n\n\n if (remaining <= 1) {\n adoptValue(singleValue, master.done(updateFunc(i)).resolve, master.reject, !remaining); // Use .then() to unwrap secondary thenables (cf. gh-3000)\n\n if (master.state() === \"pending\" || isFunction(resolveValues[i] && resolveValues[i].then)) {\n return master.then();\n }\n } // Multiple arguments are aggregated like Promise.all array elements\n\n\n while (i--) {\n adoptValue(resolveValues[i], updateFunc(i), master.reject);\n }\n\n return master.promise();\n }\n }); // These usually indicate a programmer mistake during development,\n // warn about them ASAP rather than swallowing them by default.\n\n var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\n jQuery.Deferred.exceptionHook = function (error, stack) {\n // Support: IE 8 - 9 only\n // Console exists when dev tools are open, which can happen at any time\n if (window.console && window.console.warn && error && rerrorNames.test(error.name)) {\n window.console.warn(\"jQuery.Deferred exception: \" + error.message, error.stack, stack);\n }\n };\n\n jQuery.readyException = function (error) {\n window.setTimeout(function () {\n throw error;\n });\n }; // The deferred used on DOM ready\n\n\n var readyList = jQuery.Deferred();\n\n jQuery.fn.ready = function (fn) {\n readyList.then(fn) // Wrap jQuery.readyException in a function so that the lookup\n // happens at the time of error handling instead of callback\n // registration.\n [\"catch\"](function (error) {\n jQuery.readyException(error);\n });\n return this;\n };\n\n jQuery.extend({\n // Is the DOM ready to be used? Set to true once it occurs.\n isReady: false,\n // A counter to track how many items to wait for before\n // the ready event fires. See #6781\n readyWait: 1,\n // Handle when the DOM is ready\n ready: function ready(wait) {\n // Abort if there are pending holds or we're already ready\n if (wait === true ? --jQuery.readyWait : jQuery.isReady) {\n return;\n } // Remember that the DOM is ready\n\n\n jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be\n\n if (wait !== true && --jQuery.readyWait > 0) {\n return;\n } // If there are functions bound, to execute\n\n\n readyList.resolveWith(document, [jQuery]);\n }\n });\n jQuery.ready.then = readyList.then; // The ready event handler and self cleanup method\n\n function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n } // Catch cases where $(document).ready() is called\n // after the browser event has already occurred.\n // Support: IE <=9 - 10 only\n // Older IE sometimes signals \"interactive\" too soon\n\n\n if (document.readyState === \"complete\" || document.readyState !== \"loading\" && !document.documentElement.doScroll) {\n // Handle it asynchronously to allow scripts the opportunity to delay ready\n window.setTimeout(jQuery.ready);\n } else {\n // Use the handy event callback\n document.addEventListener(\"DOMContentLoaded\", completed); // A fallback to window.onload, that will always work\n\n window.addEventListener(\"load\", completed);\n } // Multifunctional method to get and set values of a collection\n // The value/s can optionally be executed if it's a function\n\n\n var access = function access(elems, fn, key, value, chainable, emptyGet, raw) {\n var i = 0,\n len = elems.length,\n bulk = key == null; // Sets many values\n\n if (toType(key) === \"object\") {\n chainable = true;\n\n for (i in key) {\n access(elems, fn, i, key[i], true, emptyGet, raw);\n } // Sets one value\n\n } else if (value !== undefined) {\n chainable = true;\n\n if (!isFunction(value)) {\n raw = true;\n }\n\n if (bulk) {\n // Bulk operations run against the entire set\n if (raw) {\n fn.call(elems, value);\n fn = null; // ...except when executing function values\n } else {\n bulk = fn;\n\n fn = function fn(elem, _key, value) {\n return bulk.call(jQuery(elem), value);\n };\n }\n }\n\n if (fn) {\n for (; i < len; i++) {\n fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));\n }\n }\n }\n\n if (chainable) {\n return elems;\n } // Gets\n\n\n if (bulk) {\n return fn.call(elems);\n }\n\n return len ? fn(elems[0], key) : emptyGet;\n }; // Matches dashed string for camelizing\n\n\n var rmsPrefix = /^-ms-/,\n rdashAlpha = /-([a-z])/g; // Used by camelCase as callback to replace()\n\n function fcamelCase(_all, letter) {\n return letter.toUpperCase();\n } // Convert dashed to camelCase; used by the css and data modules\n // Support: IE <=9 - 11, Edge 12 - 15\n // Microsoft forgot to hump their vendor prefix (#9572)\n\n\n function camelCase(string) {\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n }\n\n var acceptData = function acceptData(owner) {\n // Accepts only:\n // - Node\n // - Node.ELEMENT_NODE\n // - Node.DOCUMENT_NODE\n // - Object\n // - Any\n return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;\n };\n\n function Data() {\n this.expando = jQuery.expando + Data.uid++;\n }\n\n Data.uid = 1;\n Data.prototype = {\n cache: function cache(owner) {\n // Check if the owner object already has a cache\n var value = owner[this.expando]; // If not, create one\n\n if (!value) {\n value = {}; // We can accept data for non-element nodes in modern browsers,\n // but we should not, see #8335.\n // Always return an empty object.\n\n if (acceptData(owner)) {\n // If it is a node unlikely to be stringify-ed or looped over\n // use plain assignment\n if (owner.nodeType) {\n owner[this.expando] = value; // Otherwise secure it in a non-enumerable property\n // configurable must be true to allow the property to be\n // deleted when data is removed\n } else {\n Object.defineProperty(owner, this.expando, {\n value: value,\n configurable: true\n });\n }\n }\n }\n\n return value;\n },\n set: function set(owner, data, value) {\n var prop,\n cache = this.cache(owner); // Handle: [ owner, key, value ] args\n // Always use camelCase key (gh-2257)\n\n if (typeof data === \"string\") {\n cache[camelCase(data)] = value; // Handle: [ owner, { properties } ] args\n } else {\n // Copy the properties one-by-one to the cache object\n for (prop in data) {\n cache[camelCase(prop)] = data[prop];\n }\n }\n\n return cache;\n },\n get: function get(owner, key) {\n return key === undefined ? this.cache(owner) : // Always use camelCase key (gh-2257)\n owner[this.expando] && owner[this.expando][camelCase(key)];\n },\n access: function access(owner, key, value) {\n // In cases where either:\n //\n // 1. No key was specified\n // 2. A string key was specified, but no value provided\n //\n // Take the \"read\" path and allow the get method to determine\n // which value to return, respectively either:\n //\n // 1. The entire cache object\n // 2. The data stored at the key\n //\n if (key === undefined || key && typeof key === \"string\" && value === undefined) {\n return this.get(owner, key);\n } // When the key is not a string, or both a key and value\n // are specified, set or extend (existing objects) with either:\n //\n // 1. An object of properties\n // 2. A key and value\n //\n\n\n this.set(owner, key, value); // Since the \"set\" path can have two possible entry points\n // return the expected data based on which path was taken[*]\n\n return value !== undefined ? value : key;\n },\n remove: function remove(owner, key) {\n var i,\n cache = owner[this.expando];\n\n if (cache === undefined) {\n return;\n }\n\n if (key !== undefined) {\n // Support array or space separated string of keys\n if (Array.isArray(key)) {\n // If key is an array of keys...\n // We always set camelCase keys, so remove that.\n key = key.map(camelCase);\n } else {\n key = camelCase(key); // If a key with the spaces exists, use it.\n // Otherwise, create an array by matching non-whitespace\n\n key = key in cache ? [key] : key.match(rnothtmlwhite) || [];\n }\n\n i = key.length;\n\n while (i--) {\n delete cache[key[i]];\n }\n } // Remove the expando if there's no more data\n\n\n if (key === undefined || jQuery.isEmptyObject(cache)) {\n // Support: Chrome <=35 - 45\n // Webkit & Blink performance suffers when deleting properties\n // from DOM nodes, so set to undefined instead\n // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n if (owner.nodeType) {\n owner[this.expando] = undefined;\n } else {\n delete owner[this.expando];\n }\n }\n },\n hasData: function hasData(owner) {\n var cache = owner[this.expando];\n return cache !== undefined && !jQuery.isEmptyObject(cache);\n }\n };\n var dataPriv = new Data();\n var dataUser = new Data(); //\tImplementation Summary\n //\n //\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n //\t2. Improve the module's maintainability by reducing the storage\n //\t\tpaths to a single mechanism.\n //\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n //\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n //\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n //\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\n var rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n rmultiDash = /[A-Z]/g;\n\n function getData(data) {\n if (data === \"true\") {\n return true;\n }\n\n if (data === \"false\") {\n return false;\n }\n\n if (data === \"null\") {\n return null;\n } // Only convert to a number if it doesn't change the string\n\n\n if (data === +data + \"\") {\n return +data;\n }\n\n if (rbrace.test(data)) {\n return JSON.parse(data);\n }\n\n return data;\n }\n\n function dataAttr(elem, key, data) {\n var name; // If nothing was found internally, try to fetch any\n // data from the HTML5 data-* attribute\n\n if (data === undefined && elem.nodeType === 1) {\n name = \"data-\" + key.replace(rmultiDash, \"-$&\").toLowerCase();\n data = elem.getAttribute(name);\n\n if (typeof data === \"string\") {\n try {\n data = getData(data);\n } catch (e) {} // Make sure we set the data so it isn't changed later\n\n\n dataUser.set(elem, key, data);\n } else {\n data = undefined;\n }\n }\n\n return data;\n }\n\n jQuery.extend({\n hasData: function hasData(elem) {\n return dataUser.hasData(elem) || dataPriv.hasData(elem);\n },\n data: function data(elem, name, _data) {\n return dataUser.access(elem, name, _data);\n },\n removeData: function removeData(elem, name) {\n dataUser.remove(elem, name);\n },\n // TODO: Now that all calls to _data and _removeData have been replaced\n // with direct calls to dataPriv methods, these can be deprecated.\n _data: function _data(elem, name, data) {\n return dataPriv.access(elem, name, data);\n },\n _removeData: function _removeData(elem, name) {\n dataPriv.remove(elem, name);\n }\n });\n jQuery.fn.extend({\n data: function data(key, value) {\n var i,\n name,\n data,\n elem = this[0],\n attrs = elem && elem.attributes; // Gets all values\n\n if (key === undefined) {\n if (this.length) {\n data = dataUser.get(elem);\n\n if (elem.nodeType === 1 && !dataPriv.get(elem, \"hasDataAttrs\")) {\n i = attrs.length;\n\n while (i--) {\n // Support: IE 11 only\n // The attrs elements can be null (#14894)\n if (attrs[i]) {\n name = attrs[i].name;\n\n if (name.indexOf(\"data-\") === 0) {\n name = camelCase(name.slice(5));\n dataAttr(elem, name, data[name]);\n }\n }\n }\n\n dataPriv.set(elem, \"hasDataAttrs\", true);\n }\n }\n\n return data;\n } // Sets multiple values\n\n\n if (_typeof(key) === \"object\") {\n return this.each(function () {\n dataUser.set(this, key);\n });\n }\n\n return access(this, function (value) {\n var data; // The calling jQuery object (element matches) is not empty\n // (and therefore has an element appears at this[ 0 ]) and the\n // `value` parameter was not undefined. An empty jQuery object\n // will result in `undefined` for elem = this[ 0 ] which will\n // throw an exception if an attempt to read a data cache is made.\n\n if (elem && value === undefined) {\n // Attempt to get data from the cache\n // The key will always be camelCased in Data\n data = dataUser.get(elem, key);\n\n if (data !== undefined) {\n return data;\n } // Attempt to \"discover\" the data in\n // HTML5 custom data-* attrs\n\n\n data = dataAttr(elem, key);\n\n if (data !== undefined) {\n return data;\n } // We tried really hard, but the data doesn't exist.\n\n\n return;\n } // Set the data...\n\n\n this.each(function () {\n // We always store the camelCased key\n dataUser.set(this, key, value);\n });\n }, null, value, arguments.length > 1, null, true);\n },\n removeData: function removeData(key) {\n return this.each(function () {\n dataUser.remove(this, key);\n });\n }\n });\n jQuery.extend({\n queue: function queue(elem, type, data) {\n var queue;\n\n if (elem) {\n type = (type || \"fx\") + \"queue\";\n queue = dataPriv.get(elem, type); // Speed up dequeue by getting out quickly if this is just a lookup\n\n if (data) {\n if (!queue || Array.isArray(data)) {\n queue = dataPriv.access(elem, type, jQuery.makeArray(data));\n } else {\n queue.push(data);\n }\n }\n\n return queue || [];\n }\n },\n dequeue: function dequeue(elem, type) {\n type = type || \"fx\";\n\n var queue = jQuery.queue(elem, type),\n startLength = queue.length,\n fn = queue.shift(),\n hooks = jQuery._queueHooks(elem, type),\n next = function next() {\n jQuery.dequeue(elem, type);\n }; // If the fx queue is dequeued, always remove the progress sentinel\n\n\n if (fn === \"inprogress\") {\n fn = queue.shift();\n startLength--;\n }\n\n if (fn) {\n // Add a progress sentinel to prevent the fx queue from being\n // automatically dequeued\n if (type === \"fx\") {\n queue.unshift(\"inprogress\");\n } // Clear up the last queue stop function\n\n\n delete hooks.stop;\n fn.call(elem, next, hooks);\n }\n\n if (!startLength && hooks) {\n hooks.empty.fire();\n }\n },\n // Not public - generate a queueHooks object, or return the current one\n _queueHooks: function _queueHooks(elem, type) {\n var key = type + \"queueHooks\";\n return dataPriv.get(elem, key) || dataPriv.access(elem, key, {\n empty: jQuery.Callbacks(\"once memory\").add(function () {\n dataPriv.remove(elem, [type + \"queue\", key]);\n })\n });\n }\n });\n jQuery.fn.extend({\n queue: function queue(type, data) {\n var setter = 2;\n\n if (typeof type !== \"string\") {\n data = type;\n type = \"fx\";\n setter--;\n }\n\n if (arguments.length < setter) {\n return jQuery.queue(this[0], type);\n }\n\n return data === undefined ? this : this.each(function () {\n var queue = jQuery.queue(this, type, data); // Ensure a hooks for this queue\n\n jQuery._queueHooks(this, type);\n\n if (type === \"fx\" && queue[0] !== \"inprogress\") {\n jQuery.dequeue(this, type);\n }\n });\n },\n dequeue: function dequeue(type) {\n return this.each(function () {\n jQuery.dequeue(this, type);\n });\n },\n clearQueue: function clearQueue(type) {\n return this.queue(type || \"fx\", []);\n },\n // Get a promise resolved when queues of a certain type\n // are emptied (fx is the type by default)\n promise: function promise(type, obj) {\n var tmp,\n count = 1,\n defer = jQuery.Deferred(),\n elements = this,\n i = this.length,\n resolve = function resolve() {\n if (! --count) {\n defer.resolveWith(elements, [elements]);\n }\n };\n\n if (typeof type !== \"string\") {\n obj = type;\n type = undefined;\n }\n\n type = type || \"fx\";\n\n while (i--) {\n tmp = dataPriv.get(elements[i], type + \"queueHooks\");\n\n if (tmp && tmp.empty) {\n count++;\n tmp.empty.add(resolve);\n }\n }\n\n resolve();\n return defer.promise(obj);\n }\n });\n var pnum = /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source;\n var rcssNum = new RegExp(\"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\");\n var cssExpand = [\"Top\", \"Right\", \"Bottom\", \"Left\"];\n var documentElement = document.documentElement;\n\n var isAttached = function isAttached(elem) {\n return jQuery.contains(elem.ownerDocument, elem);\n },\n composed = {\n composed: true\n }; // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n // Check attachment across shadow DOM boundaries when possible (gh-3504)\n // Support: iOS 10.0-10.2 only\n // Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n // leading to errors. We need to check for `getRootNode`.\n\n\n if (documentElement.getRootNode) {\n isAttached = function isAttached(elem) {\n return jQuery.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument;\n };\n }\n\n var isHiddenWithinTree = function isHiddenWithinTree(elem, el) {\n // isHiddenWithinTree might be called from jQuery#filter function;\n // in that case, element will be second argument\n elem = el || elem; // Inline style trumps all\n\n return elem.style.display === \"none\" || elem.style.display === \"\" && // Otherwise, check computed style\n // Support: Firefox <=43 - 45\n // Disconnected elements can have computed display: none, so first confirm that elem is\n // in the document.\n isAttached(elem) && jQuery.css(elem, \"display\") === \"none\";\n };\n\n function adjustCSS(elem, prop, valueParts, tween) {\n var adjusted,\n scale,\n maxIterations = 20,\n currentValue = tween ? function () {\n return tween.cur();\n } : function () {\n return jQuery.css(elem, prop, \"\");\n },\n initial = currentValue(),\n unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? \"\" : \"px\"),\n // Starting value computation is required for potential unit mismatches\n initialInUnit = elem.nodeType && (jQuery.cssNumber[prop] || unit !== \"px\" && +initial) && rcssNum.exec(jQuery.css(elem, prop));\n\n if (initialInUnit && initialInUnit[3] !== unit) {\n // Support: Firefox <=54\n // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n initial = initial / 2; // Trust units reported by jQuery.css\n\n unit = unit || initialInUnit[3]; // Iteratively approximate from a nonzero starting point\n\n initialInUnit = +initial || 1;\n\n while (maxIterations--) {\n // Evaluate and update our best guess (doubling guesses that zero out).\n // Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n jQuery.style(elem, prop, initialInUnit + unit);\n\n if ((1 - scale) * (1 - (scale = currentValue() / initial || 0.5)) <= 0) {\n maxIterations = 0;\n }\n\n initialInUnit = initialInUnit / scale;\n }\n\n initialInUnit = initialInUnit * 2;\n jQuery.style(elem, prop, initialInUnit + unit); // Make sure we update the tween properties later on\n\n valueParts = valueParts || [];\n }\n\n if (valueParts) {\n initialInUnit = +initialInUnit || +initial || 0; // Apply relative offset (+=/-=) if specified\n\n adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];\n\n if (tween) {\n tween.unit = unit;\n tween.start = initialInUnit;\n tween.end = adjusted;\n }\n }\n\n return adjusted;\n }\n\n var defaultDisplayMap = {};\n\n function getDefaultDisplay(elem) {\n var temp,\n doc = elem.ownerDocument,\n nodeName = elem.nodeName,\n display = defaultDisplayMap[nodeName];\n\n if (display) {\n return display;\n }\n\n temp = doc.body.appendChild(doc.createElement(nodeName));\n display = jQuery.css(temp, \"display\");\n temp.parentNode.removeChild(temp);\n\n if (display === \"none\") {\n display = \"block\";\n }\n\n defaultDisplayMap[nodeName] = display;\n return display;\n }\n\n function showHide(elements, show) {\n var display,\n elem,\n values = [],\n index = 0,\n length = elements.length; // Determine new display value for elements that need to change\n\n for (; index < length; index++) {\n elem = elements[index];\n\n if (!elem.style) {\n continue;\n }\n\n display = elem.style.display;\n\n if (show) {\n // Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n // check is required in this first loop unless we have a nonempty display value (either\n // inline or about-to-be-restored)\n if (display === \"none\") {\n values[index] = dataPriv.get(elem, \"display\") || null;\n\n if (!values[index]) {\n elem.style.display = \"\";\n }\n }\n\n if (elem.style.display === \"\" && isHiddenWithinTree(elem)) {\n values[index] = getDefaultDisplay(elem);\n }\n } else {\n if (display !== \"none\") {\n values[index] = \"none\"; // Remember what we're overwriting\n\n dataPriv.set(elem, \"display\", display);\n }\n }\n } // Set the display of the elements in a second loop to avoid constant reflow\n\n\n for (index = 0; index < length; index++) {\n if (values[index] != null) {\n elements[index].style.display = values[index];\n }\n }\n\n return elements;\n }\n\n jQuery.fn.extend({\n show: function show() {\n return showHide(this, true);\n },\n hide: function hide() {\n return showHide(this);\n },\n toggle: function toggle(state) {\n if (typeof state === \"boolean\") {\n return state ? this.show() : this.hide();\n }\n\n return this.each(function () {\n if (isHiddenWithinTree(this)) {\n jQuery(this).show();\n } else {\n jQuery(this).hide();\n }\n });\n }\n });\n var rcheckableType = /^(?:checkbox|radio)$/i;\n var rtagName = /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i;\n var rscriptType = /^$|^module$|\\/(?:java|ecma)script/i;\n\n (function () {\n var fragment = document.createDocumentFragment(),\n div = fragment.appendChild(document.createElement(\"div\")),\n input = document.createElement(\"input\"); // Support: Android 4.0 - 4.3 only\n // Check state lost if the name is set (#11217)\n // Support: Windows Web Apps (WWA)\n // `name` and `type` must use .setAttribute for WWA (#14901)\n\n input.setAttribute(\"type\", \"radio\");\n input.setAttribute(\"checked\", \"checked\");\n input.setAttribute(\"name\", \"t\");\n div.appendChild(input); // Support: Android <=4.1 only\n // Older WebKit doesn't clone checked state correctly in fragments\n\n support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked; // Support: IE <=11 only\n // Make sure textarea (and checkbox) defaultValue is properly cloned\n\n div.innerHTML = \"\";\n support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue; // Support: IE <=9 only\n // IE <=9 replaces \";\n support.option = !!div.lastChild;\n })(); // We have to close these tags to support XHTML (#13200)\n\n\n var wrapMap = {\n // XHTML parsers do not magically insert elements in the\n // same way that tag soup parsers do. So we cannot shorten\n // this by omitting or other required elements.\n thead: [1, \"\", \"
    \"],\n col: [2, \"\", \"
    \"],\n tr: [2, \"\", \"
    \"],\n td: [3, \"\", \"
    \"],\n _default: [0, \"\", \"\"]\n };\n wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\n wrapMap.th = wrapMap.td; // Support: IE <=9 only\n\n if (!support.option) {\n wrapMap.optgroup = wrapMap.option = [1, \"\"];\n }\n\n function getAll(context, tag) {\n // Support: IE <=9 - 11 only\n // Use typeof to avoid zero-argument method invocation on host objects (#15151)\n var ret;\n\n if (typeof context.getElementsByTagName !== \"undefined\") {\n ret = context.getElementsByTagName(tag || \"*\");\n } else if (typeof context.querySelectorAll !== \"undefined\") {\n ret = context.querySelectorAll(tag || \"*\");\n } else {\n ret = [];\n }\n\n if (tag === undefined || tag && nodeName(context, tag)) {\n return jQuery.merge([context], ret);\n }\n\n return ret;\n } // Mark scripts as having already been evaluated\n\n\n function setGlobalEval(elems, refElements) {\n var i = 0,\n l = elems.length;\n\n for (; i < l; i++) {\n dataPriv.set(elems[i], \"globalEval\", !refElements || dataPriv.get(refElements[i], \"globalEval\"));\n }\n }\n\n var rhtml = /<|&#?\\w+;/;\n\n function buildFragment(elems, context, scripts, selection, ignored) {\n var elem,\n tmp,\n tag,\n wrap,\n attached,\n j,\n fragment = context.createDocumentFragment(),\n nodes = [],\n i = 0,\n l = elems.length;\n\n for (; i < l; i++) {\n elem = elems[i];\n\n if (elem || elem === 0) {\n // Add nodes directly\n if (toType(elem) === \"object\") {\n // Support: Android <=4.0 only, PhantomJS 1 only\n // push.apply(_, arraylike) throws on ancient WebKit\n jQuery.merge(nodes, elem.nodeType ? [elem] : elem); // Convert non-html into a text node\n } else if (!rhtml.test(elem)) {\n nodes.push(context.createTextNode(elem)); // Convert html into DOM nodes\n } else {\n tmp = tmp || fragment.appendChild(context.createElement(\"div\")); // Deserialize a standard representation\n\n tag = (rtagName.exec(elem) || [\"\", \"\"])[1].toLowerCase();\n wrap = wrapMap[tag] || wrapMap._default;\n tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2]; // Descend through wrappers to the right content\n\n j = wrap[0];\n\n while (j--) {\n tmp = tmp.lastChild;\n } // Support: Android <=4.0 only, PhantomJS 1 only\n // push.apply(_, arraylike) throws on ancient WebKit\n\n\n jQuery.merge(nodes, tmp.childNodes); // Remember the top-level container\n\n tmp = fragment.firstChild; // Ensure the created nodes are orphaned (#12392)\n\n tmp.textContent = \"\";\n }\n }\n } // Remove wrapper from fragment\n\n\n fragment.textContent = \"\";\n i = 0;\n\n while (elem = nodes[i++]) {\n // Skip elements already in the context collection (trac-4087)\n if (selection && jQuery.inArray(elem, selection) > -1) {\n if (ignored) {\n ignored.push(elem);\n }\n\n continue;\n }\n\n attached = isAttached(elem); // Append to fragment\n\n tmp = getAll(fragment.appendChild(elem), \"script\"); // Preserve script evaluation history\n\n if (attached) {\n setGlobalEval(tmp);\n } // Capture executables\n\n\n if (scripts) {\n j = 0;\n\n while (elem = tmp[j++]) {\n if (rscriptType.test(elem.type || \"\")) {\n scripts.push(elem);\n }\n }\n }\n }\n\n return fragment;\n }\n\n var rkeyEvent = /^key/,\n rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n rtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\n function returnTrue() {\n return true;\n }\n\n function returnFalse() {\n return false;\n } // Support: IE <=9 - 11+\n // focus() and blur() are asynchronous, except when they are no-op.\n // So expect focus to be synchronous when the element is already active,\n // and blur to be synchronous when the element is not already active.\n // (focus and blur are always synchronous in other supported browsers,\n // this just defines when we can count on it).\n\n\n function expectSync(elem, type) {\n return elem === safeActiveElement() === (type === \"focus\");\n } // Support: IE <=9 only\n // Accessing document.activeElement can throw unexpectedly\n // https://bugs.jquery.com/ticket/13393\n\n\n function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }\n\n function _on(elem, types, selector, data, fn, one) {\n var origFn, type; // Types can be a map of types/handlers\n\n if (_typeof(types) === \"object\") {\n // ( types-Object, selector, data )\n if (typeof selector !== \"string\") {\n // ( types-Object, data )\n data = data || selector;\n selector = undefined;\n }\n\n for (type in types) {\n _on(elem, type, selector, data, types[type], one);\n }\n\n return elem;\n }\n\n if (data == null && fn == null) {\n // ( types, fn )\n fn = selector;\n data = selector = undefined;\n } else if (fn == null) {\n if (typeof selector === \"string\") {\n // ( types, selector, fn )\n fn = data;\n data = undefined;\n } else {\n // ( types, data, fn )\n fn = data;\n data = selector;\n selector = undefined;\n }\n }\n\n if (fn === false) {\n fn = returnFalse;\n } else if (!fn) {\n return elem;\n }\n\n if (one === 1) {\n origFn = fn;\n\n fn = function fn(event) {\n // Can use an empty set, since event contains the info\n jQuery().off(event);\n return origFn.apply(this, arguments);\n }; // Use same guid so caller can remove using origFn\n\n\n fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);\n }\n\n return elem.each(function () {\n jQuery.event.add(this, types, fn, data, selector);\n });\n }\n /*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\n\n\n jQuery.event = {\n global: {},\n add: function add(elem, types, handler, data, selector) {\n var handleObjIn,\n eventHandle,\n tmp,\n events,\n t,\n handleObj,\n special,\n handlers,\n type,\n namespaces,\n origType,\n elemData = dataPriv.get(elem); // Only attach events to objects that accept data\n\n if (!acceptData(elem)) {\n return;\n } // Caller can pass in an object of custom data in lieu of the handler\n\n\n if (handler.handler) {\n handleObjIn = handler;\n handler = handleObjIn.handler;\n selector = handleObjIn.selector;\n } // Ensure that invalid selectors throw exceptions at attach time\n // Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\n\n if (selector) {\n jQuery.find.matchesSelector(documentElement, selector);\n } // Make sure that the handler has a unique ID, used to find/remove it later\n\n\n if (!handler.guid) {\n handler.guid = jQuery.guid++;\n } // Init the element's event structure and main handler, if this is the first\n\n\n if (!(events = elemData.events)) {\n events = elemData.events = Object.create(null);\n }\n\n if (!(eventHandle = elemData.handle)) {\n eventHandle = elemData.handle = function (e) {\n // Discard the second event of a jQuery.event.trigger() and\n // when an event is called after a page has unloaded\n return typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : undefined;\n };\n } // Handle multiple events separated by a space\n\n\n types = (types || \"\").match(rnothtmlwhite) || [\"\"];\n t = types.length;\n\n while (t--) {\n tmp = rtypenamespace.exec(types[t]) || [];\n type = origType = tmp[1];\n namespaces = (tmp[2] || \"\").split(\".\").sort(); // There *must* be a type, no attaching namespace-only handlers\n\n if (!type) {\n continue;\n } // If event changes its type, use the special event handlers for the changed type\n\n\n special = jQuery.event.special[type] || {}; // If selector defined, determine special event api type, otherwise given type\n\n type = (selector ? special.delegateType : special.bindType) || type; // Update special based on newly reset type\n\n special = jQuery.event.special[type] || {}; // handleObj is passed to all event handlers\n\n handleObj = jQuery.extend({\n type: type,\n origType: origType,\n data: data,\n handler: handler,\n guid: handler.guid,\n selector: selector,\n needsContext: selector && jQuery.expr.match.needsContext.test(selector),\n namespace: namespaces.join(\".\")\n }, handleObjIn); // Init the event handler queue if we're the first\n\n if (!(handlers = events[type])) {\n handlers = events[type] = [];\n handlers.delegateCount = 0; // Only use addEventListener if the special events handler returns false\n\n if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {\n if (elem.addEventListener) {\n elem.addEventListener(type, eventHandle);\n }\n }\n }\n\n if (special.add) {\n special.add.call(elem, handleObj);\n\n if (!handleObj.handler.guid) {\n handleObj.handler.guid = handler.guid;\n }\n } // Add to the element's handler list, delegates in front\n\n\n if (selector) {\n handlers.splice(handlers.delegateCount++, 0, handleObj);\n } else {\n handlers.push(handleObj);\n } // Keep track of which events have ever been used, for event optimization\n\n\n jQuery.event.global[type] = true;\n }\n },\n // Detach an event or set of events from an element\n remove: function remove(elem, types, handler, selector, mappedTypes) {\n var j,\n origCount,\n tmp,\n events,\n t,\n handleObj,\n special,\n handlers,\n type,\n namespaces,\n origType,\n elemData = dataPriv.hasData(elem) && dataPriv.get(elem);\n\n if (!elemData || !(events = elemData.events)) {\n return;\n } // Once for each type.namespace in types; type may be omitted\n\n\n types = (types || \"\").match(rnothtmlwhite) || [\"\"];\n t = types.length;\n\n while (t--) {\n tmp = rtypenamespace.exec(types[t]) || [];\n type = origType = tmp[1];\n namespaces = (tmp[2] || \"\").split(\".\").sort(); // Unbind all events (on this namespace, if provided) for the element\n\n if (!type) {\n for (type in events) {\n jQuery.event.remove(elem, type + types[t], handler, selector, true);\n }\n\n continue;\n }\n\n special = jQuery.event.special[type] || {};\n type = (selector ? special.delegateType : special.bindType) || type;\n handlers = events[type] || [];\n tmp = tmp[2] && new RegExp(\"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\"); // Remove matching events\n\n origCount = j = handlers.length;\n\n while (j--) {\n handleObj = handlers[j];\n\n if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === \"**\" && handleObj.selector)) {\n handlers.splice(j, 1);\n\n if (handleObj.selector) {\n handlers.delegateCount--;\n }\n\n if (special.remove) {\n special.remove.call(elem, handleObj);\n }\n }\n } // Remove generic event handler if we removed something and no more handlers exist\n // (avoids potential for endless recursion during removal of special event handlers)\n\n\n if (origCount && !handlers.length) {\n if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {\n jQuery.removeEvent(elem, type, elemData.handle);\n }\n\n delete events[type];\n }\n } // Remove data and the expando if it's no longer used\n\n\n if (jQuery.isEmptyObject(events)) {\n dataPriv.remove(elem, \"handle events\");\n }\n },\n dispatch: function dispatch(nativeEvent) {\n var i,\n j,\n ret,\n matched,\n handleObj,\n handlerQueue,\n args = new Array(arguments.length),\n // Make a writable jQuery.Event from the native event object\n event = jQuery.event.fix(nativeEvent),\n handlers = (dataPriv.get(this, \"events\") || Object.create(null))[event.type] || [],\n special = jQuery.event.special[event.type] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event\n\n args[0] = event;\n\n for (i = 1; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n\n event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired\n\n if (special.preDispatch && special.preDispatch.call(this, event) === false) {\n return;\n } // Determine handlers\n\n\n handlerQueue = jQuery.event.handlers.call(this, event, handlers); // Run delegates first; they may want to stop propagation beneath us\n\n i = 0;\n\n while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {\n event.currentTarget = matched.elem;\n j = 0;\n\n while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {\n // If the event is namespaced, then each handler is only invoked if it is\n // specially universal or its namespaces are a superset of the event's.\n if (!event.rnamespace || handleObj.namespace === false || event.rnamespace.test(handleObj.namespace)) {\n event.handleObj = handleObj;\n event.data = handleObj.data;\n ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);\n\n if (ret !== undefined) {\n if ((event.result = ret) === false) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n }\n }\n } // Call the postDispatch hook for the mapped type\n\n\n if (special.postDispatch) {\n special.postDispatch.call(this, event);\n }\n\n return event.result;\n },\n handlers: function handlers(event, _handlers) {\n var i,\n handleObj,\n sel,\n matchedHandlers,\n matchedSelectors,\n handlerQueue = [],\n delegateCount = _handlers.delegateCount,\n cur = event.target; // Find delegate handlers\n\n if (delegateCount && // Support: IE <=9\n // Black-hole SVG instance trees (trac-13180)\n cur.nodeType && // Support: Firefox <=42\n // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n // Support: IE 11 only\n // ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n !(event.type === \"click\" && event.button >= 1)) {\n for (; cur !== this; cur = cur.parentNode || this) {\n // Don't check non-elements (#13208)\n // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n if (cur.nodeType === 1 && !(event.type === \"click\" && cur.disabled === true)) {\n matchedHandlers = [];\n matchedSelectors = {};\n\n for (i = 0; i < delegateCount; i++) {\n handleObj = _handlers[i]; // Don't conflict with Object.prototype properties (#13203)\n\n sel = handleObj.selector + \" \";\n\n if (matchedSelectors[sel] === undefined) {\n matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length;\n }\n\n if (matchedSelectors[sel]) {\n matchedHandlers.push(handleObj);\n }\n }\n\n if (matchedHandlers.length) {\n handlerQueue.push({\n elem: cur,\n handlers: matchedHandlers\n });\n }\n }\n }\n } // Add the remaining (directly-bound) handlers\n\n\n cur = this;\n\n if (delegateCount < _handlers.length) {\n handlerQueue.push({\n elem: cur,\n handlers: _handlers.slice(delegateCount)\n });\n }\n\n return handlerQueue;\n },\n addProp: function addProp(name, hook) {\n Object.defineProperty(jQuery.Event.prototype, name, {\n enumerable: true,\n configurable: true,\n get: isFunction(hook) ? function () {\n if (this.originalEvent) {\n return hook(this.originalEvent);\n }\n } : function () {\n if (this.originalEvent) {\n return this.originalEvent[name];\n }\n },\n set: function set(value) {\n Object.defineProperty(this, name, {\n enumerable: true,\n configurable: true,\n writable: true,\n value: value\n });\n }\n });\n },\n fix: function fix(originalEvent) {\n return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent);\n },\n special: {\n load: {\n // Prevent triggered image.load events from bubbling to window.load\n noBubble: true\n },\n click: {\n // Utilize native event to ensure correct state for checkable inputs\n setup: function setup(data) {\n // For mutual compressibility with _default, replace `this` access with a local var.\n // `|| data` is dead code meant only to preserve the variable through minification.\n var el = this || data; // Claim the first handler\n\n if (rcheckableType.test(el.type) && el.click && nodeName(el, \"input\")) {\n // dataPriv.set( el, \"click\", ... )\n leverageNative(el, \"click\", returnTrue);\n } // Return false to allow normal processing in the caller\n\n\n return false;\n },\n trigger: function trigger(data) {\n // For mutual compressibility with _default, replace `this` access with a local var.\n // `|| data` is dead code meant only to preserve the variable through minification.\n var el = this || data; // Force setup before triggering a click\n\n if (rcheckableType.test(el.type) && el.click && nodeName(el, \"input\")) {\n leverageNative(el, \"click\");\n } // Return non-false to allow normal event-path propagation\n\n\n return true;\n },\n // For cross-browser consistency, suppress native .click() on links\n // Also prevent it if we're currently inside a leveraged native-event stack\n _default: function _default(event) {\n var target = event.target;\n return rcheckableType.test(target.type) && target.click && nodeName(target, \"input\") && dataPriv.get(target, \"click\") || nodeName(target, \"a\");\n }\n },\n beforeunload: {\n postDispatch: function postDispatch(event) {\n // Support: Firefox 20+\n // Firefox doesn't alert if the returnValue field is not set.\n if (event.result !== undefined && event.originalEvent) {\n event.originalEvent.returnValue = event.result;\n }\n }\n }\n }\n }; // Ensure the presence of an event listener that handles manually-triggered\n // synthetic events by interrupting progress until reinvoked in response to\n // *native* events that it fires directly, ensuring that state changes have\n // already occurred before other listeners are invoked.\n\n function leverageNative(el, type, expectSync) {\n // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add\n if (!expectSync) {\n if (dataPriv.get(el, type) === undefined) {\n jQuery.event.add(el, type, returnTrue);\n }\n\n return;\n } // Register the controller as a special universal handler for all event namespaces\n\n\n dataPriv.set(el, type, false);\n jQuery.event.add(el, type, {\n namespace: false,\n handler: function handler(event) {\n var notAsync,\n result,\n saved = dataPriv.get(this, type);\n\n if (event.isTrigger & 1 && this[type]) {\n // Interrupt processing of the outer synthetic .trigger()ed event\n // Saved data should be false in such cases, but might be a leftover capture object\n // from an async native handler (gh-4350)\n if (!saved.length) {\n // Store arguments for use when handling the inner native event\n // There will always be at least one argument (an event object), so this array\n // will not be confused with a leftover capture object.\n saved = _slice.call(arguments);\n dataPriv.set(this, type, saved); // Trigger the native event and capture its result\n // Support: IE <=9 - 11+\n // focus() and blur() are asynchronous\n\n notAsync = expectSync(this, type);\n this[type]();\n result = dataPriv.get(this, type);\n\n if (saved !== result || notAsync) {\n dataPriv.set(this, type, false);\n } else {\n result = {};\n }\n\n if (saved !== result) {\n // Cancel the outer synthetic event\n event.stopImmediatePropagation();\n event.preventDefault();\n return result.value;\n } // If this is an inner synthetic event for an event with a bubbling surrogate\n // (focus or blur), assume that the surrogate already propagated from triggering the\n // native event and prevent that from happening again here.\n // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n // bubbling surrogate propagates *after* the non-bubbling base), but that seems\n // less bad than duplication.\n\n } else if ((jQuery.event.special[type] || {}).delegateType) {\n event.stopPropagation();\n } // If this is a native event triggered above, everything is now in order\n // Fire an inner synthetic event with the original arguments\n\n } else if (saved.length) {\n // ...and capture the result\n dataPriv.set(this, type, {\n value: jQuery.event.trigger( // Support: IE <=9 - 11+\n // Extend with the prototype to reset the above stopImmediatePropagation()\n jQuery.extend(saved[0], jQuery.Event.prototype), saved.slice(1), this)\n }); // Abort handling of the native event\n\n event.stopImmediatePropagation();\n }\n }\n });\n }\n\n jQuery.removeEvent = function (elem, type, handle) {\n // This \"if\" is needed for plain objects\n if (elem.removeEventListener) {\n elem.removeEventListener(type, handle);\n }\n };\n\n jQuery.Event = function (src, props) {\n // Allow instantiation without the 'new' keyword\n if (!(this instanceof jQuery.Event)) {\n return new jQuery.Event(src, props);\n } // Event object\n\n\n if (src && src.type) {\n this.originalEvent = src;\n this.type = src.type; // Events bubbling up the document may have been marked as prevented\n // by a handler lower down the tree; reflect the correct value.\n\n this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && // Support: Android <=2.3 only\n src.returnValue === false ? returnTrue : returnFalse; // Create target properties\n // Support: Safari <=6 - 7 only\n // Target should not be a text node (#504, #13143)\n\n this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target;\n this.currentTarget = src.currentTarget;\n this.relatedTarget = src.relatedTarget; // Event type\n } else {\n this.type = src;\n } // Put explicitly provided properties onto the event object\n\n\n if (props) {\n jQuery.extend(this, props);\n } // Create a timestamp if incoming event doesn't have one\n\n\n this.timeStamp = src && src.timeStamp || Date.now(); // Mark it as fixed\n\n this[jQuery.expando] = true;\n }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\n\n\n jQuery.Event.prototype = {\n constructor: jQuery.Event,\n isDefaultPrevented: returnFalse,\n isPropagationStopped: returnFalse,\n isImmediatePropagationStopped: returnFalse,\n isSimulated: false,\n preventDefault: function preventDefault() {\n var e = this.originalEvent;\n this.isDefaultPrevented = returnTrue;\n\n if (e && !this.isSimulated) {\n e.preventDefault();\n }\n },\n stopPropagation: function stopPropagation() {\n var e = this.originalEvent;\n this.isPropagationStopped = returnTrue;\n\n if (e && !this.isSimulated) {\n e.stopPropagation();\n }\n },\n stopImmediatePropagation: function stopImmediatePropagation() {\n var e = this.originalEvent;\n this.isImmediatePropagationStopped = returnTrue;\n\n if (e && !this.isSimulated) {\n e.stopImmediatePropagation();\n }\n\n this.stopPropagation();\n }\n }; // Includes all common event props including KeyEvent and MouseEvent specific props\n\n jQuery.each({\n altKey: true,\n bubbles: true,\n cancelable: true,\n changedTouches: true,\n ctrlKey: true,\n detail: true,\n eventPhase: true,\n metaKey: true,\n pageX: true,\n pageY: true,\n shiftKey: true,\n view: true,\n \"char\": true,\n code: true,\n charCode: true,\n key: true,\n keyCode: true,\n button: true,\n buttons: true,\n clientX: true,\n clientY: true,\n offsetX: true,\n offsetY: true,\n pointerId: true,\n pointerType: true,\n screenX: true,\n screenY: true,\n targetTouches: true,\n toElement: true,\n touches: true,\n which: function which(event) {\n var button = event.button; // Add which for key events\n\n if (event.which == null && rkeyEvent.test(event.type)) {\n return event.charCode != null ? event.charCode : event.keyCode;\n } // Add which for click: 1 === left; 2 === middle; 3 === right\n\n\n if (!event.which && button !== undefined && rmouseEvent.test(event.type)) {\n if (button & 1) {\n return 1;\n }\n\n if (button & 2) {\n return 3;\n }\n\n if (button & 4) {\n return 2;\n }\n\n return 0;\n }\n\n return event.which;\n }\n }, jQuery.event.addProp);\n jQuery.each({\n focus: \"focusin\",\n blur: \"focusout\"\n }, function (type, delegateType) {\n jQuery.event.special[type] = {\n // Utilize native event if possible so blur/focus sequence is correct\n setup: function setup() {\n // Claim the first handler\n // dataPriv.set( this, \"focus\", ... )\n // dataPriv.set( this, \"blur\", ... )\n leverageNative(this, type, expectSync); // Return false to allow normal processing in the caller\n\n return false;\n },\n trigger: function trigger() {\n // Force setup before trigger\n leverageNative(this, type); // Return non-false to allow normal event-path propagation\n\n return true;\n },\n delegateType: delegateType\n };\n }); // Create mouseenter/leave events using mouseover/out and event-time checks\n // so that event delegation works in jQuery.\n // Do the same for pointerenter/pointerleave and pointerover/pointerout\n //\n // Support: Safari 7 only\n // Safari sends mouseenter too often; see:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n // for the description of the bug (it existed in older Chrome versions as well).\n\n jQuery.each({\n mouseenter: \"mouseover\",\n mouseleave: \"mouseout\",\n pointerenter: \"pointerover\",\n pointerleave: \"pointerout\"\n }, function (orig, fix) {\n jQuery.event.special[orig] = {\n delegateType: fix,\n bindType: fix,\n handle: function handle(event) {\n var ret,\n target = this,\n related = event.relatedTarget,\n handleObj = event.handleObj; // For mouseenter/leave call the handler if related is outside the target.\n // NB: No relatedTarget if the mouse left/entered the browser window\n\n if (!related || related !== target && !jQuery.contains(target, related)) {\n event.type = handleObj.origType;\n ret = handleObj.handler.apply(this, arguments);\n event.type = fix;\n }\n\n return ret;\n }\n };\n });\n jQuery.fn.extend({\n on: function on(types, selector, data, fn) {\n return _on(this, types, selector, data, fn);\n },\n one: function one(types, selector, data, fn) {\n return _on(this, types, selector, data, fn, 1);\n },\n off: function off(types, selector, fn) {\n var handleObj, type;\n\n if (types && types.preventDefault && types.handleObj) {\n // ( event ) dispatched jQuery.Event\n handleObj = types.handleObj;\n jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + \".\" + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler);\n return this;\n }\n\n if (_typeof(types) === \"object\") {\n // ( types-object [, selector] )\n for (type in types) {\n this.off(type, selector, types[type]);\n }\n\n return this;\n }\n\n if (selector === false || typeof selector === \"function\") {\n // ( types [, fn] )\n fn = selector;\n selector = undefined;\n }\n\n if (fn === false) {\n fn = returnFalse;\n }\n\n return this.each(function () {\n jQuery.event.remove(this, types, fn, selector);\n });\n }\n });\n var // Support: IE <=10 - 11, Edge 12 - 13 only\n // In IE/Edge using regex groups here causes severe slowdowns.\n // See https://connect.microsoft.com/IE/feedback/details/1736512/\n rnoInnerhtml = /\\s*$/g; // Prefer a tbody over its parent table for containing new rows\n\n function manipulationTarget(elem, content) {\n if (nodeName(elem, \"table\") && nodeName(content.nodeType !== 11 ? content : content.firstChild, \"tr\")) {\n return jQuery(elem).children(\"tbody\")[0] || elem;\n }\n\n return elem;\n } // Replace/restore the type attribute of script elements for safe DOM manipulation\n\n\n function disableScript(elem) {\n elem.type = (elem.getAttribute(\"type\") !== null) + \"/\" + elem.type;\n return elem;\n }\n\n function restoreScript(elem) {\n if ((elem.type || \"\").slice(0, 5) === \"true/\") {\n elem.type = elem.type.slice(5);\n } else {\n elem.removeAttribute(\"type\");\n }\n\n return elem;\n }\n\n function cloneCopyEvent(src, dest) {\n var i, l, type, pdataOld, udataOld, udataCur, events;\n\n if (dest.nodeType !== 1) {\n return;\n } // 1. Copy private data: events, handlers, etc.\n\n\n if (dataPriv.hasData(src)) {\n pdataOld = dataPriv.get(src);\n events = pdataOld.events;\n\n if (events) {\n dataPriv.remove(dest, \"handle events\");\n\n for (type in events) {\n for (i = 0, l = events[type].length; i < l; i++) {\n jQuery.event.add(dest, type, events[type][i]);\n }\n }\n }\n } // 2. Copy user data\n\n\n if (dataUser.hasData(src)) {\n udataOld = dataUser.access(src);\n udataCur = jQuery.extend({}, udataOld);\n dataUser.set(dest, udataCur);\n }\n } // Fix IE bugs, see support tests\n\n\n function fixInput(src, dest) {\n var nodeName = dest.nodeName.toLowerCase(); // Fails to persist the checked state of a cloned checkbox or radio button.\n\n if (nodeName === \"input\" && rcheckableType.test(src.type)) {\n dest.checked = src.checked; // Fails to return the selected option to the default selected state when cloning options\n } else if (nodeName === \"input\" || nodeName === \"textarea\") {\n dest.defaultValue = src.defaultValue;\n }\n }\n\n function domManip(collection, args, callback, ignored) {\n // Flatten any nested arrays\n args = flat(args);\n var fragment,\n first,\n scripts,\n hasScripts,\n node,\n doc,\n i = 0,\n l = collection.length,\n iNoClone = l - 1,\n value = args[0],\n valueIsFunction = isFunction(value); // We can't cloneNode fragments that contain checked, in WebKit\n\n if (valueIsFunction || l > 1 && typeof value === \"string\" && !support.checkClone && rchecked.test(value)) {\n return collection.each(function (index) {\n var self = collection.eq(index);\n\n if (valueIsFunction) {\n args[0] = value.call(this, index, self.html());\n }\n\n domManip(self, args, callback, ignored);\n });\n }\n\n if (l) {\n fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored);\n first = fragment.firstChild;\n\n if (fragment.childNodes.length === 1) {\n fragment = first;\n } // Require either new content or an interest in ignored elements to invoke the callback\n\n\n if (first || ignored) {\n scripts = jQuery.map(getAll(fragment, \"script\"), disableScript);\n hasScripts = scripts.length; // Use the original fragment for the last item\n // instead of the first because it can end up\n // being emptied incorrectly in certain situations (#8070).\n\n for (; i < l; i++) {\n node = fragment;\n\n if (i !== iNoClone) {\n node = jQuery.clone(node, true, true); // Keep references to cloned scripts for later restoration\n\n if (hasScripts) {\n // Support: Android <=4.0 only, PhantomJS 1 only\n // push.apply(_, arraylike) throws on ancient WebKit\n jQuery.merge(scripts, getAll(node, \"script\"));\n }\n }\n\n callback.call(collection[i], node, i);\n }\n\n if (hasScripts) {\n doc = scripts[scripts.length - 1].ownerDocument; // Reenable scripts\n\n jQuery.map(scripts, restoreScript); // Evaluate executable scripts on first document insertion\n\n for (i = 0; i < hasScripts; i++) {\n node = scripts[i];\n\n if (rscriptType.test(node.type || \"\") && !dataPriv.access(node, \"globalEval\") && jQuery.contains(doc, node)) {\n if (node.src && (node.type || \"\").toLowerCase() !== \"module\") {\n // Optional AJAX dependency, but won't run scripts if not present\n if (jQuery._evalUrl && !node.noModule) {\n jQuery._evalUrl(node.src, {\n nonce: node.nonce || node.getAttribute(\"nonce\")\n }, doc);\n }\n } else {\n DOMEval(node.textContent.replace(rcleanScript, \"\"), node, doc);\n }\n }\n }\n }\n }\n }\n\n return collection;\n }\n\n function _remove(elem, selector, keepData) {\n var node,\n nodes = selector ? jQuery.filter(selector, elem) : elem,\n i = 0;\n\n for (; (node = nodes[i]) != null; i++) {\n if (!keepData && node.nodeType === 1) {\n jQuery.cleanData(getAll(node));\n }\n\n if (node.parentNode) {\n if (keepData && isAttached(node)) {\n setGlobalEval(getAll(node, \"script\"));\n }\n\n node.parentNode.removeChild(node);\n }\n }\n\n return elem;\n }\n\n jQuery.extend({\n htmlPrefilter: function htmlPrefilter(html) {\n return html;\n },\n clone: function clone(elem, dataAndEvents, deepDataAndEvents) {\n var i,\n l,\n srcElements,\n destElements,\n clone = elem.cloneNode(true),\n inPage = isAttached(elem); // Fix IE cloning issues\n\n if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {\n // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n destElements = getAll(clone);\n srcElements = getAll(elem);\n\n for (i = 0, l = srcElements.length; i < l; i++) {\n fixInput(srcElements[i], destElements[i]);\n }\n } // Copy the events from the original to the clone\n\n\n if (dataAndEvents) {\n if (deepDataAndEvents) {\n srcElements = srcElements || getAll(elem);\n destElements = destElements || getAll(clone);\n\n for (i = 0, l = srcElements.length; i < l; i++) {\n cloneCopyEvent(srcElements[i], destElements[i]);\n }\n } else {\n cloneCopyEvent(elem, clone);\n }\n } // Preserve script evaluation history\n\n\n destElements = getAll(clone, \"script\");\n\n if (destElements.length > 0) {\n setGlobalEval(destElements, !inPage && getAll(elem, \"script\"));\n } // Return the cloned set\n\n\n return clone;\n },\n cleanData: function cleanData(elems) {\n var data,\n elem,\n type,\n special = jQuery.event.special,\n i = 0;\n\n for (; (elem = elems[i]) !== undefined; i++) {\n if (acceptData(elem)) {\n if (data = elem[dataPriv.expando]) {\n if (data.events) {\n for (type in data.events) {\n if (special[type]) {\n jQuery.event.remove(elem, type); // This is a shortcut to avoid jQuery.event.remove's overhead\n } else {\n jQuery.removeEvent(elem, type, data.handle);\n }\n }\n } // Support: Chrome <=35 - 45+\n // Assign undefined instead of using delete, see Data#remove\n\n\n elem[dataPriv.expando] = undefined;\n }\n\n if (elem[dataUser.expando]) {\n // Support: Chrome <=35 - 45+\n // Assign undefined instead of using delete, see Data#remove\n elem[dataUser.expando] = undefined;\n }\n }\n }\n }\n });\n jQuery.fn.extend({\n detach: function detach(selector) {\n return _remove(this, selector, true);\n },\n remove: function remove(selector) {\n return _remove(this, selector);\n },\n text: function text(value) {\n return access(this, function (value) {\n return value === undefined ? jQuery.text(this) : this.empty().each(function () {\n if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {\n this.textContent = value;\n }\n });\n }, null, value, arguments.length);\n },\n append: function append() {\n return domManip(this, arguments, function (elem) {\n if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {\n var target = manipulationTarget(this, elem);\n target.appendChild(elem);\n }\n });\n },\n prepend: function prepend() {\n return domManip(this, arguments, function (elem) {\n if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {\n var target = manipulationTarget(this, elem);\n target.insertBefore(elem, target.firstChild);\n }\n });\n },\n before: function before() {\n return domManip(this, arguments, function (elem) {\n if (this.parentNode) {\n this.parentNode.insertBefore(elem, this);\n }\n });\n },\n after: function after() {\n return domManip(this, arguments, function (elem) {\n if (this.parentNode) {\n this.parentNode.insertBefore(elem, this.nextSibling);\n }\n });\n },\n empty: function empty() {\n var elem,\n i = 0;\n\n for (; (elem = this[i]) != null; i++) {\n if (elem.nodeType === 1) {\n // Prevent memory leaks\n jQuery.cleanData(getAll(elem, false)); // Remove any remaining nodes\n\n elem.textContent = \"\";\n }\n }\n\n return this;\n },\n clone: function clone(dataAndEvents, deepDataAndEvents) {\n dataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n return this.map(function () {\n return jQuery.clone(this, dataAndEvents, deepDataAndEvents);\n });\n },\n html: function html(value) {\n return access(this, function (value) {\n var elem = this[0] || {},\n i = 0,\n l = this.length;\n\n if (value === undefined && elem.nodeType === 1) {\n return elem.innerHTML;\n } // See if we can take a shortcut and just use innerHTML\n\n\n if (typeof value === \"string\" && !rnoInnerhtml.test(value) && !wrapMap[(rtagName.exec(value) || [\"\", \"\"])[1].toLowerCase()]) {\n value = jQuery.htmlPrefilter(value);\n\n try {\n for (; i < l; i++) {\n elem = this[i] || {}; // Remove element nodes and prevent memory leaks\n\n if (elem.nodeType === 1) {\n jQuery.cleanData(getAll(elem, false));\n elem.innerHTML = value;\n }\n }\n\n elem = 0; // If using innerHTML throws an exception, use the fallback method\n } catch (e) {}\n }\n\n if (elem) {\n this.empty().append(value);\n }\n }, null, value, arguments.length);\n },\n replaceWith: function replaceWith() {\n var ignored = []; // Make the changes, replacing each non-ignored context element with the new content\n\n return domManip(this, arguments, function (elem) {\n var parent = this.parentNode;\n\n if (jQuery.inArray(this, ignored) < 0) {\n jQuery.cleanData(getAll(this));\n\n if (parent) {\n parent.replaceChild(elem, this);\n }\n } // Force callback invocation\n\n }, ignored);\n }\n });\n jQuery.each({\n appendTo: \"append\",\n prependTo: \"prepend\",\n insertBefore: \"before\",\n insertAfter: \"after\",\n replaceAll: \"replaceWith\"\n }, function (name, original) {\n jQuery.fn[name] = function (selector) {\n var elems,\n ret = [],\n insert = jQuery(selector),\n last = insert.length - 1,\n i = 0;\n\n for (; i <= last; i++) {\n elems = i === last ? this : this.clone(true);\n jQuery(insert[i])[original](elems); // Support: Android <=4.0 only, PhantomJS 1 only\n // .get() because push.apply(_, arraylike) throws on ancient WebKit\n\n push.apply(ret, elems.get());\n }\n\n return this.pushStack(ret);\n };\n });\n var rnumnonpx = new RegExp(\"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\");\n\n var getStyles = function getStyles(elem) {\n // Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n // IE throws on elements created in popups\n // FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n var view = elem.ownerDocument.defaultView;\n\n if (!view || !view.opener) {\n view = window;\n }\n\n return view.getComputedStyle(elem);\n };\n\n var swap = function swap(elem, options, callback) {\n var ret,\n name,\n old = {}; // Remember the old values, and insert the new ones\n\n for (name in options) {\n old[name] = elem.style[name];\n elem.style[name] = options[name];\n }\n\n ret = callback.call(elem); // Revert the old values\n\n for (name in options) {\n elem.style[name] = old[name];\n }\n\n return ret;\n };\n\n var rboxStyle = new RegExp(cssExpand.join(\"|\"), \"i\");\n\n (function () {\n // Executing both pixelPosition & boxSizingReliable tests require only one layout\n // so they're executed at the same time to save the second computation.\n function computeStyleTests() {\n // This is a singleton, we need to execute it only once\n if (!div) {\n return;\n }\n\n container.style.cssText = \"position:absolute;left:-11111px;width:60px;\" + \"margin-top:1px;padding:0;border:0\";\n div.style.cssText = \"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" + \"margin:auto;border:1px;padding:1px;\" + \"width:60%;top:1%\";\n documentElement.appendChild(container).appendChild(div);\n var divStyle = window.getComputedStyle(div);\n pixelPositionVal = divStyle.top !== \"1%\"; // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\n reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12; // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n // Some styles come back with percentage values, even though they shouldn't\n\n div.style.right = \"60%\";\n pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36; // Support: IE 9 - 11 only\n // Detect misreporting of content dimensions for box-sizing:border-box elements\n\n boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36; // Support: IE 9 only\n // Detect overflow:scroll screwiness (gh-3699)\n // Support: Chrome <=64\n // Don't get tricked when zoom affects offsetWidth (gh-4029)\n\n div.style.position = \"absolute\";\n scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;\n documentElement.removeChild(container); // Nullify the div so it wouldn't be stored in the memory and\n // it will also be a sign that checks already performed\n\n div = null;\n }\n\n function roundPixelMeasures(measure) {\n return Math.round(parseFloat(measure));\n }\n\n var pixelPositionVal,\n boxSizingReliableVal,\n scrollboxSizeVal,\n pixelBoxStylesVal,\n reliableTrDimensionsVal,\n reliableMarginLeftVal,\n container = document.createElement(\"div\"),\n div = document.createElement(\"div\"); // Finish early in limited (non-browser) environments\n\n if (!div.style) {\n return;\n } // Support: IE <=9 - 11 only\n // Style of cloned element affects source element cloned (#8908)\n\n\n div.style.backgroundClip = \"content-box\";\n div.cloneNode(true).style.backgroundClip = \"\";\n support.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n jQuery.extend(support, {\n boxSizingReliable: function boxSizingReliable() {\n computeStyleTests();\n return boxSizingReliableVal;\n },\n pixelBoxStyles: function pixelBoxStyles() {\n computeStyleTests();\n return pixelBoxStylesVal;\n },\n pixelPosition: function pixelPosition() {\n computeStyleTests();\n return pixelPositionVal;\n },\n reliableMarginLeft: function reliableMarginLeft() {\n computeStyleTests();\n return reliableMarginLeftVal;\n },\n scrollboxSize: function scrollboxSize() {\n computeStyleTests();\n return scrollboxSizeVal;\n },\n // Support: IE 9 - 11+, Edge 15 - 18+\n // IE/Edge misreport `getComputedStyle` of table rows with width/height\n // set in CSS while `offset*` properties report correct values.\n // Behavior in IE 9 is more subtle than in newer versions & it passes\n // some versions of this test; make sure not to make it pass there!\n reliableTrDimensions: function reliableTrDimensions() {\n var table, tr, trChild, trStyle;\n\n if (reliableTrDimensionsVal == null) {\n table = document.createElement(\"table\");\n tr = document.createElement(\"tr\");\n trChild = document.createElement(\"div\");\n table.style.cssText = \"position:absolute;left:-11111px\";\n tr.style.height = \"1px\";\n trChild.style.height = \"9px\";\n documentElement.appendChild(table).appendChild(tr).appendChild(trChild);\n trStyle = window.getComputedStyle(tr);\n reliableTrDimensionsVal = parseInt(trStyle.height) > 3;\n documentElement.removeChild(table);\n }\n\n return reliableTrDimensionsVal;\n }\n });\n })();\n\n function curCSS(elem, name, computed) {\n var width,\n minWidth,\n maxWidth,\n ret,\n // Support: Firefox 51+\n // Retrieving style before computed somehow\n // fixes an issue with getting wrong values\n // on detached elements\n style = elem.style;\n computed = computed || getStyles(elem); // getPropertyValue is needed for:\n // .css('filter') (IE 9 only, #12537)\n // .css('--customProperty) (#3144)\n\n if (computed) {\n ret = computed.getPropertyValue(name) || computed[name];\n\n if (ret === \"\" && !isAttached(elem)) {\n ret = jQuery.style(elem, name);\n } // A tribute to the \"awesome hack by Dean Edwards\"\n // Android Browser returns percentage for some values,\n // but width seems to be reliably pixels.\n // This is against the CSSOM draft spec:\n // https://drafts.csswg.org/cssom/#resolved-values\n\n\n if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) {\n // Remember the original values\n width = style.width;\n minWidth = style.minWidth;\n maxWidth = style.maxWidth; // Put in the new values to get a computed value out\n\n style.minWidth = style.maxWidth = style.width = ret;\n ret = computed.width; // Revert the changed values\n\n style.width = width;\n style.minWidth = minWidth;\n style.maxWidth = maxWidth;\n }\n }\n\n return ret !== undefined ? // Support: IE <=9 - 11 only\n // IE returns zIndex value as an integer.\n ret + \"\" : ret;\n }\n\n function addGetHookIf(conditionFn, hookFn) {\n // Define the hook, we'll check on the first run if it's really needed.\n return {\n get: function get() {\n if (conditionFn()) {\n // Hook not needed (or it's not possible to use it due\n // to missing dependency), remove it.\n delete this.get;\n return;\n } // Hook needed; redefine it so that the support test is not executed again.\n\n\n return (this.get = hookFn).apply(this, arguments);\n }\n };\n }\n\n var cssPrefixes = [\"Webkit\", \"Moz\", \"ms\"],\n emptyStyle = document.createElement(\"div\").style,\n vendorProps = {}; // Return a vendor-prefixed property or undefined\n\n function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property\n\n\n function finalPropName(name) {\n var _final = jQuery.cssProps[name] || vendorProps[name];\n\n if (_final) {\n return _final;\n }\n\n if (name in emptyStyle) {\n return name;\n }\n\n return vendorProps[name] = vendorPropName(name) || name;\n }\n\n var // Swappable if display is none or starts with table\n // except \"table\", \"table-cell\", or \"table-caption\"\n // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n rdisplayswap = /^(none|table(?!-c[ea]).+)/,\n rcustomProp = /^--/,\n cssShow = {\n position: \"absolute\",\n visibility: \"hidden\",\n display: \"block\"\n },\n cssNormalTransform = {\n letterSpacing: \"0\",\n fontWeight: \"400\"\n };\n\n function setPositiveNumber(_elem, value, subtract) {\n // Any relative (+/-) values have already been\n // normalized at this point\n var matches = rcssNum.exec(value);\n return matches ? // Guard against undefined \"subtract\", e.g., when used as in cssHooks\n Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || \"px\") : value;\n }\n\n function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) {\n var i = dimension === \"width\" ? 1 : 0,\n extra = 0,\n delta = 0; // Adjustment may not be necessary\n\n if (box === (isBorderBox ? \"border\" : \"content\")) {\n return 0;\n }\n\n for (; i < 4; i += 2) {\n // Both box models exclude margin\n if (box === \"margin\") {\n delta += jQuery.css(elem, box + cssExpand[i], true, styles);\n } // If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\n\n if (!isBorderBox) {\n // Add padding\n delta += jQuery.css(elem, \"padding\" + cssExpand[i], true, styles); // For \"border\" or \"margin\", add border\n\n if (box !== \"padding\") {\n delta += jQuery.css(elem, \"border\" + cssExpand[i] + \"Width\", true, styles); // But still keep track of it otherwise\n } else {\n extra += jQuery.css(elem, \"border\" + cssExpand[i] + \"Width\", true, styles);\n } // If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n // \"padding\" or \"margin\"\n\n } else {\n // For \"content\", subtract padding\n if (box === \"content\") {\n delta -= jQuery.css(elem, \"padding\" + cssExpand[i], true, styles);\n } // For \"content\" or \"padding\", subtract border\n\n\n if (box !== \"margin\") {\n delta -= jQuery.css(elem, \"border\" + cssExpand[i] + \"Width\", true, styles);\n }\n }\n } // Account for positive content-box scroll gutter when requested by providing computedVal\n\n\n if (!isBorderBox && computedVal >= 0) {\n // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n // Assuming integer scroll gutter, subtract the rest and round down\n delta += Math.max(0, Math.ceil(elem[\"offset\" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n // Use an explicit zero to avoid NaN (gh-3964)\n )) || 0;\n }\n\n return delta;\n }\n\n function getWidthOrHeight(elem, dimension, extra) {\n // Start with computed style\n var styles = getStyles(elem),\n // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n // Fake content-box until we know it's needed to know the true value.\n boxSizingNeeded = !support.boxSizingReliable() || extra,\n isBorderBox = boxSizingNeeded && jQuery.css(elem, \"boxSizing\", false, styles) === \"border-box\",\n valueIsBorderBox = isBorderBox,\n val = curCSS(elem, dimension, styles),\n offsetProp = \"offset\" + dimension[0].toUpperCase() + dimension.slice(1); // Support: Firefox <=54\n // Return a confounding non-pixel value or feign ignorance, as appropriate.\n\n if (rnumnonpx.test(val)) {\n if (!extra) {\n return val;\n }\n\n val = \"auto\";\n } // Support: IE 9 - 11 only\n // Use offsetWidth/offsetHeight for when box sizing is unreliable.\n // In those cases, the computed value can be trusted to be border-box.\n\n\n if ((!support.boxSizingReliable() && isBorderBox || // Support: IE 10 - 11+, Edge 15 - 18+\n // IE/Edge misreport `getComputedStyle` of table rows with width/height\n // set in CSS while `offset*` properties report correct values.\n // Interestingly, in some cases IE 9 doesn't suffer from this issue.\n !support.reliableTrDimensions() && nodeName(elem, \"tr\") || // Fall back to offsetWidth/offsetHeight when value is \"auto\"\n // This happens for inline elements with no explicit setting (gh-3571)\n val === \"auto\" || // Support: Android <=4.1 - 4.3 only\n // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n !parseFloat(val) && jQuery.css(elem, \"display\", false, styles) === \"inline\") && // Make sure the element is visible & connected\n elem.getClientRects().length) {\n isBorderBox = jQuery.css(elem, \"boxSizing\", false, styles) === \"border-box\"; // Where available, offsetWidth/offsetHeight approximate border box dimensions.\n // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n // retrieved value as a content box dimension.\n\n valueIsBorderBox = offsetProp in elem;\n\n if (valueIsBorderBox) {\n val = elem[offsetProp];\n }\n } // Normalize \"\" and auto\n\n\n val = parseFloat(val) || 0; // Adjust for the element's box model\n\n return val + boxModelAdjustment(elem, dimension, extra || (isBorderBox ? \"border\" : \"content\"), valueIsBorderBox, styles, // Provide the current computed size to request scroll gutter calculation (gh-3589)\n val) + \"px\";\n }\n\n jQuery.extend({\n // Add in style property hooks for overriding the default\n // behavior of getting and setting a style property\n cssHooks: {\n opacity: {\n get: function get(elem, computed) {\n if (computed) {\n // We should always get a number back from opacity\n var ret = curCSS(elem, \"opacity\");\n return ret === \"\" ? \"1\" : ret;\n }\n }\n }\n },\n // Don't automatically add \"px\" to these possibly-unitless properties\n cssNumber: {\n \"animationIterationCount\": true,\n \"columnCount\": true,\n \"fillOpacity\": true,\n \"flexGrow\": true,\n \"flexShrink\": true,\n \"fontWeight\": true,\n \"gridArea\": true,\n \"gridColumn\": true,\n \"gridColumnEnd\": true,\n \"gridColumnStart\": true,\n \"gridRow\": true,\n \"gridRowEnd\": true,\n \"gridRowStart\": true,\n \"lineHeight\": true,\n \"opacity\": true,\n \"order\": true,\n \"orphans\": true,\n \"widows\": true,\n \"zIndex\": true,\n \"zoom\": true\n },\n // Add in properties whose names you wish to fix before\n // setting or getting the value\n cssProps: {},\n // Get and set the style property on a DOM Node\n style: function style(elem, name, value, extra) {\n // Don't set styles on text and comment nodes\n if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {\n return;\n } // Make sure that we're working with the right name\n\n\n var ret,\n type,\n hooks,\n origName = camelCase(name),\n isCustomProp = rcustomProp.test(name),\n style = elem.style; // Make sure that we're working with the right name. We don't\n // want to query the value if it is a CSS custom property\n // since they are user-defined.\n\n if (!isCustomProp) {\n name = finalPropName(origName);\n } // Gets hook for the prefixed version, then unprefixed version\n\n\n hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; // Check if we're setting a value\n\n if (value !== undefined) {\n type = _typeof(value); // Convert \"+=\" or \"-=\" to relative numbers (#7345)\n\n if (type === \"string\" && (ret = rcssNum.exec(value)) && ret[1]) {\n value = adjustCSS(elem, name, ret); // Fixes bug #9237\n\n type = \"number\";\n } // Make sure that null and NaN values aren't set (#7116)\n\n\n if (value == null || value !== value) {\n return;\n } // If a number was passed in, add the unit (except for certain CSS properties)\n // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n // \"px\" to a few hardcoded values.\n\n\n if (type === \"number\" && !isCustomProp) {\n value += ret && ret[3] || (jQuery.cssNumber[origName] ? \"\" : \"px\");\n } // background-* props affect original clone's values\n\n\n if (!support.clearCloneStyle && value === \"\" && name.indexOf(\"background\") === 0) {\n style[name] = \"inherit\";\n } // If a hook was provided, use that value, otherwise just set the specified value\n\n\n if (!hooks || !(\"set\" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {\n if (isCustomProp) {\n style.setProperty(name, value);\n } else {\n style[name] = value;\n }\n }\n } else {\n // If a hook was provided get the non-computed value from there\n if (hooks && \"get\" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {\n return ret;\n } // Otherwise just get the value from the style object\n\n\n return style[name];\n }\n },\n css: function css(elem, name, extra, styles) {\n var val,\n num,\n hooks,\n origName = camelCase(name),\n isCustomProp = rcustomProp.test(name); // Make sure that we're working with the right name. We don't\n // want to modify the value if it is a CSS custom property\n // since they are user-defined.\n\n if (!isCustomProp) {\n name = finalPropName(origName);\n } // Try prefixed name followed by the unprefixed name\n\n\n hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; // If a hook was provided get the computed value from there\n\n if (hooks && \"get\" in hooks) {\n val = hooks.get(elem, true, extra);\n } // Otherwise, if a way to get the computed value exists, use that\n\n\n if (val === undefined) {\n val = curCSS(elem, name, styles);\n } // Convert \"normal\" to computed value\n\n\n if (val === \"normal\" && name in cssNormalTransform) {\n val = cssNormalTransform[name];\n } // Make numeric if forced or a qualifier was provided and val looks numeric\n\n\n if (extra === \"\" || extra) {\n num = parseFloat(val);\n return extra === true || isFinite(num) ? num || 0 : val;\n }\n\n return val;\n }\n });\n jQuery.each([\"height\", \"width\"], function (_i, dimension) {\n jQuery.cssHooks[dimension] = {\n get: function get(elem, computed, extra) {\n if (computed) {\n // Certain elements can have dimension info if we invisibly show them\n // but it must have a current display style that would benefit\n return rdisplayswap.test(jQuery.css(elem, \"display\")) && ( // Support: Safari 8+\n // Table columns in Safari have non-zero offsetWidth & zero\n // getBoundingClientRect().width unless display is changed.\n // Support: IE <=11 only\n // Running getBoundingClientRect on a disconnected node\n // in IE throws an error.\n !elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function () {\n return getWidthOrHeight(elem, dimension, extra);\n }) : getWidthOrHeight(elem, dimension, extra);\n }\n },\n set: function set(elem, value, extra) {\n var matches,\n styles = getStyles(elem),\n // Only read styles.position if the test has a chance to fail\n // to avoid forcing a reflow.\n scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === \"absolute\",\n // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n boxSizingNeeded = scrollboxSizeBuggy || extra,\n isBorderBox = boxSizingNeeded && jQuery.css(elem, \"boxSizing\", false, styles) === \"border-box\",\n subtract = extra ? boxModelAdjustment(elem, dimension, extra, isBorderBox, styles) : 0; // Account for unreliable border-box dimensions by comparing offset* to computed and\n // faking a content-box to get border and padding (gh-3699)\n\n if (isBorderBox && scrollboxSizeBuggy) {\n subtract -= Math.ceil(elem[\"offset\" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, \"border\", false, styles) - 0.5);\n } // Convert to pixels if value adjustment is needed\n\n\n if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || \"px\") !== \"px\") {\n elem.style[dimension] = value;\n value = jQuery.css(elem, dimension);\n }\n\n return setPositiveNumber(elem, value, subtract);\n }\n };\n });\n jQuery.cssHooks.marginLeft = addGetHookIf(support.reliableMarginLeft, function (elem, computed) {\n if (computed) {\n return (parseFloat(curCSS(elem, \"marginLeft\")) || elem.getBoundingClientRect().left - swap(elem, {\n marginLeft: 0\n }, function () {\n return elem.getBoundingClientRect().left;\n })) + \"px\";\n }\n }); // These hooks are used by animate to expand properties\n\n jQuery.each({\n margin: \"\",\n padding: \"\",\n border: \"Width\"\n }, function (prefix, suffix) {\n jQuery.cssHooks[prefix + suffix] = {\n expand: function expand(value) {\n var i = 0,\n expanded = {},\n // Assumes a single number if not a string\n parts = typeof value === \"string\" ? value.split(\" \") : [value];\n\n for (; i < 4; i++) {\n expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0];\n }\n\n return expanded;\n }\n };\n\n if (prefix !== \"margin\") {\n jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;\n }\n });\n jQuery.fn.extend({\n css: function css(name, value) {\n return access(this, function (elem, name, value) {\n var styles,\n len,\n map = {},\n i = 0;\n\n if (Array.isArray(name)) {\n styles = getStyles(elem);\n len = name.length;\n\n for (; i < len; i++) {\n map[name[i]] = jQuery.css(elem, name[i], false, styles);\n }\n\n return map;\n }\n\n return value !== undefined ? jQuery.style(elem, name, value) : jQuery.css(elem, name);\n }, name, value, arguments.length > 1);\n }\n });\n\n function Tween(elem, options, prop, end, easing) {\n return new Tween.prototype.init(elem, options, prop, end, easing);\n }\n\n jQuery.Tween = Tween;\n Tween.prototype = {\n constructor: Tween,\n init: function init(elem, options, prop, end, easing, unit) {\n this.elem = elem;\n this.prop = prop;\n this.easing = easing || jQuery.easing._default;\n this.options = options;\n this.start = this.now = this.cur();\n this.end = end;\n this.unit = unit || (jQuery.cssNumber[prop] ? \"\" : \"px\");\n },\n cur: function cur() {\n var hooks = Tween.propHooks[this.prop];\n return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this);\n },\n run: function run(percent) {\n var eased,\n hooks = Tween.propHooks[this.prop];\n\n if (this.options.duration) {\n this.pos = eased = jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration);\n } else {\n this.pos = eased = percent;\n }\n\n this.now = (this.end - this.start) * eased + this.start;\n\n if (this.options.step) {\n this.options.step.call(this.elem, this.now, this);\n }\n\n if (hooks && hooks.set) {\n hooks.set(this);\n } else {\n Tween.propHooks._default.set(this);\n }\n\n return this;\n }\n };\n Tween.prototype.init.prototype = Tween.prototype;\n Tween.propHooks = {\n _default: {\n get: function get(tween) {\n var result; // Use a property on the element directly when it is not a DOM element,\n // or when there is no matching style property that exists.\n\n if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) {\n return tween.elem[tween.prop];\n } // Passing an empty string as a 3rd parameter to .css will automatically\n // attempt a parseFloat and fallback to a string if the parse fails.\n // Simple values such as \"10px\" are parsed to Float;\n // complex values such as \"rotate(1rad)\" are returned as-is.\n\n\n result = jQuery.css(tween.elem, tween.prop, \"\"); // Empty strings, null, undefined and \"auto\" are converted to 0.\n\n return !result || result === \"auto\" ? 0 : result;\n },\n set: function set(tween) {\n // Use step hook for back compat.\n // Use cssHook if its there.\n // Use .style if available and use plain properties where available.\n if (jQuery.fx.step[tween.prop]) {\n jQuery.fx.step[tween.prop](tween);\n } else if (tween.elem.nodeType === 1 && (jQuery.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) {\n jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);\n } else {\n tween.elem[tween.prop] = tween.now;\n }\n }\n }\n }; // Support: IE <=9 only\n // Panic based approach to setting things on disconnected nodes\n\n Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n set: function set(tween) {\n if (tween.elem.nodeType && tween.elem.parentNode) {\n tween.elem[tween.prop] = tween.now;\n }\n }\n };\n jQuery.easing = {\n linear: function linear(p) {\n return p;\n },\n swing: function swing(p) {\n return 0.5 - Math.cos(p * Math.PI) / 2;\n },\n _default: \"swing\"\n };\n jQuery.fx = Tween.prototype.init; // Back compat <1.8 extension point\n\n jQuery.fx.step = {};\n var fxNow,\n inProgress,\n rfxtypes = /^(?:toggle|show|hide)$/,\n rrun = /queueHooks$/;\n\n function schedule() {\n if (inProgress) {\n if (document.hidden === false && window.requestAnimationFrame) {\n window.requestAnimationFrame(schedule);\n } else {\n window.setTimeout(schedule, jQuery.fx.interval);\n }\n\n jQuery.fx.tick();\n }\n } // Animations created synchronously will run synchronously\n\n\n function createFxNow() {\n window.setTimeout(function () {\n fxNow = undefined;\n });\n return fxNow = Date.now();\n } // Generate parameters to create a standard animation\n\n\n function genFx(type, includeWidth) {\n var which,\n i = 0,\n attrs = {\n height: type\n }; // If we include width, step value is 1 to do all cssExpand values,\n // otherwise step value is 2 to skip over Left and Right\n\n includeWidth = includeWidth ? 1 : 0;\n\n for (; i < 4; i += 2 - includeWidth) {\n which = cssExpand[i];\n attrs[\"margin\" + which] = attrs[\"padding\" + which] = type;\n }\n\n if (includeWidth) {\n attrs.opacity = attrs.width = type;\n }\n\n return attrs;\n }\n\n function createTween(value, prop, animation) {\n var tween,\n collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners[\"*\"]),\n index = 0,\n length = collection.length;\n\n for (; index < length; index++) {\n if (tween = collection[index].call(animation, prop, value)) {\n // We're done with this property\n return tween;\n }\n }\n }\n\n function defaultPrefilter(elem, props, opts) {\n var prop,\n value,\n toggle,\n hooks,\n oldfire,\n propTween,\n restoreDisplay,\n display,\n isBox = \"width\" in props || \"height\" in props,\n anim = this,\n orig = {},\n style = elem.style,\n hidden = elem.nodeType && isHiddenWithinTree(elem),\n dataShow = dataPriv.get(elem, \"fxshow\"); // Queue-skipping animations hijack the fx hooks\n\n if (!opts.queue) {\n hooks = jQuery._queueHooks(elem, \"fx\");\n\n if (hooks.unqueued == null) {\n hooks.unqueued = 0;\n oldfire = hooks.empty.fire;\n\n hooks.empty.fire = function () {\n if (!hooks.unqueued) {\n oldfire();\n }\n };\n }\n\n hooks.unqueued++;\n anim.always(function () {\n // Ensure the complete handler is called before this completes\n anim.always(function () {\n hooks.unqueued--;\n\n if (!jQuery.queue(elem, \"fx\").length) {\n hooks.empty.fire();\n }\n });\n });\n } // Detect show/hide animations\n\n\n for (prop in props) {\n value = props[prop];\n\n if (rfxtypes.test(value)) {\n delete props[prop];\n toggle = toggle || value === \"toggle\";\n\n if (value === (hidden ? \"hide\" : \"show\")) {\n // Pretend to be hidden if this is a \"show\" and\n // there is still data from a stopped show/hide\n if (value === \"show\" && dataShow && dataShow[prop] !== undefined) {\n hidden = true; // Ignore all other no-op show/hide data\n } else {\n continue;\n }\n }\n\n orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);\n }\n } // Bail out if this is a no-op like .hide().hide()\n\n\n propTween = !jQuery.isEmptyObject(props);\n\n if (!propTween && jQuery.isEmptyObject(orig)) {\n return;\n } // Restrict \"overflow\" and \"display\" styles during box animations\n\n\n if (isBox && elem.nodeType === 1) {\n // Support: IE <=9 - 11, Edge 12 - 15\n // Record all 3 overflow attributes because IE does not infer the shorthand\n // from identically-valued overflowX and overflowY and Edge just mirrors\n // the overflowX value there.\n opts.overflow = [style.overflow, style.overflowX, style.overflowY]; // Identify a display type, preferring old show/hide data over the CSS cascade\n\n restoreDisplay = dataShow && dataShow.display;\n\n if (restoreDisplay == null) {\n restoreDisplay = dataPriv.get(elem, \"display\");\n }\n\n display = jQuery.css(elem, \"display\");\n\n if (display === \"none\") {\n if (restoreDisplay) {\n display = restoreDisplay;\n } else {\n // Get nonempty value(s) by temporarily forcing visibility\n showHide([elem], true);\n restoreDisplay = elem.style.display || restoreDisplay;\n display = jQuery.css(elem, \"display\");\n showHide([elem]);\n }\n } // Animate inline elements as inline-block\n\n\n if (display === \"inline\" || display === \"inline-block\" && restoreDisplay != null) {\n if (jQuery.css(elem, \"float\") === \"none\") {\n // Restore the original display value at the end of pure show/hide animations\n if (!propTween) {\n anim.done(function () {\n style.display = restoreDisplay;\n });\n\n if (restoreDisplay == null) {\n display = style.display;\n restoreDisplay = display === \"none\" ? \"\" : display;\n }\n }\n\n style.display = \"inline-block\";\n }\n }\n }\n\n if (opts.overflow) {\n style.overflow = \"hidden\";\n anim.always(function () {\n style.overflow = opts.overflow[0];\n style.overflowX = opts.overflow[1];\n style.overflowY = opts.overflow[2];\n });\n } // Implement show/hide animations\n\n\n propTween = false;\n\n for (prop in orig) {\n // General show/hide setup for this element animation\n if (!propTween) {\n if (dataShow) {\n if (\"hidden\" in dataShow) {\n hidden = dataShow.hidden;\n }\n } else {\n dataShow = dataPriv.access(elem, \"fxshow\", {\n display: restoreDisplay\n });\n } // Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\n\n if (toggle) {\n dataShow.hidden = !hidden;\n } // Show elements before animating them\n\n\n if (hidden) {\n showHide([elem], true);\n }\n /* eslint-disable no-loop-func */\n\n\n anim.done(function () {\n /* eslint-enable no-loop-func */\n // The final step of a \"hide\" animation is actually hiding the element\n if (!hidden) {\n showHide([elem]);\n }\n\n dataPriv.remove(elem, \"fxshow\");\n\n for (prop in orig) {\n jQuery.style(elem, prop, orig[prop]);\n }\n });\n } // Per-property setup\n\n\n propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim);\n\n if (!(prop in dataShow)) {\n dataShow[prop] = propTween.start;\n\n if (hidden) {\n propTween.end = propTween.start;\n propTween.start = 0;\n }\n }\n }\n }\n\n function propFilter(props, specialEasing) {\n var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass\n\n for (index in props) {\n name = camelCase(index);\n easing = specialEasing[name];\n value = props[index];\n\n if (Array.isArray(value)) {\n easing = value[1];\n value = props[index] = value[0];\n }\n\n if (index !== name) {\n props[name] = value;\n delete props[index];\n }\n\n hooks = jQuery.cssHooks[name];\n\n if (hooks && \"expand\" in hooks) {\n value = hooks.expand(value);\n delete props[name]; // Not quite $.extend, this won't overwrite existing keys.\n // Reusing 'index' because we have the correct \"name\"\n\n for (index in value) {\n if (!(index in props)) {\n props[index] = value[index];\n specialEasing[index] = easing;\n }\n }\n } else {\n specialEasing[name] = easing;\n }\n }\n }\n\n function Animation(elem, properties, options) {\n var result,\n stopped,\n index = 0,\n length = Animation.prefilters.length,\n deferred = jQuery.Deferred().always(function () {\n // Don't match elem in the :animated selector\n delete tick.elem;\n }),\n tick = function tick() {\n if (stopped) {\n return false;\n }\n\n var currentTime = fxNow || createFxNow(),\n remaining = Math.max(0, animation.startTime + animation.duration - currentTime),\n // Support: Android 2.3 only\n // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n temp = remaining / animation.duration || 0,\n percent = 1 - temp,\n index = 0,\n length = animation.tweens.length;\n\n for (; index < length; index++) {\n animation.tweens[index].run(percent);\n }\n\n deferred.notifyWith(elem, [animation, percent, remaining]); // If there's more to do, yield\n\n if (percent < 1 && length) {\n return remaining;\n } // If this was an empty animation, synthesize a final progress notification\n\n\n if (!length) {\n deferred.notifyWith(elem, [animation, 1, 0]);\n } // Resolve the animation and report its conclusion\n\n\n deferred.resolveWith(elem, [animation]);\n return false;\n },\n animation = deferred.promise({\n elem: elem,\n props: jQuery.extend({}, properties),\n opts: jQuery.extend(true, {\n specialEasing: {},\n easing: jQuery.easing._default\n }, options),\n originalProperties: properties,\n originalOptions: options,\n startTime: fxNow || createFxNow(),\n duration: options.duration,\n tweens: [],\n createTween: function createTween(prop, end) {\n var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing);\n animation.tweens.push(tween);\n return tween;\n },\n stop: function stop(gotoEnd) {\n var index = 0,\n // If we are going to the end, we want to run all the tweens\n // otherwise we skip this part\n length = gotoEnd ? animation.tweens.length : 0;\n\n if (stopped) {\n return this;\n }\n\n stopped = true;\n\n for (; index < length; index++) {\n animation.tweens[index].run(1);\n } // Resolve when we played the last frame; otherwise, reject\n\n\n if (gotoEnd) {\n deferred.notifyWith(elem, [animation, 1, 0]);\n deferred.resolveWith(elem, [animation, gotoEnd]);\n } else {\n deferred.rejectWith(elem, [animation, gotoEnd]);\n }\n\n return this;\n }\n }),\n props = animation.props;\n\n propFilter(props, animation.opts.specialEasing);\n\n for (; index < length; index++) {\n result = Animation.prefilters[index].call(animation, elem, props, animation.opts);\n\n if (result) {\n if (isFunction(result.stop)) {\n jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result);\n }\n\n return result;\n }\n }\n\n jQuery.map(props, createTween, animation);\n\n if (isFunction(animation.opts.start)) {\n animation.opts.start.call(elem, animation);\n } // Attach callbacks from options\n\n\n animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);\n jQuery.fx.timer(jQuery.extend(tick, {\n elem: elem,\n anim: animation,\n queue: animation.opts.queue\n }));\n return animation;\n }\n\n jQuery.Animation = jQuery.extend(Animation, {\n tweeners: {\n \"*\": [function (prop, value) {\n var tween = this.createTween(prop, value);\n adjustCSS(tween.elem, prop, rcssNum.exec(value), tween);\n return tween;\n }]\n },\n tweener: function tweener(props, callback) {\n if (isFunction(props)) {\n callback = props;\n props = [\"*\"];\n } else {\n props = props.match(rnothtmlwhite);\n }\n\n var prop,\n index = 0,\n length = props.length;\n\n for (; index < length; index++) {\n prop = props[index];\n Animation.tweeners[prop] = Animation.tweeners[prop] || [];\n Animation.tweeners[prop].unshift(callback);\n }\n },\n prefilters: [defaultPrefilter],\n prefilter: function prefilter(callback, prepend) {\n if (prepend) {\n Animation.prefilters.unshift(callback);\n } else {\n Animation.prefilters.push(callback);\n }\n }\n });\n\n jQuery.speed = function (speed, easing, fn) {\n var opt = speed && _typeof(speed) === \"object\" ? jQuery.extend({}, speed) : {\n complete: fn || !fn && easing || isFunction(speed) && speed,\n duration: speed,\n easing: fn && easing || easing && !isFunction(easing) && easing\n }; // Go to the end state if fx are off\n\n if (jQuery.fx.off) {\n opt.duration = 0;\n } else {\n if (typeof opt.duration !== \"number\") {\n if (opt.duration in jQuery.fx.speeds) {\n opt.duration = jQuery.fx.speeds[opt.duration];\n } else {\n opt.duration = jQuery.fx.speeds._default;\n }\n }\n } // Normalize opt.queue - true/undefined/null -> \"fx\"\n\n\n if (opt.queue == null || opt.queue === true) {\n opt.queue = \"fx\";\n } // Queueing\n\n\n opt.old = opt.complete;\n\n opt.complete = function () {\n if (isFunction(opt.old)) {\n opt.old.call(this);\n }\n\n if (opt.queue) {\n jQuery.dequeue(this, opt.queue);\n }\n };\n\n return opt;\n };\n\n jQuery.fn.extend({\n fadeTo: function fadeTo(speed, to, easing, callback) {\n // Show any hidden elements after setting opacity to 0\n return this.filter(isHiddenWithinTree).css(\"opacity\", 0).show() // Animate to the value specified\n .end().animate({\n opacity: to\n }, speed, easing, callback);\n },\n animate: function animate(prop, speed, easing, callback) {\n var empty = jQuery.isEmptyObject(prop),\n optall = jQuery.speed(speed, easing, callback),\n doAnimation = function doAnimation() {\n // Operate on a copy of prop so per-property easing won't be lost\n var anim = Animation(this, jQuery.extend({}, prop), optall); // Empty animations, or finishing resolves immediately\n\n if (empty || dataPriv.get(this, \"finish\")) {\n anim.stop(true);\n }\n };\n\n doAnimation.finish = doAnimation;\n return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);\n },\n stop: function stop(type, clearQueue, gotoEnd) {\n var stopQueue = function stopQueue(hooks) {\n var stop = hooks.stop;\n delete hooks.stop;\n stop(gotoEnd);\n };\n\n if (typeof type !== \"string\") {\n gotoEnd = clearQueue;\n clearQueue = type;\n type = undefined;\n }\n\n if (clearQueue) {\n this.queue(type || \"fx\", []);\n }\n\n return this.each(function () {\n var dequeue = true,\n index = type != null && type + \"queueHooks\",\n timers = jQuery.timers,\n data = dataPriv.get(this);\n\n if (index) {\n if (data[index] && data[index].stop) {\n stopQueue(data[index]);\n }\n } else {\n for (index in data) {\n if (data[index] && data[index].stop && rrun.test(index)) {\n stopQueue(data[index]);\n }\n }\n }\n\n for (index = timers.length; index--;) {\n if (timers[index].elem === this && (type == null || timers[index].queue === type)) {\n timers[index].anim.stop(gotoEnd);\n dequeue = false;\n timers.splice(index, 1);\n }\n } // Start the next in the queue if the last step wasn't forced.\n // Timers currently will call their complete callbacks, which\n // will dequeue but only if they were gotoEnd.\n\n\n if (dequeue || !gotoEnd) {\n jQuery.dequeue(this, type);\n }\n });\n },\n finish: function finish(type) {\n if (type !== false) {\n type = type || \"fx\";\n }\n\n return this.each(function () {\n var index,\n data = dataPriv.get(this),\n queue = data[type + \"queue\"],\n hooks = data[type + \"queueHooks\"],\n timers = jQuery.timers,\n length = queue ? queue.length : 0; // Enable finishing flag on private data\n\n data.finish = true; // Empty the queue first\n\n jQuery.queue(this, type, []);\n\n if (hooks && hooks.stop) {\n hooks.stop.call(this, true);\n } // Look for any active animations, and finish them\n\n\n for (index = timers.length; index--;) {\n if (timers[index].elem === this && timers[index].queue === type) {\n timers[index].anim.stop(true);\n timers.splice(index, 1);\n }\n } // Look for any animations in the old queue and finish them\n\n\n for (index = 0; index < length; index++) {\n if (queue[index] && queue[index].finish) {\n queue[index].finish.call(this);\n }\n } // Turn off finishing flag\n\n\n delete data.finish;\n });\n }\n });\n jQuery.each([\"toggle\", \"show\", \"hide\"], function (_i, name) {\n var cssFn = jQuery.fn[name];\n\n jQuery.fn[name] = function (speed, easing, callback) {\n return speed == null || typeof speed === \"boolean\" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback);\n };\n }); // Generate shortcuts for custom animations\n\n jQuery.each({\n slideDown: genFx(\"show\"),\n slideUp: genFx(\"hide\"),\n slideToggle: genFx(\"toggle\"),\n fadeIn: {\n opacity: \"show\"\n },\n fadeOut: {\n opacity: \"hide\"\n },\n fadeToggle: {\n opacity: \"toggle\"\n }\n }, function (name, props) {\n jQuery.fn[name] = function (speed, easing, callback) {\n return this.animate(props, speed, easing, callback);\n };\n });\n jQuery.timers = [];\n\n jQuery.fx.tick = function () {\n var timer,\n i = 0,\n timers = jQuery.timers;\n fxNow = Date.now();\n\n for (; i < timers.length; i++) {\n timer = timers[i]; // Run the timer and safely remove it when done (allowing for external removal)\n\n if (!timer() && timers[i] === timer) {\n timers.splice(i--, 1);\n }\n }\n\n if (!timers.length) {\n jQuery.fx.stop();\n }\n\n fxNow = undefined;\n };\n\n jQuery.fx.timer = function (timer) {\n jQuery.timers.push(timer);\n jQuery.fx.start();\n };\n\n jQuery.fx.interval = 13;\n\n jQuery.fx.start = function () {\n if (inProgress) {\n return;\n }\n\n inProgress = true;\n schedule();\n };\n\n jQuery.fx.stop = function () {\n inProgress = null;\n };\n\n jQuery.fx.speeds = {\n slow: 600,\n fast: 200,\n // Default speed\n _default: 400\n }; // Based off of the plugin by Clint Helfers, with permission.\n // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\n\n jQuery.fn.delay = function (time, type) {\n time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;\n type = type || \"fx\";\n return this.queue(type, function (next, hooks) {\n var timeout = window.setTimeout(next, time);\n\n hooks.stop = function () {\n window.clearTimeout(timeout);\n };\n });\n };\n\n (function () {\n var input = document.createElement(\"input\"),\n select = document.createElement(\"select\"),\n opt = select.appendChild(document.createElement(\"option\"));\n input.type = \"checkbox\"; // Support: Android <=4.3 only\n // Default value for a checkbox should be \"on\"\n\n support.checkOn = input.value !== \"\"; // Support: IE <=11 only\n // Must access selectedIndex to make default options select\n\n support.optSelected = opt.selected; // Support: IE <=11 only\n // An input loses its value after becoming a radio\n\n input = document.createElement(\"input\");\n input.value = \"t\";\n input.type = \"radio\";\n support.radioValue = input.value === \"t\";\n })();\n\n var boolHook,\n attrHandle = jQuery.expr.attrHandle;\n jQuery.fn.extend({\n attr: function attr(name, value) {\n return access(this, jQuery.attr, name, value, arguments.length > 1);\n },\n removeAttr: function removeAttr(name) {\n return this.each(function () {\n jQuery.removeAttr(this, name);\n });\n }\n });\n jQuery.extend({\n attr: function attr(elem, name, value) {\n var ret,\n hooks,\n nType = elem.nodeType; // Don't get/set attributes on text, comment and attribute nodes\n\n if (nType === 3 || nType === 8 || nType === 2) {\n return;\n } // Fallback to prop when attributes are not supported\n\n\n if (typeof elem.getAttribute === \"undefined\") {\n return jQuery.prop(elem, name, value);\n } // Attribute hooks are determined by the lowercase version\n // Grab necessary hook if one is defined\n\n\n if (nType !== 1 || !jQuery.isXMLDoc(elem)) {\n hooks = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : undefined);\n }\n\n if (value !== undefined) {\n if (value === null) {\n jQuery.removeAttr(elem, name);\n return;\n }\n\n if (hooks && \"set\" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {\n return ret;\n }\n\n elem.setAttribute(name, value + \"\");\n return value;\n }\n\n if (hooks && \"get\" in hooks && (ret = hooks.get(elem, name)) !== null) {\n return ret;\n }\n\n ret = jQuery.find.attr(elem, name); // Non-existent attributes return null, we normalize to undefined\n\n return ret == null ? undefined : ret;\n },\n attrHooks: {\n type: {\n set: function set(elem, value) {\n if (!support.radioValue && value === \"radio\" && nodeName(elem, \"input\")) {\n var val = elem.value;\n elem.setAttribute(\"type\", value);\n\n if (val) {\n elem.value = val;\n }\n\n return value;\n }\n }\n }\n },\n removeAttr: function removeAttr(elem, value) {\n var name,\n i = 0,\n // Attribute names can contain non-HTML whitespace characters\n // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n attrNames = value && value.match(rnothtmlwhite);\n\n if (attrNames && elem.nodeType === 1) {\n while (name = attrNames[i++]) {\n elem.removeAttribute(name);\n }\n }\n }\n }); // Hooks for boolean attributes\n\n boolHook = {\n set: function set(elem, value, name) {\n if (value === false) {\n // Remove boolean attributes when set to false\n jQuery.removeAttr(elem, name);\n } else {\n elem.setAttribute(name, name);\n }\n\n return name;\n }\n };\n jQuery.each(jQuery.expr.match.bool.source.match(/\\w+/g), function (_i, name) {\n var getter = attrHandle[name] || jQuery.find.attr;\n\n attrHandle[name] = function (elem, name, isXML) {\n var ret,\n handle,\n lowercaseName = name.toLowerCase();\n\n if (!isXML) {\n // Avoid an infinite loop by temporarily removing this function from the getter\n handle = attrHandle[lowercaseName];\n attrHandle[lowercaseName] = ret;\n ret = getter(elem, name, isXML) != null ? lowercaseName : null;\n attrHandle[lowercaseName] = handle;\n }\n\n return ret;\n };\n });\n var rfocusable = /^(?:input|select|textarea|button)$/i,\n rclickable = /^(?:a|area)$/i;\n jQuery.fn.extend({\n prop: function prop(name, value) {\n return access(this, jQuery.prop, name, value, arguments.length > 1);\n },\n removeProp: function removeProp(name) {\n return this.each(function () {\n delete this[jQuery.propFix[name] || name];\n });\n }\n });\n jQuery.extend({\n prop: function prop(elem, name, value) {\n var ret,\n hooks,\n nType = elem.nodeType; // Don't get/set properties on text, comment and attribute nodes\n\n if (nType === 3 || nType === 8 || nType === 2) {\n return;\n }\n\n if (nType !== 1 || !jQuery.isXMLDoc(elem)) {\n // Fix name and attach hooks\n name = jQuery.propFix[name] || name;\n hooks = jQuery.propHooks[name];\n }\n\n if (value !== undefined) {\n if (hooks && \"set\" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {\n return ret;\n }\n\n return elem[name] = value;\n }\n\n if (hooks && \"get\" in hooks && (ret = hooks.get(elem, name)) !== null) {\n return ret;\n }\n\n return elem[name];\n },\n propHooks: {\n tabIndex: {\n get: function get(elem) {\n // Support: IE <=9 - 11 only\n // elem.tabIndex doesn't always return the\n // correct value when it hasn't been explicitly set\n // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n // Use proper attribute retrieval(#12072)\n var tabindex = jQuery.find.attr(elem, \"tabindex\");\n\n if (tabindex) {\n return parseInt(tabindex, 10);\n }\n\n if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) {\n return 0;\n }\n\n return -1;\n }\n }\n },\n propFix: {\n \"for\": \"htmlFor\",\n \"class\": \"className\"\n }\n }); // Support: IE <=11 only\n // Accessing the selectedIndex property\n // forces the browser to respect setting selected\n // on the option\n // The getter ensures a default option is selected\n // when in an optgroup\n // eslint rule \"no-unused-expressions\" is disabled for this code\n // since it considers such accessions noop\n\n if (!support.optSelected) {\n jQuery.propHooks.selected = {\n get: function get(elem) {\n /* eslint no-unused-expressions: \"off\" */\n var parent = elem.parentNode;\n\n if (parent && parent.parentNode) {\n parent.parentNode.selectedIndex;\n }\n\n return null;\n },\n set: function set(elem) {\n /* eslint no-unused-expressions: \"off\" */\n var parent = elem.parentNode;\n\n if (parent) {\n parent.selectedIndex;\n\n if (parent.parentNode) {\n parent.parentNode.selectedIndex;\n }\n }\n }\n };\n }\n\n jQuery.each([\"tabIndex\", \"readOnly\", \"maxLength\", \"cellSpacing\", \"cellPadding\", \"rowSpan\", \"colSpan\", \"useMap\", \"frameBorder\", \"contentEditable\"], function () {\n jQuery.propFix[this.toLowerCase()] = this;\n }); // Strip and collapse whitespace according to HTML spec\n // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\n function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }\n\n function getClass(elem) {\n return elem.getAttribute && elem.getAttribute(\"class\") || \"\";\n }\n\n function classesToArray(value) {\n if (Array.isArray(value)) {\n return value;\n }\n\n if (typeof value === \"string\") {\n return value.match(rnothtmlwhite) || [];\n }\n\n return [];\n }\n\n jQuery.fn.extend({\n addClass: function addClass(value) {\n var classes,\n elem,\n cur,\n curValue,\n clazz,\n j,\n finalValue,\n i = 0;\n\n if (isFunction(value)) {\n return this.each(function (j) {\n jQuery(this).addClass(value.call(this, j, getClass(this)));\n });\n }\n\n classes = classesToArray(value);\n\n if (classes.length) {\n while (elem = this[i++]) {\n curValue = getClass(elem);\n cur = elem.nodeType === 1 && \" \" + stripAndCollapse(curValue) + \" \";\n\n if (cur) {\n j = 0;\n\n while (clazz = classes[j++]) {\n if (cur.indexOf(\" \" + clazz + \" \") < 0) {\n cur += clazz + \" \";\n }\n } // Only assign if different to avoid unneeded rendering.\n\n\n finalValue = stripAndCollapse(cur);\n\n if (curValue !== finalValue) {\n elem.setAttribute(\"class\", finalValue);\n }\n }\n }\n }\n\n return this;\n },\n removeClass: function removeClass(value) {\n var classes,\n elem,\n cur,\n curValue,\n clazz,\n j,\n finalValue,\n i = 0;\n\n if (isFunction(value)) {\n return this.each(function (j) {\n jQuery(this).removeClass(value.call(this, j, getClass(this)));\n });\n }\n\n if (!arguments.length) {\n return this.attr(\"class\", \"\");\n }\n\n classes = classesToArray(value);\n\n if (classes.length) {\n while (elem = this[i++]) {\n curValue = getClass(elem); // This expression is here for better compressibility (see addClass)\n\n cur = elem.nodeType === 1 && \" \" + stripAndCollapse(curValue) + \" \";\n\n if (cur) {\n j = 0;\n\n while (clazz = classes[j++]) {\n // Remove *all* instances\n while (cur.indexOf(\" \" + clazz + \" \") > -1) {\n cur = cur.replace(\" \" + clazz + \" \", \" \");\n }\n } // Only assign if different to avoid unneeded rendering.\n\n\n finalValue = stripAndCollapse(cur);\n\n if (curValue !== finalValue) {\n elem.setAttribute(\"class\", finalValue);\n }\n }\n }\n }\n\n return this;\n },\n toggleClass: function toggleClass(value, stateVal) {\n var type = _typeof(value),\n isValidValue = type === \"string\" || Array.isArray(value);\n\n if (typeof stateVal === \"boolean\" && isValidValue) {\n return stateVal ? this.addClass(value) : this.removeClass(value);\n }\n\n if (isFunction(value)) {\n return this.each(function (i) {\n jQuery(this).toggleClass(value.call(this, i, getClass(this), stateVal), stateVal);\n });\n }\n\n return this.each(function () {\n var className, i, self, classNames;\n\n if (isValidValue) {\n // Toggle individual class names\n i = 0;\n self = jQuery(this);\n classNames = classesToArray(value);\n\n while (className = classNames[i++]) {\n // Check each className given, space separated list\n if (self.hasClass(className)) {\n self.removeClass(className);\n } else {\n self.addClass(className);\n }\n } // Toggle whole class name\n\n } else if (value === undefined || type === \"boolean\") {\n className = getClass(this);\n\n if (className) {\n // Store className if set\n dataPriv.set(this, \"__className__\", className);\n } // If the element has a class name or if we're passed `false`,\n // then remove the whole classname (if there was one, the above saved it).\n // Otherwise bring back whatever was previously saved (if anything),\n // falling back to the empty string if nothing was stored.\n\n\n if (this.setAttribute) {\n this.setAttribute(\"class\", className || value === false ? \"\" : dataPriv.get(this, \"__className__\") || \"\");\n }\n }\n });\n },\n hasClass: function hasClass(selector) {\n var className,\n elem,\n i = 0;\n className = \" \" + selector + \" \";\n\n while (elem = this[i++]) {\n if (elem.nodeType === 1 && (\" \" + stripAndCollapse(getClass(elem)) + \" \").indexOf(className) > -1) {\n return true;\n }\n }\n\n return false;\n }\n });\n var rreturn = /\\r/g;\n jQuery.fn.extend({\n val: function val(value) {\n var hooks,\n ret,\n valueIsFunction,\n elem = this[0];\n\n if (!arguments.length) {\n if (elem) {\n hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];\n\n if (hooks && \"get\" in hooks && (ret = hooks.get(elem, \"value\")) !== undefined) {\n return ret;\n }\n\n ret = elem.value; // Handle most common string cases\n\n if (typeof ret === \"string\") {\n return ret.replace(rreturn, \"\");\n } // Handle cases where value is null/undef or number\n\n\n return ret == null ? \"\" : ret;\n }\n\n return;\n }\n\n valueIsFunction = isFunction(value);\n return this.each(function (i) {\n var val;\n\n if (this.nodeType !== 1) {\n return;\n }\n\n if (valueIsFunction) {\n val = value.call(this, i, jQuery(this).val());\n } else {\n val = value;\n } // Treat null/undefined as \"\"; convert numbers to string\n\n\n if (val == null) {\n val = \"\";\n } else if (typeof val === \"number\") {\n val += \"\";\n } else if (Array.isArray(val)) {\n val = jQuery.map(val, function (value) {\n return value == null ? \"\" : value + \"\";\n });\n }\n\n hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()]; // If set returns undefined, fall back to normal setting\n\n if (!hooks || !(\"set\" in hooks) || hooks.set(this, val, \"value\") === undefined) {\n this.value = val;\n }\n });\n }\n });\n jQuery.extend({\n valHooks: {\n option: {\n get: function get(elem) {\n var val = jQuery.find.attr(elem, \"value\");\n return val != null ? val : // Support: IE <=10 - 11 only\n // option.text throws exceptions (#14686, #14858)\n // Strip and collapse whitespace\n // https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n stripAndCollapse(jQuery.text(elem));\n }\n },\n select: {\n get: function get(elem) {\n var value,\n option,\n i,\n options = elem.options,\n index = elem.selectedIndex,\n one = elem.type === \"select-one\",\n values = one ? null : [],\n max = one ? index + 1 : options.length;\n\n if (index < 0) {\n i = max;\n } else {\n i = one ? index : 0;\n } // Loop through all the selected options\n\n\n for (; i < max; i++) {\n option = options[i]; // Support: IE <=9 only\n // IE8-9 doesn't update selected after form reset (#2551)\n\n if ((option.selected || i === index) && // Don't return options that are disabled or in a disabled optgroup\n !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, \"optgroup\"))) {\n // Get the specific value for the option\n value = jQuery(option).val(); // We don't need an array for one selects\n\n if (one) {\n return value;\n } // Multi-Selects return an array\n\n\n values.push(value);\n }\n }\n\n return values;\n },\n set: function set(elem, value) {\n var optionSet,\n option,\n options = elem.options,\n values = jQuery.makeArray(value),\n i = options.length;\n\n while (i--) {\n option = options[i];\n /* eslint-disable no-cond-assign */\n\n if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values) > -1) {\n optionSet = true;\n }\n /* eslint-enable no-cond-assign */\n\n } // Force browsers to behave consistently when non-matching value is set\n\n\n if (!optionSet) {\n elem.selectedIndex = -1;\n }\n\n return values;\n }\n }\n }\n }); // Radios and checkboxes getter/setter\n\n jQuery.each([\"radio\", \"checkbox\"], function () {\n jQuery.valHooks[this] = {\n set: function set(elem, value) {\n if (Array.isArray(value)) {\n return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1;\n }\n }\n };\n\n if (!support.checkOn) {\n jQuery.valHooks[this].get = function (elem) {\n return elem.getAttribute(\"value\") === null ? \"on\" : elem.value;\n };\n }\n }); // Return jQuery for attributes-only inclusion\n\n support.focusin = \"onfocusin\" in window;\n\n var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n stopPropagationCallback = function stopPropagationCallback(e) {\n e.stopPropagation();\n };\n\n jQuery.extend(jQuery.event, {\n trigger: function trigger(event, data, elem, onlyHandlers) {\n var i,\n cur,\n tmp,\n bubbleType,\n ontype,\n handle,\n special,\n lastElement,\n eventPath = [elem || document],\n type = hasOwn.call(event, \"type\") ? event.type : event,\n namespaces = hasOwn.call(event, \"namespace\") ? event.namespace.split(\".\") : [];\n cur = lastElement = tmp = elem = elem || document; // Don't do events on text and comment nodes\n\n if (elem.nodeType === 3 || elem.nodeType === 8) {\n return;\n } // focus/blur morphs to focusin/out; ensure we're not firing them right now\n\n\n if (rfocusMorph.test(type + jQuery.event.triggered)) {\n return;\n }\n\n if (type.indexOf(\".\") > -1) {\n // Namespaced trigger; create a regexp to match event type in handle()\n namespaces = type.split(\".\");\n type = namespaces.shift();\n namespaces.sort();\n }\n\n ontype = type.indexOf(\":\") < 0 && \"on\" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string\n\n event = event[jQuery.expando] ? event : new jQuery.Event(type, _typeof(event) === \"object\" && event); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\n event.isTrigger = onlyHandlers ? 2 : 3;\n event.namespace = namespaces.join(\".\");\n event.rnamespace = event.namespace ? new RegExp(\"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\") : null; // Clean up the event in case it is being reused\n\n event.result = undefined;\n\n if (!event.target) {\n event.target = elem;\n } // Clone any incoming data and prepend the event, creating the handler arg list\n\n\n data = data == null ? [event] : jQuery.makeArray(data, [event]); // Allow special events to draw outside the lines\n\n special = jQuery.event.special[type] || {};\n\n if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {\n return;\n } // Determine event propagation path in advance, per W3C events spec (#9951)\n // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\n\n if (!onlyHandlers && !special.noBubble && !isWindow(elem)) {\n bubbleType = special.delegateType || type;\n\n if (!rfocusMorph.test(bubbleType + type)) {\n cur = cur.parentNode;\n }\n\n for (; cur; cur = cur.parentNode) {\n eventPath.push(cur);\n tmp = cur;\n } // Only add window if we got to document (e.g., not plain obj or detached DOM)\n\n\n if (tmp === (elem.ownerDocument || document)) {\n eventPath.push(tmp.defaultView || tmp.parentWindow || window);\n }\n } // Fire handlers on the event path\n\n\n i = 0;\n\n while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {\n lastElement = cur;\n event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler\n\n handle = (dataPriv.get(cur, \"events\") || Object.create(null))[event.type] && dataPriv.get(cur, \"handle\");\n\n if (handle) {\n handle.apply(cur, data);\n } // Native handler\n\n\n handle = ontype && cur[ontype];\n\n if (handle && handle.apply && acceptData(cur)) {\n event.result = handle.apply(cur, data);\n\n if (event.result === false) {\n event.preventDefault();\n }\n }\n }\n\n event.type = type; // If nobody prevented the default action, do it now\n\n if (!onlyHandlers && !event.isDefaultPrevented()) {\n if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) {\n // Call a native DOM method on the target with the same name as the event.\n // Don't do default actions on window, that's where global variables be (#6170)\n if (ontype && isFunction(elem[type]) && !isWindow(elem)) {\n // Don't re-trigger an onFOO event when we call its FOO() method\n tmp = elem[ontype];\n\n if (tmp) {\n elem[ontype] = null;\n } // Prevent re-triggering of the same event, since we already bubbled it above\n\n\n jQuery.event.triggered = type;\n\n if (event.isPropagationStopped()) {\n lastElement.addEventListener(type, stopPropagationCallback);\n }\n\n elem[type]();\n\n if (event.isPropagationStopped()) {\n lastElement.removeEventListener(type, stopPropagationCallback);\n }\n\n jQuery.event.triggered = undefined;\n\n if (tmp) {\n elem[ontype] = tmp;\n }\n }\n }\n }\n\n return event.result;\n },\n // Piggyback on a donor event to simulate a different one\n // Used only for `focus(in | out)` events\n simulate: function simulate(type, elem, event) {\n var e = jQuery.extend(new jQuery.Event(), event, {\n type: type,\n isSimulated: true\n });\n jQuery.event.trigger(e, null, elem);\n }\n });\n jQuery.fn.extend({\n trigger: function trigger(type, data) {\n return this.each(function () {\n jQuery.event.trigger(type, data, this);\n });\n },\n triggerHandler: function triggerHandler(type, data) {\n var elem = this[0];\n\n if (elem) {\n return jQuery.event.trigger(type, data, elem, true);\n }\n }\n }); // Support: Firefox <=44\n // Firefox doesn't have focus(in | out) events\n // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n //\n // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n // focus(in | out) events fire after focus & blur events,\n // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\n\n if (!support.focusin) {\n jQuery.each({\n focus: \"focusin\",\n blur: \"focusout\"\n }, function (orig, fix) {\n // Attach a single capturing handler on the document while someone wants focusin/focusout\n var handler = function handler(event) {\n jQuery.event.simulate(fix, event.target, jQuery.event.fix(event));\n };\n\n jQuery.event.special[fix] = {\n setup: function setup() {\n // Handle: regular nodes (via `this.ownerDocument`), window\n // (via `this.document`) & document (via `this`).\n var doc = this.ownerDocument || this.document || this,\n attaches = dataPriv.access(doc, fix);\n\n if (!attaches) {\n doc.addEventListener(orig, handler, true);\n }\n\n dataPriv.access(doc, fix, (attaches || 0) + 1);\n },\n teardown: function teardown() {\n var doc = this.ownerDocument || this.document || this,\n attaches = dataPriv.access(doc, fix) - 1;\n\n if (!attaches) {\n doc.removeEventListener(orig, handler, true);\n dataPriv.remove(doc, fix);\n } else {\n dataPriv.access(doc, fix, attaches);\n }\n }\n };\n });\n }\n\n var location = window.location;\n var nonce = {\n guid: Date.now()\n };\n var rquery = /\\?/; // Cross-browser xml parsing\n\n jQuery.parseXML = function (data) {\n var xml;\n\n if (!data || typeof data !== \"string\") {\n return null;\n } // Support: IE 9 - 11 only\n // IE throws on parseFromString with invalid input.\n\n\n try {\n xml = new window.DOMParser().parseFromString(data, \"text/xml\");\n } catch (e) {\n xml = undefined;\n }\n\n if (!xml || xml.getElementsByTagName(\"parsererror\").length) {\n jQuery.error(\"Invalid XML: \" + data);\n }\n\n return xml;\n };\n\n var rbracket = /\\[\\]$/,\n rCRLF = /\\r?\\n/g,\n rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n rsubmittable = /^(?:input|select|textarea|keygen)/i;\n\n function buildParams(prefix, obj, traditional, add) {\n var name;\n\n if (Array.isArray(obj)) {\n // Serialize array item.\n jQuery.each(obj, function (i, v) {\n if (traditional || rbracket.test(prefix)) {\n // Treat each array item as a scalar.\n add(prefix, v);\n } else {\n // Item is non-scalar (array or object), encode its numeric index.\n buildParams(prefix + \"[\" + (_typeof(v) === \"object\" && v != null ? i : \"\") + \"]\", v, traditional, add);\n }\n });\n } else if (!traditional && toType(obj) === \"object\") {\n // Serialize object item.\n for (name in obj) {\n buildParams(prefix + \"[\" + name + \"]\", obj[name], traditional, add);\n }\n } else {\n // Serialize scalar item.\n add(prefix, obj);\n }\n } // Serialize an array of form elements or a set of\n // key/values into a query string\n\n\n jQuery.param = function (a, traditional) {\n var prefix,\n s = [],\n add = function add(key, valueOrFunction) {\n // If value is a function, invoke it and use its return value\n var value = isFunction(valueOrFunction) ? valueOrFunction() : valueOrFunction;\n s[s.length] = encodeURIComponent(key) + \"=\" + encodeURIComponent(value == null ? \"\" : value);\n };\n\n if (a == null) {\n return \"\";\n } // If an array was passed in, assume that it is an array of form elements.\n\n\n if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {\n // Serialize the form elements\n jQuery.each(a, function () {\n add(this.name, this.value);\n });\n } else {\n // If traditional, encode the \"old\" way (the way 1.3.2 or older\n // did it), otherwise encode params recursively.\n for (prefix in a) {\n buildParams(prefix, a[prefix], traditional, add);\n }\n } // Return the resulting serialization\n\n\n return s.join(\"&\");\n };\n\n jQuery.fn.extend({\n serialize: function serialize() {\n return jQuery.param(this.serializeArray());\n },\n serializeArray: function serializeArray() {\n return this.map(function () {\n // Can add propHook for \"elements\" to filter or add form elements\n var elements = jQuery.prop(this, \"elements\");\n return elements ? jQuery.makeArray(elements) : this;\n }).filter(function () {\n var type = this.type; // Use .is( \":disabled\" ) so that fieldset[disabled] works\n\n return this.name && !jQuery(this).is(\":disabled\") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type));\n }).map(function (_i, elem) {\n var val = jQuery(this).val();\n\n if (val == null) {\n return null;\n }\n\n if (Array.isArray(val)) {\n return jQuery.map(val, function (val) {\n return {\n name: elem.name,\n value: val.replace(rCRLF, \"\\r\\n\")\n };\n });\n }\n\n return {\n name: elem.name,\n value: val.replace(rCRLF, \"\\r\\n\")\n };\n }).get();\n }\n });\n var r20 = /%20/g,\n rhash = /#.*$/,\n rantiCache = /([?&])_=[^&]*/,\n rheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n // #7653, #8125, #8152: local protocol detection\n rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n rnoContent = /^(?:GET|HEAD)$/,\n rprotocol = /^\\/\\//,\n\n /* Prefilters\n * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n * 2) These are called:\n * - BEFORE asking for a transport\n * - AFTER param serialization (s.data is a string if s.processData is true)\n * 3) key is the dataType\n * 4) the catchall symbol \"*\" can be used\n * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n */\n prefilters = {},\n\n /* Transports bindings\n * 1) key is the dataType\n * 2) the catchall symbol \"*\" can be used\n * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n */\n transports = {},\n // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n allTypes = \"*/\".concat(\"*\"),\n // Anchor tag for parsing the document origin\n originAnchor = document.createElement(\"a\");\n originAnchor.href = location.href; // Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\n\n function addToPrefiltersOrTransports(structure) {\n // dataTypeExpression is optional and defaults to \"*\"\n return function (dataTypeExpression, func) {\n if (typeof dataTypeExpression !== \"string\") {\n func = dataTypeExpression;\n dataTypeExpression = \"*\";\n }\n\n var dataType,\n i = 0,\n dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || [];\n\n if (isFunction(func)) {\n // For each dataType in the dataTypeExpression\n while (dataType = dataTypes[i++]) {\n // Prepend if requested\n if (dataType[0] === \"+\") {\n dataType = dataType.slice(1) || \"*\";\n (structure[dataType] = structure[dataType] || []).unshift(func); // Otherwise append\n } else {\n (structure[dataType] = structure[dataType] || []).push(func);\n }\n }\n }\n };\n } // Base inspection function for prefilters and transports\n\n\n function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {\n var inspected = {},\n seekingTransport = structure === transports;\n\n function inspect(dataType) {\n var selected;\n inspected[dataType] = true;\n jQuery.each(structure[dataType] || [], function (_, prefilterOrFactory) {\n var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);\n\n if (typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[dataTypeOrTransport]) {\n options.dataTypes.unshift(dataTypeOrTransport);\n inspect(dataTypeOrTransport);\n return false;\n } else if (seekingTransport) {\n return !(selected = dataTypeOrTransport);\n }\n });\n return selected;\n }\n\n return inspect(options.dataTypes[0]) || !inspected[\"*\"] && inspect(\"*\");\n } // A special extend for ajax options\n // that takes \"flat\" options (not to be deep extended)\n // Fixes #9887\n\n\n function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }\n /* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\n\n\n function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }\n /* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\n\n\n function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }\n\n jQuery.extend({\n // Counter for holding the number of active queries\n active: 0,\n // Last-Modified header cache for next request\n lastModified: {},\n etag: {},\n ajaxSettings: {\n url: location.href,\n type: \"GET\",\n isLocal: rlocalProtocol.test(location.protocol),\n global: true,\n processData: true,\n async: true,\n contentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n /*\n timeout: 0,\n data: null,\n dataType: null,\n username: null,\n password: null,\n cache: null,\n throws: false,\n traditional: false,\n headers: {},\n */\n accepts: {\n \"*\": allTypes,\n text: \"text/plain\",\n html: \"text/html\",\n xml: \"application/xml, text/xml\",\n json: \"application/json, text/javascript\"\n },\n contents: {\n xml: /\\bxml\\b/,\n html: /\\bhtml/,\n json: /\\bjson\\b/\n },\n responseFields: {\n xml: \"responseXML\",\n text: \"responseText\",\n json: \"responseJSON\"\n },\n // Data converters\n // Keys separate source (or catchall \"*\") and destination types with a single space\n converters: {\n // Convert anything to text\n \"* text\": String,\n // Text to html (true = no transformation)\n \"text html\": true,\n // Evaluate text as a json expression\n \"text json\": JSON.parse,\n // Parse text as xml\n \"text xml\": jQuery.parseXML\n },\n // For options that shouldn't be deep extended:\n // you can add your own custom options here if\n // and when you create one that shouldn't be\n // deep extended (see ajaxExtend)\n flatOptions: {\n url: true,\n context: true\n }\n },\n // Creates a full fledged settings object into target\n // with both ajaxSettings and settings fields.\n // If target is omitted, writes into ajaxSettings.\n ajaxSetup: function ajaxSetup(target, settings) {\n return settings ? // Building a settings object\n ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : // Extending ajaxSettings\n ajaxExtend(jQuery.ajaxSettings, target);\n },\n ajaxPrefilter: addToPrefiltersOrTransports(prefilters),\n ajaxTransport: addToPrefiltersOrTransports(transports),\n // Main method\n ajax: function ajax(url, options) {\n // If url is an object, simulate pre-1.5 signature\n if (_typeof(url) === \"object\") {\n options = url;\n url = undefined;\n } // Force options to be an object\n\n\n options = options || {};\n\n var transport,\n // URL without anti-cache param\n cacheURL,\n // Response headers\n responseHeadersString,\n responseHeaders,\n // timeout handle\n timeoutTimer,\n // Url cleanup var\n urlAnchor,\n // Request state (becomes false upon send and true upon completion)\n completed,\n // To know if global events are to be dispatched\n fireGlobals,\n // Loop variable\n i,\n // uncached part of the url\n uncached,\n // Create the final options object\n s = jQuery.ajaxSetup({}, options),\n // Callbacks context\n callbackContext = s.context || s,\n // Context for global events is callbackContext if it is a DOM node or jQuery collection\n globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event,\n // Deferreds\n deferred = jQuery.Deferred(),\n completeDeferred = jQuery.Callbacks(\"once memory\"),\n // Status-dependent callbacks\n _statusCode = s.statusCode || {},\n // Headers (they are sent all at once)\n requestHeaders = {},\n requestHeadersNames = {},\n // Default abort message\n strAbort = \"canceled\",\n // Fake xhr\n jqXHR = {\n readyState: 0,\n // Builds headers hashtable if needed\n getResponseHeader: function getResponseHeader(key) {\n var match;\n\n if (completed) {\n if (!responseHeaders) {\n responseHeaders = {};\n\n while (match = rheaders.exec(responseHeadersString)) {\n responseHeaders[match[1].toLowerCase() + \" \"] = (responseHeaders[match[1].toLowerCase() + \" \"] || []).concat(match[2]);\n }\n }\n\n match = responseHeaders[key.toLowerCase() + \" \"];\n }\n\n return match == null ? null : match.join(\", \");\n },\n // Raw string\n getAllResponseHeaders: function getAllResponseHeaders() {\n return completed ? responseHeadersString : null;\n },\n // Caches the header\n setRequestHeader: function setRequestHeader(name, value) {\n if (completed == null) {\n name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name;\n requestHeaders[name] = value;\n }\n\n return this;\n },\n // Overrides response content-type header\n overrideMimeType: function overrideMimeType(type) {\n if (completed == null) {\n s.mimeType = type;\n }\n\n return this;\n },\n // Status-dependent callbacks\n statusCode: function statusCode(map) {\n var code;\n\n if (map) {\n if (completed) {\n // Execute the appropriate callbacks\n jqXHR.always(map[jqXHR.status]);\n } else {\n // Lazy-add the new callbacks in a way that preserves old ones\n for (code in map) {\n _statusCode[code] = [_statusCode[code], map[code]];\n }\n }\n }\n\n return this;\n },\n // Cancel the request\n abort: function abort(statusText) {\n var finalText = statusText || strAbort;\n\n if (transport) {\n transport.abort(finalText);\n }\n\n done(0, finalText);\n return this;\n }\n }; // Attach deferreds\n\n\n deferred.promise(jqXHR); // Add protocol if not provided (prefilters might expect it)\n // Handle falsy url in the settings object (#10093: consistency with old signature)\n // We also use the url parameter if available\n\n s.url = ((url || s.url || location.href) + \"\").replace(rprotocol, location.protocol + \"//\"); // Alias method option to type as per ticket #12004\n\n s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list\n\n s.dataTypes = (s.dataType || \"*\").toLowerCase().match(rnothtmlwhite) || [\"\"]; // A cross-domain request is in order when the origin doesn't match the current origin.\n\n if (s.crossDomain == null) {\n urlAnchor = document.createElement(\"a\"); // Support: IE <=8 - 11, Edge 12 - 15\n // IE throws exception on accessing the href property if url is malformed,\n // e.g. http://example.com:80x/\n\n try {\n urlAnchor.href = s.url; // Support: IE <=8 - 11 only\n // Anchor's host property isn't correctly set when s.url is relative\n\n urlAnchor.href = urlAnchor.href;\n s.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !== urlAnchor.protocol + \"//\" + urlAnchor.host;\n } catch (e) {\n // If there is an error parsing the URL, assume it is crossDomain,\n // it can be rejected by the transport if it is invalid\n s.crossDomain = true;\n }\n } // Convert data if not already a string\n\n\n if (s.data && s.processData && typeof s.data !== \"string\") {\n s.data = jQuery.param(s.data, s.traditional);\n } // Apply prefilters\n\n\n inspectPrefiltersOrTransports(prefilters, s, options, jqXHR); // If request was aborted inside a prefilter, stop there\n\n if (completed) {\n return jqXHR;\n } // We can fire global events as of now if asked to\n // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n\n\n fireGlobals = jQuery.event && s.global; // Watch for a new set of requests\n\n if (fireGlobals && jQuery.active++ === 0) {\n jQuery.event.trigger(\"ajaxStart\");\n } // Uppercase the type\n\n\n s.type = s.type.toUpperCase(); // Determine if request has content\n\n s.hasContent = !rnoContent.test(s.type); // Save the URL in case we're toying with the If-Modified-Since\n // and/or If-None-Match header later on\n // Remove hash to simplify url manipulation\n\n cacheURL = s.url.replace(rhash, \"\"); // More options handling for requests with no content\n\n if (!s.hasContent) {\n // Remember the hash so we can put it back\n uncached = s.url.slice(cacheURL.length); // If data is available and should be processed, append data to url\n\n if (s.data && (s.processData || typeof s.data === \"string\")) {\n cacheURL += (rquery.test(cacheURL) ? \"&\" : \"?\") + s.data; // #9682: remove data so that it's not used in an eventual retry\n\n delete s.data;\n } // Add or update anti-cache param if needed\n\n\n if (s.cache === false) {\n cacheURL = cacheURL.replace(rantiCache, \"$1\");\n uncached = (rquery.test(cacheURL) ? \"&\" : \"?\") + \"_=\" + nonce.guid++ + uncached;\n } // Put hash and anti-cache on the URL that will be requested (gh-1732)\n\n\n s.url = cacheURL + uncached; // Change '%20' to '+' if this is encoded form body content (gh-2658)\n } else if (s.data && s.processData && (s.contentType || \"\").indexOf(\"application/x-www-form-urlencoded\") === 0) {\n s.data = s.data.replace(r20, \"+\");\n } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\n\n if (s.ifModified) {\n if (jQuery.lastModified[cacheURL]) {\n jqXHR.setRequestHeader(\"If-Modified-Since\", jQuery.lastModified[cacheURL]);\n }\n\n if (jQuery.etag[cacheURL]) {\n jqXHR.setRequestHeader(\"If-None-Match\", jQuery.etag[cacheURL]);\n }\n } // Set the correct header, if data is being sent\n\n\n if (s.data && s.hasContent && s.contentType !== false || options.contentType) {\n jqXHR.setRequestHeader(\"Content-Type\", s.contentType);\n } // Set the Accepts header for the server, depending on the dataType\n\n\n 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[\"*\"]); // Check for headers option\n\n for (i in s.headers) {\n jqXHR.setRequestHeader(i, s.headers[i]);\n } // Allow custom headers/mimetypes and early abort\n\n\n if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed)) {\n // Abort if not done already and return\n return jqXHR.abort();\n } // Aborting is no longer a cancellation\n\n\n strAbort = \"abort\"; // Install callbacks on deferreds\n\n completeDeferred.add(s.complete);\n jqXHR.done(s.success);\n jqXHR.fail(s.error); // Get transport\n\n transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR); // If no transport, we auto-abort\n\n if (!transport) {\n done(-1, \"No Transport\");\n } else {\n jqXHR.readyState = 1; // Send global event\n\n if (fireGlobals) {\n globalEventContext.trigger(\"ajaxSend\", [jqXHR, s]);\n } // If request was aborted inside ajaxSend, stop there\n\n\n if (completed) {\n return jqXHR;\n } // Timeout\n\n\n if (s.async && s.timeout > 0) {\n timeoutTimer = window.setTimeout(function () {\n jqXHR.abort(\"timeout\");\n }, s.timeout);\n }\n\n try {\n completed = false;\n transport.send(requestHeaders, done);\n } catch (e) {\n // Rethrow post-completion exceptions\n if (completed) {\n throw e;\n } // Propagate others as results\n\n\n done(-1, e);\n }\n } // Callback for when everything is done\n\n\n function done(status, nativeStatusText, responses, headers) {\n var isSuccess,\n success,\n error,\n response,\n modified,\n statusText = nativeStatusText; // Ignore repeat invocations\n\n if (completed) {\n return;\n }\n\n completed = true; // Clear timeout if it exists\n\n if (timeoutTimer) {\n window.clearTimeout(timeoutTimer);\n } // Dereference transport for early garbage collection\n // (no matter how long the jqXHR object will be used)\n\n\n transport = undefined; // Cache response headers\n\n responseHeadersString = headers || \"\"; // Set readyState\n\n jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful\n\n isSuccess = status >= 200 && status < 300 || status === 304; // Get response data\n\n if (responses) {\n response = ajaxHandleResponses(s, jqXHR, responses);\n } // Use a noop converter for missing script\n\n\n if (!isSuccess && jQuery.inArray(\"script\", s.dataTypes) > -1) {\n s.converters[\"text script\"] = function () {};\n } // Convert no matter what (that way responseXXX fields are always set)\n\n\n response = ajaxConvert(s, response, jqXHR, isSuccess); // If successful, handle type chaining\n\n if (isSuccess) {\n // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n if (s.ifModified) {\n modified = jqXHR.getResponseHeader(\"Last-Modified\");\n\n if (modified) {\n jQuery.lastModified[cacheURL] = modified;\n }\n\n modified = jqXHR.getResponseHeader(\"etag\");\n\n if (modified) {\n jQuery.etag[cacheURL] = modified;\n }\n } // if no content\n\n\n if (status === 204 || s.type === \"HEAD\") {\n statusText = \"nocontent\"; // if not modified\n } else if (status === 304) {\n statusText = \"notmodified\"; // If we have data, let's convert it\n } else {\n statusText = response.state;\n success = response.data;\n error = response.error;\n isSuccess = !error;\n }\n } else {\n // Extract error from statusText and normalize for non-aborts\n error = statusText;\n\n if (status || !statusText) {\n statusText = \"error\";\n\n if (status < 0) {\n status = 0;\n }\n }\n } // Set data for the fake xhr object\n\n\n jqXHR.status = status;\n jqXHR.statusText = (nativeStatusText || statusText) + \"\"; // Success/Error\n\n if (isSuccess) {\n deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);\n } else {\n deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);\n } // Status-dependent callbacks\n\n\n jqXHR.statusCode(_statusCode);\n _statusCode = undefined;\n\n if (fireGlobals) {\n globalEventContext.trigger(isSuccess ? \"ajaxSuccess\" : \"ajaxError\", [jqXHR, s, isSuccess ? success : error]);\n } // Complete\n\n\n completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);\n\n if (fireGlobals) {\n globalEventContext.trigger(\"ajaxComplete\", [jqXHR, s]); // Handle the global AJAX counter\n\n if (! --jQuery.active) {\n jQuery.event.trigger(\"ajaxStop\");\n }\n }\n }\n\n return jqXHR;\n },\n getJSON: function getJSON(url, data, callback) {\n return jQuery.get(url, data, callback, \"json\");\n },\n getScript: function getScript(url, callback) {\n return jQuery.get(url, undefined, callback, \"script\");\n }\n });\n jQuery.each([\"get\", \"post\"], function (_i, method) {\n jQuery[method] = function (url, data, callback, type) {\n // Shift arguments if data argument was omitted\n if (isFunction(data)) {\n type = type || callback;\n callback = data;\n data = undefined;\n } // The url can be an options object (which then must have .url)\n\n\n return jQuery.ajax(jQuery.extend({\n url: url,\n type: method,\n dataType: type,\n data: data,\n success: callback\n }, jQuery.isPlainObject(url) && url));\n };\n });\n jQuery.ajaxPrefilter(function (s) {\n var i;\n\n for (i in s.headers) {\n if (i.toLowerCase() === \"content-type\") {\n s.contentType = s.headers[i] || \"\";\n }\n }\n });\n\n jQuery._evalUrl = function (url, options, doc) {\n return jQuery.ajax({\n url: url,\n // Make this explicit, since user can override this through ajaxSetup (#11264)\n type: \"GET\",\n dataType: \"script\",\n cache: true,\n async: false,\n global: false,\n // Only evaluate the response if it is successful (gh-4126)\n // dataFilter is not invoked for failure responses, so using it instead\n // of the default converter is kludgy but it works.\n converters: {\n \"text script\": function textScript() {}\n },\n dataFilter: function dataFilter(response) {\n jQuery.globalEval(response, options, doc);\n }\n });\n };\n\n jQuery.fn.extend({\n wrapAll: function wrapAll(html) {\n var wrap;\n\n if (this[0]) {\n if (isFunction(html)) {\n html = html.call(this[0]);\n } // The elements to wrap the target around\n\n\n wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);\n\n if (this[0].parentNode) {\n wrap.insertBefore(this[0]);\n }\n\n wrap.map(function () {\n var elem = this;\n\n while (elem.firstElementChild) {\n elem = elem.firstElementChild;\n }\n\n return elem;\n }).append(this);\n }\n\n return this;\n },\n wrapInner: function wrapInner(html) {\n if (isFunction(html)) {\n return this.each(function (i) {\n jQuery(this).wrapInner(html.call(this, i));\n });\n }\n\n return this.each(function () {\n var self = jQuery(this),\n contents = self.contents();\n\n if (contents.length) {\n contents.wrapAll(html);\n } else {\n self.append(html);\n }\n });\n },\n wrap: function wrap(html) {\n var htmlIsFunction = isFunction(html);\n return this.each(function (i) {\n jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i) : html);\n });\n },\n unwrap: function unwrap(selector) {\n this.parent(selector).not(\"body\").each(function () {\n jQuery(this).replaceWith(this.childNodes);\n });\n return this;\n }\n });\n\n jQuery.expr.pseudos.hidden = function (elem) {\n return !jQuery.expr.pseudos.visible(elem);\n };\n\n jQuery.expr.pseudos.visible = function (elem) {\n return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);\n };\n\n jQuery.ajaxSettings.xhr = function () {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {}\n };\n\n var xhrSuccessStatus = {\n // File protocol always yields status code 0, assume 200\n 0: 200,\n // Support: IE <=9 only\n // #1450: sometimes IE returns 1223 when it should be 204\n 1223: 204\n },\n xhrSupported = jQuery.ajaxSettings.xhr();\n support.cors = !!xhrSupported && \"withCredentials\" in xhrSupported;\n support.ajax = xhrSupported = !!xhrSupported;\n jQuery.ajaxTransport(function (options) {\n var _callback, errorCallback; // Cross domain only allowed if supported through XMLHttpRequest\n\n\n if (support.cors || xhrSupported && !options.crossDomain) {\n return {\n send: function send(headers, complete) {\n var i,\n xhr = options.xhr();\n xhr.open(options.type, options.url, options.async, options.username, options.password); // Apply custom fields if provided\n\n if (options.xhrFields) {\n for (i in options.xhrFields) {\n xhr[i] = options.xhrFields[i];\n }\n } // Override mime type if needed\n\n\n if (options.mimeType && xhr.overrideMimeType) {\n xhr.overrideMimeType(options.mimeType);\n } // X-Requested-With header\n // For cross-domain requests, seeing as conditions for a preflight are\n // akin to a jigsaw puzzle, we simply never set it to be sure.\n // (it can always be set on a per-request basis or even using ajaxSetup)\n // For same-domain requests, won't change header if already provided.\n\n\n if (!options.crossDomain && !headers[\"X-Requested-With\"]) {\n headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\n } // Set headers\n\n\n for (i in headers) {\n xhr.setRequestHeader(i, headers[i]);\n } // Callback\n\n\n _callback = function callback(type) {\n return function () {\n if (_callback) {\n _callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null;\n\n if (type === \"abort\") {\n xhr.abort();\n } else if (type === \"error\") {\n // Support: IE <=9 only\n // On a manual native abort, IE9 throws\n // errors on any property access that is not readyState\n if (typeof xhr.status !== \"number\") {\n complete(0, \"error\");\n } else {\n complete( // File: protocol always yields status 0; see #8605, #14207\n xhr.status, xhr.statusText);\n }\n } else {\n complete(xhrSuccessStatus[xhr.status] || xhr.status, xhr.statusText, // Support: IE <=9 only\n // IE9 has no XHR2 but throws on binary (trac-11426)\n // For XHR2 non-text, let the caller handle it (gh-2498)\n (xhr.responseType || \"text\") !== \"text\" || typeof xhr.responseText !== \"string\" ? {\n binary: xhr.response\n } : {\n text: xhr.responseText\n }, xhr.getAllResponseHeaders());\n }\n }\n };\n }; // Listen to events\n\n\n xhr.onload = _callback();\n errorCallback = xhr.onerror = xhr.ontimeout = _callback(\"error\"); // Support: IE 9 only\n // Use onreadystatechange to replace onabort\n // to handle uncaught aborts\n\n if (xhr.onabort !== undefined) {\n xhr.onabort = errorCallback;\n } else {\n xhr.onreadystatechange = function () {\n // Check readyState before timeout as it changes\n if (xhr.readyState === 4) {\n // Allow onerror to be called first,\n // but that will not handle a native abort\n // Also, save errorCallback to a variable\n // as xhr.onerror cannot be accessed\n window.setTimeout(function () {\n if (_callback) {\n errorCallback();\n }\n });\n }\n };\n } // Create the abort callback\n\n\n _callback = _callback(\"abort\");\n\n try {\n // Do send the request (this may raise an exception)\n xhr.send(options.hasContent && options.data || null);\n } catch (e) {\n // #14683: Only rethrow if this hasn't been notified as an error yet\n if (_callback) {\n throw e;\n }\n }\n },\n abort: function abort() {\n if (_callback) {\n _callback();\n }\n }\n };\n }\n }); // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\n\n jQuery.ajaxPrefilter(function (s) {\n if (s.crossDomain) {\n s.contents.script = false;\n }\n }); // Install script dataType\n\n jQuery.ajaxSetup({\n accepts: {\n script: \"text/javascript, application/javascript, \" + \"application/ecmascript, application/x-ecmascript\"\n },\n contents: {\n script: /\\b(?:java|ecma)script\\b/\n },\n converters: {\n \"text script\": function textScript(text) {\n jQuery.globalEval(text);\n return text;\n }\n }\n }); // Handle cache's special case and crossDomain\n\n jQuery.ajaxPrefilter(\"script\", function (s) {\n if (s.cache === undefined) {\n s.cache = false;\n }\n\n if (s.crossDomain) {\n s.type = \"GET\";\n }\n }); // Bind script tag hack transport\n\n jQuery.ajaxTransport(\"script\", function (s) {\n // This transport only deals with cross domain or forced-by-attrs requests\n if (s.crossDomain || s.scriptAttrs) {\n var script, _callback2;\n\n return {\n send: function send(_, complete) {\n script = jQuery(\"