{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_project/cartridge/client/default/js/components/spinner.js","webpack:///./cartridges/app_project/cartridge/client/default/js/components/formValidation.js","webpack:///./cartridges/int_mf_tealium/cartridge/client/default/js/tealiumEvents.js","webpack:///./cartridges/app_project/cartridge/client/default/js/components/clientSideValidation.js","webpack:///./cartridges/app_project_marni/cartridge/client/default/js/registration.js","webpack:///./cartridges/app_project_marni/cartridge/client/default/js/registration/registration.js","webpack:///./cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack:///./node_modules/vanillajs-datepicker/js/lib/utils.js","webpack:///./node_modules/vanillajs-datepicker/js/lib/date.js","webpack:///./node_modules/vanillajs-datepicker/js/lib/date-format.js","webpack:///./node_modules/vanillajs-datepicker/js/lib/event.js","webpack:///./node_modules/vanillajs-datepicker/js/i18n/base-locales.js","webpack:///./node_modules/vanillajs-datepicker/js/options/defaultOptions.js","webpack:///./node_modules/vanillajs-datepicker/js/lib/dom.js","webpack:///./node_modules/vanillajs-datepicker/js/options/processOptions.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/templates/pickerTemplate.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/templates/daysTemplate.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/templates/calendarWeeksTemplate.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/views/View.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/views/DaysView.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/views/MonthsView.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/views/YearsView.js","webpack:///./node_modules/vanillajs-datepicker/js/events/functions.js","webpack:///./node_modules/vanillajs-datepicker/js/events/pickerListeners.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/Picker.js","webpack:///./node_modules/vanillajs-datepicker/js/events/inputFieldListeners.js","webpack:///./node_modules/vanillajs-datepicker/js/events/otherListeners.js","webpack:///./node_modules/vanillajs-datepicker/js/Datepicker.js","webpack:///./cartridges/app_project/cartridge/client/default/js/datepicker.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","fn","spinner","$element","this","start","length","stop","isMargiela","document","body","dataset","sitebrand","formElement","payload","find","removeClass","remove","fields","keys","forEach","feedbackElement","parent","children","Array","isArray","html","join","siblings","addClass","error","form","prop","parents","content","attr","before","prepend","$body","$document","utagExists","utag","refreshCartData","url","window","sfcc_urls","refresh_utag_basket","location","href","indexOf","ajax","method","dataType","success","data","copyResponseData","err","console","log","getParameterByName","paramName","replace","results","RegExp","exec","decodeURIComponent","getVariationValue","variationAttributes","id","result","variation","filter","attributeId","selected","values","addProductData","page_type","product_id","utag_data","product_name","product_season","product_newin","product_category","product_color","product_waist","product_length","product_size","product_unit_price","product_old_price","product_sale_price","product_net_price","addCartData","product_quantity","product_shipping_type","order_currency","order_track_id","response","utagData","newsletterEventTrigger","gender","page_name","store_country","event_name","link","ready","trigger","loadMoreProduct","on","nodeList","arrayValue","replaceAll","split","original","mergedArray","concat","item","index","concatUtagValues","querySelectorAll","pageNewsletter","text","trim","genders","isMultipleGender","g","push","innerText","footerNewsletter","val","video","$video","video_title","video_time","currentTime","track","duration","PLPUpdateData","e","activePLP","active_plp","PDPUpdateData","activePDP","product","active_pdp","product_sku","addToCart","page_context_type","addAllProductsFromWishList","backInStock","PDPAddToWishlist","productSetIDs","pid","storeLocatorFind","storeLocatorMyLocation","filters","detail","pmin","pmax","subArray","j","checkoutStages","step","stage","page_name_onload","login","register","fastCheckout","event","cartType","buttonPosition","cart_type","cartModifyModalOpen","cartModifyModalConfirm","cartRemoveProduct","cartMoveToPickup","cartShipItem","cartStoreDialogOpen","cartStoreChanged","helpOrderDetails","view","createReturnSteps","params","product_return_type","types","orderID","URL","searchParams","updateCustomerAttributes","customerProfileAttributes","updateCartAndWishlist","persist_wishlist","total_with_vat","currency","persist_cart","total_without_vat","jQuery","setListViewType","click","viewType","list_view_type","searchOpen","searchTypeKeyword","names","skus","suggestions","productName","searchProductClick","currentTarget","ariaLabel","sku","type","searchSend","searchResultsPage","formCleared","triggerEdgeValidation","input","nextElementSibling","classList","contains","toggle","scrollToError","$form","animate","scrollTop","first","offset","top","focus","validateReCaptcha","$response","valid","toggleClass","validateForm","checkValidity","preventDefault","stopPropagation","stopImmediatePropagation","each","validity","clearFormErrors","jquery","empty","attachNoBubbleEvents","attachTimeout","off","setCustomValidity","fieldMessages","formValidationMessages","validationMessage","clearTimeout","setTimeout","clearFormFieldErrors","noBubbleEvents","init","additionalMessagesStr","additionalMessages","JSON","parse","warn","$formMessages","extend","submit","buttonClick","focusOut","$this","target","blur","cleanString","onChange","handleDateChange","scrollOnError","updatePostalCodePattern","postalCodeElementID","$postalCode","closest","postalCodeRegexp","defaults","at","be","bg","dk","gr","hu","lv","lt","lu","nl","no","pl","pt","ro","ru","sk","si","es","se","ch","gb","us","ca","cz","countryCode","toLowerCase","regexp","toString","slice","reCaptchaOnChange","functions","reAttachNoBubbleEvents","processInclude","formValidation","clientSideValidation","$registrationForm","initAgeValidation","post","serialize","redirectUrl","responseJSON","slideToggle","$birthdateInput","today","Date","maxDate","getFullYear","getMonth","getDate","toISOString","handlePopups","$aTag","relatedTarget","$relevantSelector","scrollIntoView","datePickerKeyboardNav","activeElement","$datepicker","css","passwordDinamicValidation","emailInput","test","include","hasProperty","obj","lastItemOf","arr","pushUnique","items","includes","stringToArray","str","separator","isInRange","testVal","min","max","undefined","limitToRange","createTagRepeat","tagName","repeat","attributes","reduce","src","next","optimizeTemplateHTML","stripTime","timeValue","setHours","dateValue","args","newDate","setFullYear","addDays","date","amount","setDate","addMonths","monthsToSet","expectedMonth","time","setMonth","addYears","dayDiff","day","from","dayOfTheWeekOf","baseDate","dayOfWeek","weekStart","baseDay","getDay","startOfYearPeriod","years","year","Math","floor","reFormatTokens","reNonDateParts","knownFormats","parseFns","y","parseInt","month","locale","monthIndex","isNaN","NaN","monthName","compareNames","startsWith","monthsShort","findIndex","months","normalizeMonth","getTime","formatFns","dd","padZero","D","daysShort","DD","days","mm","M","MM","yy","yyyy","num","padStart","parseFormatString","format","Error","separators","parts","match","partFormatters","map","token","partParserKeys","part","dateStr","dateParts","dtParts","origDate","formatter","parseDate","toValue","parser","formatDate","dateObj","toDisplay","listenerRegistry","WeakMap","addEventListener","removeEventListener","EventTarget","registerListeners","keyObj","listeners","registered","set","listener","unregisterListeners","delete","Event","composedPath","getComposedPath","node","path","parentNode","host","defaultView","findElementInEventPath","ev","selector","criteria","el","matches","findFromPath","parentElement","en","daysMin","clear","titleFormat","autohide","beforeShowDay","beforeShowDecade","beforeShowMonth","beforeShowYear","calendarWeeks","clearBtn","dateDelimiter","datesDisabled","daysOfWeekDisabled","daysOfWeekHighlighted","defaultViewDate","disableTouchKeyboard","language","maxNumberOfDates","maxView","minDate","nextArrow","orientation","pickLevel","prevArrow","showDaysOfWeek","showOnClick","showOnFocus","startView","title","todayBtn","todayBtnMode","todayHighlight","updateOnBlur","createRange","parseHTML","createContextualFragment","hideElement","style","display","styleDisplay","showElement","emptyChildNodes","firstChild","removeChild","defaultLang","defaultFormat","defaultWeekStart","sanitizeDOW","dow","calcEndOfWeek","startOfWeek","validateDate","origValue","validateViewId","viewId","processOptions","options","datepicker","inOpts","assign","config","locales","constructor","lang","origLocale","weekEnd","hasToDisplay","hasToValue","validFormatString","minDt","maxDt","dates","dt","viewDate","wkStart","Number","multidate","String","newPickLevel","newMaxView","newStartView","childNodes","x","class","picker","element","isMinView","setOptions","updateFocus","updateSelection","current","beforeShow","enabled","classes","add","disabled","extraClasses","newChildNodes","DocumentFragment","appendChild","replaceChildNodes","super","cellClass","onConstruction","inner","grid","lastChild","updateDOW","dayNames","switchLabelFormat","weeksElem","weeks","insertBefore","textContent","className","viewYear","viewMonth","firstOfMonth","last","focused","rangepicker","range","switchLabel","setViewSwitchLabel","setPrevBtnDisabled","setNextBtnDisabled","thuOfTheWeek","firstThu","round","getWeek","rangeStart","rangeEnd","performBeforeHook","computeMonthRange","thisYear","startY","startM","endY","endM","ix","monthNames","minYear","minMonth","minDateObj","maxYear","maxMonth","maxDateObj","yrOutOfRange","isMinYear","isMaxYear","word","navStep","beforeShowOption","toUpperCase","triggerDatepickerEvent","currentView","dispatchEvent","CustomEvent","goToPrevOrNext","direction","newViewDate","changeFocus","render","switchView","changeView","unfocus","update","refresh","hide","goToSelectedMonthOrYear","selection","onClickTodayBtn","currentDate","onClickClearBtn","onClickViewSwitch","onClickPrevBtn","onClickNextBtn","onClickView","onClickPicker","inline","inputField","processPickerOptions","controls","prevBtn","cloneNode","nextBtn","computeResetViewDate","setViewDate","oldViewDate","getTextDirection","getComputedStyle","template","buttonClass","header","main","footer","firstElementChild","viewSwitch","lastElementChild","elementClass","capture","views","container","active","inputDirection","dir","removeAttribute","place","exitEditMode","width","calendarWidth","height","calendarHeight","getBoundingClientRect","left","containerLeft","containerTop","containerWidth","inputLeft","inputTop","inputWidth","inputHeight","orientX","orientY","scrollY","scrollX","labelText","oldView","newView","_renderMethod","replaceChild","quickRender","renderMethod","moveByArrowKey","vertical","addFn","testFn","ctrlKey","metaKey","findNextAvailableOne","increase","onKeydown","editMode","shiftKey","enterEditMode","show","onFocus","_showing","onMousedown","_active","_clicking","onClickInput","onPaste","clipboardData","onClickOutside","pickerElem","stringifyDates","processInputDates","inputDates","origDates","datepickers","newDates","refreshUI","_options","initialDates","querySelector","inputs","inputDateValues","onMousedownDocument","newOptions","detach","callback","opts","lastArg","pop","forceRender","inputElement","datepickerDefault","milliseconds","now","nowTime","currentConfig"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAO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AUluB,KAAMjB,GAAOgwB,GAOzB,gBACM/uB,KAAK+oB,SAAW/oB,KAAKgjB,OAAOuH,QAAUvqB,KAAK8sB,WAG/C9sB,KAAK8sB,UAAW,EAChB9sB,KAAKgpB,WAAW3b,UAAUqW,IAAI,YAWhC,aAAatC,GACX,GAAIphB,KAAK+oB,SAAW/oB,KAAK8sB,SACvB,OAEF,MAAM8B,EAAOtwB,OAAOijB,OAAO,CAAC2G,QAAQ,GAAQ9G,UACrCphB,KAAK8sB,SACZ9sB,KAAKgpB,WAAW3b,UAAUxM,OAAO,WAC7B+tB,EAAK1G,QACPloB,KAAKkoB,OAAO0G,IC/dlB,MAAMI,GAAe3uB,SAASguB,cAAc,8BAE5C,GAAIzuB,EAAEovB,IAAc9uB,OAAS,EAAG,CAC9B,MAAM+uB,EAAoB,CACxBlR,UAAU,EACVwB,UAAW,GAEb,GAAIyP,GAAazuB,QAAQ2uB,aAAc,CACrC,MAAMC,EAAM,IAAItb,KACVub,EAAU,IAAIvb,KAAKsb,EAAI1V,UAAY8I,OAAOyM,GAAazuB,QAAQ2uB,eACrED,EAAkBnb,QAAUsb,SACrBJ,GAAazuB,QAAQ2uB,aAE9B,MAAMG,EAAgB,IAAKJ,KAAsBD,GAAazuB,SAC9DyuB,GAAa3N,WAAa,IAAI,GAAW2N,GAAcK","file":"app_project_marni/cartridge/static/default/js/registration.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 = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 258);\n","'use strict';\n\n/**\n * Show a spinner inside a given element\n * @param {element} $target - Element to block by the veil and spinner.\n * Pass body to block the whole page.\n */\nfunction addSpinner($target) {\n let $veil = $('
');\n $veil.append('
');\n if ($target.get(0).tagName === 'IMG') {\n $target.after($veil);\n $veil.css({ width: $target.width(), height: $target.height() });\n if ($target.parent().css('position') === 'static') {\n $target.parent().css('position', 'relative');\n }\n } else {\n $target.append($veil);\n if ($target.css('position') === 'static') {\n $target.parent().css('position', 'relative');\n $target.parent().addClass('veiled');\n }\n if ($target.get(0).tagName === 'BODY') {\n $veil.find('.spinner').css('position', 'fixed');\n }\n }\n $veil.click(function (e) {\n e.stopPropagation();\n });\n}\n\n/**\n * Remove existing spinner\n * @param {element} $veil - jQuery pointer to the veil element\n */\nfunction removeSpinner($veil) {\n if ($veil.parent().hasClass('veiled')) {\n $veil.parent().css('position', '');\n $veil.parent().removeClass('veiled');\n }\n $veil.off('click');\n $veil.remove();\n}\n\n// element level spinner:\n$.fn.spinner = function () {\n let $element = $(this);\n let Fn = function () {\n this.start = function () {\n if ($element.length) {\n // remove default spinner test IBT-1180\n // addSpinner($element);\n }\n };\n this.stop = function () {\n if ($element.length) {\n // remove default spinner test IBT-1180\n // let $veil = $('.veil');\n // removeSpinner($veil);\n }\n };\n };\n return new Fn();\n};\n\n// page-level spinner:\n$.spinner = function () {\n let Fn = function () {\n this.start = function () {\n // remove default spinner test IBT-1180\n // addSpinner($('body'));\n };\n this.stop = function () {\n // remove default spinner test IBT-1180\n // removeSpinner($('.veil'));\n };\n };\n return new Fn();\n};\n","'use strict';\n\nconst isMargiela = document.body.dataset.sitebrand === \"Margiela\";\n\n/**\n * Remove all validation. Should be called every time before revalidating form\n * @param {element} form - Form to be cleared\n * @returns {void}\n */\nfunction clearFormErrors(form) {\n $(form).find('.form-control.is-invalid').removeClass('is-invalid');\n}\n\nmodule.exports = function (formElement, payload) {\n // clear form validation first\n clearFormErrors(formElement);\n $('.alert', formElement).remove();\n\n if (typeof payload === 'object' && payload.fields) {\n Object.keys(payload.fields).forEach(function (key) {\n if (payload.fields[key]) {\n let feedbackElement = $(formElement)\n .find('[name=\"' + key + '\"]')\n .parent()\n .children('.invalid-feedback');\n\n if (feedbackElement.length > 0) {\n if (Array.isArray(payload[key])) {\n feedbackElement.html(payload.fields[key].join('
'));\n } else {\n feedbackElement.html(payload.fields[key]);\n }\n feedbackElement.siblings('.form-control').addClass('is-invalid');\n }\n }\n });\n }\n if (payload && payload.error) {\n let form = $(formElement).prop('tagName') === 'FORM' ? $(formElement) : $(formElement).parents('form');\n const content = '
' + payload.error.join('
') + '
';\n if (isMargiela && form.attr('name') === 'login-form') {\n form.find('.remember-me-section').before(content);\n } else {\n form.prepend(content);\n }\n }\n};\n","'use strict';\n\nconst delimiter = ':';\nconst $body = $('body');\nconst $document = $(document);\n\n$document.ready(function(){\n $body.trigger('tealiumEvents:loaded');\n});\n\nfunction utagExists(){\n return typeof utag !== 'undefined';\n}\n\n/**\n* Gets a parameter from a link or from [window.location.href]\n*/\nfunction refreshCartData() {\n const url = window.sfcc_urls.refresh_utag_basket;\n\n if (window.location.href.indexOf('Order-ReturnConfirmation') > 0) {\n return;\n }\n\n $.ajax({\n url: url,\n method: 'GET',\n dataType: 'json',\n success: function(data) {\n copyResponseData(data);\n },\n error: function(err) {\n console.log('error refreshing utag', err);\n }\n });\n}\n\n/**\n* Gets a parameter from a link or from [window.location.href]\n* @param {string} paramName - the parameter name\n* @param {string} url - [window.location.href] or equivalent\n* @returns {string} the parameter value or [null]\n*/\nfunction getParameterByName(paramName, url = window.location.href) {\n const name = paramName.replace(/[[\\]]/g, '\\\\$&');\n const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');\n const results = regex.exec(url);\n if (!results) return null;\n if (!results[2]) return '';\n return decodeURIComponent(results[2].replace(/\\+/g, ' '));\n}\n\n/**\n* Get selected variation value by variation id\n* @param {Object} variationAttributes - variation attributes model from backend\n* @param {string} id - variation id\n* @returns {string} the id of the variation value or empty string\n*/\nfunction getVariationValue(variationAttributes, id) {\n let result = '';\n\n if (variationAttributes instanceof Array) {\n const variation = variationAttributes.filter((i) => i.attributeId === id);\n\n if (variation && variation.length) {\n const selected = variation[0].values.filter((i) => i.selected === true);\n if (selected && selected.length) result = selected[0].id;\n }\n }\n\n return result;\n}\n\n/**\n* Use the existing data from the [utag_data] object to fill [utag.data] with product data on PDP\n*/\nfunction addProductData() {\n utag.data.page_type = 'product';\n utag.data.product_id = utag_data.product_id;\n utag.data.product_name = utag_data.product_name;\n utag.data.product_season = utag_data.product_season;\n utag.data.product_newin = utag_data.product_newin;\n utag.data.product_category = utag_data.product_category;\n utag.data.product_color = utag_data.product_color;\n utag.data.product_waist = utag_data.product_waist;\n utag.data.product_length = utag_data.product_length;\n utag.data.product_size = utag_data.product_size;\n utag.data.product_unit_price = utag_data.product_unit_price;\n utag.data.product_old_price = utag_data.product_old_price;\n utag.data.product_sale_price = utag_data.product_sale_price;\n utag.data.product_net_price = utag_data.product_net_price;\n}\n\n/**\n* Use the existing data from the [utag_data] object to fill [utag.data] with product data on Cart/Checkout\n*/\nfunction addCartData() {\n utag.data.page_type = 'checkout';\n utag.data.product_id = utag_data.product_id;\n utag.data.product_name = utag_data.product_name;\n utag.data.product_season = utag_data.product_season;\n utag.data.product_newin = utag_data.product_newin;\n utag.data.product_category = utag_data.product_category;\n utag.data.product_color = utag_data.product_color;\n utag.data.product_waist = utag_data.product_waist;\n utag.data.product_length = utag_data.product_length;\n utag.data.product_size = utag_data.product_size;\n utag.data.product_unit_price = utag_data.product_unit_price;\n utag.data.product_old_price = utag_data.product_old_price;\n utag.data.product_sale_price = utag_data.product_sale_price;\n utag.data.product_net_price = utag_data.product_net_price;\n utag.data.product_quantity = utag_data.product_quantity;\n utag.data.product_shipping_type = utag_data.product_shipping_type;\n utag.data.order_currency = utag_data.order_currency;\n\n if (utag_data.order_track_id) {\n utag.data.order_track_id = utag_data.order_track_id;\n }\n}\n\n/**\n * Copies the `utagData` object values to the current utag data object\n * @param {Object} response - the response object from the server that contains a `utagData` object\n */\nfunction copyResponseData(response) {\n if (!response) return;\n\n for (const key in response.utagData) { // eslint-disable-line no-restricted-syntax\n if (response.utagData.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins\n utag.data[key] = response.utagData[key];\n }\n }\n}\n\nfunction concatUtagValues(nodeList, key){\n for (let i = 0; i < nodeList.length; i++) {\n var value = nodeList[i].value;\n var arrayValue = value.replaceAll('[','').replaceAll(']','').replaceAll(' ','').split(',');\n var original = utag.data[key];\n\n if(original) {\n let mergedArray = original.concat(arrayValue);\n mergedArray = mergedArray.filter((item,index) => {\n return (mergedArray.indexOf(item) == index);\n }); \n utag.data[key] = mergedArray;\n }\n }\n}\n\nfunction newsletterEventTrigger(gender) {\n\n if (!gender) gender = '';\n\n utag.data.page_type = 'newsletter';\n utag.data.page_name = utag_data.store_country + delimiter + 'myaccount' + delimiter + 'newsletter_subscription';\n utag.data.event_name = 'newsletter_subscription_' + gender;\n utag.link(utag.data);\n}\n\nmodule.exports = {\n loadMoreProduct: function(){\n $body.on('product:listing-show-more', function(){\n var utag_product_id = document.querySelectorAll('[name=\"utag_product_id\"]');\n \n concatUtagValues(utag_product_id, 'product_id');\n });\n },\n\n pageNewsletter: function() {\n $body.on('newsletter:submit', function() {\n if (typeof utag === 'undefined' || !utag) return;\n const $form = $('.page-newsletter .form-newsletter');\n \n $form.find('.gender-check:checked +.checkbox-label').text().trim();\n let genders = [];\n let gender;\n let isMultipleGender = false;\n document.querySelectorAll('.gender-check:checked + .checkbox-label').forEach(g => {\n genders.push(g.innerText);\n isMultipleGender = genders.length > 1;\n });\n gender = isMultipleGender ? 'Both' : genders[0];\n newsletterEventTrigger(gender);\n });\n },\n\n footerNewsletter: function() {\n $body.on('click', 'footer .form-newsletter [type=\"submit\"]', function() {\n if (typeof utag === 'undefined' || !utag) return;\n const $form = $('footer .form-newsletter');\n const gender = $form.find('[name=\"gender-radio\"]:checked').val(); \n newsletterEventTrigger(gender);\n });\n },\n\n video: function() {\n const $video = $('video');\n\n $video.on('pause', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.video_title = $(this).find('source').attr('src');\n utag.data.video_time = this.currentTime;\n utag.data.event_name = 'video_pause';\n utag.track('video', utag.data);\n });\n\n $video.on('loadeddata', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.video_title = $(this).find('source').attr('src');\n utag.data.video_time = this.duration;\n utag.data.event_name = 'video_open';\n utag.track('video', utag.data);\n });\n\n $video.on('play', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.video_title = $(this).find('source').attr('src');\n utag.data.video_time = this.currentTime;\n\n if (this.currentTime > 0) {\n utag.data.event_name = 'video_play';\n } else {\n utag.data.event_name = 'video_start';\n }\n\n utag.track('video', utag.data);\n });\n },\n\n PLPUpdateData: function() {\n // Update data for future events\n $body.on('plp:plpPageLoad', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n\n\n var activePLP = 'old';\n\n if ($('.new-page-search-result').length > 0) {\n activePLP = 'new';\n }\n\n utag_data.active_plp = activePLP;\n });\n },\n\n PDPUpdateData: function() {\n // Update data for future events\n $body.on('product:afterAttributeSelect', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n\n\n var activePDP = 'old';\n\n if ($('.pdp-new').length > 0) {\n activePDP = 'new';\n }\n\n const product = response.data.product;\n utag_data.active_pdp = activePDP;\n utag_data.product_sku = [product.id];\n utag_data.product_color = [getVariationValue(product.variationAttributes, 'color')];\n utag_data.product_waist = [getVariationValue(product.variationAttributes, 'waist')];\n utag_data.product_length = [getVariationValue(product.variationAttributes, 'length')];\n utag_data.product_size = [getVariationValue(product.variationAttributes, 'size')];\n });\n },\n\n addToCart: function() {\n $body.on('product:afterAddToCart', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n addProductData();\n\n\n\n var activePDP = 'old';\n\n if ($('.pdp-new').length > 0) {\n activePDP = 'new';\n }\n utag_data.active_pdp = activePDP;\n\n if (utag_data.page_context_type === 'product') {\n utag.data.event_name = 'pdp_cart_add';\n } else if (response.addAllProductsFromWishList) {\n utag.data.event_name = 'cart_add_wishlist_full';\n } else if (utag_data.page_context_type === 'myaccount') {\n utag.data.event_name = 'cart_add_wishlist_prod';\n } else {\n utag.data.event_name = utag_data.page_type + 'pdp_cart_add';\n }\n\n utag.link(utag.data);\n });\n },\n\n backInStock: function() {\n $body.on('product:afterBackInStock', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n addProductData();\n var activePDP = 'old';\n\n if ($('.pdp-new').length > 0) {\n activePDP = 'new';\n }\n utag_data.active_pdp = activePDP;\n\n utag.data.event_name = 'pdp_backinstock';\n\n utag.link(utag.data);\n });\n },\n\n PDPAddToWishlist: function() {\n $body.on('product:afterAddToWishlist', function() {\n if (typeof utag === 'undefined' || !utag || !utag_data.page_context_type === 'product') return;\n\n addProductData();\n var activePDP = 'old';\n if (utag_data.page_context_type == \"product set\") {\n var productSetIDs = [''];\n for (i = 0 ; i < $('.product-set-item').length; i++) {\n if (i +1 < $('.product-set-item').length) {\n productSetIDs[0] += $('.product-set-item')[i].dataset.pid + ', ';\n } else {\n productSetIDs[0] += $('.product-set-item')[i].dataset.pid;\n }\n }\n utag.data.product_id = productSetIDs;\n utag.data.page_type = 'product set';\n }\n if ($('.pdp-new').length > 0) {\n activePDP = 'new';\n }\n utag_data.active_pdp = activePDP;\n utag.data.event_name = 'pdp_wishlist_add';\n utag.link(utag.data);\n });\n },\n\n storeLocatorFind: function() {\n $body.on('store:MyLocation', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.page_type = 'store locator';\n utag.data.page_name = utag.data.page_name + ':my location';\n utag.data.event_name = 'storelocator_mylocation';\n utag.link(utag.data);\n });\n },\n\n storeLocatorMyLocation: function() {\n $body.on('store:Search', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.page_type = 'store locator';\n utag.data.page_name = utag.data.page_name + ':search location';\n utag.data.event_name = 'storelocator_search';\n utag.link(utag.data);\n });\n },\n\n filters: function() {\n $document.on('appliedFilter', function(e) {\n\n var url;\n if (typeof utag === 'undefined' || !utag) {return;} \n \n if (typeof e.url !== 'undefined' && e.url) {\n url = e.url;\n };\n\n if (!url) {\n url = (e.detail && e.detail.url) ? e.detail.url : null; \n }\n\n if (!url){\n return;\n }\n\n const result = [];\n\n const pmin = getParameterByName('pmin', url);\n const pmax = getParameterByName('pmax', url);\n\n if (pmin && pmax) {\n result.push('price' + delimiter + pmin + ' to ' + pmax);\n }\n\n let i = 1;\n let name = getParameterByName('prefn' + i, url);\n let value;\n let subArray;\n\n while (name) {\n value = getParameterByName('prefv' + i, url);\n name = name.replace('refinement', '');\n\n if (value.indexOf('|') > -1) { // Multiple values for this preference\n subArray = value.split('|');\n\n for (let j = 0; j < subArray.length; j++) {\n result.push(name + delimiter + subArray[j]);\n }\n } else { // Single value for this preference\n result.push(name + delimiter + value);\n }\n\n i++;\n name = getParameterByName('prefn' + i, e.url);\n }\n\n if (result.length > 0) {\n utag.data.filter = result;\n utag.data.event_name = 'filter_usage';\n utag.link(utag.data);\n }\n });\n },\n\n checkoutStages: function() {\n $body.on('checkout:stageGoTo checkout:updatedCheckoutView', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n let step = '';\n const stage = $('#checkout-main').attr('data-checkout-stage');\n\n if (stage === 'shipping') {\n step = 'step1';\n } else if (stage === 'payment') {\n step = 'step2';\n } else if (stage === 'placeOrder') {\n step = 'step3';\n }\n\n utag.data.page_name = utag_data.page_name_onload.replace(/step\\d/gi, step);\n utag.link(utag.data);\n });\n },\n\n login: function() {\n $body.on('user:loggedIn', function() {\n if (typeof utag === 'undefined' || !utag) return;\n utag.data.event_name = 'login_ok';\n utag.link(utag.data);\n });\n },\n\n register: function() {\n $body.on('user:registered', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.event_name = 'registration_ok';\n utag.link(utag.data);\n });\n },\n\n fastCheckout: function() {\n $body.on('checkout:fastCheckoutStart', function(event, cartType, buttonPosition) {\n if (typeof utag === 'undefined' || !utag) return;\n\n if(typeof cartType !== 'undefined' && typeof buttonPosition !== 'undefined') {\n utag.data.cart_type = cartType + ':' + buttonPosition;\n }\n utag.data.event_name = 'fastcheckout_start';\n utag.link(utag.data);\n });\n },\n\n cartModifyModalOpen: function() {\n $body.on('cart:modifyProductOpen', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n addCartData();\n utag.data.event_name = 'cart_prod_update_popup';\n utag.link(utag.data);\n });\n },\n\n cartModifyModalConfirm: function() {\n $body.on('cart:productModified', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_prod_update_confirm';\n utag.link(utag.data);\n\n refreshCartData();\n });\n },\n\n cartRemoveProduct: function() {\n $body.on('cart:productRemoved', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_prod_update';\n utag.link(utag.data);\n\n refreshCartData();\n });\n },\n\n cartMoveToPickup: function() {\n $body.on('cart:pickUpItem', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_moveto_pickup';\n utag.link(utag.data);\n\n refreshCartData();\n });\n },\n\n cartShipItem: function() {\n $body.on('cart:shipItem', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_moveto_shipping';\n utag.link(utag.data);\n\n refreshCartData();\n });\n },\n\n cartStoreDialogOpen: function() {\n $body.on('findInStore:open', function() {\n if (typeof utag === 'undefined' || !utag) return;\n if ($('.page').data('action') !== 'Cart-Show') return;\n\n addCartData();\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_store_detail_popup';\n utag.link(utag.data);\n });\n },\n\n cartStoreChanged: function() {\n $body.on('cart:storeChanged', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_store_detail_change';\n utag.link(utag.data);\n });\n },\n\n helpOrderDetails: function() {\n $body.on('help:orderDetailsOpened', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_name = `${utag.data.store_country}:order_track:detail ${utag.data.order_track_id}`;\n utag.data.page_type = 'order track';\n utag.view(utag.data);\n });\n },\n\n createReturnSteps: function() {\n $body.on('order:createReturn:step2', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n addCartData();\n\n utag.data.page_name = `${utag.data.store_country}:order_track:return_exchange:step2`;\n utag.data.page_type = 'return-exchange funnel';\n utag.data.event_name = 'return_exchange:step2';\n utag.view(utag.data);\n });\n $body.on('order:createReturn:step3', function(e, params) {\n if (typeof utag === 'undefined' || !utag) return;\n\n addCartData();\n \n utag.data.product_return_type = params.types;\n\n utag.data.page_name = `${utag.data.store_country}:order_track:return_exchange:step3`;\n utag.data.page_type = 'return-exchange funnel';\n utag.data.event_name = 'return_exchange:step3';\n utag.view(utag.data);\n });\n $body.on('order:createReturn:thank-you', function(e, params) {\n if (typeof utag === 'undefined' || !utag) return;\n\n addCartData();\n utag.data.product_return_type = params.types;\n\n if (!utag.data.order_track_id){\n let searchParams = (new URL(document.location)).searchParams;\n let orderID = searchParams.get('orderID');\n utag.data.order_track_id = orderID;\n }\n\n utag.data.page_name = `${utag.data.store_country}:order_track:return_exchange:thank you`;\n utag.data.page_type = 'return-exchange funnel';\n utag.data.event_name = 'return_exchange:thank you';\n });\n },\n\n /**\n * Method to track events and collect information about customers\n */\n updateCustomerAttributes: function() {\n if (utagExists()) {\n $body.on('customer:updateAttributes', function() {\n const url = $('.get-customer-profile-url').attr('data-get-customer-profile');\n\n if (url) {\n $.ajax({\n url: url,\n method: 'GET',\n success: function(data) {\n if (typeof utag === 'undefined' || !utag || !data.success) return;\n\n for (const key in data.customerProfileAttributes) {\n if (data.customerProfileAttributes.hasOwnProperty(key)) {\n utag.data[key] = data.customerProfileAttributes[key];\n }\n }\n\n utag.link(utag.data);\n $body.trigger('datalayer:redirectUrl');\n },\n error: function(data) {\n console.error(data);\n }\n });\n }\n });\n }\n },\n /**\n * Method to track events and collect information about cart and wishlist\n */\n updateCartAndWishlist: function() {\n if (utagExists()) {\n $(document).ready(function() {\n /* Persist wishlist variable */\n\n var url = $('.get-datalayer-wishlist-url').attr('data-datalayer-wishlist');\n\n if (url) {\n $.ajax({\n url: url,\n method: 'GET',\n success: function(data) {\n var persist_wishlist = {\n item: data.item,\n total_with_vat: data.total_with_vat,\n currency: data.currency\n };\n utag.data['persist_wishlist'] = persist_wishlist;\n },\n error: function(data) {\n console.error(data);\n }\n });\n }\n\n /* Persist cart variable */\n url = $('.get-datalayer-cart-url').attr('data-datalayer-cart');\n\n if (url) {\n $.ajax({\n url: url,\n method: 'GET',\n success: function(data) {\n var persist_cart = {\n item: data.item,\n total_without_vat: data.total_without_vat,\n total_with_vat: data.total_with_vat,\n currency: data.currency\n };\n utag.data['persist_cart'] = persist_cart;\n\n jQuery('body').trigger('cart_wishlist_updated');\n\n },\n error: function(data) {\n console.error(data);\n }\n });\n }\n });\n }\n },\n\n setListViewType: function() {\n $(\".js-change-view-toggle\").click(function() {\n let viewType = $(\".js-change-view-toggle.active\").attr('data-layout');\n\n if (viewType == 'single') {\n utag.data.list_view_type = 'outfit view';\n } else {\n utag.data.list_view_type = 'product view';\n }\n utag.link(utag.data);\n });\n },\n\n\n searchOpen: function() {\n $body.on('search:open', function() {\n if (utagExists()) {\n utag.data.page_name = utag.data.store_country + ':search:open';\n // utag.data.page_type = 'search';\n // utag.data.event_name = 'search_open';\n // utag.link(utag.data);\n let page_name = utag.data.store_country + ':search:open';\n \n utag.view({\n 'page_name' : page_name,\n 'view_name': utag.data.store_country + ':search:open',\n 'page_type' : 'search',\n \"tealium_event\" : 'search',\n 'event_name' : 'search_open',\n 'event_category' : 'searchOpen',\n 'event_action' : 'click'\n });\n }\n });\n },\n\n\n searchTypeKeyword: function() {\n $body.on('search:searchKeyword', function(e, response) {\n if (utagExists()) {\n let names = [];\n let skus = [];\n for (let i = 0; i < response.suggestions.length; i++) {\n if (response.suggestions[i].dataset.productName) {\n names.push(response.suggestions[i].dataset.productName);\n }\n if (response.suggestions[i].dataset.pid) {\n skus.push(response.suggestions[i].dataset.pid);\n }\n }\n if (typeof utag === 'undefined' || !utag) return;\n utag.data.page_name = `${utag.data.store_country}:search:inline result`;\n // utag.data.page_type = 'search';\n // utag.data.search_results = response.suggestions.length;\n // utag.data.search_term = $('.search-field').val();\n // utag.data.product_impression_name = names.toString();\n // utag.data.product_impression_sku = skus.toString();\n // utag.data.event_name = 'search_inline';\n // utag.view(utag.data);\n\n\n utag.view({\n 'page_name' : utag.data.store_country + ':search:inline result',\n 'view_name': utag.data.store_country + ':search:inline result',\n 'page_type' : 'search',\n \"tealium_event\" : 'search',\n 'search_results' : response.suggestions.length,\n 'search_term' : $('.search-field').val(),\n 'product_name' : names,\n 'product_sku' : skus,\n 'event_name' : 'search_inline',\n 'event_category' : 'searchInline',\n 'event_action' : 'typeKeywords'\n });\n }\n });\n },\n\n searchProductClick: function() {\n $body.on('click', '.search-suggestion-list-item', function(e) {\n if (utagExists()) {\n utag.data.page_name = `${utag.data.store_country}:search:inline result`;\n // utag.data.page_type = 'search';\n // utag.data.search_term = $('.search-field').val();\n // utag.data.search_result_type = e.currentTarget.dataset.type;\n // utag.data.search_result_value = e.currentTarget.ariaLabel;\n // utag.data.product_impression_name = e.currentTarget.ariaLabel;\n // utag.data.product_impression_sku = e.currentTarget.dataset.pid;\n // utag.data.event_name = 'search_inline_click';\n // utag.view(utag.data);\n let page_name = utag.data.store_country + ':search:inline result';\n let name = [e.currentTarget.ariaLabel];\n let sku = [e.currentTarget.dataset.pid];\n\n\n utag.view({\n 'page_name' : page_name,\n 'view_name': utag.data.store_country + ':search:inline result',\n \"tealium_event\" : 'search',\n 'page_type' : 'search',\n 'search_term' : $('.search-field').val(),\n 'search_result_type' : e.currentTarget.dataset.type,\n 'search_result_value' : e.currentTarget.ariaLabel,\n 'product_name' : name,\n 'product_sku' : sku,\n 'event_name' : 'search_inline_click',\n 'event_category' : 'searchInlineClick',\n 'event_action' : 'searchClick'\n });\n }\n });\n },\n\n\n searchSend: function() {\n $body.on('search:send', function() {\n if (utagExists()) {\n utag.view({\n 'page_name' : utag.data.store_country + ':search send',\n 'page_section' : 'search',\n 'page_type' : 'search',\n 'search_term' : $('.search-field').val(),\n 'event_name' : 'search_ok',\n });\n utag.link(utag.data);\n }\n });\n },\n\n searchResultsPage: function() {\n if (utagExists()) {\n $body.on('search:searchResultsPage', function() {\n let names = [];\n let skus = [];\n let product = $('.product');\n for (let i = 0; i < product.length; i++) {\n if (product[i].dataset.productName) {\n names.push(product[i].dataset.productName);\n }\n if (product[i].dataset.pid) {\n skus.push(product[i].dataset.pid);\n }\n }\n utag.data.page_name = utag.data.store_country + ':search';\n // utag.data.page_type = 'search';\n // utag.data.list_view_type = 'product view';\n // utag.data.product_impression_name = names.toString();\n // utag.data.product_impression_sku = skus.toString();\n\n\n utag.view({\n 'page_name' : utag.data.store_country + ':search',\n 'view_name': utag.data.store_country + ':search', \n \"tealium_event\" : 'search',\n 'page_type' : 'search',\n 'list_view_type' : 'product view',\n 'search_term' : $('.search-field').val(),\n 'product_name' : names,\n 'product_sku' : skus,\n 'event_name' : 'search_results_page',\n 'event_category' : 'searchResults',\n 'event_action' : 'resultsLoad'\n });\n });\n }\n }\n};\n","'use strict';\n\nlet formCleared = false;\n\n/**\n * Additional class to invalid-feed back when input field is changed\n * @param {HTMLElement} input input field\n */\nfunction triggerEdgeValidation(input) {\n if (!input || !input.nextElementSibling) return;\n if (!input.nextElementSibling.classList.contains('invalid-feedback')) return;\n\n const invalidFeedback = input.nextElementSibling;\n invalidFeedback.classList.toggle('edge-validation-fix');\n}\n\n/**\n * Scroll to first error in given form (if there is any)\n * @param {JQuery} $form - jQuery object containing form\n */\nfunction scrollToError($form) {\n if ($form.find('.is-invalid,.-invalid').length && !$form.parents('.modal').length) {\n $('html, body').animate(\n {\n scrollTop: $form.find('.is-invalid,.-invalid').first().offset().top - 25,\n },\n 500\n );\n $form.find('.is-invalid:first,.-invalid:first').focus();\n }\n}\n\n/**\n * Check if the user has done the reCaptcha and return true if so\n * @param {jQuery} $form - the from which contains the reCaptcha\n * @returns {boolean} whether the reCaptcha is entered or not\n */\nfunction validateReCaptcha($form) {\n const $response = $form.find('[name=g-recaptcha-response]');\n let valid;\n\n if ($response.length && $response.val()) {\n // ReCaptcha found and valid\n valid = true;\n } else if ($response.length) {\n // ReCaptcha found but not valid\n valid = false;\n } else {\n // ReCaptcha not found\n valid = true;\n }\n\n $response.parent().toggleClass('highlight-recaptcha', !valid);\n return valid;\n}\n\n/**\n * Validate whole form. Requires `this` to be set to form object\n * @param {jQuery.event} event - Event to be canceled if form is invalid.\n * @returns {boolean} - Flag to indicate if form is valid\n */\nfunction validateForm(event) {\n let valid = true;\n\n if (!validateReCaptcha($(this)) || (this.checkValidity && !this.checkValidity())) {\n // safari\n valid = false;\n\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n }\n\n $(this)\n .find('input, select, textarea')\n .each(function () {\n if (!this.validity.valid) {\n $(this).trigger('invalid', this.validity);\n }\n });\n }\n\n return valid;\n}\n\n/**\n * Remove all validation. Should be called every time before revalidating form\n * @param {element|jQuery} form - Form to be cleared. Could be plain JS object or jQuery object\n * @returns {void}\n */\nfunction clearFormErrors(form) {\n let $form = form;\n\n // Transform to jQuery object if plain JS object is passed.\n if (!form.jquery) {\n $form = $(form);\n }\n\n $form.find('.form-control.is-invalid').removeClass('is-invalid');\n $form.find('.form-control.is-valid').removeClass('is-valid');\n // margiela\n $form.find('.-invalid').removeClass('-invalid');\n $form.find('-valid').removeClass('-valid');\n \n $form.find('.invalid-feedback').empty();\n}\n\n/**\n * Init the handlers for events which doesn't bubble.\n * No bubbling means that body, document or element's container cannot be used for that event\n * and the exact element should be selected instead.\n * This is not a problem on initial load but doesn't work on html loaded with Ajax\n * and this is why this method is needed so we can re-attach the event handlers.\n * @returns {void}\n */\nfunction attachNoBubbleEvents() {\n let attachTimeout;\n $('form input, form select, form textarea')\n .off('invalid')\n .on('invalid', function (e) {\n e.preventDefault();\n this.setCustomValidity('');\n const $form = $(this).parents('form');\n triggerEdgeValidation(this);\n\n if (!this.validity.valid) {\n $(this).removeClass('is-valid -valid');\n $(this).addClass('is-invalid -invalid');\n\n const id = $(this).attr('id');\n const fieldMessages = window.formValidationMessages[id];\n\n if (fieldMessages) {\n // Important:\n // for-in statement was the only possible solution in this case.\n // ValidityState has no enumerable properties hence Object.keys() wouldn't work.\n let key;\n\n for (key in this.validity) {\n // eslint-disable-line no-restricted-syntax, guard-for-in\n if (key !== 'valid') {\n if (this.validity[key] && fieldMessages[key]) {\n this.setCustomValidity(fieldMessages[key]);\n break;\n }\n }\n }\n }\n\n $(this).parents('.form-group').find('.invalid-feedback').text(this.validationMessage);\n $(this).parents('[class^=\"mm-form\"]').find('.invalid-feedback').text(this.validationMessage);\n\n clearTimeout(attachTimeout);\n attachTimeout = setTimeout(function () {\n $body.trigger('validation:afterReattachInvalid', { $form });\n }, 50);\n }\n });\n}\n\n/**\n * Clear errors from form fields (includes messeges and visual feedback)\n * @param {JQuery} $form - jquery form object\n */\nfunction clearFormFieldErrors($form) {\n $form.siblings('.invalid-feedback').empty();\n $form.removeClass('is-invalid -inalid');\n $form.addClass('is-valid -valid');\n\n $form.find('input').each((i, e) => {\n triggerEdgeValidation(e);\n });\n}\n\nmodule.exports = {\n noBubbleEvents: attachNoBubbleEvents,\n\n init: function (additionalMessagesStr) {\n window.formValidationMessages = {};\n\n let additionalMessages;\n\n if (additionalMessagesStr) {\n try {\n additionalMessages = JSON.parse(additionalMessagesStr);\n } catch (e) {\n window.console.warn(e);\n }\n }\n\n const $formMessages = $('.js-form-messages');\n\n if ($formMessages.length) {\n try {\n window.formValidationMessages = JSON.parse($formMessages.text());\n } catch (e) {\n window.console.warn(e);\n }\n }\n\n if (additionalMessages) {\n $.extend(window.formValidationMessages, additionalMessages);\n }\n\n },\n\n submit: function () {\n $body.on('submit', 'form', function (e) {\n return validateForm.call(this, e);\n });\n },\n\n buttonClick: function () {\n $body.on('click', 'form button[type=\"submit\"], form input[type=\"submit\"]', function () {\n // clear all errors when trying to submit the form\n const $form = $(this).parents('form');\n clearFormErrors($form);\n validateReCaptcha($form);\n formCleared = true;\n });\n },\n\n focusOut: function () {\n $body.on('focusout', 'form input:not(.validate-on-change), form select:not(.validate-on-change), form textarea', function (e) {\n const $this = $(e.target);\n $this.siblings('.field-description').remove();\n\n if (!this.checkValidity()) {\n $this.trigger('invalid', this.validity);\n } else {\n clearFormFieldErrors($this);\n }\n });\n },\n\n blur: function () {\n $body.on('blur', 'form input:not(.validate-on-change), form select:not(.validate-on-change), form textarea', function (e) {\n const $this = $(e.target);\n\n const removeWhitespaces = $($this).val();\n const cleanString = removeWhitespaces.replace(/^\\s+|\\s+$/g, '');\n $($this).val(cleanString);\n $this.siblings('.field-description').remove();\n\n if (!this.checkValidity()) {\n $this.trigger('invalid', this.validity);\n } else {\n clearFormFieldErrors($this);\n }\n });\n },\n\n onChange: function () {\n $body.on('change', 'input.validate-on-change, select.validate-on-change', function (e) {\n const $this = $(e.target);\n\n if (!this.checkValidity()) {\n $this.trigger('invalid', this.validity);\n } else {\n clearFormFieldErrors($this);\n }\n });\n },\n\n handleDateChange: function () {\n $body.on('changeDate', '[data-provide=datepicker]', function () {\n $(this).trigger('change');\n $(this).trigger('focusout');\n });\n },\n\n scrollOnError: function () {\n $body.on('validation:afterReattachInvalid', function (e, data) {\n if (formCleared) {\n formCleared = false;\n scrollToError(data.$form);\n }\n });\n },\n\n updatePostalCodePattern: function () {\n $body.on('change', '[data-update-postal-code-pattern]', function () {\n const $this = $(this);\n const postalCodeElementID = $this.data('update-postal-code-pattern');\n const $postalCode = $this.closest('form').find('#' + postalCodeElementID);\n\n if ($postalCode.length > 0) {\n const postalCodeRegexp = {\n defaults: /^[0-9]{5}$/,\n at: /^(?!0)([0-9]{4})$/,\n be: /^(?!0)([0-9]{4})$/,\n bg: /^(?!0)([0-9]{4})$/,\n dk: /^(?!0)([0-9]{4})$/,\n gr: /^([0-9]{3}\\s[0-9]{2}|[0-9]{5})$/,\n hu: /^[0-9]{4}$/,\n lv: /^([Ll][Vv])[-]([0-9]){4}$/,\n lt: /^([Ll][Tt])[-]([0-9]){5}$/,\n lu: /^(?!0)([0-9]{4})$/,\n nl: /^[1-9][0-9]{3}\\s[A-Z]{2}$/,\n no: /^[0-9]{4}$/,\n pl: /^[0-9]{2}[-][0-9]{3}$/,\n pt: /^(?!0)([0-9]{4}-?[0-9]{3})$/,\n ro: /^[0-9]{6}$/,\n ru: /^[0-9]{6}$/,\n sk: /^(?=0|8|9)([0-9]{3}\\s?[0-9]{2})$/,\n si: /^(?!0)([0-9]{4}$)/,\n es: /^((0[1-9]|5[0-2])|[1-4][0-9])[0-9]{3}$/,\n se: /^([0-9]{3}\\s[0-9]{2}|[0-9]{5})$/,\n ch: /^[0-9]{4}$/,\n gb: /^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9][A-Za-z]?))))\\s?[0-9][A-Za-z]{2})$/,\n us: /^\\d{5}(-\\d{4})?$/,\n ca: /^[ABCEGHJKLMNPRSTVXYabceghjklmnprstvxy]{1}\\d{1}[ABCEGHJKLMNPRSTVWXYZabceghjklmnprstvwxyz]{1} *\\d{1}[ABCEGHJKLMNPRSTVWXYZabceghjklmnprstvwxyz]{1}\\d{1}$/,\n cz: /^[0-9]{3}\\s[0-9]{2}$/,\n };\n const countryCode = ($this.val() || '').toLowerCase();\n const regexp = countryCode in postalCodeRegexp ? postalCodeRegexp[countryCode] : postalCodeRegexp.defaults;\n\n $postalCode.attr('pattern', regexp.toString().slice(1, -1));\n }\n });\n\n $('[data-update-postal-code-pattern]').trigger('change');\n },\n\n reCaptchaOnChange: function () {\n $body.on('focusin', '.g-recaptcha iframe', function () {\n validateReCaptcha($(event.target).parents('form'));\n });\n },\n\n functions: {\n validateForm: function (form, event) {\n return validateForm.call(form, event || null);\n },\n clearFormErrors: clearFormErrors,\n reAttachNoBubbleEvents: attachNoBubbleEvents,\n scrollToError: scrollToError,\n },\n};\n","'use strict';\n\nconst processInclude = require('base/util');\n\n$(document).ready(function () {\n processInclude(require('./registration/registration'));\n processInclude(require('core/datepicker'));\n processInclude(require('tealium/tealiumEvents'));\n});\nrequire('core/components/spinner');\n","'use strict';\n\nconst $body = $('body');\nconst formValidation = require('core/components/formValidation');\nconst clientSideValidation = require('core/components/clientSideValidation');\n\nconst $registrationForm = $('form.registration');\n\nmodule.exports = {\n init: function () {\n this.initAgeValidation();\n // clientSideValidation.init();\n $registrationForm.on('bouncerFormValid', function (e) {\n e.preventDefault();\n\n $.spinner().start();\n clientSideValidation.functions.clearFormErrors($registrationForm);\n\n $.post({\n url: $registrationForm.attr('action'),\n dataType: 'json',\n data: $registrationForm.serialize(),\n success: function (data) {\n if (!data.success) {\n formValidation($registrationForm, data);\n $.spinner().stop();\n clientSideValidation.functions.scrollToError($registrationForm);\n } else {\n $body.trigger('user:registered');\n $body.trigger('customer:updateAttributes');\n window.location = data.redirectUrl;\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n\n $.spinner().stop();\n },\n });\n\n return false;\n });\n\n /**\n * toggle confirmation content\n */\n $('.js_toggle-order-details').on('click', function () {\n $('.js_confirmation-content').slideToggle();\n $(this).toggleClass('active');\n });\n },\n initAgeValidation: function() {\n const $birthdateInput = $('#registration-form-birthday');\n const today = new Date();\n const maxDate = new Date(\n today.getFullYear() - 18,\n today.getMonth(),\n today.getDate()\n );\n\n $birthdateInput.attr('max', maxDate.toISOString().split('T')[0]);\n },\n\n handlePopups: function () {\n $('#privacyPopupModal').on('shown.bs.modal', function (event) {\n const $aTag = $(event.relatedTarget); // Element that triggered the modal\n const $relevantSelector = $($aTag.data('hash'));\n\n if ($relevantSelector.length) {\n $relevantSelector.get(0).scrollIntoView();\n }\n });\n },\n datePickerKeyboardNav: function () {\n $('#registration-form-birthday').on('keydown', function (event) {\n if (event.key !== 'Enter' || this !== document.activeElement) return; // Only do something if element has focus and Enter is pressed.\n\n const $datepicker = $('.datepicker');\n if (!$datepicker.length) return; // date picker not open\n\n // get current user selection\n const $selection = $datepicker\n .children()\n .filter(function () {\n return $(this).css('display') !== 'none';\n })\n .find('.focused');\n // click on user selection\n $selection.trigger('click');\n\n event.preventDefault();\n event.stopImmediatePropagation();\n });\n },\n passwordDinamicValidation: function() {\n $('#registration-form-password').on('keydown input', function(e) {\n var emailInput = e.target.value;\n if(emailInput.length >= 8) {\n $('.error-length').addClass('green');\n } else {\n $('.error-length').removeClass('green');\n } \n if(/\\d/.test(emailInput)) {\n $('.error-number').addClass('green');\n } else {\n $('.error-number').removeClass('green');\n }\n if( /[!+,\\-./:;<=>?@]/.test(emailInput)) {\n $('.error-character').addClass('green');\n } else {\n $('.error-character').removeClass('green');\n }\n });\n }\n};\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","export function hasProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function lastItemOf(arr) {\n return arr[arr.length - 1];\n}\n\n// push only the items not included in the array\nexport function pushUnique(arr, ...items) {\n items.forEach((item) => {\n if (arr.includes(item)) {\n return;\n }\n arr.push(item);\n });\n return arr;\n}\n\nexport function stringToArray(str, separator) {\n // convert empty string to an empty array\n return str ? str.split(separator) : [];\n}\n\nexport function isInRange(testVal, min, max) {\n const minOK = min === undefined || testVal >= min;\n const maxOK = max === undefined || testVal <= max;\n return minOK && maxOK;\n}\n\nexport function limitToRange(val, min, max) {\n if (val < min) {\n return min;\n }\n if (val > max) {\n return max;\n }\n return val;\n}\n\nexport function createTagRepeat(tagName, repeat, attributes = {}, index = 0, html = '') {\n const openTagSrc = Object.keys(attributes).reduce((src, attr) => {\n let val = attributes[attr];\n if (typeof val === 'function') {\n val = val(index);\n }\n return `${src} ${attr}=\"${val}\"`;\n }, tagName);\n html += `<${openTagSrc}>`;\n\n const next = index + 1;\n return next < repeat\n ? createTagRepeat(tagName, repeat, attributes, next, html)\n : html;\n}\n\n// Remove the spacing surrounding tags for HTML parser not to create text nodes\n// before/after elements\nexport function optimizeTemplateHTML(html) {\n return html.replace(/>\\s+/g, '>').replace(/\\s+ name.toLowerCase().startsWith(monthName);\n // compare with both short and full names because some locales have periods\n // in the short names (not equal to the first X letters of the full names)\n monthIndex = locale.monthsShort.findIndex(compareNames);\n if (monthIndex < 0) {\n monthIndex = locale.months.findIndex(compareNames);\n }\n if (monthIndex < 0) {\n return NaN;\n }\n }\n\n newDate.setMonth(monthIndex);\n return newDate.getMonth() !== normalizeMonth(monthIndex)\n ? newDate.setDate(0)\n : newDate.getTime();\n },\n d(date, day) {\n return new Date(date).setDate(parseInt(day, 10));\n },\n};\n// format functions for date parts\nconst formatFns = {\n d(date) {\n return date.getDate();\n },\n dd(date) {\n return padZero(date.getDate(), 2);\n },\n D(date, locale) {\n return locale.daysShort[date.getDay()];\n },\n DD(date, locale) {\n return locale.days[date.getDay()];\n },\n m(date) {\n return date.getMonth() + 1;\n },\n mm(date) {\n return padZero(date.getMonth() + 1, 2);\n },\n M(date, locale) {\n return locale.monthsShort[date.getMonth()];\n },\n MM(date, locale) {\n return locale.months[date.getMonth()];\n },\n y(date) {\n return date.getFullYear();\n },\n yy(date) {\n return padZero(date.getFullYear(), 2).slice(-2);\n },\n yyyy(date) {\n return padZero(date.getFullYear(), 4);\n },\n};\n\n// get month index in normal range (0 - 11) from any number\nfunction normalizeMonth(monthIndex) {\n return monthIndex > -1 ? monthIndex % 12 : normalizeMonth(monthIndex + 12);\n}\n\nfunction padZero(num, length) {\n return num.toString().padStart(length, '0');\n}\n\nfunction parseFormatString(format) {\n if (typeof format !== 'string') {\n throw new Error(\"Invalid date format.\");\n }\n if (format in knownFormats) {\n return knownFormats[format];\n }\n\n // sprit the format string into parts and seprators\n const separators = format.split(reFormatTokens);\n const parts = format.match(new RegExp(reFormatTokens, 'g'));\n if (separators.length === 0 || !parts) {\n throw new Error(\"Invalid date format.\");\n }\n\n // collect format functions used in the format\n const partFormatters = parts.map(token => formatFns[token]);\n\n // collect parse function keys used in the format\n // iterate over parseFns' keys in order to keep the order of the keys.\n const partParserKeys = Object.keys(parseFns).reduce((keys, key) => {\n const token = parts.find(part => part[0] !== 'D' && part[0].toLowerCase() === key);\n if (token) {\n keys.push(key);\n }\n return keys;\n }, []);\n\n return knownFormats[format] = {\n parser(dateStr, locale) {\n const dateParts = dateStr.split(reNonDateParts).reduce((dtParts, part, index) => {\n if (part.length > 0 && parts[index]) {\n const token = parts[index][0];\n if (token === 'M') {\n dtParts.m = part;\n } else if (token !== 'D') {\n dtParts[token] = part;\n }\n }\n return dtParts;\n }, {});\n\n // iterate over partParserkeys so that the parsing is made in the oder\n // of year, month and day to prevent the day parser from correcting last\n // day of month wrongly\n return partParserKeys.reduce((origDate, key) => {\n const newDate = parseFns[key](origDate, dateParts[key], locale);\n // ingnore the part failed to parse\n return isNaN(newDate) ? origDate : newDate;\n }, today());\n },\n formatter(date, locale) {\n let dateStr = partFormatters.reduce((str, fn, index) => {\n return str += `${separators[index]}${fn(date, locale)}`;\n }, '');\n // separators' length is always parts' length + 1,\n return dateStr += lastItemOf(separators);\n },\n };\n}\n\nexport function parseDate(dateStr, format, locale) {\n if (dateStr instanceof Date || typeof dateStr === 'number') {\n const date = stripTime(dateStr);\n return isNaN(date) ? undefined : date;\n }\n if (!dateStr) {\n return undefined;\n }\n if (dateStr === 'today') {\n return today();\n }\n\n if (format && format.toValue) {\n const date = format.toValue(dateStr, format, locale);\n return isNaN(date) ? undefined : stripTime(date);\n }\n\n return parseFormatString(format).parser(dateStr, locale);\n}\n\nexport function formatDate(date, format, locale) {\n if (isNaN(date) || (!date && date !== 0)) {\n return '';\n }\n\n const dateObj = typeof date === 'number' ? new Date(date) : date;\n\n if (format.toDisplay) {\n return format.toDisplay(dateObj, format, locale);\n }\n\n return parseFormatString(format).formatter(dateObj, locale);\n}\n","const listenerRegistry = new WeakMap();\nconst {addEventListener, removeEventListener} = EventTarget.prototype;\n\n// Register event listeners to a key object\n// listeners: array of listener definitions;\n// - each definition must be a flat array of event target and the arguments\n// used to call addEventListener() on the target\nexport function registerListeners(keyObj, listeners) {\n let registered = listenerRegistry.get(keyObj);\n if (!registered) {\n registered = [];\n listenerRegistry.set(keyObj, registered);\n }\n listeners.forEach((listener) => {\n addEventListener.call(...listener);\n registered.push(listener);\n });\n}\n\nexport function unregisterListeners(keyObj) {\n let listeners = listenerRegistry.get(keyObj);\n if (!listeners) {\n return;\n }\n listeners.forEach((listener) => {\n removeEventListener.call(...listener);\n });\n listenerRegistry.delete(keyObj);\n}\n\n// Event.composedPath() polyfill for Edge\n// based on https://gist.github.com/kleinfreund/e9787d73776c0e3750dcfcdc89f100ec\nif (!Event.prototype.composedPath) {\n const getComposedPath = (node, path = []) => {\n path.push(node);\n\n let parent;\n if (node.parentNode) {\n parent = node.parentNode;\n } else if (node.host) { // ShadowRoot\n parent = node.host;\n } else if (node.defaultView) { // Document\n parent = node.defaultView;\n }\n return parent ? getComposedPath(parent, path) : path;\n };\n\n Event.prototype.composedPath = function () {\n return getComposedPath(this.target);\n };\n}\n\nfunction findFromPath(path, criteria, currentTarget, index = 0) {\n const el = path[index];\n if (criteria(el)) {\n return el;\n } else if (el === currentTarget || !el.parentElement) {\n // stop when reaching currentTarget or \n return;\n }\n return findFromPath(path, criteria, currentTarget, index + 1);\n}\n\n// Search for the actual target of a delegated event\nexport function findElementInEventPath(ev, selector) {\n const criteria = typeof selector === 'function' ? selector : el => el.matches(selector);\n return findFromPath(ev.composedPath(), criteria, ev.currentTarget);\n}\n","// default locales\nexport const locales = {\n en: {\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n daysShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n daysMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthsShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n today: \"Today\",\n clear: \"Clear\",\n titleFormat: \"MM y\"\n }\n};\n","// config options updatable by setOptions() and their default values\nconst defaultOptions = {\n autohide: false,\n beforeShowDay: null,\n beforeShowDecade: null,\n beforeShowMonth: null,\n beforeShowYear: null,\n calendarWeeks: false,\n clearBtn: false,\n dateDelimiter: ',',\n datesDisabled: [],\n daysOfWeekDisabled: [],\n daysOfWeekHighlighted: [],\n defaultViewDate: undefined, // placeholder, defaults to today() by the program\n disableTouchKeyboard: false,\n format: 'mm/dd/yyyy',\n language: 'en',\n maxDate: null,\n maxNumberOfDates: 1,\n maxView: 3,\n minDate: null,\n nextArrow: '»',\n orientation: 'auto',\n pickLevel: 0,\n prevArrow: '«',\n showDaysOfWeek: true,\n showOnClick: true,\n showOnFocus: true,\n startView: 0,\n title: '',\n todayBtn: false,\n todayBtnMode: 0,\n todayHighlight: false,\n updateOnBlur: true,\n weekStart: 0,\n};\n\nexport default defaultOptions;\n","const range = document.createRange();\n\nexport function parseHTML(html) {\n return range.createContextualFragment(html);\n}\n\n// equivalent to jQuery's :visble\nexport function isVisible(el) {\n return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n}\n\nexport function hideElement(el) {\n if (el.style.display === 'none') {\n return;\n }\n // back up the existing display setting in data-style-display\n if (el.style.display) {\n el.dataset.styleDisplay = el.style.display;\n }\n el.style.display = 'none';\n}\n\nexport function showElement(el) {\n if (el.style.display !== 'none') {\n return;\n }\n if (el.dataset.styleDisplay) {\n // restore backed-up dispay property\n el.style.display = el.dataset.styleDisplay;\n delete el.dataset.styleDisplay;\n } else {\n el.style.display = '';\n }\n}\n\nexport function emptyChildNodes(el) {\n if (el.firstChild) {\n el.removeChild(el.firstChild);\n emptyChildNodes(el);\n }\n}\n\nexport function replaceChildNodes(el, newChildNodes) {\n emptyChildNodes(el);\n if (newChildNodes instanceof DocumentFragment) {\n el.appendChild(newChildNodes);\n } else if (typeof newChildNodes === 'string') {\n el.appendChild(parseHTML(newChildNodes));\n } else if (typeof newChildNodes.forEach === 'function') {\n newChildNodes.forEach((node) => {\n el.appendChild(node);\n });\n }\n}\n","import {hasProperty, pushUnique} from '../lib/utils.js';\nimport {dateValue} from '../lib/date.js';\nimport {reFormatTokens, parseDate} from '../lib/date-format.js';\nimport {parseHTML} from '../lib/dom.js';\nimport defaultOptions from './defaultOptions.js';\n\nconst {\n language: defaultLang,\n format: defaultFormat,\n weekStart: defaultWeekStart,\n} = defaultOptions;\n\n// Reducer function to filter out invalid day-of-week from the input\nfunction sanitizeDOW(dow, day) {\n return dow.length < 6 && day >= 0 && day < 7\n ? pushUnique(dow, day)\n : dow;\n}\n\nfunction calcEndOfWeek(startOfWeek) {\n return (startOfWeek + 6) % 7;\n}\n\n// validate input date. if invalid, fallback to the original value\nfunction validateDate(value, format, locale, origValue) {\n const date = parseDate(value, format, locale);\n return date !== undefined ? date : origValue;\n}\n\n// Validate viewId. if invalid, fallback to the original value\nfunction validateViewId(value, origValue, max = 3) {\n const viewId = parseInt(value, 10);\n return viewId >= 0 && viewId <= max ? viewId : origValue;\n}\n\n// Create Datepicker configuration to set\nexport default function processOptions(options, datepicker) {\n const inOpts = Object.assign({}, options);\n const config = {};\n const locales = datepicker.constructor.locales;\n let {\n format,\n language,\n locale,\n maxDate,\n maxView,\n minDate,\n pickLevel,\n startView,\n weekStart,\n } = datepicker.config || {};\n\n if (inOpts.language) {\n let lang;\n if (inOpts.language !== language) {\n if (locales[inOpts.language]) {\n lang = inOpts.language;\n } else {\n // Check if langauge + region tag can fallback to the one without\n // region (e.g. fr-CA → fr)\n lang = inOpts.language.split('-')[0];\n if (locales[lang] === undefined) {\n lang = false;\n }\n }\n }\n delete inOpts.language;\n if (lang) {\n language = config.language = lang;\n\n // update locale as well when updating language\n const origLocale = locale || locales[defaultLang];\n // use default language's properties for the fallback\n locale = Object.assign({\n format: defaultFormat,\n weekStart: defaultWeekStart\n }, locales[defaultLang]);\n if (language !== defaultLang) {\n Object.assign(locale, locales[language]);\n }\n config.locale = locale;\n // if format and/or weekStart are the same as old locale's defaults,\n // update them to new locale's defaults\n if (format === origLocale.format) {\n format = config.format = locale.format;\n }\n if (weekStart === origLocale.weekStart) {\n weekStart = config.weekStart = locale.weekStart;\n config.weekEnd = calcEndOfWeek(locale.weekStart);\n }\n }\n }\n\n if (inOpts.format) {\n const hasToDisplay = typeof inOpts.format.toDisplay === 'function';\n const hasToValue = typeof inOpts.format.toValue === 'function';\n const validFormatString = reFormatTokens.test(inOpts.format);\n if ((hasToDisplay && hasToValue) || validFormatString) {\n format = config.format = inOpts.format;\n }\n delete inOpts.format;\n }\n\n //*** dates ***//\n // while min and maxDate for \"no limit\" in the options are better to be null\n // (especially when updating), the ones in the config have to be undefined\n // because null is treated as 0 (= unix epoch) when comparing with time value\n let minDt = minDate;\n let maxDt = maxDate;\n if (inOpts.minDate !== undefined) {\n minDt = inOpts.minDate === null\n ? dateValue(0, 0, 1) // set 0000-01-01 to prevent negative values for year\n : validateDate(inOpts.minDate, format, locale, minDt);\n delete inOpts.minDate;\n }\n if (inOpts.maxDate !== undefined) {\n maxDt = inOpts.maxDate === null\n ? undefined\n : validateDate(inOpts.maxDate, format, locale, maxDt);\n delete inOpts.maxDate;\n }\n if (maxDt < minDt) {\n minDate = config.minDate = maxDt;\n maxDate = config.maxDate = minDt;\n } else {\n if (minDate !== minDt) {\n minDate = config.minDate = minDt;\n }\n if (maxDate !== maxDt) {\n maxDate = config.maxDate = maxDt;\n }\n }\n\n if (inOpts.datesDisabled) {\n config.datesDisabled = inOpts.datesDisabled.reduce((dates, dt) => {\n const date = parseDate(dt, format, locale);\n return date !== undefined ? pushUnique(dates, date) : dates;\n }, []);\n delete inOpts.datesDisabled;\n }\n if (inOpts.defaultViewDate !== undefined) {\n const viewDate = parseDate(inOpts.defaultViewDate, format, locale);\n if (viewDate !== undefined) {\n config.defaultViewDate = viewDate;\n }\n delete inOpts.defaultViewDate;\n }\n\n //*** days of week ***//\n if (inOpts.weekStart !== undefined) {\n const wkStart = Number(inOpts.weekStart) % 7;\n if (!isNaN(wkStart)) {\n weekStart = config.weekStart = wkStart;\n config.weekEnd = calcEndOfWeek(wkStart);\n }\n delete inOpts.weekStart;\n }\n if (inOpts.daysOfWeekDisabled) {\n config.daysOfWeekDisabled = inOpts.daysOfWeekDisabled.reduce(sanitizeDOW, []);\n delete inOpts.daysOfWeekDisabled;\n }\n if (inOpts.daysOfWeekHighlighted) {\n config.daysOfWeekHighlighted = inOpts.daysOfWeekHighlighted.reduce(sanitizeDOW, []);\n delete inOpts.daysOfWeekHighlighted;\n }\n\n //*** multi date ***//\n if (inOpts.maxNumberOfDates !== undefined) {\n const maxNumberOfDates = parseInt(inOpts.maxNumberOfDates, 10);\n if (maxNumberOfDates >= 0) {\n config.maxNumberOfDates = maxNumberOfDates;\n config.multidate = maxNumberOfDates !== 1;\n }\n delete inOpts.maxNumberOfDates;\n }\n if (inOpts.dateDelimiter) {\n config.dateDelimiter = String(inOpts.dateDelimiter);\n delete inOpts.dateDelimiter;\n }\n\n //*** pick level & view ***//\n let newPickLevel = pickLevel;\n if (inOpts.pickLevel !== undefined) {\n newPickLevel = validateViewId(inOpts.pickLevel, 2);\n delete inOpts.pickLevel;\n }\n if (newPickLevel !== pickLevel) {\n pickLevel = config.pickLevel = newPickLevel;\n }\n\n let newMaxView = maxView;\n if (inOpts.maxView !== undefined) {\n newMaxView = validateViewId(inOpts.maxView, maxView);\n delete inOpts.maxView;\n }\n // ensure max view >= pick level\n newMaxView = pickLevel > newMaxView ? pickLevel : newMaxView;\n if (newMaxView !== maxView) {\n maxView = config.maxView = newMaxView;\n }\n\n let newStartView = startView;\n if (inOpts.startView !== undefined) {\n newStartView = validateViewId(inOpts.startView, newStartView);\n delete inOpts.startView;\n }\n // ensure pick level <= start view <= max view\n if (newStartView < pickLevel) {\n newStartView = pickLevel;\n } else if (newStartView > maxView) {\n newStartView = maxView;\n }\n if (newStartView !== startView) {\n config.startView = newStartView;\n }\n\n //*** template ***//\n if (inOpts.prevArrow) {\n const prevArrow = parseHTML(inOpts.prevArrow);\n if (prevArrow.childNodes.length > 0) {\n config.prevArrow = prevArrow.childNodes;\n }\n delete inOpts.prevArrow;\n }\n if (inOpts.nextArrow) {\n const nextArrow = parseHTML(inOpts.nextArrow);\n if (nextArrow.childNodes.length > 0) {\n config.nextArrow = nextArrow.childNodes;\n }\n delete inOpts.nextArrow;\n }\n\n //*** misc ***//\n if (inOpts.disableTouchKeyboard !== undefined) {\n config.disableTouchKeyboard = 'ontouchstart' in document && !!inOpts.disableTouchKeyboard;\n delete inOpts.disableTouchKeyboard;\n }\n if (inOpts.orientation) {\n const orientation = inOpts.orientation.toLowerCase().split(/\\s+/g);\n config.orientation = {\n x: orientation.find(x => (x === 'left' || x === 'right')) || 'auto',\n y: orientation.find(y => (y === 'top' || y === 'bottom')) || 'auto',\n };\n delete inOpts.orientation;\n }\n if (inOpts.todayBtnMode !== undefined) {\n switch(inOpts.todayBtnMode) {\n case 0:\n case 1:\n config.todayBtnMode = inOpts.todayBtnMode;\n }\n delete inOpts.todayBtnMode;\n }\n\n //*** copy the rest ***//\n Object.keys(inOpts).forEach((key) => {\n if (inOpts[key] !== undefined && hasProperty(defaultOptions, key)) {\n config[key] = inOpts[key];\n }\n });\n\n return config;\n}\n","import {optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst pickerTemplate = optimizeTemplateHTML(`
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
`);\n\nexport default pickerTemplate;\n","import {createTagRepeat, optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst daysTemplate = optimizeTemplateHTML(`
\n
${createTagRepeat('span', 7, {class: 'dow'})}
\n
${createTagRepeat('span', 42)}
\n
`);\n\nexport default daysTemplate;\n","import {createTagRepeat, optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst calendarWeeksTemplate = optimizeTemplateHTML(`
\n
\n
${createTagRepeat('span', 6, {class: 'week'})}
\n
`);\n\nexport default calendarWeeksTemplate;\n","import {pushUnique} from '../../lib/utils.js';\nimport {parseHTML, replaceChildNodes} from '../../lib/dom.js';\n\n// Base class of the view classes\nexport default class View {\n constructor(picker, config) {\n Object.assign(this, config, {\n picker,\n element: parseHTML(`
`).firstChild,\n selected: [],\n });\n this.init(this.picker.datepicker.config);\n }\n\n init(options) {\n if (options.pickLevel !== undefined) {\n this.isMinView = this.id === options.pickLevel;\n }\n this.setOptions(options);\n this.updateFocus();\n this.updateSelection();\n }\n\n // Execute beforeShow() callback and apply the result to the element\n // args:\n // - current - current value on the iteration on view rendering\n // - timeValue - time value of the date to pass to beforeShow()\n performBeforeHook(el, current, timeValue) {\n let result = this.beforeShow(new Date(timeValue));\n switch (typeof result) {\n case 'boolean':\n result = {enabled: result};\n break;\n case 'string':\n result = {classes: result};\n }\n\n if (result) {\n if (result.enabled === false) {\n el.classList.add('disabled');\n pushUnique(this.disabled, current);\n }\n if (result.classes) {\n const extraClasses = result.classes.split(/\\s+/);\n el.classList.add(...extraClasses);\n if (extraClasses.includes('disabled')) {\n pushUnique(this.disabled, current);\n }\n }\n if (result.content) {\n replaceChildNodes(el, result.content);\n }\n }\n }\n}\n","import {hasProperty, pushUnique} from '../../lib/utils.js';\nimport {today, dateValue, addDays, addWeeks, dayOfTheWeekOf, getWeek} from '../../lib/date.js';\nimport {formatDate} from '../../lib/date-format.js';\nimport {parseHTML, showElement, hideElement} from '../../lib/dom.js';\nimport daysTemplate from '../templates/daysTemplate.js';\nimport calendarWeeksTemplate from '../templates/calendarWeeksTemplate.js';\nimport View from './View.js';\n\nexport default class DaysView extends View {\n constructor(picker) {\n super(picker, {\n id: 0,\n name: 'days',\n cellClass: 'day',\n });\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n const inner = parseHTML(daysTemplate).firstChild;\n this.dow = inner.firstChild;\n this.grid = inner.lastChild;\n this.element.appendChild(inner);\n }\n super.init(options);\n }\n\n setOptions(options) {\n let updateDOW;\n\n if (hasProperty(options, 'minDate')) {\n this.minDate = options.minDate;\n }\n if (hasProperty(options, 'maxDate')) {\n this.maxDate = options.maxDate;\n }\n if (options.datesDisabled) {\n this.datesDisabled = options.datesDisabled;\n }\n if (options.daysOfWeekDisabled) {\n this.daysOfWeekDisabled = options.daysOfWeekDisabled;\n updateDOW = true;\n }\n if (options.daysOfWeekHighlighted) {\n this.daysOfWeekHighlighted = options.daysOfWeekHighlighted;\n }\n if (options.todayHighlight !== undefined) {\n this.todayHighlight = options.todayHighlight;\n }\n if (options.weekStart !== undefined) {\n this.weekStart = options.weekStart;\n this.weekEnd = options.weekEnd;\n updateDOW = true;\n }\n if (options.locale) {\n const locale = this.locale = options.locale;\n this.dayNames = locale.daysMin;\n this.switchLabelFormat = locale.titleFormat;\n updateDOW = true;\n }\n if (options.beforeShowDay !== undefined) {\n this.beforeShow = typeof options.beforeShowDay === 'function'\n ? options.beforeShowDay\n : undefined;\n }\n\n if (options.calendarWeeks !== undefined) {\n if (options.calendarWeeks && !this.calendarWeeks) {\n const weeksElem = parseHTML(calendarWeeksTemplate).firstChild;\n this.calendarWeeks = {\n element: weeksElem,\n dow: weeksElem.firstChild,\n weeks: weeksElem.lastChild,\n };\n this.element.insertBefore(weeksElem, this.element.firstChild);\n } else if (this.calendarWeeks && !options.calendarWeeks) {\n this.element.removeChild(this.calendarWeeks.element);\n this.calendarWeeks = null;\n }\n }\n if (options.showDaysOfWeek !== undefined) {\n if (options.showDaysOfWeek) {\n showElement(this.dow);\n if (this.calendarWeeks) {\n showElement(this.calendarWeeks.dow);\n }\n } else {\n hideElement(this.dow);\n if (this.calendarWeeks) {\n hideElement(this.calendarWeeks.dow);\n }\n }\n }\n\n // update days-of-week when locale, daysOfweekDisabled or weekStart is changed\n if (updateDOW) {\n Array.from(this.dow.children).forEach((el, index) => {\n const dow = (this.weekStart + index) % 7;\n el.textContent = this.dayNames[dow];\n el.className = this.daysOfWeekDisabled.includes(dow) ? 'dow disabled' : 'dow';\n });\n }\n }\n\n // Apply update on the focused date to view's settings\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const viewYear = viewDate.getFullYear();\n const viewMonth = viewDate.getMonth();\n const firstOfMonth = dateValue(viewYear, viewMonth, 1);\n const start = dayOfTheWeekOf(firstOfMonth, this.weekStart, this.weekStart);\n\n this.first = firstOfMonth;\n this.last = dateValue(viewYear, viewMonth + 1, 0);\n this.start = start;\n this.focused = this.picker.viewDate;\n }\n\n // Apply update on the selected dates to view's settings\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates;\n if (rangepicker) {\n this.range = rangepicker.dates;\n }\n }\n\n // Update the entire view UI\n render() {\n // update today marker on ever render\n this.today = this.todayHighlight ? today() : undefined;\n // refresh disabled dates on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [...this.datesDisabled];\n\n const switchLabel = formatDate(this.focused, this.switchLabelFormat, this.locale);\n this.picker.setViewSwitchLabel(switchLabel);\n this.picker.setPrevBtnDisabled(this.first <= this.minDate);\n this.picker.setNextBtnDisabled(this.last >= this.maxDate);\n\n if (this.calendarWeeks) {\n // start of the UTC week (Monday) of the 1st of the month\n const startOfWeek = dayOfTheWeekOf(this.first, 1, 1);\n Array.from(this.calendarWeeks.weeks.children).forEach((el, index) => {\n el.textContent = getWeek(addWeeks(startOfWeek, index));\n });\n }\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const current = addDays(this.start, index);\n const date = new Date(current);\n const day = date.getDay();\n\n el.className = `datepicker-cell ${this.cellClass}`;\n el.dataset.date = current;\n el.textContent = date.getDate();\n\n if (current < this.first) {\n classList.add('prev');\n } else if (current > this.last) {\n classList.add('next');\n }\n if (this.today === current) {\n classList.add('today');\n }\n if (current < this.minDate || current > this.maxDate || this.disabled.includes(current)) {\n classList.add('disabled');\n }\n if (this.daysOfWeekDisabled.includes(day)) {\n classList.add('disabled');\n pushUnique(this.disabled, current);\n }\n if (this.daysOfWeekHighlighted.includes(day)) {\n classList.add('highlighted');\n }\n if (this.range) {\n const [rangeStart, rangeEnd] = this.range;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n }\n if (this.selected.includes(current)) {\n classList.add('selected');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, current, current);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const [rangeStart, rangeEnd] = this.range || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'focused');\n });\n Array.from(this.grid.children).forEach((el) => {\n const current = Number(el.dataset.date);\n const classList = el.classList;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n if (this.selected.includes(current)) {\n classList.add('selected');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n const index = Math.round((this.focused - this.start) / 86400000);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }\n}\n","import {hasProperty, pushUnique, createTagRepeat} from '../../lib/utils.js';\nimport {dateValue} from '../../lib/date.js';\nimport {parseHTML} from '../../lib/dom.js';\nimport View from './View.js';\n\nfunction computeMonthRange(range, thisYear) {\n if (!range || !range[0] || !range[1]) {\n return;\n }\n\n const [[startY, startM], [endY, endM]] = range;\n if (startY > thisYear || endY < thisYear) {\n return;\n }\n return [\n startY === thisYear ? startM : -1,\n endY === thisYear ? endM : 12,\n ];\n}\n\nexport default class MonthsView extends View {\n constructor(picker) {\n super(picker, {\n id: 1,\n name: 'months',\n cellClass: 'month',\n });\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n this.grid = this.element;\n this.element.classList.add('months', 'datepicker-grid');\n this.grid.appendChild(parseHTML(createTagRepeat('span', 12, {'data-month': ix => ix})));\n }\n super.init(options);\n }\n\n setOptions(options) {\n if (options.locale) {\n this.monthNames = options.locale.monthsShort;\n }\n if (hasProperty(options, 'minDate')) {\n if (options.minDate === undefined) {\n this.minYear = this.minMonth = this.minDate = undefined;\n } else {\n const minDateObj = new Date(options.minDate);\n this.minYear = minDateObj.getFullYear();\n this.minMonth = minDateObj.getMonth();\n this.minDate = minDateObj.setDate(1);\n }\n }\n if (hasProperty(options, 'maxDate')) {\n if (options.maxDate === undefined) {\n this.maxYear = this.maxMonth = this.maxDate = undefined;\n } else {\n const maxDateObj = new Date(options.maxDate);\n this.maxYear = maxDateObj.getFullYear();\n this.maxMonth = maxDateObj.getMonth();\n this.maxDate = dateValue(this.maxYear, this.maxMonth + 1, 0);\n }\n }\n if (options.beforeShowMonth !== undefined) {\n this.beforeShow = typeof options.beforeShowMonth === 'function'\n ? options.beforeShowMonth\n : undefined;\n }\n }\n\n // Update view's settings to reflect the viewDate set on the picker\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n this.year = viewDate.getFullYear();\n this.focused = viewDate.getMonth();\n }\n\n // Update view's settings to reflect the selected dates\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates.reduce((selected, timeValue) => {\n const date = new Date(timeValue);\n const year = date.getFullYear();\n const month = date.getMonth();\n if (selected[year] === undefined) {\n selected[year] = [month];\n } else {\n pushUnique(selected[year], month);\n }\n return selected;\n }, {});\n if (rangepicker && rangepicker.dates) {\n this.range = rangepicker.dates.map(timeValue => {\n const date = new Date(timeValue);\n return isNaN(date) ? undefined : [date.getFullYear(), date.getMonth()];\n });\n }\n }\n\n // Update the entire view UI\n render() {\n // refresh disabled months on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [];\n\n this.picker.setViewSwitchLabel(this.year);\n this.picker.setPrevBtnDisabled(this.year <= this.minYear);\n this.picker.setNextBtnDisabled(this.year >= this.maxYear);\n\n const selected = this.selected[this.year] || [];\n const yrOutOfRange = this.year < this.minYear || this.year > this.maxYear;\n const isMinYear = this.year === this.minYear;\n const isMaxYear = this.year === this.maxYear;\n const range = computeMonthRange(this.range, this.year);\n\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const date = dateValue(this.year, index, 1);\n\n el.className = `datepicker-cell ${this.cellClass}`;\n if (this.isMinView) {\n el.dataset.date = date;\n }\n // reset text on every render to clear the custom content set\n // by beforeShow hook at previous render\n el.textContent = this.monthNames[index];\n\n if (\n yrOutOfRange\n || isMinYear && index < this.minMonth\n || isMaxYear && index > this.maxMonth\n ) {\n classList.add('disabled');\n }\n if (range) {\n const [rangeStart, rangeEnd] = range;\n if (index > rangeStart && index < rangeEnd) {\n classList.add('range');\n }\n if (index === rangeStart) {\n classList.add('range-start');\n }\n if (index === rangeEnd) {\n classList.add('range-end');\n }\n }\n if (selected.includes(index)) {\n classList.add('selected');\n }\n if (index === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, index, date);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const selected = this.selected[this.year] || [];\n const [rangeStart, rangeEnd] = computeMonthRange(this.range, this.year) || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'focused');\n });\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n if (index > rangeStart && index < rangeEnd) {\n classList.add('range');\n }\n if (index === rangeStart) {\n classList.add('range-start');\n }\n if (index === rangeEnd) {\n classList.add('range-end');\n }\n if (selected.includes(index)) {\n classList.add('selected');\n }\n if (index === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[this.focused].classList.add('focused');\n }\n}","import {hasProperty, pushUnique, createTagRepeat} from '../../lib/utils.js';\nimport {dateValue, startOfYearPeriod} from '../../lib/date.js';\nimport {parseHTML} from '../../lib/dom.js';\nimport View from './View.js';\n\nfunction toTitleCase(word) {\n return [...word].reduce((str, ch, ix) => str += ix ? ch : ch.toUpperCase(), '');\n}\n\n// Class representing the years and decades view elements\nexport default class YearsView extends View {\n constructor(picker, config) {\n super(picker, config);\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n this.navStep = this.step * 10;\n this.beforeShowOption = `beforeShow${toTitleCase(this.cellClass)}`;\n this.grid = this.element;\n this.element.classList.add(this.name, 'datepicker-grid');\n this.grid.appendChild(parseHTML(createTagRepeat('span', 12)));\n }\n super.init(options);\n }\n\n setOptions(options) {\n if (hasProperty(options, 'minDate')) {\n if (options.minDate === undefined) {\n this.minYear = this.minDate = undefined;\n } else {\n this.minYear = startOfYearPeriod(options.minDate, this.step);\n this.minDate = dateValue(this.minYear, 0, 1);\n }\n }\n if (hasProperty(options, 'maxDate')) {\n if (options.maxDate === undefined) {\n this.maxYear = this.maxDate = undefined;\n } else {\n this.maxYear = startOfYearPeriod(options.maxDate, this.step);\n this.maxDate = dateValue(this.maxYear, 11, 31);\n }\n }\n if (options[this.beforeShowOption] !== undefined) {\n const beforeShow = options[this.beforeShowOption];\n this.beforeShow = typeof beforeShow === 'function' ? beforeShow : undefined;\n }\n }\n\n // Update view's settings to reflect the viewDate set on the picker\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const first = startOfYearPeriod(viewDate, this.navStep);\n const last = first + 9 * this.step;\n\n this.first = first;\n this.last = last;\n this.start = first - this.step;\n this.focused = startOfYearPeriod(viewDate, this.step);\n }\n\n // Update view's settings to reflect the selected dates\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates.reduce((years, timeValue) => {\n return pushUnique(years, startOfYearPeriod(timeValue, this.step));\n }, []);\n if (rangepicker && rangepicker.dates) {\n this.range = rangepicker.dates.map(timeValue => {\n if (timeValue !== undefined) {\n return startOfYearPeriod(timeValue, this.step);\n }\n });\n }\n }\n\n // Update the entire view UI\n render() {\n // refresh disabled years on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [];\n\n this.picker.setViewSwitchLabel(`${this.first}-${this.last}`);\n this.picker.setPrevBtnDisabled(this.first <= this.minYear);\n this.picker.setNextBtnDisabled(this.last >= this.maxYear);\n\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const current = this.start + (index * this.step);\n const date = dateValue(current, 0, 1);\n\n el.className = `datepicker-cell ${this.cellClass}`;\n if (this.isMinView) {\n el.dataset.date = date;\n }\n el.textContent = el.dataset.year = current;\n\n if (index === 0) {\n classList.add('prev');\n } else if (index === 11) {\n classList.add('next');\n }\n if (current < this.minYear || current > this.maxYear) {\n classList.add('disabled');\n }\n if (this.range) {\n const [rangeStart, rangeEnd] = this.range;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n }\n if (this.selected.includes(current)) {\n classList.add('selected');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, current, date);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const [rangeStart, rangeEnd] = this.range || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'focused');\n });\n Array.from(this.grid.children).forEach((el) => {\n const current = Number(el.textContent);\n const classList = el.classList;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n if (this.selected.includes(current)) {\n classList.add('selected');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n const index = Math.round((this.focused - this.start) / this.step);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }\n}\n","import {limitToRange} from '../lib/utils.js';\nimport {addMonths, addYears} from '../lib/date.js';\n\nexport function triggerDatepickerEvent(datepicker, type) {\n const detail = {\n date: datepicker.getDate(),\n viewDate: new Date(datepicker.picker.viewDate),\n viewId: datepicker.picker.currentView.id,\n datepicker,\n };\n datepicker.element.dispatchEvent(new CustomEvent(type, {detail}));\n}\n\n// direction: -1 (to previous), 1 (to next)\nexport function goToPrevOrNext(datepicker, direction) {\n const {minDate, maxDate} = datepicker.config;\n const {currentView, viewDate} = datepicker.picker;\n let newViewDate;\n switch (currentView.id) {\n case 0:\n newViewDate = addMonths(viewDate, direction);\n break;\n case 1:\n newViewDate = addYears(viewDate, direction);\n break;\n default:\n newViewDate = addYears(viewDate, direction * currentView.navStep);\n }\n newViewDate = limitToRange(newViewDate, minDate, maxDate);\n datepicker.picker.changeFocus(newViewDate).render();\n}\n\nexport function switchView(datepicker) {\n const viewId = datepicker.picker.currentView.id;\n if (viewId === datepicker.config.maxView) {\n return;\n }\n datepicker.picker.changeView(viewId + 1).render();\n}\n\nexport function unfocus(datepicker) {\n if (datepicker.config.updateOnBlur) {\n datepicker.update({autohide: true});\n } else {\n datepicker.refresh('input');\n datepicker.hide();\n }\n}\n","import {today, addMonths, addYears} from '../lib/date.js';\nimport {findElementInEventPath} from '../lib/event.js';\nimport {goToPrevOrNext, switchView} from './functions.js';\n\nfunction goToSelectedMonthOrYear(datepicker, selection) {\n const picker = datepicker.picker;\n const viewDate = new Date(picker.viewDate);\n const viewId = picker.currentView.id;\n const newDate = viewId === 1\n ? addMonths(viewDate, selection - viewDate.getMonth())\n : addYears(viewDate, selection - viewDate.getFullYear());\n\n picker.changeFocus(newDate).changeView(viewId - 1).render();\n}\n\nexport function onClickTodayBtn(datepicker) {\n const picker = datepicker.picker;\n const currentDate = today();\n if (datepicker.config.todayBtnMode === 1) {\n if (datepicker.config.autohide) {\n datepicker.setDate(currentDate);\n return;\n }\n datepicker.setDate(currentDate, {render: false});\n picker.update();\n }\n if (picker.viewDate !== currentDate) {\n picker.changeFocus(currentDate);\n }\n picker.changeView(0).render();\n}\n\nexport function onClickClearBtn(datepicker) {\n datepicker.setDate({clear: true});\n}\n\nexport function onClickViewSwitch(datepicker) {\n switchView(datepicker);\n}\n\nexport function onClickPrevBtn(datepicker) {\n goToPrevOrNext(datepicker, -1);\n}\n\nexport function onClickNextBtn(datepicker) {\n goToPrevOrNext(datepicker, 1);\n}\n\n// For the picker's main block to delegete the events from `datepicker-cell`s\nexport function onClickView(datepicker, ev) {\n const target = findElementInEventPath(ev, '.datepicker-cell');\n if (!target || target.classList.contains('disabled')) {\n return;\n }\n\n const {id, isMinView} = datepicker.picker.currentView;\n if (isMinView) {\n datepicker.setDate(Number(target.dataset.date));\n } else if (id === 1) {\n goToSelectedMonthOrYear(datepicker, Number(target.dataset.month));\n } else {\n goToSelectedMonthOrYear(datepicker, Number(target.dataset.year));\n }\n}\n\nexport function onClickPicker(datepicker) {\n if (!datepicker.inline && !datepicker.config.disableTouchKeyboard) {\n datepicker.inputField.focus();\n }\n}\n","import {hasProperty, lastItemOf, isInRange, limitToRange} from '../lib/utils.js';\nimport {today} from '../lib/date.js';\nimport {parseHTML, showElement, hideElement, emptyChildNodes} from '../lib/dom.js';\nimport {registerListeners} from '../lib/event.js';\nimport pickerTemplate from './templates/pickerTemplate.js';\nimport DaysView from './views/DaysView.js';\nimport MonthsView from './views/MonthsView.js';\nimport YearsView from './views/YearsView.js';\nimport {triggerDatepickerEvent} from '../events/functions.js';\nimport {\n onClickTodayBtn,\n onClickClearBtn,\n onClickViewSwitch,\n onClickPrevBtn,\n onClickNextBtn,\n onClickView,\n onClickPicker,\n} from '../events/pickerListeners.js';\n\nfunction processPickerOptions(picker, options) {\n if (options.title !== undefined) {\n if (options.title) {\n picker.controls.title.textContent = options.title;\n showElement(picker.controls.title);\n } else {\n picker.controls.title.textContent = '';\n hideElement(picker.controls.title);\n }\n }\n if (options.prevArrow) {\n const prevBtn = picker.controls.prevBtn;\n emptyChildNodes(prevBtn);\n options.prevArrow.forEach((node) => {\n prevBtn.appendChild(node.cloneNode(true));\n });\n }\n if (options.nextArrow) {\n const nextBtn = picker.controls.nextBtn;\n emptyChildNodes(nextBtn);\n options.nextArrow.forEach((node) => {\n nextBtn.appendChild(node.cloneNode(true));\n });\n }\n if (options.locale) {\n picker.controls.todayBtn.textContent = options.locale.today;\n picker.controls.clearBtn.textContent = options.locale.clear;\n }\n if (options.todayBtn !== undefined) {\n if (options.todayBtn) {\n showElement(picker.controls.todayBtn);\n } else {\n hideElement(picker.controls.todayBtn);\n }\n }\n if (hasProperty(options, 'minDate') || hasProperty(options, 'maxDate')) {\n const {minDate, maxDate} = picker.datepicker.config;\n picker.controls.todayBtn.disabled = !isInRange(today(), minDate, maxDate);\n }\n if (options.clearBtn !== undefined) {\n if (options.clearBtn) {\n showElement(picker.controls.clearBtn);\n } else {\n hideElement(picker.controls.clearBtn);\n }\n }\n}\n\n// Compute view date to reset, which will be...\n// - the last item of the selected dates or defaultViewDate if no selection\n// - limitted to minDate or maxDate if it exceeds the range\nfunction computeResetViewDate(datepicker) {\n const {dates, config} = datepicker;\n const viewDate = dates.length > 0 ? lastItemOf(dates) : config.defaultViewDate;\n return limitToRange(viewDate, config.minDate, config.maxDate);\n}\n\n// Change current view's view date\nfunction setViewDate(picker, newDate) {\n const oldViewDate = new Date(picker.viewDate);\n const newViewDate = new Date(newDate);\n const {id, year, first, last} = picker.currentView;\n const viewYear = newViewDate.getFullYear();\n\n picker.viewDate = newDate;\n if (viewYear !== oldViewDate.getFullYear()) {\n triggerDatepickerEvent(picker.datepicker, 'changeYear');\n }\n if (newViewDate.getMonth() !== oldViewDate.getMonth()) {\n triggerDatepickerEvent(picker.datepicker, 'changeMonth');\n }\n\n // return whether the new date is in different period on time from the one\n // displayed in the current view\n // when true, the view needs to be re-rendered on the next UI refresh.\n switch (id) {\n case 0:\n return newDate < first || newDate > last;\n case 1:\n return viewYear !== year;\n default:\n return viewYear < first || viewYear > last;\n }\n}\n\nfunction getTextDirection(el) {\n return window.getComputedStyle(el).direction;\n}\n\n// Class representing the picker UI\nexport default class Picker {\n constructor(datepicker) {\n this.datepicker = datepicker;\n\n const template = pickerTemplate.replace(/%buttonClass%/g, datepicker.config.buttonClass);\n const element = this.element = parseHTML(template).firstChild;\n const [header, main, footer] = element.firstChild.children;\n const title = header.firstElementChild;\n const [prevBtn, viewSwitch, nextBtn] = header.lastElementChild.children;\n const [todayBtn, clearBtn] = footer.firstChild.children;\n const controls = {\n title,\n prevBtn,\n viewSwitch,\n nextBtn,\n todayBtn,\n clearBtn,\n };\n this.main = main;\n this.controls = controls;\n\n const elementClass = datepicker.inline ? 'inline' : 'dropdown';\n element.classList.add(`datepicker-${elementClass}`);\n\n processPickerOptions(this, datepicker.config);\n this.viewDate = computeResetViewDate(datepicker);\n\n // set up event listeners\n registerListeners(datepicker, [\n [element, 'click', onClickPicker.bind(null, datepicker), {capture: true}],\n [main, 'click', onClickView.bind(null, datepicker)],\n [controls.viewSwitch, 'click', onClickViewSwitch.bind(null, datepicker)],\n [controls.prevBtn, 'click', onClickPrevBtn.bind(null, datepicker)],\n [controls.nextBtn, 'click', onClickNextBtn.bind(null, datepicker)],\n [controls.todayBtn, 'click', onClickTodayBtn.bind(null, datepicker)],\n [controls.clearBtn, 'click', onClickClearBtn.bind(null, datepicker)],\n ]);\n\n // set up views\n this.views = [\n new DaysView(this),\n new MonthsView(this),\n new YearsView(this, {id: 2, name: 'years', cellClass: 'year', step: 1}),\n new YearsView(this, {id: 3, name: 'decades', cellClass: 'decade', step: 10}),\n ];\n this.currentView = this.views[datepicker.config.startView];\n\n this.currentView.render();\n this.main.appendChild(this.currentView.element);\n datepicker.config.container.appendChild(this.element);\n }\n\n setOptions(options) {\n processPickerOptions(this, options);\n this.views.forEach((view) => {\n view.init(options, false);\n });\n this.currentView.render();\n }\n\n detach() {\n this.datepicker.config.container.removeChild(this.element);\n }\n\n show() {\n if (this.active) {\n return;\n }\n this.element.classList.add('active');\n this.active = true;\n\n const datepicker = this.datepicker;\n if (!datepicker.inline) {\n // ensure picker's direction matches input's\n const inputDirection = getTextDirection(datepicker.inputField);\n if (inputDirection !== getTextDirection(datepicker.config.container)) {\n this.element.dir = inputDirection;\n } else if (this.element.dir) {\n this.element.removeAttribute('dir');\n }\n\n this.place();\n if (datepicker.config.disableTouchKeyboard) {\n datepicker.inputField.blur();\n }\n }\n triggerDatepickerEvent(datepicker, 'show');\n }\n\n hide() {\n if (!this.active) {\n return;\n }\n this.datepicker.exitEditMode();\n this.element.classList.remove('active');\n this.active = false;\n triggerDatepickerEvent(this.datepicker, 'hide');\n }\n\n place() {\n const {classList, style} = this.element;\n const {config, inputField} = this.datepicker;\n const container = config.container;\n const {\n width: calendarWidth,\n height: calendarHeight,\n } = this.element.getBoundingClientRect();\n const {\n left: containerLeft,\n top: containerTop,\n width: containerWidth,\n } = container.getBoundingClientRect();\n const {\n left: inputLeft,\n top: inputTop,\n width: inputWidth,\n height: inputHeight\n } = inputField.getBoundingClientRect();\n let {x: orientX, y: orientY} = config.orientation;\n let scrollTop;\n let left;\n let top;\n\n if (container === document.body) {\n scrollTop = window.scrollY;\n left = inputLeft + window.scrollX;\n top = inputTop + scrollTop;\n } else {\n scrollTop = container.scrollTop;\n left = inputLeft - containerLeft;\n top = inputTop - containerTop + scrollTop;\n }\n\n if (orientX === 'auto') {\n if (left < 0) {\n // align to the left and move into visible area if input's left edge < window's\n orientX = 'left';\n left = 10;\n } else if (left + calendarWidth > containerWidth) {\n // align to the right if canlendar's right edge > container's\n orientX = 'right';\n } else {\n orientX = getTextDirection(inputField) === 'rtl' ? 'right' : 'left';\n }\n }\n if (orientX === 'right') {\n left -= calendarWidth - inputWidth;\n }\n\n if (orientY === 'auto') {\n orientY = top - calendarHeight < scrollTop ? 'bottom' : 'top';\n }\n if (orientY === 'top') {\n top -= calendarHeight;\n } else {\n top += inputHeight;\n }\n\n classList.remove(\n 'datepicker-orient-top',\n 'datepicker-orient-bottom',\n 'datepicker-orient-right',\n 'datepicker-orient-left'\n );\n classList.add(`datepicker-orient-${orientY}`, `datepicker-orient-${orientX}`);\n\n style.top = top ? `${top}px` : top;\n style.left = left ? `${left}px` : left;\n }\n\n setViewSwitchLabel(labelText) {\n this.controls.viewSwitch.textContent = labelText;\n }\n\n setPrevBtnDisabled(disabled) {\n this.controls.prevBtn.disabled = disabled;\n }\n\n setNextBtnDisabled(disabled) {\n this.controls.nextBtn.disabled = disabled;\n }\n\n changeView(viewId) {\n const oldView = this.currentView;\n const newView = this.views[viewId];\n if (newView.id !== oldView.id) {\n this.currentView = newView;\n this._renderMethod = 'render';\n triggerDatepickerEvent(this.datepicker, 'changeView');\n this.main.replaceChild(newView.element, oldView.element);\n }\n return this;\n }\n\n // Change the focused date (view date)\n changeFocus(newViewDate) {\n this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refreshFocus';\n this.views.forEach((view) => {\n view.updateFocus();\n });\n return this;\n }\n\n // Apply the change of the selected dates\n update() {\n const newViewDate = computeResetViewDate(this.datepicker);\n this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refresh';\n this.views.forEach((view) => {\n view.updateFocus();\n view.updateSelection();\n });\n return this;\n }\n\n // Refresh the picker UI\n render(quickRender = true) {\n const renderMethod = (quickRender && this._renderMethod) || 'render';\n delete this._renderMethod;\n\n this.currentView[renderMethod]();\n }\n}\n","import {isInRange} from '../lib/utils.js';\nimport {addDays, addMonths, addYears, startOfYearPeriod} from '../lib/date.js';\nimport {goToPrevOrNext, switchView, unfocus} from './functions.js';\n\n// Find the closest date that doesn't meet the condition for unavailable date\n// Returns undefined if no available date is found\n// addFn: function to calculate the next date\n// - args: time value, amount\n// increase: amount to pass to addFn\n// testFn: function to test the unavailablity of the date\n// - args: time value; retun: true if unavailable\nfunction findNextAvailableOne(date, addFn, increase, testFn, min, max) {\n if (!isInRange(date, min, max)) {\n return;\n }\n if (testFn(date)) {\n const newDate = addFn(date, increase);\n return findNextAvailableOne(newDate, addFn, increase, testFn, min, max);\n }\n return date;\n}\n\n// direction: -1 (left/up), 1 (right/down)\n// vertical: true for up/down, false for left/right\nfunction moveByArrowKey(datepicker, ev, direction, vertical) {\n const picker = datepicker.picker;\n const currentView = picker.currentView;\n const step = currentView.step || 1;\n let viewDate = picker.viewDate;\n let addFn;\n let testFn;\n switch (currentView.id) {\n case 0:\n if (vertical) {\n viewDate = addDays(viewDate, direction * 7);\n } else if (ev.ctrlKey || ev.metaKey) {\n viewDate = addYears(viewDate, direction);\n } else {\n viewDate = addDays(viewDate, direction);\n }\n addFn = addDays;\n testFn = (date) => currentView.disabled.includes(date);\n break;\n case 1:\n viewDate = addMonths(viewDate, vertical ? direction * 4 : direction);\n addFn = addMonths;\n testFn = (date) => {\n const dt = new Date(date);\n const {year, disabled} = currentView;\n return dt.getFullYear() === year && disabled.includes(dt.getMonth());\n };\n break;\n default:\n viewDate = addYears(viewDate, direction * (vertical ? 4 : 1) * step);\n addFn = addYears;\n testFn = date => currentView.disabled.includes(startOfYearPeriod(date, step));\n }\n viewDate = findNextAvailableOne(\n viewDate,\n addFn,\n direction < 0 ? -step : step,\n testFn,\n currentView.minDate,\n currentView.maxDate\n );\n if (viewDate !== undefined) {\n picker.changeFocus(viewDate).render();\n }\n}\n\nexport function onKeydown(datepicker, ev) {\n if (ev.key === 'Tab') {\n unfocus(datepicker);\n return;\n }\n\n const picker = datepicker.picker;\n const {id, isMinView} = picker.currentView;\n if (!picker.active) {\n switch (ev.key) {\n case 'ArrowDown':\n case 'Escape':\n picker.show();\n break;\n case 'Enter':\n datepicker.update();\n break;\n default:\n return;\n }\n } else if (datepicker.editMode) {\n switch (ev.key) {\n case 'Escape':\n picker.hide();\n break;\n case 'Enter':\n datepicker.exitEditMode({update: true, autohide: datepicker.config.autohide});\n break;\n default:\n return;\n }\n } else {\n switch (ev.key) {\n case 'Escape':\n picker.hide();\n break;\n case 'ArrowLeft':\n if (ev.ctrlKey || ev.metaKey) {\n goToPrevOrNext(datepicker, -1);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, -1, false);\n }\n break;\n case 'ArrowRight':\n if (ev.ctrlKey || ev.metaKey) {\n goToPrevOrNext(datepicker, 1);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, 1, false);\n }\n break;\n case 'ArrowUp':\n if (ev.ctrlKey || ev.metaKey) {\n switchView(datepicker);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, -1, true);\n }\n break;\n case 'ArrowDown':\n if (ev.shiftKey && !ev.ctrlKey && !ev.metaKey) {\n datepicker.enterEditMode();\n return;\n }\n moveByArrowKey(datepicker, ev, 1, true);\n break;\n case 'Enter':\n if (isMinView) {\n datepicker.setDate(picker.viewDate);\n } else {\n picker.changeView(id - 1).render();\n }\n break;\n case 'Backspace':\n case 'Delete':\n datepicker.enterEditMode();\n return;\n default:\n if (ev.key.length === 1 && !ev.ctrlKey && !ev.metaKey) {\n datepicker.enterEditMode();\n }\n return;\n }\n }\n ev.preventDefault();\n ev.stopPropagation();\n}\n\nexport function onFocus(datepicker) {\n if (datepicker.config.showOnFocus && !datepicker._showing) {\n datepicker.show();\n }\n}\n\n// for the prevention for entering edit mode while getting focus on click\nexport function onMousedown(datepicker, ev) {\n const el = ev.target;\n if (datepicker.picker.active || datepicker.config.showOnClick) {\n el._active = el === document.activeElement;\n el._clicking = setTimeout(() => {\n delete el._active;\n delete el._clicking;\n }, 2000);\n }\n}\n\nexport function onClickInput(datepicker, ev) {\n const el = ev.target;\n if (!el._clicking) {\n return;\n }\n clearTimeout(el._clicking);\n delete el._clicking;\n\n if (el._active) {\n datepicker.enterEditMode();\n }\n delete el._active;\n\n if (datepicker.config.showOnClick) {\n datepicker.show();\n }\n}\n\nexport function onPaste(datepicker, ev) {\n if (ev.clipboardData.types.includes('text/plain')) {\n datepicker.enterEditMode();\n }\n}\n","import {findElementInEventPath} from '../lib/event.js';\nimport {unfocus} from './functions.js';\n\n// for the `document` to delegate the events from outside the picker/input field\nexport function onClickOutside(datepicker, ev) {\n const element = datepicker.element;\n if (element !== document.activeElement) {\n return;\n }\n const pickerElem = datepicker.picker.element;\n if (findElementInEventPath(ev, el => el === element || el === pickerElem)) {\n return;\n }\n unfocus(datepicker);\n}\n","import {lastItemOf, stringToArray, isInRange} from './lib/utils.js';\nimport {today} from './lib/date.js';\nimport {parseDate, formatDate} from './lib/date-format.js';\nimport {registerListeners, unregisterListeners} from './lib/event.js';\nimport {locales} from './i18n/base-locales.js';\nimport defaultOptions from './options/defaultOptions.js';\nimport processOptions from './options/processOptions.js';\nimport Picker from './picker/Picker.js';\nimport {triggerDatepickerEvent} from './events/functions.js';\nimport {onKeydown, onFocus, onMousedown, onClickInput, onPaste} from './events/inputFieldListeners.js';\nimport {onClickOutside} from './events/otherListeners.js';\n\nfunction stringifyDates(dates, config) {\n return dates\n .map(dt => formatDate(dt, config.format, config.locale))\n .join(config.dateDelimiter);\n}\n\n// parse input dates and create an array of time values for selection\n// returns undefined if there are no valid dates in inputDates\n// when origDates (current selection) is passed, the function works to mix\n// the input dates into the current selection\nfunction processInputDates(datepicker, inputDates, clear = false) {\n const {config, dates: origDates, rangepicker} = datepicker;\n if (inputDates.length === 0) {\n // empty input is considered valid unless origiDates is passed\n return clear ? [] : undefined;\n }\n\n const rangeEnd = rangepicker && datepicker === rangepicker.datepickers[1];\n let newDates = inputDates.reduce((dates, dt) => {\n let date = parseDate(dt, config.format, config.locale);\n if (date === undefined) {\n return dates;\n }\n if (config.pickLevel > 0) {\n // adjust to 1st of the month/Jan 1st of the year\n // or to the last day of the monh/Dec 31st of the year if the datepicker\n // is the range-end picker of a rangepicker\n const dt = new Date(date);\n if (config.pickLevel === 1) {\n date = rangeEnd\n ? dt.setMonth(dt.getMonth() + 1, 0)\n : dt.setDate(1);\n } else {\n date = rangeEnd\n ? dt.setFullYear(dt.getFullYear() + 1, 0, 0)\n : dt.setMonth(0, 1);\n }\n }\n if (\n isInRange(date, config.minDate, config.maxDate)\n && !dates.includes(date)\n && !config.datesDisabled.includes(date)\n && !config.daysOfWeekDisabled.includes(new Date(date).getDay())\n ) {\n dates.push(date);\n }\n return dates;\n }, []);\n if (newDates.length === 0) {\n return;\n }\n if (config.multidate && !clear) {\n // get the synmetric difference between origDates and newDates\n newDates = newDates.reduce((dates, date) => {\n if (!origDates.includes(date)) {\n dates.push(date);\n }\n return dates;\n }, origDates.filter(date => !newDates.includes(date)));\n }\n // do length check always because user can input multiple dates regardless of the mode\n return config.maxNumberOfDates && newDates.length > config.maxNumberOfDates\n ? newDates.slice(config.maxNumberOfDates * -1)\n : newDates;\n}\n\n// refresh the UI elements\n// modes: 1: input only, 2, picker only, 3 both\nfunction refreshUI(datepicker, mode = 3, quickRender = true) {\n const {config, picker, inputField} = datepicker;\n if (mode & 2) {\n const newView = picker.active ? config.pickLevel : config.startView;\n picker.update().changeView(newView).render(quickRender);\n }\n if (mode & 1 && inputField) {\n inputField.value = stringifyDates(datepicker.dates, config);\n }\n}\n\nfunction setDate(datepicker, inputDates, options) {\n let {clear, render, autohide} = options;\n if (render === undefined) {\n render = true;\n }\n if (!render) {\n autohide = false;\n } else if (autohide === undefined) {\n autohide = datepicker.config.autohide;\n }\n\n const newDates = processInputDates(datepicker, inputDates, clear);\n if (!newDates) {\n return;\n }\n if (newDates.toString() !== datepicker.dates.toString()) {\n datepicker.dates = newDates;\n refreshUI(datepicker, render ? 3 : 1);\n triggerDatepickerEvent(datepicker, 'changeDate');\n } else {\n refreshUI(datepicker, 1);\n }\n if (autohide) {\n datepicker.hide();\n }\n}\n\n/**\n * Class representing a date picker\n */\nexport default class Datepicker {\n /**\n * Create a date picker\n * @param {Element} element - element to bind a date picker\n * @param {Object} [options] - config options\n * @param {DateRangePicker} [rangepicker] - DateRangePicker instance the\n * date picker belongs to. Use this only when creating date picker as a part\n * of date range picker\n */\n constructor(element, options = {}, rangepicker = undefined) {\n element.datepicker = this;\n this.element = element;\n\n // set up config\n const config = this.config = Object.assign({\n buttonClass: (options.buttonClass && String(options.buttonClass)) || 'button',\n container: document.body,\n defaultViewDate: today(),\n maxDate: undefined,\n minDate: undefined,\n }, processOptions(defaultOptions, this));\n this._options = options;\n Object.assign(config, processOptions(options, this));\n\n // configure by type\n const inline = this.inline = element.tagName !== 'INPUT';\n let inputField;\n let initialDates;\n\n if (inline) {\n config.container = element;\n initialDates = stringToArray(element.dataset.date, config.dateDelimiter);\n delete element.dataset.date;\n } else {\n const container = options.container ? document.querySelector(options.container) : null;\n if (container) {\n config.container = container;\n }\n inputField = this.inputField = element;\n inputField.classList.add('datepicker-input');\n initialDates = stringToArray(inputField.value, config.dateDelimiter);\n }\n if (rangepicker) {\n // check validiry\n const index = rangepicker.inputs.indexOf(inputField);\n const datepickers = rangepicker.datepickers;\n if (index < 0 || index > 1 || !Array.isArray(datepickers)) {\n throw Error('Invalid rangepicker object.');\n }\n // attach itaelf to the rangepicker here so that processInputDates() can\n // determine if this is the range-end picker of the rangepicker while\n // setting inital values when pickLevel > 0\n datepickers[index] = this;\n // add getter for rangepicker\n Object.defineProperty(this, 'rangepicker', {\n get() {\n return rangepicker;\n },\n });\n }\n\n // set initial dates\n this.dates = [];\n // process initial value\n const inputDateValues = processInputDates(this, initialDates);\n if (inputDateValues && inputDateValues.length > 0) {\n this.dates = inputDateValues;\n }\n if (inputField) {\n inputField.value = stringifyDates(this.dates, config);\n }\n\n const picker = this.picker = new Picker(this);\n\n if (inline) {\n this.show();\n } else {\n // set up event listeners in other modes\n const onMousedownDocument = onClickOutside.bind(null, this);\n const listeners = [\n [inputField, 'keydown', onKeydown.bind(null, this)],\n [inputField, 'focus', onFocus.bind(null, this)],\n [inputField, 'mousedown', onMousedown.bind(null, this)],\n [inputField, 'click', onClickInput.bind(null, this)],\n [inputField, 'paste', onPaste.bind(null, this)],\n [document, 'mousedown', onMousedownDocument],\n [document, 'touchstart', onMousedownDocument],\n [window, 'resize', picker.place.bind(picker)]\n ];\n registerListeners(this, listeners);\n }\n }\n\n /**\n * Format Date object or time value in given format and language\n * @param {Date|Number} date - date or time value to format\n * @param {String|Object} format - format string or object that contains\n * toDisplay() custom formatter, whose signature is\n * - args:\n * - date: {Date} - Date instance of the date passed to the method\n * - format: {Object} - the format object passed to the method\n * - locale: {Object} - locale for the language specified by `lang`\n * - return:\n * {String} formatted date\n * @param {String} [lang=en] - language code for the locale to use\n * @return {String} formatted date\n */\n static formatDate(date, format, lang) {\n return formatDate(date, format, lang && locales[lang] || locales.en);\n }\n\n /**\n * Parse date string\n * @param {String|Date|Number} dateStr - date string, Date object or time\n * value to parse\n * @param {String|Object} format - format string or object that contains\n * toValue() custom parser, whose signature is\n * - args:\n * - dateStr: {String|Date|Number} - the dateStr passed to the method\n * - format: {Object} - the format object passed to the method\n * - locale: {Object} - locale for the language specified by `lang`\n * - return:\n * {Date|Number} parsed date or its time value\n * @param {String} [lang=en] - language code for the locale to use\n * @return {Number} time value of parsed date\n */\n static parseDate(dateStr, format, lang) {\n return parseDate(dateStr, format, lang && locales[lang] || locales.en);\n }\n\n /**\n * @type {Object} - Installed locales in `[languageCode]: localeObject` format\n * en`:_English (US)_ is pre-installed.\n */\n static get locales() {\n return locales;\n }\n\n /**\n * @type {Boolean} - Whether the picker element is shown. `true` whne shown\n */\n get active() {\n return !!(this.picker && this.picker.active);\n }\n\n /**\n * @type {HTMLDivElement} - DOM object of picker element\n */\n get pickerElement() {\n return this.picker ? this.picker.element : undefined;\n }\n\n /**\n * Set new values to the config options\n * @param {Object} options - config options to update\n */\n setOptions(options) {\n const picker = this.picker;\n const newOptions = processOptions(options, this);\n Object.assign(this._options, options);\n Object.assign(this.config, newOptions);\n picker.setOptions(newOptions);\n\n refreshUI(this, 3);\n }\n\n /**\n * Show the picker element\n */\n show() {\n if (this.inputField) {\n if (this.inputField.disabled) {\n return;\n }\n if (this.inputField !== document.activeElement) {\n this._showing = true;\n this.inputField.focus();\n delete this._showing;\n }\n }\n this.picker.show();\n }\n\n /**\n * Hide the picker element\n * Not available on inline picker\n */\n hide() {\n if (this.inline) {\n return;\n }\n this.picker.hide();\n this.picker.update().changeView(this.config.startView).render();\n }\n\n /**\n * Destroy the Datepicker instance\n * @return {Detepicker} - the instance destroyed\n */\n destroy() {\n this.hide();\n unregisterListeners(this);\n this.picker.detach();\n if (!this.inline) {\n this.inputField.classList.remove('datepicker-input');\n }\n delete this.element.datepicker;\n return this;\n }\n\n /**\n * Get the selected date(s)\n *\n * The method returns a Date object of selected date by default, and returns\n * an array of selected dates in multidate mode. If format string is passed,\n * it returns date string(s) formatted in given format.\n *\n * @param {String} [format] - Format string to stringify the date(s)\n * @return {Date|String|Date[]|String[]} - selected date(s), or if none is\n * selected, empty array in multidate mode and untitled in sigledate mode\n */\n getDate(format = undefined) {\n const callback = format\n ? date => formatDate(date, format, this.config.locale)\n : date => new Date(date);\n\n if (this.config.multidate) {\n return this.dates.map(callback);\n }\n if (this.dates.length > 0) {\n return callback(this.dates[0]);\n }\n }\n\n /**\n * Set selected date(s)\n *\n * In multidate mode, you can pass multiple dates as a series of arguments\n * or an array. (Since each date is parsed individually, the type of the\n * dates doesn't have to be the same.)\n * The given dates are used to toggle the select status of each date. The\n * number of selected dates is kept from exceeding the length set to\n * maxNumberOfDates.\n *\n * With clear: true option, the method can be used to clear the selection\n * and to replace the selection instead of toggling in multidate mode.\n * If the option is passed with no date arguments or an empty dates array,\n * it works as \"clear\" (clear the selection then set nothing), and if the\n * option is passed with new dates to select, it works as \"replace\" (clear\n * the selection then set the given dates)\n *\n * When render: false option is used, the method omits re-rendering the\n * picker element. In this case, you need to call refresh() method later in\n * order for the picker element to reflect the changes. The input field is\n * refreshed always regardless of this option.\n *\n * When invalid (unparsable, repeated, disabled or out-of-range) dates are\n * passed, the method ignores them and applies only valid ones. In the case\n * that all the given dates are invalid, which is distinguished from passing\n * no dates, the method considers it as an error and leaves the selection\n * untouched.\n *\n * @param {...(Date|Number|String)|Array} [dates] - Date strings, Date\n * objects, time values or mix of those for new selection\n * @param {Object} [options] - function options\n * - clear: {boolean} - Whether to clear the existing selection\n * defualt: false\n * - render: {boolean} - Whether to re-render the picker element\n * default: true\n * - autohide: {boolean} - Whether to hide the picker element after re-render\n * Ignored when used with render: false\n * default: config.autohide\n */\n setDate(...args) {\n const dates = [...args];\n const opts = {};\n const lastArg = lastItemOf(args);\n if (\n typeof lastArg === 'object'\n && !Array.isArray(lastArg)\n && !(lastArg instanceof Date)\n && lastArg\n ) {\n Object.assign(opts, dates.pop());\n }\n\n const inputDates = Array.isArray(dates[0]) ? dates[0] : dates;\n setDate(this, inputDates, opts);\n }\n\n /**\n * Update the selected date(s) with input field's value\n * Not available on inline picker\n *\n * The input field will be refreshed with properly formatted date string.\n *\n * @param {Object} [options] - function options\n * - autohide: {boolean} - whether to hide the picker element after refresh\n * default: false\n */\n update(options = undefined) {\n if (this.inline) {\n return;\n }\n\n const opts = {clear: true, autohide: !!(options && options.autohide)};\n const inputDates = stringToArray(this.inputField.value, this.config.dateDelimiter);\n setDate(this, inputDates, opts);\n }\n\n /**\n * Refresh the picker element and the associated input field\n * @param {String} [target] - target item when refreshing one item only\n * 'picker' or 'input'\n * @param {Boolean} [forceRender] - whether to re-render the picker element\n * regardless of its state instead of optimized refresh\n */\n refresh(target = undefined, forceRender = false) {\n if (target && typeof target !== 'string') {\n forceRender = target;\n target = undefined;\n }\n\n let mode;\n if (target === 'picker') {\n mode = 2;\n } else if (target === 'input') {\n mode = 1;\n } else {\n mode = 3;\n }\n refreshUI(this, mode, !forceRender);\n }\n\n /**\n * Enter edit mode\n * Not available on inline picker or when the picker element is hidden\n */\n enterEditMode() {\n if (this.inline || !this.picker.active || this.editMode) {\n return;\n }\n this.editMode = true;\n this.inputField.classList.add('in-edit');\n }\n\n /**\n * Exit from edit mode\n * Not available on inline picker\n * @param {Object} [options] - function options\n * - update: {boolean} - whether to call update() after exiting\n * If false, input field is revert to the existing selection\n * default: false\n */\n exitEditMode(options = undefined) {\n if (this.inline || !this.editMode) {\n return;\n }\n const opts = Object.assign({update: false}, options);\n delete this.editMode;\n this.inputField.classList.remove('in-edit');\n if (opts.update) {\n this.update(opts);\n }\n }\n}\n","'use strict';\n\nimport { Datepicker } from 'vanillajs-datepicker'; \n\nconst inputElement = document.querySelector('.form-control__input--date');\n\nif ($(inputElement).length > 0) {\n const datepickerDefault = {\n autohide: true,\n startView: 2\n };\n if (inputElement.dataset.milliseconds) {\n const now = new Date();\n const nowTime = new Date(now.getTime() - Number(inputElement.dataset.milliseconds));\n datepickerDefault.maxDate = nowTime;\n delete inputElement.dataset.milliseconds;\n }\n const currentConfig = { ...datepickerDefault, ...inputElement.dataset };\n inputElement.datepicker = new Datepicker(inputElement, currentConfig);\n}"],"sourceRoot":""}