| Current Path : /proc/thread-self/cwd/static/adminhtml/Magento/backend/it_IT/js/bundle/ |
| Current File : //proc/thread-self/cwd/static/adminhtml/Magento/backend/it_IT/js/bundle/bundle5.js |
require.config({"config": {
"jsbuild":{"Magento_Swatches/js/text.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'jquery',\n 'mage/template',\n 'uiRegistry',\n 'jquery/ui',\n 'prototype',\n 'validation'\n], function (jQuery, mageTemplate, rg) {\n 'use strict';\n\n return function (config) {\n var swatchOptionTextDefaultInputType = 'radio',\n swatchTextOption = {\n table: $('swatch-text-options-table'),\n itemCount: 0,\n totalItems: 0,\n rendered: 0,\n isReadOnly: config.isReadOnly,\n template: mageTemplate('#swatch-text-row-template'),\n\n /**\n * Add option\n *\n * @param {Object} data\n * @param {Object} render\n */\n add: function (data, render) {\n var isNewOption = false,\n element;\n\n if (typeof data.id == 'undefined') {\n data = {\n 'id': 'option_' + this.itemCount,\n 'sort_order': this.itemCount + 1\n };\n isNewOption = true;\n }\n\n if (!data.intype) {\n data.intype = swatchOptionTextDefaultInputType;\n }\n\n element = this.template({\n data: data\n });\n\n if (isNewOption && !this.isReadOnly) {\n this.enableNewOptionDeleteButton(data.id);\n }\n this.itemCount++;\n this.totalItems++;\n this.elements += element;\n\n if (render) {\n this.render();\n }\n },\n\n /**\n * Remove option\n *\n * @param {Object} event\n */\n remove: function (event) {\n var element = $(Event.findElement(event, 'tr')),\n elementFlags; // !!! Button already have table parent in safari\n\n // Safari workaround\n element.ancestors().each(function (parentItem) {\n if (parentItem.hasClassName('option-row')) {\n element = parentItem;\n throw $break;\n } else if (parentItem.hasClassName('box')) {\n throw $break;\n }\n });\n\n if (element) {\n elementFlags = element.getElementsByClassName('delete-flag');\n\n if (elementFlags[0]) {\n elementFlags[0].value = 1;\n }\n\n element.addClassName('no-display');\n element.addClassName('template');\n element.hide();\n this.totalItems--;\n this.updateItemsCountField();\n }\n },\n\n /**\n * Update items count field\n */\n updateItemsCountField: function () {\n $('swatch-text-option-count-check').value = this.totalItems > 0 ? '1' : '';\n },\n\n /**\n * Enable delete button for new option\n *\n * @param {String} id\n */\n enableNewOptionDeleteButton: function (id) {\n $$('#delete_button_swatch_container_' + id + ' button').each(function (button) {\n button.enable();\n button.removeClassName('disabled');\n });\n },\n\n /**\n * Bind remove button\n */\n bindRemoveButtons: function () {\n jQuery('#swatch-text-options-panel').on('click', '.delete-option', this.remove.bind(this));\n },\n\n /**\n * Render action\n */\n render: function () {\n Element.insert($$('[data-role=swatch-text-options-container]')[0], this.elements);\n this.elements = '';\n },\n\n /**\n * Render action with delay (performance fix)\n *\n * @param {Object} data\n * @param {Number} from\n * @param {Number} step\n * @param {Number} delay\n * @returns {Boolean}\n */\n renderWithDelay: function (data, from, step, delay) {\n var arrayLength = data.length,\n len;\n\n for (len = from + step; from < len && from < arrayLength; from++) {\n this.add(data[from]);\n }\n this.render();\n\n if (from === arrayLength) {\n this.updateItemsCountField();\n this.rendered = 1;\n jQuery('body').trigger('processStop');\n\n return true;\n }\n setTimeout(this.renderWithDelay.bind(this, data, from, step, delay), delay);\n },\n\n /**\n * Ignore validate action\n */\n ignoreValidate: function () {\n var ignore = '.ignore-validate input, ' +\n '.ignore-validate select, ' +\n '.ignore-validate textarea';\n\n jQuery('#edit_form').data('validator').settings.forceIgnore = ignore;\n }\n };\n\n if ($('add_new_swatch_text_option_button')) {\n Event.observe(\n 'add_new_swatch_text_option_button',\n 'click',\n swatchTextOption.add.bind(swatchTextOption, true)\n );\n }\n jQuery('#swatch-text-options-panel').on('render', function () {\n swatchTextOption.ignoreValidate();\n\n if (swatchTextOption.rendered) {\n return false;\n }\n jQuery('body').trigger('processStart');\n swatchTextOption.renderWithDelay(config.attributesData, 0, 100, 300);\n swatchTextOption.bindRemoveButtons();\n });\n\n if (config.isSortable) {\n jQuery(function ($) {\n $('[data-role=swatch-text-options-container]').sortable({\n distance: 8,\n tolerance: 'pointer',\n cancel: 'input, button',\n axis: 'y',\n\n /**\n * Update components\n */\n update: function () {\n $('[data-role=swatch-text-options-container] [data-role=order]').each(\n function (index, element) {\n $(element).val(index + 1);\n }\n );\n }\n });\n });\n }\n\n jQuery(function () {\n if (jQuery('#frontend_input').val() !== 'swatch_text') {\n jQuery('.swatch-text-field-0').removeClass('required-option');\n }\n });\n\n window.swatchTextOption = swatchTextOption;\n window.swatchOptionTextDefaultInputType = swatchOptionTextDefaultInputType;\n\n rg.set('swatch-text-options-panel', swatchTextOption);\n };\n});\n","Magento_Swatches/js/visual.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* global FORM_KEY */\n\n/**\n * @api\n */\ndefine([\n 'jquery',\n 'mage/template',\n 'uiRegistry',\n 'jquery/colorpicker/js/colorpicker',\n 'prototype',\n 'jquery/ui',\n 'validation'\n], function (jQuery, mageTemplate, rg) {\n 'use strict';\n\n return function (config) {\n var swatchOptionVisualDefaultInputType = 'radio',\n swatchVisualOption = {\n table: $('swatch-visual-options-table'),\n itemCount: 0,\n totalItems: 0,\n rendered: 0,\n isReadOnly: config.isReadOnly,\n template: mageTemplate('#swatch-visual-row-template'),\n\n /**\n * Add new option using template\n *\n * @param {Object} data\n * @param {Object} render\n */\n add: function (data, render) {\n var isNewOption = false,\n element;\n\n if (typeof data.id == 'undefined') {\n data = {\n 'id': 'option_' + this.itemCount,\n 'sort_order': this.itemCount + 1,\n 'empty_class': 'unavailable'\n };\n isNewOption = true;\n } else if (data.defaultswatch0 === '') {\n data['empty_class'] = 'unavailable';\n }\n\n if (!data.intype) {\n data.intype = swatchOptionVisualDefaultInputType;\n }\n\n element = this.template({\n data: data\n });\n\n if (isNewOption && !this.isReadOnly) {\n this.enableNewOptionDeleteButton(data.id);\n }\n this.itemCount++;\n this.totalItems++;\n this.elements += element;\n\n if (render) {\n this.render();\n }\n },\n\n /**\n * ColorPicker initialization process\n */\n initColorPicker: function () {\n var element = this,\n hiddenColorPicker = !jQuery(element).data('colorpickerId');\n\n jQuery(this).ColorPicker({\n\n /**\n * ColorPicker onShow action\n */\n onShow: function () {\n var color = jQuery(element).parent().parent().prev().prev('input').val(),\n menu = jQuery(this).parents('.swatch_sub-menu_container');\n\n menu.hide();\n jQuery(element).ColorPickerSetColor(color);\n },\n\n /**\n * ColorPicker onSubmit action\n *\n * @param {String} hsb\n * @param {String} hex\n * @param {String} rgb\n * @param {String} el\n */\n onSubmit: function (hsb, hex, rgb, el) {\n var container = jQuery(el).parent().parent().prev();\n\n jQuery(el).ColorPickerHide();\n container.parent().removeClass('unavailable');\n container.prev('input').val('#' + hex);\n container.css('background', '#' + hex);\n }\n });\n\n if (hiddenColorPicker) {\n jQuery(this).ColorPickerShow();\n }\n },\n\n /**\n * Remove action\n *\n * @param {Object} event\n */\n remove: function (event) {\n var element = $(Event.findElement(event, 'tr')),\n elementFlags; // !!! Button already have table parent in safari\n\n // Safari workaround\n element.ancestors().each(function (parentItem) {\n if (parentItem.hasClassName('option-row')) {\n element = parentItem;\n throw $break;\n } else if (parentItem.hasClassName('box')) {\n throw $break;\n }\n });\n\n if (element) {\n elementFlags = element.getElementsByClassName('delete-flag');\n\n if (elementFlags[0]) {\n elementFlags[0].value = 1;\n }\n\n element.addClassName('no-display');\n element.addClassName('template');\n element.hide();\n this.totalItems--;\n this.updateItemsCountField();\n }\n },\n\n /**\n * Update items count field\n */\n updateItemsCountField: function () {\n $('swatch-visual-option-count-check').value = this.totalItems > 0 ? '1' : '';\n },\n\n /**\n * Enable delete button for new option\n *\n * @param {String} id\n */\n enableNewOptionDeleteButton: function (id) {\n $$('#delete_button_swatch_container_' + id + ' button').each(function (button) {\n button.enable();\n button.removeClassName('disabled');\n });\n },\n\n /**\n * Bind remove button\n */\n bindRemoveButtons: function () {\n jQuery('#swatch-visual-options-panel').on('click', '.delete-option', this.remove.bind(this));\n },\n\n /**\n * Render options\n */\n render: function () {\n Element.insert($$('[data-role=swatch-visual-options-container]')[0], this.elements);\n this.elements = '';\n },\n\n /**\n * Render elements with delay (performance fix)\n *\n * @param {Object} data\n * @param {Number} from\n * @param {Number} step\n * @param {Number} delay\n * @returns {Boolean}\n */\n renderWithDelay: function (data, from, step, delay) {\n var arrayLength = data.length,\n len;\n\n for (len = from + step; from < len && from < arrayLength; from++) {\n this.add(data[from]);\n }\n this.render();\n\n if (from === arrayLength) {\n this.updateItemsCountField();\n this.rendered = 1;\n jQuery('body').trigger('processStop');\n\n return true;\n }\n setTimeout(this.renderWithDelay.bind(this, data, from, step, delay), delay);\n },\n\n /**\n * Ignore validate action\n */\n ignoreValidate: function () {\n var ignore = '.ignore-validate input, ' +\n '.ignore-validate select, ' +\n '.ignore-validate textarea';\n\n jQuery('#edit_form').data('validator').settings.forceIgnore = ignore;\n }\n };\n\n if ($('add_new_swatch_visual_option_button')) {\n Event.observe(\n 'add_new_swatch_visual_option_button',\n 'click',\n swatchVisualOption.add.bind(swatchVisualOption, {}, true)\n );\n }\n\n jQuery('#swatch-visual-options-panel').on('render', function () {\n swatchVisualOption.ignoreValidate();\n\n if (swatchVisualOption.rendered) {\n return false;\n }\n jQuery('body').trigger('processStart');\n swatchVisualOption.renderWithDelay(config.attributesData, 0, 100, 300);\n swatchVisualOption.bindRemoveButtons();\n jQuery('#swatch-visual-options-panel').on(\n 'click',\n '.colorpicker_handler',\n swatchVisualOption.initColorPicker\n );\n });\n jQuery('body').on('click', function (event) {\n var element = jQuery(event.target);\n\n if (\n element.parents('.swatch_sub-menu_container').length === 1 ||\n element.next('div.swatch_sub-menu_container').length === 1\n ) {\n return true;\n }\n jQuery('.swatch_sub-menu_container').hide();\n });\n\n if (config.isSortable) {\n jQuery(function ($) {\n $('[data-role=swatch-visual-options-container]').sortable({\n distance: 8,\n tolerance: 'pointer',\n cancel: 'input, button',\n axis: 'y',\n\n /**\n * Update component\n */\n update: function () {\n $('[data-role=swatch-visual-options-container] [data-role=order]').each(\n function (index, element) {\n $(element).val(index + 1);\n }\n );\n }\n });\n });\n }\n\n window.swatchVisualOption = swatchVisualOption;\n window.swatchOptionVisualDefaultInputType = swatchOptionVisualDefaultInputType;\n\n rg.set('swatch-visual-options-panel', swatchVisualOption);\n\n jQuery(function ($) {\n\n var swatchComponents = {\n\n /**\n * div wrapper for to hide all evement\n */\n wrapper: null,\n\n /**\n * iframe component to perform file upload without page reload\n */\n iframe: null,\n\n /**\n * form component for upload image\n */\n form: null,\n\n /**\n * Input file component for upload image\n */\n inputFile: null,\n\n /**\n * Create swatch component for upload files\n *\n * @this {swatchComponents}\n * @public\n */\n create: function () {\n this.wrapper = $('<div>').css({\n display: 'none'\n }).appendTo($('body'));\n\n this.iframe = $('<iframe></iframe>', {\n id: 'upload_iframe',\n name: 'upload_iframe'\n }).appendTo(this.wrapper);\n\n this.form = $('<form></form>', {\n id: 'swatch_form_image_upload',\n name: 'swatch_form_image_upload',\n target: 'upload_iframe',\n method: 'post',\n enctype: 'multipart/form-data',\n class: 'ignore-validate',\n action: config.uploadActionUrl\n }).appendTo(this.wrapper);\n\n this.inputFile = $('<input />', {\n type: 'file',\n name: 'datafile',\n class: 'swatch_option_file'\n }).appendTo(this.form);\n\n $('<input />', {\n type: 'hidden',\n name: 'form_key',\n value: FORM_KEY\n }).appendTo(this.form);\n }\n };\n\n /**\n * Create swatch components\n */\n swatchComponents.create();\n\n /**\n * Register event for swatch input[type=file] change\n */\n swatchComponents.inputFile.change(function () {\n var container = $('#' + $(this).attr('data-called-by')).parents().eq(2).children('.swatch_window'),\n\n /**\n * @this {iframe}\n */\n iframeHandler = function () {\n var imageParams = $.parseJSON($(this).contents().find('body').html()),\n fullMediaUrl = imageParams['swatch_path'] + imageParams['file_path'];\n\n container.prev('input').val(imageParams['file_path']);\n container.css({\n 'background-image': 'url(' + fullMediaUrl + ')',\n 'background-size': 'cover'\n });\n container.parent().removeClass('unavailable');\n };\n\n swatchComponents.iframe.off('load');\n swatchComponents.iframe.on('load', iframeHandler);\n swatchComponents.form.submit();\n $(this).val('');\n });\n\n /**\n * Register event for choose \"upload image\" option\n */\n $(document).on('click', '.btn_choose_file_upload', function () {\n swatchComponents.inputFile.attr('data-called-by', $(this).attr('id'));\n swatchComponents.inputFile.trigger('click');\n });\n\n /**\n * Register event for remove option\n */\n $(document).on('click', '.btn_remove_swatch', function () {\n var optionPanel = $(this).parents().eq(2);\n\n optionPanel.children('input').val('');\n optionPanel.children('.swatch_window').css('background', '');\n\n optionPanel.addClass('unavailable');\n\n jQuery('.swatch_sub-menu_container').hide();\n });\n\n /**\n * Toggle color upload chooser\n */\n $(document).on('click', '.swatches-visual-col', function () {\n var currentElement = $(this).find('.swatch_sub-menu_container');\n\n jQuery('.swatch_sub-menu_container').not(currentElement).hide();\n currentElement.toggle();\n });\n });\n };\n});\n","Magento_Swatches/js/form/element/swatch-visual.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* global FORM_KEY */\n\n/**\n * @api\n */\ndefine([\n 'underscore',\n 'Magento_Ui/js/lib/view/utils/async',\n 'mage/template',\n 'uiRegistry',\n 'prototype',\n 'Magento_Ui/js/form/element/abstract',\n 'jquery/colorpicker/js/colorpicker',\n 'jquery/ui'\n], function (_, jQuery, mageTemplate, rg, prototype, Abstract) {\n 'use strict';\n\n /**\n * Former implementation.\n *\n * @param {*} value\n * @param {Object} container\n * @param {String} uploadUrl\n * @param {String} elementName\n */\n function oldCode(value, container, uploadUrl, elementName) {\n var swatchVisualOption = {\n itemCount: 0,\n totalItems: 0,\n rendered: 0,\n isReadOnly: false,\n\n /**\n * Initialize.\n */\n initialize: function () {\n if (_.isEmpty(value)) {\n container.addClassName('unavailable');\n }\n\n jQuery(container).on(\n 'click',\n '.colorpicker_handler',\n this.initColorPicker\n );\n },\n\n /**\n * ColorPicker initialization process\n */\n initColorPicker: function () {\n var element = this,\n hiddenColorPicker = !jQuery(element).data('colorpickerId');\n\n jQuery(this).ColorPicker({\n\n /**\n * ColorPicker onShow action\n */\n onShow: function () {\n var color = jQuery(element).parent().parent().prev().prev('input').val(),\n menu = jQuery(this).parents('.swatch_sub-menu_container');\n\n menu.hide();\n jQuery(element).ColorPickerSetColor(color);\n },\n\n /**\n * ColorPicker onSubmit action\n *\n * @param {String} hsb\n * @param {String} hex\n * @param {String} rgb\n * @param {String} el\n */\n onSubmit: function (hsb, hex, rgb, el) {\n var localContainer = jQuery(el).parent().parent().prev();\n\n jQuery(el).ColorPickerHide();\n localContainer.parent().removeClass('unavailable');\n localContainer.prev('input').val('#' + hex).trigger('change');\n localContainer.css('background', '#' + hex);\n }\n });\n\n if (hiddenColorPicker) {\n jQuery(this).ColorPickerShow();\n }\n },\n\n /**\n * Remove action\n *\n * @param {Object} event\n */\n remove: function (event) {\n var element = $(Event.findElement(event, 'tr')),\n elementFlags; // !!! Button already have table parent in safari\n\n // Safari workaround\n element.ancestors().each(function (parentItem) {\n if (parentItem.hasClassName('option-row')) {\n element = parentItem;\n throw $break;\n } else if (parentItem.hasClassName('box')) {\n throw $break;\n }\n });\n\n if (element) {\n elementFlags = element.getElementsByClassName('delete-flag');\n\n if (elementFlags[0]) {\n elementFlags[0].value = 1;\n }\n\n element.addClassName('no-display');\n element.addClassName('template');\n element.hide();\n this.totalItems--;\n this.updateItemsCountField();\n }\n },\n\n /**\n * Update items count field\n */\n updateItemsCountField: function () {\n $('swatch-visual-option-count-check').value = this.totalItems > 0 ? '1' : '';\n }\n };\n\n //swatchVisualOption.initColorPicker();\n\n jQuery('body').on('click', function (event) {\n var element = jQuery(event.target);\n\n if (\n element.parents('.swatch_sub-menu_container').length === 1 ||\n element.next('div.swatch_sub-menu_container').length === 1\n ) {\n return true;\n }\n jQuery('.swatch_sub-menu_container').hide();\n });\n\n jQuery(function ($) {\n\n var swatchComponents = {\n\n /**\n * div wrapper for to hide all evement\n */\n wrapper: null,\n\n /**\n * iframe component to perform file upload without page reload\n */\n iframe: null,\n\n /**\n * form component for upload image\n */\n form: null,\n\n /**\n * Input file component for upload image\n */\n inputFile: null,\n\n /**\n * Create swatch component for upload files\n *\n * @this {swatchComponents}\n * @public\n */\n create: function () {\n this.wrapper = $('<div>').css({\n display: 'none'\n }).appendTo($('body'));\n\n this.iframe = $('<iframe></iframe>', {\n name: 'upload_iframe_' + elementName\n }).appendTo(this.wrapper);\n\n this.form = $('<form></form>', {\n name: 'swatch_form_image_upload_' + elementName,\n target: 'upload_iframe_' + elementName,\n method: 'post',\n enctype: 'multipart/form-data',\n class: 'ignore-validate',\n action: uploadUrl\n }).appendTo(this.wrapper);\n\n this.inputFile = $('<input />', {\n type: 'file',\n name: 'datafile',\n class: 'swatch_option_file'\n }).appendTo(this.form);\n\n $('<input />', {\n type: 'hidden',\n name: 'form_key',\n value: FORM_KEY\n }).appendTo(this.form);\n }\n };\n\n swatchVisualOption.initialize();\n\n /**\n * Create swatch components\n */\n swatchComponents.create();\n\n /**\n * Register event for swatch input[type=file] change\n */\n swatchComponents.inputFile.change(function () {\n var localContainer = $('.' + $(this).attr('data-called-by')).parents().eq(2).children('.swatch_window'),\n\n /**\n * @this {iframe}\n */\n iframeHandler = function () {\n var imageParams = $.parseJSON($(this).contents().find('body').html()),\n fullMediaUrl = imageParams['swatch_path'] + imageParams['file_path'];\n\n localContainer.prev('input').val(imageParams['file_path']).trigger('change');\n localContainer.css({\n 'background-image': 'url(' + fullMediaUrl + ')',\n 'background-size': 'cover'\n });\n localContainer.parent().removeClass('unavailable');\n };\n\n swatchComponents.iframe.off('load');\n swatchComponents.iframe.on('load', iframeHandler);\n swatchComponents.form.submit();\n $(this).val('');\n });\n\n /**\n * Register event for choose \"upload image\" option\n */\n $(container).on('click', '.btn_choose_file_upload', function () {\n swatchComponents.inputFile.attr('data-called-by', $(this).data('class'));\n swatchComponents.inputFile.trigger('click');\n });\n\n /**\n * Register event for remove option\n */\n $(container).on('click', '.btn_remove_swatch', function () {\n var optionPanel = $(this).parents().eq(2);\n\n optionPanel.children('input').val('').trigger('change');\n optionPanel.children('.swatch_window').css('background', '');\n optionPanel.addClass('unavailable');\n jQuery('.swatch_sub-menu_container').hide();\n });\n\n /**\n * Toggle color upload chooser\n */\n $(container).on('click', '.swatch_window', function () {\n jQuery('.swatch_sub-menu_container').hide();\n $(this).next('div').toggle();\n });\n });\n }\n\n return Abstract.extend({\n defaults: {\n elementId: 0,\n prefixName: '',\n prefixElementName: '',\n elementName: '',\n value: '',\n uploadUrl: ''\n },\n\n /**\n * Parses options and merges the result with instance\n *\n * @returns {Object} Chainable.\n */\n initConfig: function () {\n this._super();\n\n this.configureDataScope();\n\n return this;\n },\n\n /**\n * Initialize.\n *\n * @returns {Object} Chainable.\n */\n initialize: function () {\n this._super()\n .initOldCode()\n .on('value', this.onChangeColor.bind(this));\n\n return this;\n },\n\n /**\n * Handler function that execute when color changes.\n *\n * @param {String} data - color\n */\n onChangeColor: function (data) {\n if (!data) {\n jQuery('.' + this.elementName).parent().removeClass('unavailable');\n }\n },\n\n /**\n * Initialize wrapped former implementation.\n *\n * @returns {Object} Chainable.\n */\n initOldCode: function () {\n jQuery.async('.' + this.elementName, this.name, function (elem) {\n oldCode(this.value(), elem.parentElement, this.uploadUrl, this.elementName);\n }.bind(this));\n\n return this;\n },\n\n /**\n * Configure data scope.\n */\n configureDataScope: function () {\n var recordId, prefixName;\n\n // Get recordId\n recordId = this.parentName.split('.').last();\n\n prefixName = this.dataScopeToHtmlArray(this.prefixName);\n this.elementName = this.prefixElementName + recordId;\n\n this.inputName = prefixName + '[' + this.elementName + ']';\n this.exportDataLink = 'data.' + this.prefixName + '.' + this.elementName;\n this.exports.value = this.provider + ':' + this.exportDataLink;\n },\n\n /** @inheritdoc */\n destroy: function () {\n this._super();\n\n this.source.remove(this.exportDataLink);\n },\n\n /**\n * Get HTML array from data scope.\n *\n * @param {String} dataScopeString\n * @returns {String}\n */\n dataScopeToHtmlArray: function (dataScopeString) {\n var dataScopeArray, dataScope, reduceFunction;\n\n /**\n * Add new level of nesting.\n *\n * @param {String} prev\n * @param {String} curr\n * @returns {String}\n */\n reduceFunction = function (prev, curr) {\n return prev + '[' + curr + ']';\n };\n\n dataScopeArray = dataScopeString.split('.');\n\n dataScope = dataScopeArray.shift();\n dataScope += dataScopeArray.reduce(reduceFunction, '');\n\n return dataScope;\n }\n });\n});\n","Mageplaza_Blog/js/grid/columns/select.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license sliderConfig is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Blog\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'Magento_Ui/js/grid/columns/select'\r\n], function (Column) {\r\n 'use strict';\r\n\r\n return Column.extend({\r\n defaults: {\r\n bodyTmpl: 'ui/grid/cells/html'\r\n },\r\n getLabel: function (record) {\r\n var label = this._super(record);\r\n\r\n if (label !== '') {\r\n switch (record.status) {\r\n case '1':\r\n label = '<span class=\"grid-severity-notice\"><span>' + label + '</span></span>';\r\n break;\r\n case '2':\r\n label = '<span class=\"grid-severity-critical\"><span>' + label + '</span></span>';\r\n break;\r\n case '3':\r\n label = '<span class=\"grid-severity-minor\"><span>' + label + '</span></span>';\r\n break;\r\n }\r\n }\r\n return label;\r\n }\r\n });\r\n});","Mageplaza_Blog/js/grid/columns/enable.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license sliderConfig is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Blog\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'Magento_Ui/js/grid/columns/select'\r\n], function (Column) {\r\n 'use strict';\r\n\r\n return Column.extend({\r\n defaults: {\r\n bodyTmpl: 'ui/grid/cells/html'\r\n },\r\n getLabel: function (record) {\r\n var label = this._super(record);\r\n\r\n if (label !== '') {\r\n switch (record.enabled) {\r\n case '1':\r\n label = '<span class=\"grid-severity-notice\"><span>' + label + '</span></span>';\r\n break;\r\n case '0':\r\n label = '<span class=\"grid-severity-critical\"><span>' + label + '</span></span>';\r\n break;\r\n case '2':\r\n label = '<span class=\"grid-severity-critical\"><span>' + label + '</span></span>';\r\n break;\r\n }\r\n }\r\n return label;\r\n }\r\n });\r\n});","Mageplaza_Blog/js/view/author.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Blog\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'jquery',\r\n 'Magento_Ui/js/modal/modal',\r\n 'mage/translate'\r\n], function ($, modal, $t) {\r\n \"use strict\";\r\n\r\n $.widget('mageplaza.mpBlogAuthor', {\r\n options: {\r\n url: ''\r\n },\r\n isloaded: false,\r\n\r\n /**\r\n * This method constructs a new widget.\r\n * @private\r\n */\r\n _create: function () {\r\n this.initCustomerGrid();\r\n this.selectCustomer();\r\n },\r\n\r\n /**\r\n * Init popup\r\n * Popup will automatic open\r\n */\r\n initPopup: function () {\r\n var options = {\r\n type: 'popup',\r\n responsive: true,\r\n innerScroll: true,\r\n title: $t('Select Customer'),\r\n buttons: []\r\n },\r\n customerGridEl = $('#customer-grid');\r\n\r\n modal(options, customerGridEl);\r\n customerGridEl.modal('openModal');\r\n },\r\n\r\n /**\r\n * Init select customer\r\n */\r\n selectCustomer: function () {\r\n $('body').delegate('#customer-grid_table tbody tr', 'click', function () {\r\n var first_name = $(this).find('td:nth-child(3)').text().trim(),\r\n last_name = $(this).find('td:nth-child(4)').text().trim();\r\n\r\n $(\"#author_customer_id\").val($(this).find('input').val().trim());\r\n $(\"#author_customer\").val(first_name+' '+last_name);\r\n $('#customer-grid').data('mageModal').closeModal();\r\n });\r\n },\r\n\r\n /**\r\n * Init customer grid\r\n */\r\n initCustomerGrid: function () {\r\n var self = this;\r\n\r\n $(\"#author_customer\").click(function () {\r\n $.ajax({\r\n method: 'POST',\r\n url: self.options.url,\r\n data: {form_key: window.FORM_KEY},\r\n showLoader: true\r\n }).done(function (response) {\r\n $('#customer-grid').html(response);\r\n self.initPopup();\r\n });\r\n });\r\n }\r\n });\r\n\r\n return $.mageplaza.mpBlogAuthor;\r\n});\r\n\r\n","Mageplaza_Blog/js/components/new-category.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Blog\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'underscore',\r\n 'Magento_Catalog/js/components/new-category'\r\n], function (_, Category) {\r\n 'use strict';\r\n\r\n /**\r\n * Processing options list\r\n *\r\n * @param {Array} array - Property array\r\n * @param {String} separator - Level separator\r\n * @param {Array} created - list to add new options\r\n *\r\n * @return {Array} Plain options list\r\n */\r\n function flattenCollection(array, separator, created) {\r\n var i = 0,\r\n length,\r\n childCollection;\r\n\r\n array = _.compact(array);\r\n length = array.length;\r\n created = created || [];\r\n\r\n for (i; i < length; i++) {\r\n created.push(array[i]);\r\n\r\n if (array[i].hasOwnProperty(separator)) {\r\n childCollection = array[i][separator];\r\n delete array[i][separator];\r\n flattenCollection.call(this, childCollection, separator, created);\r\n }\r\n }\r\n\r\n return created;\r\n }\r\n\r\n return Category.extend({\r\n /**\r\n * Get path to current option\r\n *\r\n * @param {Object} data - option data\r\n * @returns {String} path\r\n */\r\n getPath: function (data) {\r\n var pathParts,\r\n createdPath = '';\r\n\r\n if (this.renderPath && typeof data.path !== \"undefined\") {\r\n pathParts = data.path.split('.');\r\n _.each(pathParts, function (curData) {\r\n createdPath = createdPath ? createdPath + ' / ' + curData : curData;\r\n });\r\n\r\n return createdPath;\r\n }\r\n },\r\n\r\n /**\r\n * Set option to options array.\r\n *\r\n * @param {Object} option\r\n * @param {Array} options\r\n */\r\n setOption: function (option, options) {\r\n // eslint-disable-next-line radix\r\n var parent = parseInt(option.parent),\r\n copyOptionsTree;\r\n\r\n if (_.contains([0, 1], parent)) {\r\n options = options || this.cacheOptions.tree;\r\n options.push(option);\r\n\r\n copyOptionsTree = JSON.parse(JSON.stringify(this.cacheOptions.tree));\r\n this.cacheOptions.plain = flattenCollection(copyOptionsTree, this.separator);\r\n this.options(this.cacheOptions.tree);\r\n } else {\r\n this._super(option, options);\r\n }\r\n }\r\n });\r\n});\r\n","Mageplaza_Blog/category/form.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Blog\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\n/*jshint jquery:true browser:true*/\r\n/*global Ajax:true alert:true*/\r\ndefine([\r\n \"jquery\",\r\n \"mage/backend/form\",\r\n \"jquery/ui\",\r\n \"prototype\"\r\n], function ($) {\r\n \"use strict\";\r\n\r\n $.widget(\"mage.categoryForm\", $.mage.form, {\r\n options: {\r\n categoryIdSelector: 'input[name=\"category[category_id]\"]',\r\n categoryPathSelector: 'input[name=\"category[path]\"]'\r\n },\r\n\r\n /**\r\n * Form creation\r\n * @protected\r\n */\r\n _create: function () {\r\n this._super();\r\n $('body').on('categoryMove.tree', $.proxy(this.refreshPath, this));\r\n },\r\n\r\n /**\r\n * Sending ajax to server to refresh field 'category[path]'\r\n * @protected\r\n */\r\n refreshPath: function () {\r\n var that = this;\r\n if (!this.element.find(this.options.categoryIdSelector).prop('value')) {\r\n return false;\r\n }\r\n $.ajax({\r\n type: 'POST',\r\n url: this.options.refreshUrl,\r\n dataType: 'json',\r\n data: {\r\n form_key: FORM_KEY\r\n }\r\n }).success(function (data) {\r\n that._refreshPathSuccess(data);\r\n });\r\n },\r\n _refreshPathSuccess: function (response) {\r\n if (response.error) {\r\n alert(response.message);\r\n } else {\r\n if (this.element.find(this.options.categoryIdSelector).prop('value') == response.id) {\r\n this.element.find(this.options.categoryPathSelector)\r\n .prop('value', response.path);\r\n }\r\n }\r\n }\r\n });\r\n\r\n return $.mage.categoryForm;\r\n});\r\n","Mageplaza_Blog/category/edit.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Blog\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'jquery',\r\n 'prototype',\r\n 'extjs/ext-tree-checkbox'\r\n], function (jQuery) {\r\n\r\n var categorySubmit = function (url, useAjax) {\r\n var activeTab = $('active_tab_id');\r\n if (activeTab) {\r\n if (activeTab.tabsJsObject && activeTab.tabsJsObject.tabs('activeAnchor')) {\r\n activeTab.value = activeTab.tabsJsObject.tabs('activeAnchor').prop('id');\r\n }\r\n }\r\n\r\n var params = {};\r\n var fields = $('category_edit_form').getElementsBySelector('input', 'select');\r\n for (var i = 0; i < fields.length; i++) {\r\n if (!fields[i].name) {\r\n continue;\r\n }\r\n params[fields[i].name] = fields[i].getValue();\r\n }\r\n\r\n // Get info about what we're submitting - to properly update tree nodes\r\n var categoryId = params['category[id]'] ? params['category[id]'] : 0;\r\n var isCreating = categoryId == 0; // Separate variable is needed because '0' in javascript converts to TRUE\r\n var path = params['category[path]'].split('/');\r\n var parentId = path.pop();\r\n if (parentId == categoryId) { // Maybe path includes Blog Category id itself\r\n parentId = path.pop();\r\n }\r\n\r\n // Make operations with Blog Category tree\r\n if (isCreating) {\r\n if (!Ext.tree.currentNodeId) {\r\n // First submit of form - select some node to be current\r\n Ext.tree.currentNodeId = parentId;\r\n }\r\n Ext.tree.addNodeTo = parentId;\r\n }\r\n\r\n // Submit form\r\n jQuery('#category_edit_form').trigger('submit');\r\n };\r\n\r\n return function (config, element) {\r\n config = config || {};\r\n jQuery(element).on('click', function (event) {\r\n categorySubmit(config.url, config.ajax);\r\n });\r\n };\r\n});\r\n","Magento_LoginAsCustomerAdminUi/js/confirmation-popup.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'uiComponent',\n 'Magento_Ui/js/modal/confirm',\n 'jquery',\n 'ko',\n 'mage/translate',\n 'mage/template',\n 'underscore',\n 'Magento_Ui/js/modal/alert',\n 'text!Magento_LoginAsCustomerAdminUi/template/confirmation-popup/store-view-ptions.html'\n], function (Component, confirm, $, ko, $t, template, _, alert, selectTpl) {\n\n 'use strict';\n\n return Component.extend({\n /**\n * Initialize Component\n */\n initialize: function () {\n var self = this,\n content;\n\n this._super();\n\n content = '<div class=\"message message-warning\">' + self.content + '</div>';\n\n if (self.showStoreViewOptions) {\n content = template(\n selectTpl,\n {\n data: {\n showStoreViewOptions: self.showStoreViewOptions,\n storeViewOptions: self.storeViewOptions,\n label: $t('Store')\n }\n }) + content;\n }\n\n /**\n * Confirmation popup\n *\n * @param {String} url\n * @returns {Boolean}\n */\n window.lacConfirmationPopup = function (url) {\n confirm({\n title: self.title,\n content: content,\n modalClass: 'confirm lac-confirm',\n actions: {\n /**\n * Confirm action.\n */\n confirm: function () {\n var storeId = $('#lac-confirmation-popup-store-id').val(),\n formKey = $('input[name=\"form_key\"]').val(),\n params = {};\n\n // jscs:disable requireCamelCaseOrUpperCaseIdentifiers\n if (storeId) {\n params.store_id = storeId;\n }\n\n if (formKey) {\n params.form_key = formKey;\n }\n // jscs:enable requireCamelCaseOrUpperCaseIdentifiers\n\n $.ajax({\n url: url,\n type: 'POST',\n dataType: 'json',\n data: params,\n showLoader: true,\n\n /**\n * Open redirect URL in new window, or show messages if they are present\n *\n * @param {Object} data\n */\n success: function (data) {\n var messages = data.messages || [];\n\n if (data.message) {\n messages.push(data.message);\n }\n\n if (data.redirectUrl) {\n window.open(data.redirectUrl);\n } else if (messages.length) {\n messages = messages.map(function (message) {\n return _.escape(message);\n });\n\n alert({\n content: messages.join('<br>')\n });\n }\n },\n\n /**\n * Show XHR response text\n *\n * @param {Object} jqXHR\n */\n error: function (jqXHR) {\n alert({\n content: _.escape(jqXHR.responseText)\n });\n }\n });\n }\n },\n buttons: [{\n text: $t('Cancel'),\n class: 'action-secondary action-dismiss',\n\n /**\n * Click handler.\n */\n click: function (event) {\n this.closeModal(event);\n }\n }, {\n text: $t('Login as Customer'),\n class: 'action-primary action-accept',\n\n /**\n * Click handler.\n */\n click: function (event) {\n this.closeModal(event, true);\n }\n }]\n });\n\n return false;\n };\n }\n });\n});\n","js-storage/storage-wrapper.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'js-storage/js.storage'\n], function ($, storage) {\n 'use strict';\n\n if (window.cookieStorage) {\n var cookiesConfig = window.cookiesConfig || {};\n\n $.extend(window.cookieStorage, {\n _secure: !!cookiesConfig.secure,\n _samesite: cookiesConfig.samesite ? cookiesConfig.samesite : 'lax',\n\n /**\n * Set value under name\n * @param {String} name\n * @param {String} value\n * @param {Object} [options]\n */\n setItem: function (name, value, options) {\n var _default = {\n expires: this._expires,\n path: this._path,\n domain: this._domain,\n secure: this._secure,\n samesite: this._samesite\n };\n\n $.cookie(this._prefix + name, value, $.extend(_default, options || {}));\n },\n\n /**\n * Set default options\n * @param {Object} c\n * @returns {storage}\n */\n setConf: function (c) {\n if (c.path) {\n this._path = c.path;\n }\n\n if (c.domain) {\n this._domain = c.domain;\n }\n\n if (c.expires) {\n this._expires = c.expires;\n }\n\n if (typeof c.secure !== 'undefined') {\n this._secure = c.secure;\n }\n\n if (typeof c.samesite !== 'undefined') {\n this._samesite = c.samesite;\n }\n\n return this;\n }\n });\n }\n\n $.alwaysUseJsonInStorage = $.alwaysUseJsonInStorage || storage.alwaysUseJsonInStorage;\n $.cookieStorage = $.cookieStorage || storage.cookieStorage;\n $.initNamespaceStorage = $.initNamespaceStorage || storage.initNamespaceStorage;\n $.localStorage = $.localStorage || storage.localStorage;\n $.namespaceStorages = $.namespaceStorages || storage.namespaceStorages;\n $.removeAllStorages = $.removeAllStorages || storage.removeAllStorages;\n $.sessionStorage = $.sessionStorage || storage.sessionStorage;\n});\n","js-storage/js.storage.js":"/*\n * JS Storage Plugin\n *\n * Copyright (c) 2019 Julien Maurel\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * Project home:\n * https://github.com/julien-maurel/js-storage\n *\n * Version: 1.1.0\n */\n(function (factory) {\n var registeredInModuleLoader = false;\n if (typeof define === 'function' && define.amd) {\n define(['jquery', 'jquery/jquery.cookie'], factory);\n registeredInModuleLoader = true;\n }\n if (typeof exports === 'object') {\n module.exports = factory();\n registeredInModuleLoader = true;\n }\n if (!registeredInModuleLoader) {\n var OldStorages = window.Storages;\n var api = window.Storages = factory();\n api.noConflict = function () {\n window.Storages = OldStorages;\n return api;\n };\n }\n}(function () {\n // Variables used by utilities functions (like isPlainObject...)\n var class2type = {};\n var toString = class2type.toString;\n var hasOwn = class2type.hasOwnProperty;\n var fnToString = hasOwn.toString;\n var ObjectFunctionString = fnToString.call(Object);\n var getProto = Object.getPrototypeOf;\n var apis = {};\n\n // Prefix to use with cookie fallback\n var cookie_local_prefix = \"ls_\";\n var cookie_session_prefix = \"ss_\";\n\n // Get items from a storage\n function _get() {\n var storage = this._type, l = arguments.length, s = window[storage], a = arguments, a0 = a[0], vi, ret, tmp, i, j;\n if (l < 1) {\n throw new Error('Minimum 1 argument must be given');\n } else if (Array.isArray(a0)) {\n // If second argument is an array, return an object with value of storage for each item in this array\n ret = {};\n for (i in a0) {\n if (a0.hasOwnProperty(i)) {\n vi = a0[i];\n try {\n ret[vi] = JSON.parse(s.getItem(vi));\n } catch (e) {\n ret[vi] = s.getItem(vi);\n }\n }\n }\n return ret;\n } else if (l == 1) {\n // If only 1 argument, return value directly\n try {\n return JSON.parse(s.getItem(a0));\n } catch (e) {\n return s.getItem(a0);\n }\n } else {\n // If more than 1 argument, parse storage to retrieve final value to return it\n // Get first level\n try {\n ret = JSON.parse(s.getItem(a0));\n if (!ret) {\n throw new ReferenceError(a0 + ' is not defined in this storage');\n }\n } catch (e) {\n throw new ReferenceError(a0 + ' is not defined in this storage');\n }\n // Parse next levels\n for (i = 1; i < l - 1; i++) {\n ret = ret[a[i]];\n if (ret === undefined) {\n throw new ReferenceError([].slice.call(a, 0, i + 1).join('.') + ' is not defined in this storage');\n }\n }\n // If last argument is an array, return an object with value for each item in this array\n // Else return value normally\n if (Array.isArray(a[i])) {\n tmp = ret;\n ret = {};\n for (j in a[i]) {\n if (a[i].hasOwnProperty(j)) {\n ret[a[i][j]] = tmp[a[i][j]];\n }\n }\n return ret;\n } else {\n return ret[a[i]];\n }\n }\n }\n\n // Set items of a storage\n function _set() {\n var storage = this._type, l = arguments.length, s = window[storage], a = arguments, a0 = a[0], a1 = a[1], vi, to_store = isNaN(a1) ? {} : [], type, tmp, i;\n if (l < 1 || !_isPlainObject(a0) && l < 2) {\n throw new Error('Minimum 2 arguments must be given or first parameter must be an object');\n } else if (_isPlainObject(a0)) {\n // If first argument is an object, set values of storage for each property of this object\n for (i in a0) {\n if (a0.hasOwnProperty(i)) {\n vi = a0[i];\n if (!_isPlainObject(vi) && !this.alwaysUseJson) {\n s.setItem(i, vi);\n } else {\n s.setItem(i, JSON.stringify(vi));\n }\n }\n }\n return a0;\n } else if (l == 2) {\n // If only 2 arguments, set value of storage directly\n if (typeof a1 === 'object' || this.alwaysUseJson) {\n s.setItem(a0, JSON.stringify(a1));\n } else {\n s.setItem(a0, a1);\n }\n return a1;\n } else {\n // If more than 3 arguments, parse storage to retrieve final node and set value\n // Get first level\n try {\n tmp = s.getItem(a0);\n if (tmp != null) {\n to_store = JSON.parse(tmp);\n }\n } catch (e) {\n }\n tmp = to_store;\n // Parse next levels and set value\n for (i = 1; i < l - 2; i++) {\n vi = a[i];\n type = isNaN(a[i + 1]) ? \"object\" : \"array\";\n if (!tmp[vi] || type == \"object\" && !_isPlainObject(tmp[vi]) || type == \"array\" && !Array.isArray(tmp[vi])) {\n if (type == \"array\") tmp[vi] = [];\n else tmp[vi] = {};\n }\n tmp = tmp[vi];\n }\n tmp[a[i]] = a[i + 1];\n s.setItem(a0, JSON.stringify(to_store));\n return to_store;\n }\n }\n\n // Remove items from a storage\n function _remove() {\n var storage = this._type, l = arguments.length, s = window[storage], a = arguments, a0 = a[0], to_store, tmp, i, j;\n if (l < 1) {\n throw new Error('Minimum 1 argument must be given');\n } else if (Array.isArray(a0)) {\n // If first argument is an array, remove values from storage for each item of this array\n for (i in a0) {\n if (a0.hasOwnProperty(i)) {\n s.removeItem(a0[i]);\n }\n }\n return true;\n } else if (l == 1) {\n // If only 2 arguments, remove value from storage directly\n s.removeItem(a0);\n return true;\n } else {\n // If more than 2 arguments, parse storage to retrieve final node and remove value\n // Get first level\n try {\n to_store = tmp = JSON.parse(s.getItem(a0));\n } catch (e) {\n throw new ReferenceError(a0 + ' is not defined in this storage');\n }\n // Parse next levels and remove value\n for (i = 1; i < l - 1; i++) {\n tmp = tmp[a[i]];\n if (tmp === undefined) {\n throw new ReferenceError([].slice.call(a, 1, i).join('.') + ' is not defined in this storage');\n }\n }\n // If last argument is an array,remove value for each item in this array\n // Else remove value normally\n if (Array.isArray(a[i])) {\n for (j in a[i]) {\n if (a[i].hasOwnProperty(j)) {\n delete tmp[a[i][j]];\n }\n }\n } else {\n delete tmp[a[i]];\n }\n s.setItem(a0, JSON.stringify(to_store));\n return true;\n }\n }\n\n // Remove all items from a storage\n function _removeAll(reinit_ns) {\n var keys = _keys.call(this), i;\n for (i in keys) {\n if (keys.hasOwnProperty(i)) {\n _remove.call(this, keys[i]);\n }\n }\n // Reinitialize all namespace storages\n if (reinit_ns) {\n for (i in apis.namespaceStorages) {\n if (apis.namespaceStorages.hasOwnProperty(i)) {\n _createNamespace(i);\n }\n }\n }\n }\n\n // Check if items of a storage are empty\n function _isEmpty() {\n var l = arguments.length, a = arguments, a0 = a[0], i;\n if (l == 0) {\n // If no argument, test if storage is empty\n return (_keys.call(this).length == 0);\n } else if (Array.isArray(a0)) {\n // If first argument is an array, test each item of this array and return true only if all items are empty\n for (i = 0; i < a0.length; i++) {\n if (!_isEmpty.call(this, a0[i])) {\n return false;\n }\n }\n return true;\n } else {\n // If at least 1 argument, try to get value and test it\n try {\n var v = _get.apply(this, arguments);\n // Convert result to an object (if last argument is an array, _get return already an object) and test each item\n if (!Array.isArray(a[l - 1])) {\n v = {'totest': v};\n }\n for (i in v) {\n if (v.hasOwnProperty(i) && !(\n (_isPlainObject(v[i]) && _isEmptyObject(v[i])) ||\n (Array.isArray(v[i]) && !v[i].length) ||\n (typeof v[i] !== 'boolean' && !v[i])\n )) {\n return false;\n }\n }\n return true;\n } catch (e) {\n return true;\n }\n }\n }\n\n // Check if items of a storage exist\n function _isSet() {\n var l = arguments.length, a = arguments, a0 = a[0], i;\n if (l < 1) {\n throw new Error('Minimum 1 argument must be given');\n }\n if (Array.isArray(a0)) {\n // If first argument is an array, test each item of this array and return true only if all items exist\n for (i = 0; i < a0.length; i++) {\n if (!_isSet.call(this, a0[i])) {\n return false;\n }\n }\n return true;\n } else {\n // For other case, try to get value and test it\n try {\n var v = _get.apply(this, arguments);\n // Convert result to an object (if last argument is an array, _get return already an object) and test each item\n if (!Array.isArray(a[l - 1])) {\n v = {'totest': v};\n }\n for (i in v) {\n if (v.hasOwnProperty(i) && !(v[i] !== undefined && v[i] !== null)) {\n return false;\n }\n }\n return true;\n } catch (e) {\n return false;\n }\n }\n }\n\n // Get keys of a storage or of an item of the storage\n function _keys() {\n var storage = this._type, l = arguments.length, s = window[storage], keys = [], o = {};\n // If at least 1 argument, get value from storage to retrieve keys\n // Else, use storage to retrieve keys\n if (l > 0) {\n o = _get.apply(this, arguments);\n } else {\n o = s;\n }\n if (o && o._cookie) {\n // If storage is a cookie, use js-cookie to retrieve keys\n var cookies = Cookies.get();\n for (var key in cookies) {\n if (cookies.hasOwnProperty(key) && key != '') {\n keys.push(key.replace(o._prefix, ''));\n }\n }\n } else {\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n keys.push(i);\n }\n }\n }\n return keys;\n }\n\n // Create new namespace storage\n function _createNamespace(name) {\n if (!name || typeof name != \"string\") {\n throw new Error('First parameter must be a string');\n }\n if (storage_available) {\n if (!window.localStorage.getItem(name)) {\n window.localStorage.setItem(name, '{}');\n }\n if (!window.sessionStorage.getItem(name)) {\n window.sessionStorage.setItem(name, '{}');\n }\n } else {\n if (!window.localCookieStorage.getItem(name)) {\n window.localCookieStorage.setItem(name, '{}');\n }\n if (!window.sessionCookieStorage.getItem(name)) {\n window.sessionCookieStorage.setItem(name, '{}');\n }\n }\n var ns = {\n localStorage: _extend({}, apis.localStorage, {_ns: name}),\n sessionStorage: _extend({}, apis.sessionStorage, {_ns: name})\n };\n if (cookies_available) {\n if (!window.cookieStorage.getItem(name)) {\n window.cookieStorage.setItem(name, '{}');\n }\n ns.cookieStorage = _extend({}, apis.cookieStorage, {_ns: name});\n }\n apis.namespaceStorages[name] = ns;\n return ns;\n }\n\n // Test if storage is natively available on browser\n function _testStorage(name) {\n var foo = 'jsapi';\n try {\n if (!window[name]) {\n return false;\n }\n window[name].setItem(foo, foo);\n window[name].removeItem(foo);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n // Test if a variable is a plain object (from jQuery)\n function _isPlainObject(obj) {\n var proto, Ctor;\n\n // Detect obvious negatives\n // Use toString instead of jQuery.type to catch host objects\n if (!obj || toString.call(obj) !== \"[object Object]\") {\n return false;\n }\n\n proto = getProto(obj);\n\n // Objects with no prototype (e.g., `Object.create( null )`) are plain\n if (!proto) {\n return true;\n }\n\n // Objects with prototype are plain iff they were constructed by a global Object function\n Ctor = hasOwn.call(proto, \"constructor\") && proto.constructor;\n return typeof Ctor === \"function\" && fnToString.call(Ctor) === ObjectFunctionString;\n }\n\n // Test if a variable is an empty object (from jQuery)\n function _isEmptyObject(obj) {\n var name;\n\n for (name in obj) {\n return false;\n }\n return true;\n }\n\n // Merge objects\n function _extend() {\n var i = 1;\n var result = arguments[0];\n for (; i < arguments.length; i++) {\n var attributes = arguments[i];\n for (var key in attributes) {\n if (attributes.hasOwnProperty(key)) {\n result[key] = attributes[key];\n }\n }\n }\n return result;\n }\n\n // Check if storages are natively available on browser and check is js-cookie is present\n var storage_available = _testStorage('localStorage');\n var cookies_available = typeof Cookies !== 'undefined';\n\n // Namespace object\n var storage = {\n _type: '',\n _ns: '',\n _callMethod: function (f, a) {\n a = Array.prototype.slice.call(a);\n var p = [], a0 = a[0];\n if (this._ns) {\n p.push(this._ns);\n }\n if (typeof a0 === 'string' && a0.indexOf('.') !== -1) {\n a.shift();\n [].unshift.apply(a, a0.split('.'));\n }\n [].push.apply(p, a);\n return f.apply(this, p);\n },\n // Define if plugin always use JSON to store values (even to store simple values like string, int...) or not\n alwaysUseJson: false,\n // Get items. If no parameters and storage have a namespace, return all namespace\n get: function () {\n if (!storage_available && !cookies_available){\n return null;\n }\n return this._callMethod(_get, arguments);\n },\n // Set items\n set: function () {\n var l = arguments.length, a = arguments, a0 = a[0];\n if (l < 1 || !_isPlainObject(a0) && l < 2) {\n throw new Error('Minimum 2 arguments must be given or first parameter must be an object');\n }\n if (!storage_available && !cookies_available){\n return null;\n }\n // If first argument is an object and storage is a namespace storage, set values individually\n if (_isPlainObject(a0) && this._ns) {\n for (var i in a0) {\n if (a0.hasOwnProperty(i)) {\n this._callMethod(_set, [i, a0[i]]);\n }\n }\n return a0;\n } else {\n var r = this._callMethod(_set, a);\n if (this._ns) {\n return r[a0.split('.')[0]];\n } else {\n return r;\n }\n }\n },\n // Delete items\n remove: function () {\n if (arguments.length < 1) {\n throw new Error('Minimum 1 argument must be given');\n }\n if (!storage_available && !cookies_available){\n return null;\n }\n return this._callMethod(_remove, arguments);\n },\n // Delete all items\n removeAll: function (reinit_ns) {\n if (!storage_available && !cookies_available){\n return null;\n }\n if (this._ns) {\n this._callMethod(_set, [{}]);\n return true;\n } else {\n return this._callMethod(_removeAll, [reinit_ns]);\n }\n },\n // Items empty\n isEmpty: function () {\n if (!storage_available && !cookies_available){\n return null;\n }\n return this._callMethod(_isEmpty, arguments);\n },\n // Items exists\n isSet: function () {\n if (arguments.length < 1) {\n throw new Error('Minimum 1 argument must be given');\n }\n if (!storage_available && !cookies_available){\n return null;\n }\n return this._callMethod(_isSet, arguments);\n },\n // Get keys of items\n keys: function () {\n if (!storage_available && !cookies_available){\n return null;\n }\n return this._callMethod(_keys, arguments);\n }\n };\n\n // Use js-cookie for compatibility with old browsers and give access to cookieStorage\n if (cookies_available) {\n // sessionStorage is valid for one window/tab. To simulate that with cookie, we set a name for the window and use it for the name of the cookie\n if (!window.name) {\n window.name = Math.floor(Math.random() * 100000000);\n }\n var cookie_storage = {\n _cookie: true,\n _prefix: '',\n _expires: null,\n _path: null,\n _domain: null,\n _secure: false,\n setItem: function (n, v) {\n Cookies.set(this._prefix + n, v, {expires: this._expires, path: this._path, domain: this._domain, secure: this._secure});\n },\n getItem: function (n) {\n return Cookies.get(this._prefix + n);\n },\n removeItem: function (n) {\n return Cookies.remove(this._prefix + n, {path: this._path});\n },\n clear: function () {\n var cookies = Cookies.get();\n for (var key in cookies) {\n if (cookies.hasOwnProperty(key) && key != '') {\n if (!this._prefix && key.indexOf(cookie_local_prefix) === -1 && key.indexOf(cookie_session_prefix) === -1 || this._prefix && key.indexOf(this._prefix) === 0) {\n Cookies.remove(key);\n }\n }\n }\n },\n setExpires: function (e) {\n this._expires = e;\n return this;\n },\n setPath: function (p) {\n this._path = p;\n return this;\n },\n setDomain: function (d) {\n this._domain = d;\n return this;\n },\n setSecure: function (s) {\n this._secure = s;\n return this;\n },\n setConf: function (c) {\n if (c.path) {\n this._path = c.path;\n }\n if (c.domain) {\n this._domain = c.domain;\n }\n if (c.secure) {\n this._secure = c.secure;\n }\n if (c.expires) {\n this._expires = c.expires;\n }\n return this;\n },\n setDefaultConf: function () {\n this._path = this._domain = this._expires = null;\n this._secure = false;\n }\n };\n if (!storage_available) {\n window.localCookieStorage = _extend({}, cookie_storage, {\n _prefix: cookie_local_prefix,\n _expires: 365 * 10,\n _secure: true\n });\n window.sessionCookieStorage = _extend({}, cookie_storage, {\n _prefix: cookie_session_prefix + window.name + '_',\n _secure: true\n });\n }\n window.cookieStorage = _extend({}, cookie_storage);\n // cookieStorage API\n apis.cookieStorage = _extend({}, storage, {\n _type: 'cookieStorage',\n setExpires: function (e) {\n window.cookieStorage.setExpires(e);\n return this;\n },\n setPath: function (p) {\n window.cookieStorage.setPath(p);\n return this;\n },\n setDomain: function (d) {\n window.cookieStorage.setDomain(d);\n return this;\n },\n setSecure: function (s) {\n window.cookieStorage.setSecure(s);\n return this;\n },\n setConf: function (c) {\n window.cookieStorage.setConf(c);\n return this;\n },\n setDefaultConf: function () {\n window.cookieStorage.setDefaultConf();\n return this;\n }\n });\n }\n\n // Get a new API on a namespace\n apis.initNamespaceStorage = function (ns) {\n return _createNamespace(ns);\n };\n if (storage_available) {\n // localStorage API\n apis.localStorage = _extend({}, storage, {_type: 'localStorage'});\n // sessionStorage API\n apis.sessionStorage = _extend({}, storage, {_type: 'sessionStorage'});\n } else {\n // localStorage API\n apis.localStorage = _extend({}, storage, {_type: 'localCookieStorage'});\n // sessionStorage API\n apis.sessionStorage = _extend({}, storage, {_type: 'sessionCookieStorage'});\n }\n // List of all namespace storage\n apis.namespaceStorages = {};\n // Remove all items in all storages\n apis.removeAllStorages = function (reinit_ns) {\n apis.localStorage.removeAll(reinit_ns);\n apis.sessionStorage.removeAll(reinit_ns);\n if (apis.cookieStorage) {\n apis.cookieStorage.removeAll(reinit_ns);\n }\n if (!reinit_ns) {\n apis.namespaceStorages = {};\n }\n };\n // About alwaysUseJson\n // By default, all values are string on html storages and the plugin don't use json to store simple values (strings, int, float...)\n // So by default, if you do storage.setItem('test',2), value in storage will be \"2\", not 2\n // If you set this property to true, all values set with the plugin will be stored as json to have typed values in any cases\n apis.alwaysUseJsonInStorage = function (value) {\n storage.alwaysUseJson = value;\n apis.localStorage.alwaysUseJson = value;\n apis.sessionStorage.alwaysUseJson = value;\n if (apis.cookieStorage) {\n apis.cookieStorage.alwaysUseJson = value;\n }\n };\n\n return apis;\n}));\n","Magento_Security/js/escaper.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * A loose JavaScript version of Magento\\Framework\\Escaper\n *\n * Due to differences in how XML/HTML is processed in PHP vs JS there are a couple of minor differences in behavior\n * from the PHP counterpart.\n *\n * The first difference is that the default invocation of escapeHtml without allowedTags will double-escape existing\n * entities as the intention of such an invocation is that the input isn't supposed to contain any HTML.\n *\n * The second difference is that escapeHtml will not escape quotes. Since the input is actually being processed by the\n * DOM there is no chance of quotes being mixed with HTML syntax. And, since escapeHtml is not\n * intended to be used with raw injection into a HTML attribute, this is acceptable.\n *\n * @api\n */\ndefine([], function () {\n 'use strict';\n\n return {\n neverAllowedElements: ['script', 'img', 'embed', 'iframe', 'video', 'source', 'object', 'audio'],\n generallyAllowedAttributes: ['id', 'class', 'href', 'title', 'style'],\n forbiddenAttributesByElement: {\n a: ['style']\n },\n\n /**\n * Escape a string for safe injection into HTML\n *\n * @param {String} data\n * @param {Array|null} allowedTags\n * @returns {String}\n */\n escapeHtml: function (data, allowedTags) {\n var domParser = new DOMParser(),\n fragment = domParser.parseFromString('<div></div>', 'text/html');\n\n fragment = fragment.body.childNodes[0];\n allowedTags = typeof allowedTags === 'object' && allowedTags.length ? allowedTags : null;\n\n if (allowedTags) {\n fragment.innerHTML = data || '';\n allowedTags = this._filterProhibitedTags(allowedTags);\n\n this._removeComments(fragment);\n this._removeNotAllowedElements(fragment, allowedTags);\n this._removeNotAllowedAttributes(fragment);\n\n return fragment.innerHTML;\n }\n\n fragment.textContent = data || '';\n\n return fragment.innerHTML;\n },\n\n /**\n * Remove the always forbidden tags from a list of provided tags\n *\n * @param {Array} tags\n * @returns {Array}\n * @private\n */\n _filterProhibitedTags: function (tags) {\n return tags.filter(function (n) {\n return this.neverAllowedElements.indexOf(n) === -1;\n }.bind(this));\n },\n\n /**\n * Remove comment nodes from the given node\n *\n * @param {Node} node\n * @private\n */\n _removeComments: function (node) {\n var treeWalker = node.ownerDocument.createTreeWalker(\n node,\n NodeFilter.SHOW_COMMENT,\n function () {\n return NodeFilter.FILTER_ACCEPT;\n },\n false\n ),\n nodesToRemove = [];\n\n while (treeWalker.nextNode()) {\n nodesToRemove.push(treeWalker.currentNode);\n }\n\n nodesToRemove.forEach(function (nodeToRemove) {\n nodeToRemove.parentNode.removeChild(nodeToRemove);\n });\n },\n\n /**\n * Strip the given node of all disallowed tags while permitting any nested text nodes\n *\n * @param {Node} node\n * @param {Array|null} allowedTags\n * @private\n */\n _removeNotAllowedElements: function (node, allowedTags) {\n var treeWalker = node.ownerDocument.createTreeWalker(\n node,\n NodeFilter.SHOW_ELEMENT,\n function (currentNode) {\n return allowedTags.indexOf(currentNode.nodeName.toLowerCase()) === -1 ?\n NodeFilter.FILTER_ACCEPT\n // SKIP instead of REJECT because REJECT also rejects child nodes\n : NodeFilter.FILTER_SKIP;\n },\n false\n ),\n nodesToRemove = [];\n\n while (treeWalker.nextNode()) {\n if (allowedTags.indexOf(treeWalker.currentNode.nodeName.toLowerCase()) === -1) {\n nodesToRemove.push(treeWalker.currentNode);\n }\n }\n\n nodesToRemove.forEach(function (nodeToRemove) {\n nodeToRemove.parentNode.replaceChild(\n node.ownerDocument.createTextNode(nodeToRemove.textContent),\n nodeToRemove\n );\n });\n },\n\n /**\n * Remove any invalid attributes from the given node\n *\n * @param {Node} node\n * @private\n */\n _removeNotAllowedAttributes: function (node) {\n var treeWalker = node.ownerDocument.createTreeWalker(\n node,\n NodeFilter.SHOW_ELEMENT,\n function () {\n return NodeFilter.FILTER_ACCEPT;\n },\n false\n ),\n i,\n attribute,\n nodeName,\n attributesToRemove = [];\n\n while (treeWalker.nextNode()) {\n for (i = 0; i < treeWalker.currentNode.attributes.length; i++) {\n attribute = treeWalker.currentNode.attributes[i];\n nodeName = treeWalker.currentNode.nodeName.toLowerCase();\n\n if (this.generallyAllowedAttributes.indexOf(attribute.name) === -1 || // eslint-disable-line max-depth,max-len\n this._checkHrefValue(attribute) ||\n this.forbiddenAttributesByElement[nodeName] &&\n this.forbiddenAttributesByElement[nodeName].indexOf(attribute.name) !== -1\n ) {\n attributesToRemove.push(attribute);\n }\n }\n }\n\n attributesToRemove.forEach(function (attributeToRemove) {\n attributeToRemove.ownerElement.removeAttribute(attributeToRemove.name);\n });\n },\n\n /**\n * Check that attribute contains script content\n *\n * @param {Object} attribute\n * @private\n */\n _checkHrefValue: function (attribute) {\n return attribute.nodeName === 'href' && attribute.nodeValue.startsWith('javascript');\n }\n };\n});\n","Magento_Security/js/confirm-redirect.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*eslint-disable no-undef*/\ndefine(\n ['jquery'],\n function ($) {\n 'use strict';\n\n return function (config, element) {\n $(element).on('click', config, function () {\n confirmSetLocation(config.message, config.url);\n });\n };\n }\n);\n","Magento_Security/js/system/config/session-size.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'mage/translate',\n 'Magento_Ui/js/modal/confirm',\n 'domReady!'\n], function ($, $t, confirm) {\n 'use strict';\n\n return function (config, inputEl) {\n var $inputEl = $(inputEl);\n\n $inputEl.on('blur', function () {\n var inputVal = parseInt($inputEl.val(), 10);\n\n if (inputVal < 256000) {\n confirm({\n title: $t(config.modalTitleText),\n content: $t(config.modalContentBody),\n buttons: [{\n text: $t('No'),\n class: 'action-secondary action-dismiss',\n\n /**\n * Close modal and trigger 'cancel' action on click\n */\n click: function (event) {\n this.closeModal(event);\n }\n }, {\n text: $t('Yes'),\n class: 'action-primary action-accept',\n\n /**\n * Close modal and trigger 'confirm' action on click\n */\n click: function (event) {\n this.closeModal(event, true);\n }\n }],\n actions: {\n\n /**\n * Revert back to original value\n */\n cancel: function () {\n $inputEl.val(256000);\n }\n }\n });\n }\n });\n };\n});\n","Magento_InventoryCatalogAdminUi/js/product/form/qty.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_CatalogInventory/js/components/qty-validator-changer'\n], function (Abstract) {\n 'use strict';\n\n return Abstract.extend({\n defaults: {\n links: {\n value: false\n }\n },\n\n /** @inheritdoc */\n getInitialValue: function () {\n var values = [this.source.get(this.dataScope), this.default],\n value;\n\n values.some(function (v) {\n if (v !== null && v !== undefined) {\n value = v;\n\n return true;\n }\n\n return false;\n });\n\n return this.normalizeData(value);\n },\n\n /** @inheritdoc */\n setDifferedFromDefault: function () {\n var initialValue;\n\n this._super();\n initialValue = this.source.data.product['current_product_id'] !== null ? this.initialValue : 0;\n\n if (this.value() &&\n parseFloat(initialValue) !== parseFloat(this.value())\n ) {\n this.source.set(this.dataScope, this.value());\n } else {\n this.source.remove(this.dataScope);\n }\n }\n });\n});\n","Magento_InventoryCatalogAdminUi/js/product/form/stock-status.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/select'\n], function (Select) {\n 'use strict';\n\n return Select.extend({\n defaults: {\n links: {\n linkedValue: false\n }\n },\n\n /** @inheritdoc */\n getInitialValue: function () {\n var values = [this.source.get(this.dataScope), this.default],\n value;\n\n values.some(function (v) {\n if (v !== null && v !== undefined) {\n value = v;\n\n return true;\n }\n\n return false;\n });\n\n return this.normalizeData(value);\n },\n\n /** @inheritdoc */\n setDifferedFromDefault: function () {\n this._super();\n\n if (parseFloat(this.initialValue) !== parseFloat(this.value())) {\n this.source.set(this.dataScope, this.value());\n } else {\n this.source.remove(this.dataScope);\n }\n }\n });\n});\n","Magento_InventoryCatalogAdminUi/js/product/form/source-items.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/components/fieldset',\n 'uiRegistry',\n 'underscore'\n], function (Fieldset, registry, _) {\n 'use strict';\n\n return Fieldset.extend({\n defaults: {\n advancedInventoryButtonIndex: '',\n imports: {\n onStockChange: '${ $.provider }:data.product.stock_data.manage_stock'\n }\n },\n\n /**\n * \"Advanced Inventory\" button should stay active in any case.\n *\n * @param {Integer} canManageStock\n */\n onStockChange: function (canManageStock) {\n var advancedInventoryButton = registry.get('index = ' + this.advancedInventoryButtonIndex);\n\n if (canManageStock === 0) {\n if (!_.isUndefined(advancedInventoryButton)) {\n advancedInventoryButton.disabled(false);\n }\n }\n }\n });\n});\n","Magento_InventoryCatalogAdminUi/js/product/form/sources/qty.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_CatalogInventory/js/components/qty-validator-changer'\n], function (Validator) {\n 'use strict';\n\n return Validator.extend({\n\n /**\n * Set default value for source quantity, depends on 'Use Decimal\" value.\n *\n * @param {Integer} isDecimal\n * @returns void\n */\n setDefaultValue: function (isDecimal) {\n if (!this.value()) {\n isDecimal ? this.value('0.0') : this.value('0');\n }\n }\n });\n});\n","Magento_InventoryCatalogAdminUi/js/product/grid/cell/quantity-per-source.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/grid/columns/column'\n], function (Column) {\n 'use strict';\n\n return Column.extend({\n defaults: {\n bodyTmpl: 'Magento_InventoryCatalogAdminUi/product/grid/cell/source-items.html',\n itemsToDisplay: 5\n },\n\n /**\n * Get source items data (source name and qty)\n *\n * @param {Object} record - Record object\n * @returns {Array} Result array\n */\n getSourceItemsData: function (record) {\n return record[this.index] ? record[this.index] : [];\n },\n\n /**\n * @param {Object} record - Record object\n * @returns {Array} Result array\n */\n getSourceItemsDataCut: function (record) {\n return this.getSourceItemsData(record).slice(0, this.itemsToDisplay);\n }\n });\n});\n","Magento_InventoryCatalogAdminUi/js/product/attribute/edit/inventory/toggle/toggle-editability.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery'\n], function ($) {\n 'use strict';\n\n $('[data-role=toggle-editability]').on('change', function () {\n var useConfigSettings = $(this),\n field = useConfigSettings.parents('.field'),\n someEditable = $('input[type!=\"checkbox\"], select, textarea', field);\n\n someEditable.prop('disabled', useConfigSettings.prop('checked'));\n });\n});\n","Magento_InventoryCatalogAdminUi/js/product/attribute/edit/inventory/toggle/toggle-editability-all.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery'\n], function ($) {\n 'use strict';\n\n $('[data-role=toggle-editability-all]').on('change', function () {\n var toggler = $(this),\n field = toggler.parents('.field'),\n someEditable = $('input[type!=\"checkbox\"], select, textarea', field),\n someEditableCheckboxes = $('input[type=\"checkbox\"]', field).not(toggler);\n\n if (someEditableCheckboxes.length) {\n someEditable.prop('disabled', !toggler.prop('checked') || someEditableCheckboxes.prop('checked'));\n someEditableCheckboxes.prop('disabled', !toggler.prop('checked'));\n } else {\n someEditable.prop('disabled', !toggler.prop('checked'));\n }\n });\n});\n","Magento_LoginAsCustomerAssistance/js/not-allowed-popup.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'uiComponent',\n 'Magento_Ui/js/modal/confirm',\n 'mage/translate'\n], function (Component, confirm, $t) {\n\n 'use strict';\n\n return Component.extend({\n /**\n * Initialize Component\n */\n initialize: function () {\n var self = this,\n content;\n\n this._super();\n\n content = '<div class=\"message message-warning\">' + self.content + '</div>';\n\n /**\n * Not Allowed popup\n *\n * @returns {Boolean}\n */\n window.lacNotAllowedPopup = function () {\n confirm({\n title: self.title,\n content: content,\n modalClass: 'confirm lac-confirm',\n buttons: [\n {\n text: $t('Close'),\n class: 'action-secondary action-dismiss',\n\n /**\n * Click handler.\n */\n click: function (event) {\n this.closeModal(event);\n }\n }\n ]\n });\n\n return false;\n };\n }\n });\n});\n","Magento_AdobeStockAdminUi/js/connection.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'ko',\n 'uiComponent',\n 'jquery'\n], function (ko, Component, $) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Magento_AdobeStockAdminUi/connection',\n connectionFailedMessage: 'Connection test failed.',\n emptyApiKeyMessage: 'Please fill the \"API Key (Client ID)\" field for a connection test',\n apiKeyInputId: 'system_adobe_stock_integration_api_key',\n url: '',\n success: false,\n message: '',\n visible: false\n },\n\n /**\n * Init observable variables\n * @return {Object}\n */\n initObservable: function () {\n this._super()\n .observe([\n 'success',\n 'message',\n 'visible'\n ]);\n\n return this;\n },\n\n /**\n * @override\n */\n initialize: function () {\n this._super();\n this.messageClass = ko.computed(function () {\n return 'message-validation message message-' + (this.success() ? 'success' : 'error');\n }, this);\n\n if (!this.success()) {\n this.showMessage(false, this.connectionFailedMessage);\n }\n },\n\n /**\n * @param {bool} success\n * @param {String} message\n */\n showMessage: function (success, message) {\n this.message(message);\n this.success(success);\n this.visible(true);\n },\n\n /**\n * Send request to server to test connection to Adobe Stock API and display the result\n */\n testConnection: function () {\n var apiKey = document.getElementById(this.apiKeyInputId).value;\n\n if (apiKey.length === 0) {\n this.showMessage(false, this.emptyApiKeyMessage);\n\n return;\n }\n\n this.visible(false);\n\n $.ajax({\n type: 'POST',\n url: this.url,\n dataType: 'json',\n data: {\n 'api_key': apiKey\n },\n success: function (response) {\n this.showMessage(response.success === true, response.message);\n }.bind(this),\n error: function () {\n this.showMessage(false, this.connectionFailedMessage);\n }.bind(this)\n });\n }\n });\n});\n","Magento_Customer/js/form/components/form.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'jquery',\n 'Magento_Ui/js/modal/alert',\n 'Magento_Ui/js/modal/confirm',\n 'Magento_Ui/js/form/form',\n 'underscore',\n 'mage/translate'\n], function ($, uiAlert, uiConfirm, Form, _, $t) {\n 'use strict';\n\n return Form.extend({\n defaults: {\n deleteConfirmationMessage: '',\n ajaxSettings: {\n method: 'POST',\n dataType: 'json'\n }\n },\n\n /**\n * Delete customer address by provided url.\n * Will call confirmation message to be sure that user is really wants to delete this address\n *\n * @param {String} url - ajax url\n */\n deleteAddress: function (url) {\n var that = this;\n\n uiConfirm({\n content: this.deleteConfirmationMessage,\n actions: {\n /** @inheritdoc */\n confirm: function () {\n that._delete(url);\n }\n }\n });\n },\n\n /**\n * Perform asynchronous DELETE request to server.\n * @param {String} url - ajax url\n * @returns {Deferred}\n */\n _delete: function (url) {\n var settings = _.extend({}, this.ajaxSettings, {\n url: url,\n data: {\n 'form_key': window.FORM_KEY\n }\n }),\n that = this;\n\n $('body').trigger('processStart');\n\n return $.ajax(settings)\n .done(function (response) {\n if (response.error) {\n uiAlert({\n content: response.message\n });\n } else {\n that.trigger('deleteAddressAction', that.source.get('data.entity_id'));\n }\n })\n .fail(function () {\n uiAlert({\n content: $t('Sorry, there has been an error processing your request. Please try again later.')\n });\n })\n .always(function () {\n $('body').trigger('processStop');\n });\n\n }\n });\n});\n","Magento_Customer/js/form/components/insert-listing.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/components/insert-listing',\n 'underscore'\n], function (Insert, _) {\n 'use strict';\n\n return Insert.extend({\n\n /**\n * On action call\n *\n * @param {Object} data - customer address and actions\n */\n onAction: function (data) {\n this[data.action + 'Action'].call(this, data.data);\n },\n\n /**\n * On mass action call\n *\n * @param {Object} data - customer address\n */\n onMassAction: function (data) {\n this[data.action + 'Massaction'].call(this, data.data);\n },\n\n /**\n * Set default billing address\n *\n * @param {Object} data - customer address\n */\n setDefaultBillingAction: function (data) {\n this.source.set('data.default_billing_address', data);\n },\n\n /**\n * Set default shipping address\n *\n * @param {Object} data - customer address\n */\n setDefaultShippingAction: function (data) {\n this.source.set('data.default_shipping_address', data);\n },\n\n /**\n * Delete customer address\n *\n * @param {Object} data - customer address\n */\n deleteAction: function (data) {\n this._delete([parseFloat(data[data['id_field_name']])]);\n },\n\n /**\n * Mass action delete\n *\n * @param {Object} data - customer address\n */\n deleteMassaction: function (data) {\n var ids = data.selected || this.selections().selected();\n\n ids = _.map(ids, function (val) {\n return parseFloat(val);\n });\n\n this._delete(ids);\n },\n\n /**\n * Delete customer address and selections by provided ids.\n *\n * @param {Array} ids\n */\n _delete: function (ids) {\n var defaultShippingId = parseFloat(this.source.get('data.default_shipping_address.entity_id')),\n defaultBillingId = parseFloat(this.source.get('data.default_billing_address.entity_id'));\n\n if (ids.indexOf(defaultShippingId) !== -1) {\n this.source.set('data.default_shipping_address', []);\n }\n\n if (ids.indexOf(defaultBillingId) !== -1) {\n this.source.set('data.default_billing_address', []);\n }\n\n _.each(ids, function (id) {\n this.selections().deselect(id.toString(), false);\n }, this);\n }\n });\n});\n","Magento_Customer/js/form/components/insert-form.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/components/insert-form'\n], function (Insert) {\n 'use strict';\n\n return Insert.extend({\n defaults: {\n listens: {\n responseData: 'onResponse'\n },\n modules: {\n addressListing: '${ $.addressListingProvider }',\n addressModal: '${ $.addressModalProvider }'\n }\n },\n\n /**\n * Close modal, reload customer address listing and save customer address\n *\n * @param {Object} responseData\n */\n onResponse: function (responseData) {\n var data;\n\n if (!responseData.error) {\n this.addressModal().closeModal();\n this.addressListing().reload({\n refresh: true\n });\n data = this.externalSource().get('data');\n this.saveAddress(responseData, data);\n }\n },\n\n /**\n * Save customer address to customer form data source\n *\n * @param {Object} responseData\n * @param {Object} data - customer address\n */\n saveAddress: function (responseData, data) {\n data['entity_id'] = responseData.data['entity_id'];\n\n if (parseFloat(data['default_billing'])) {\n this.source.set('data.default_billing_address', data);\n } else if (\n parseFloat(this.source.get('data.default_billing_address')['entity_id']) === data['entity_id']\n ) {\n this.source.set('data.default_billing_address', []);\n }\n\n if (parseFloat(data['default_shipping'])) {\n this.source.set('data.default_shipping_address', data);\n } else if (\n parseFloat(this.source.get('data.default_shipping_address')['entity_id']) === data['entity_id']\n ) {\n this.source.set('data.default_shipping_address', []);\n }\n },\n\n /**\n * Event method that closes \"Edit customer address\" modal and refreshes grid after customer address\n * was removed through \"Delete\" button on the \"Edit customer address\" modal\n *\n * @param {String} id - customer address ID to delete\n */\n onAddressDelete: function (id) {\n this.addressModal().closeModal();\n this.addressListing().reload({\n refresh: true\n });\n this.addressListing()._delete([parseFloat(id)]);\n }\n });\n});\n","Magento_Customer/js/form/element/website.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/website',\n 'uiRegistry',\n 'underscore'\n], function (Website, registry, _) {\n 'use strict';\n\n return Website.extend({\n /**\n * On value change handler.\n *\n * @param {String} value\n */\n onUpdate: function (value) {\n var groupIdFieldKey = 'group_id',\n sendEmailStoreIdFieldKey = 'sendemail_store_id',\n groupId = registry.get('index = ' + groupIdFieldKey),\n sendEmailStoreId = registry.get('index = ' + sendEmailStoreIdFieldKey),\n customerAttributes = registry.filter('parentScope = data.customer'),\n option = this.getOption(value);\n\n customerAttributes.forEach(element => {\n var requiredWebsites = element.validation['required-entry-website'];\n\n if (!_.isArray(requiredWebsites)) {\n return;\n }\n if (requiredWebsites.includes(parseInt(value, 10))) {\n element.validation['required-entry'] = true;\n element.required(true);\n } else {\n delete element.validation['required-entry'];\n element.required(false);\n }\n });\n\n if (groupId) {\n groupId.value(option[groupIdFieldKey]);\n }\n\n if (sendEmailStoreId && option['default_store_view_id']) {\n sendEmailStoreId.value(option['default_store_view_id']);\n }\n return this._super();\n }\n });\n});\n","Magento_Customer/js/form/element/region.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/region'\n], function (Region) {\n 'use strict';\n\n return Region.extend({\n defaults: {\n regionScope: 'data.region'\n },\n\n /**\n * Set region to customer address form\n *\n * @param {String} value - region\n */\n setDifferedFromDefault: function (value) {\n this._super();\n\n const indexedOptionsArray = Object.values(this.indexedOptions),\n countryId = this.source.data.country_id,\n hasRegionList = indexedOptionsArray.some(option => option.country_id === countryId);\n\n this.source.set(\n this.regionScope,\n hasRegionList\n ? parseFloat(value) ? this.indexedOptions?.[value]?.label || '' : ''\n : this.source.data?.region || ''\n );\n }\n });\n});\n","Magento_Customer/js/form/element/country.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/country'\n], function (Country) {\n 'use strict';\n\n return Country.extend({\n defaults: {\n countryScope: 'data.country'\n },\n\n /**\n * Set country to customer address form\n *\n * @param {String} value - country\n */\n setDifferedFromDefault: function (value) {\n this._super();\n\n if (value) {\n this.source.set(this.countryScope, this.indexedOptions[value].label);\n }\n }\n });\n});\n","Magento_Customer/js/grid/massactions.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/grid/massactions',\n 'Magento_Ui/js/modal/alert',\n 'underscore',\n 'jquery',\n 'mage/translate'\n], function (Massactions, uiAlert, _, $, $t) {\n 'use strict';\n\n return Massactions.extend({\n defaults: {\n ajaxSettings: {\n method: 'POST',\n dataType: 'json'\n },\n listens: {\n massaction: 'onAction'\n }\n },\n\n /**\n * Reload customer addresses listing\n *\n * @param {Object} data\n */\n onAction: function (data) {\n if (data.action === 'delete') {\n this.source.reload({\n refresh: true\n });\n }\n },\n\n /**\n * Default action callback. Send selections data\n * via POST request.\n *\n * @param {Object} action - Action data.\n * @param {Object} data - Selections data.\n */\n defaultCallback: function (action, data) {\n var itemsType, selections;\n\n if (action.isAjax) {\n itemsType = data.excludeMode ? 'excluded' : 'selected';\n selections = {};\n\n selections[itemsType] = data[itemsType];\n\n if (!selections[itemsType].length) {\n selections[itemsType] = false;\n }\n\n _.extend(selections, data.params || {});\n\n this.request(action.url, selections).done(function (response) {\n if (!response.error) {\n this.trigger('massaction', {\n action: action.type,\n data: selections\n });\n }\n }.bind(this));\n } else {\n this._super();\n }\n },\n\n /**\n * Send customer address listing mass action ajax request\n *\n * @param {String} href\n * @param {Object} data\n */\n request: function (href, data) {\n var settings = _.extend({}, this.ajaxSettings, {\n url: href,\n data: data\n });\n\n $('body').trigger('processStart');\n\n return $.ajax(settings)\n .done(function (response) {\n if (response.error) {\n uiAlert({\n content: response.message\n });\n }\n })\n .fail(function () {\n uiAlert({\n content: $t('Sorry, there has been an error processing your request. Please try again later.')\n });\n })\n .always(function () {\n $('body').trigger('processStop');\n });\n }\n });\n});\n","Magento_Customer/js/grid/columns/actions.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/grid/columns/actions',\n 'Magento_Ui/js/modal/alert',\n 'underscore',\n 'jquery',\n 'mage/translate'\n], function (Actions, uiAlert, _, $, $t) {\n 'use strict';\n\n return Actions.extend({\n defaults: {\n ajaxSettings: {\n method: 'POST',\n dataType: 'json'\n },\n listens: {\n action: 'onAction'\n },\n ignoreTmpls: {\n fieldAction: true,\n options: true,\n action: true\n }\n },\n\n /**\n * Reload customer address listing data source after customer address delete action\n *\n * @param {Object} data\n */\n onAction: function (data) {\n if (data.action === 'delete') {\n this.source().reload({\n refresh: true\n });\n }\n },\n\n /**\n * Default action callback. Redirects to\n * the specified in action's data url.\n *\n * @param {String} actionIndex - Action's identifier.\n * @param {(Number|String)} recordId - Id of the record associated\n * with a specified action.\n * @param {Object} action - Action's data.\n */\n defaultCallback: function (actionIndex, recordId, action) {\n if (action.isAjax) {\n this.request(action.href).done(function (response) {\n var data;\n\n if (!response.error) {\n data = _.findWhere(this.rows, {\n _rowIndex: action.rowIndex\n });\n\n this.trigger('action', {\n action: actionIndex,\n data: data\n });\n }\n }.bind(this));\n\n } else {\n this._super();\n }\n },\n\n /**\n * Send customer address listing ajax request\n *\n * @param {String} href\n */\n request: function (href) {\n var settings = _.extend({}, this.ajaxSettings, {\n url: href,\n data: {\n 'form_key': window.FORM_KEY\n }\n });\n\n $('body').trigger('processStart');\n\n return $.ajax(settings)\n .done(function (response) {\n if (response.error) {\n uiAlert({\n content: response.message\n });\n }\n })\n .fail(function () {\n uiAlert({\n content: $t('Sorry, there has been an error processing your request. Please try again later.')\n });\n })\n .always(function () {\n $('body').trigger('processStop');\n });\n }\n });\n});\n","Magento_Customer/js/grid/filters/filters.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/grid/filters/filters'\n], function (Filters) {\n 'use strict';\n\n return Filters.extend({\n defaults: {\n chipsConfig: {\n name: '${ $.name }_chips',\n provider: '${ $.chipsConfig.name }',\n component: 'Magento_Customer/js/grid/filters/chips'\n }\n }\n });\n});\n","Magento_Customer/js/grid/filters/chips.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/grid/filters/chips'\n], function (Chips) {\n 'use strict';\n\n return Chips.extend({\n\n /**\n * Clear previous filters while initializing element to prevent filters sharing between customers\n *\n * @param {Object} elem\n */\n initElement: function (elem) {\n this.clear();\n this._super(elem);\n }\n });\n});\n","Magento_Customer/js/address/default-address.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/components/button',\n 'underscore'\n], function (Button, _) {\n 'use strict';\n\n return Button.extend({\n defaults: {\n entityId: null,\n parentId: null,\n listens: {\n entity: 'changeVisibility'\n }\n },\n\n /**\n * Apply action on target component,\n * but previously create this component from template if it is not existed\n *\n * @param {Object} action - action configuration\n */\n applyAction: function (action) {\n if (action.params && action.params[0]) {\n action.params[0]['entity_id'] = this.entityId;\n action.params[0]['parent_id'] = this.parentId;\n } else {\n action.params = [{\n 'entity_id': this.entityId,\n 'parent_id': this.parentId\n }];\n }\n\n this._super();\n },\n\n /**\n * Change visibility of the default address shipping/billing blocks\n *\n * @param {Object} entity - customer address\n */\n changeVisibility: function (entity) {\n this.visible(!_.isEmpty(entity));\n }\n });\n});\n","Magento_Customer/js/bootstrap/customer-post-action.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\nrequire([\n 'Magento_Customer/edit/post-wrapper'\n]);\n","Magento_Customer/edit/post-wrapper.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/modal/confirm',\n 'mage/translate'\n], function ($, confirm) {\n 'use strict';\n\n /**\n * @param {String} url\n * @returns {Object}\n */\n function getForm(url) {\n return $('<form>', {\n 'action': url,\n 'method': 'POST'\n }).append($('<input>', {\n 'name': 'form_key',\n 'value': window.FORM_KEY,\n 'type': 'hidden'\n }));\n }\n\n $('#customer-edit-delete-button').on('click', function () {\n var msg = $.mage.__('Are you sure you want to do this?'),\n url = $('#customer-edit-delete-button').data('url');\n\n confirm({\n 'content': msg,\n 'actions': {\n\n /**\n * 'Confirm' action handler.\n */\n confirm: function () {\n getForm(url).appendTo('body').submit();\n }\n }\n });\n\n return false;\n });\n});\n","Magento_InventoryShippingAdminUi/js/form/form.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'jquery',\n 'Magento_Ui/js/form/form',\n 'underscore',\n 'mageUtils'\n], function ($, Form, _, utils) {\n 'use strict';\n\n return Form.extend({\n defaults: {\n sourceSelectionUrl: '${ $.sourceSelectionUrl }'\n },\n\n /**\n * Process source selection algorithm\n *\n * @param {String} redirect\n * @param {Object} data\n */\n processAlgorithm: function (redirect, data) {\n var formData = utils.filterFormData(this.source.get('data'));\n\n data.requestData = [];\n\n _.each(formData.items, function (item) {\n data.requestData.push({\n orderItem: item.orderItemId,\n sku: item.sku,\n qty: item.qtyToShip\n });\n });\n\n data.orderId = formData['order_id'];\n data.websiteId = formData.websiteId;\n data = utils.serialize(utils.filterFormData(data));\n data['form_key'] = window.FORM_KEY;\n\n if (!this.sourceSelectionUrl || this.sourceSelectionUrl === 'undefined') {\n return $.Deferred.resolve();\n }\n\n $('body').trigger('processStart');\n\n $.ajax({\n url: this.sourceSelectionUrl,\n data: data,\n\n /**\n * Success callback.\n *\n * @param {Object} response\n */\n success: function (response) {\n var dataItems = this.source.get('data.items');\n\n _.each(dataItems, function (item) {\n if (response[item.orderItemId]) {\n this.source.set('data.items.' + item['record_id'] + '.sources', response[item.orderItemId]);\n }\n }.bind(this));\n this.source.trigger('reInitSources');\n this.source.set('data.sourceCodes', response.sourceCodes ? response.sourceCodes : []);\n }.bind(this),\n\n /**\n * Complete callback.\n */\n complete: function () {\n $('body').trigger('processStop');\n }\n });\n }\n });\n});\n","Magento_InventoryShippingAdminUi/js/form/element/qty_to_deduct.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/element/abstract',\n 'mageUtils'\n], function (Abstract, utils) {\n 'use strict';\n\n return Abstract.extend({\n defaults: {\n sourceCode: null,\n qtyAvailable: 0\n },\n\n /**\n * @inheritdoc\n */\n initialize: function () {\n var path,\n qtyToShip,\n isManageStock;\n\n this._super();\n\n //TODO: Is it right way?\n path = utils.getPart(utils.getPart(this.parentScope, -2), -2);\n qtyToShip = this.source.get(path + '.qtyToShip');\n isManageStock = this.source.get(path + '.isManageStock');\n\n this.validation['less-than-equals-to'] = isManageStock ? this.qtyAvailable : qtyToShip;\n\n return this;\n },\n\n /**\n * Toggle disabled state.\n *\n * @param {String} selected\n */\n toggleDisable: function (selected) {\n this.disabled(selected ? selected.toString() !== this.sourceCode : !selected);\n }\n });\n});\n","Magento_InventoryShippingAdminUi/js/form/element/source_code.js":"define([\n 'underscore',\n 'Magento_Ui/js/form/element/select'\n], function (_, select) {\n 'use strict';\n\n return select.extend({\n /**\n * @inheritdoc\n */\n setOptions: function (data) {\n var result = this._super(data);\n\n if (data.length === 1) {\n this.value(data[0].value);\n }\n\n return result;\n }\n });\n});\n","Magento_InventoryShippingAdminUi/js/order/grid/cell/allocated-sources.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/grid/columns/column'\n], function (Column) {\n 'use strict';\n\n return Column.extend({\n defaults: {\n bodyTmpl: 'Magento_InventoryShippingAdminUi/order/grid/cell/allocated-sources-cell.html',\n itemsToDisplay: 5\n },\n\n /**\n *\n * @param {Array} record\n * @returns {Array}\n */\n getTooltipData: function (record) {\n return record[this.index];\n },\n\n /**\n * @param {Object} record - Record object\n * @returns {Array} Result array\n */\n getAllocatedSources: function (record) {\n return this.getTooltipData(record).slice(0, this.itemsToDisplay);\n }\n });\n});\n","Mageplaza_Core/js/bootstrap.min.js":"/*!\n * Bootstrap v5.0.2 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n */\n!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e(require(\"@popperjs/core\")):\"function\"==typeof define&&define.amd?define([\"@popperjs/core\"],e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).bootstrap=e(t.Popper)}(this,(function(t){\"use strict\";function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(s){if(\"default\"!==s){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:function(){return t[s]}})}})),e.default=t,Object.freeze(e)}var s=e(t);const i={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter(t=>t.matches(e)),parents(t,e){const s=[];let i=t.parentNode;for(;i&&i.nodeType===Node.ELEMENT_NODE&&3!==i.nodeType;)i.matches(e)&&s.push(i),i=i.parentNode;return s},prev(t,e){let s=t.previousElementSibling;for(;s;){if(s.matches(e))return[s];s=s.previousElementSibling}return[]},next(t,e){let s=t.nextElementSibling;for(;s;){if(s.matches(e))return[s];s=s.nextElementSibling}return[]}},n=t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t},o=t=>{let e=t.getAttribute(\"data-bs-target\");if(!e||\"#\"===e){let s=t.getAttribute(\"href\");if(!s||!s.includes(\"#\")&&!s.startsWith(\".\"))return null;s.includes(\"#\")&&!s.startsWith(\"#\")&&(s=\"#\"+s.split(\"#\")[1]),e=s&&\"#\"!==s?s.trim():null}return e},r=t=>{const e=o(t);return e&&document.querySelector(e)?e:null},a=t=>{const e=o(t);return e?document.querySelector(e):null},l=t=>{t.dispatchEvent(new Event(\"transitionend\"))},c=t=>!(!t||\"object\"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),h=t=>c(t)?t.jquery?t[0]:t:\"string\"==typeof t&&t.length>0?i.findOne(t):null,d=(t,e,s)=>{Object.keys(s).forEach(i=>{const n=s[i],o=e[i],r=o&&c(o)?\"element\":null==(a=o)?\"\"+a:{}.toString.call(a).match(/\\s([a-z]+)/i)[1].toLowerCase();var a;if(!new RegExp(n).test(r))throw new TypeError(`${t.toUpperCase()}: Option \"${i}\" provided type \"${r}\" but expected type \"${n}\".`)})},u=t=>!(!c(t)||0===t.getClientRects().length)&&\"visible\"===getComputedStyle(t).getPropertyValue(\"visibility\"),g=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains(\"disabled\")||(void 0!==t.disabled?t.disabled:t.hasAttribute(\"disabled\")&&\"false\"!==t.getAttribute(\"disabled\")),p=t=>{if(!document.documentElement.attachShadow)return null;if(\"function\"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?p(t.parentNode):null},f=()=>{},m=t=>t.offsetHeight,_=()=>{const{jQuery:t}=window;return t&&!document.body.hasAttribute(\"data-bs-no-jquery\")?t:null},b=[],v=()=>\"rtl\"===document.documentElement.dir,y=t=>{var e;e=()=>{const e=_();if(e){const s=t.NAME,i=e.fn[s];e.fn[s]=t.jQueryInterface,e.fn[s].Constructor=t,e.fn[s].noConflict=()=>(e.fn[s]=i,t.jQueryInterface)}},\"loading\"===document.readyState?(b.length||document.addEventListener(\"DOMContentLoaded\",()=>{b.forEach(t=>t())}),b.push(e)):e()},w=t=>{\"function\"==typeof t&&t()},E=(t,e,s=!0)=>{if(!s)return void w(t);const i=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),n=Number.parseFloat(s);return i||n?(e=e.split(\",\")[0],s=s.split(\",\")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0})(e)+5;let n=!1;const o=({target:s})=>{s===e&&(n=!0,e.removeEventListener(\"transitionend\",o),w(t))};e.addEventListener(\"transitionend\",o),setTimeout(()=>{n||l(e)},i)},A=(t,e,s,i)=>{let n=t.indexOf(e);if(-1===n)return t[!s&&i?t.length-1:0];const o=t.length;return n+=s?1:-1,i&&(n=(n+o)%o),t[Math.max(0,Math.min(n,o-1))]},T=/[^.]*(?=\\..*)\\.|.*/,C=/\\..*/,k=/::\\d+$/,L={};let O=1;const D={mouseenter:\"mouseover\",mouseleave:\"mouseout\"},I=/^(mouseenter|mouseleave)/i,N=new Set([\"click\",\"dblclick\",\"mouseup\",\"mousedown\",\"contextmenu\",\"mousewheel\",\"DOMMouseScroll\",\"mouseover\",\"mouseout\",\"mousemove\",\"selectstart\",\"selectend\",\"keydown\",\"keypress\",\"keyup\",\"orientationchange\",\"touchstart\",\"touchmove\",\"touchend\",\"touchcancel\",\"pointerdown\",\"pointermove\",\"pointerup\",\"pointerleave\",\"pointercancel\",\"gesturestart\",\"gesturechange\",\"gestureend\",\"focus\",\"blur\",\"change\",\"reset\",\"select\",\"submit\",\"focusin\",\"focusout\",\"load\",\"unload\",\"beforeunload\",\"resize\",\"move\",\"DOMContentLoaded\",\"readystatechange\",\"error\",\"abort\",\"scroll\"]);function S(t,e){return e&&`${e}::${O++}`||t.uidEvent||O++}function x(t){const e=S(t);return t.uidEvent=e,L[e]=L[e]||{},L[e]}function M(t,e,s=null){const i=Object.keys(t);for(let n=0,o=i.length;n<o;n++){const o=t[i[n]];if(o.originalHandler===e&&o.delegationSelector===s)return o}return null}function P(t,e,s){const i=\"string\"==typeof e,n=i?s:e;let o=R(t);return N.has(o)||(o=t),[i,n,o]}function j(t,e,s,i,n){if(\"string\"!=typeof e||!t)return;if(s||(s=i,i=null),I.test(e)){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};i?i=t(i):s=t(s)}const[o,r,a]=P(e,s,i),l=x(t),c=l[a]||(l[a]={}),h=M(c,r,o?s:null);if(h)return void(h.oneOff=h.oneOff&&n);const d=S(r,e.replace(T,\"\")),u=o?function(t,e,s){return function i(n){const o=t.querySelectorAll(e);for(let{target:r}=n;r&&r!==this;r=r.parentNode)for(let a=o.length;a--;)if(o[a]===r)return n.delegateTarget=r,i.oneOff&&B.off(t,n.type,e,s),s.apply(r,[n]);return null}}(t,s,i):function(t,e){return function s(i){return i.delegateTarget=t,s.oneOff&&B.off(t,i.type,e),e.apply(t,[i])}}(t,s);u.delegationSelector=o?s:null,u.originalHandler=r,u.oneOff=n,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function H(t,e,s,i,n){const o=M(e[s],i,n);o&&(t.removeEventListener(s,o,Boolean(n)),delete e[s][o.uidEvent])}function R(t){return t=t.replace(C,\"\"),D[t]||t}const B={on(t,e,s,i){j(t,e,s,i,!1)},one(t,e,s,i){j(t,e,s,i,!0)},off(t,e,s,i){if(\"string\"!=typeof e||!t)return;const[n,o,r]=P(e,s,i),a=r!==e,l=x(t),c=e.startsWith(\".\");if(void 0!==o){if(!l||!l[r])return;return void H(t,l,r,o,n?s:null)}c&&Object.keys(l).forEach(s=>{!function(t,e,s,i){const n=e[s]||{};Object.keys(n).forEach(o=>{if(o.includes(i)){const i=n[o];H(t,e,s,i.originalHandler,i.delegationSelector)}})}(t,l,s,e.slice(1))});const h=l[r]||{};Object.keys(h).forEach(s=>{const i=s.replace(k,\"\");if(!a||e.includes(i)){const e=h[s];H(t,l,r,e.originalHandler,e.delegationSelector)}})},trigger(t,e,s){if(\"string\"!=typeof e||!t)return null;const i=_(),n=R(e),o=e!==n,r=N.has(n);let a,l=!0,c=!0,h=!1,d=null;return o&&i&&(a=i.Event(e,s),i(t).trigger(a),l=!a.isPropagationStopped(),c=!a.isImmediatePropagationStopped(),h=a.isDefaultPrevented()),r?(d=document.createEvent(\"HTMLEvents\"),d.initEvent(n,l,!0)):d=new CustomEvent(e,{bubbles:l,cancelable:!0}),void 0!==s&&Object.keys(s).forEach(t=>{Object.defineProperty(d,t,{get:()=>s[t]})}),h&&d.preventDefault(),c&&t.dispatchEvent(d),d.defaultPrevented&&void 0!==a&&a.preventDefault(),d}},$=new Map;var W={set(t,e,s){$.has(t)||$.set(t,new Map);const i=$.get(t);i.has(e)||0===i.size?i.set(e,s):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(i.keys())[0]}.`)},get:(t,e)=>$.has(t)&&$.get(t).get(e)||null,remove(t,e){if(!$.has(t))return;const s=$.get(t);s.delete(e),0===s.size&&$.delete(t)}};class q{constructor(t){(t=h(t))&&(this._element=t,W.set(this._element,this.constructor.DATA_KEY,this))}dispose(){W.remove(this._element,this.constructor.DATA_KEY),B.off(this._element,this.constructor.EVENT_KEY),Object.getOwnPropertyNames(this).forEach(t=>{this[t]=null})}_queueCallback(t,e,s=!0){E(t,e,s)}static getInstance(t){return W.get(t,this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,\"object\"==typeof e?e:null)}static get VERSION(){return\"5.0.2\"}static get NAME(){throw new Error('You have to implement the static method \"NAME\", for each component!')}static get DATA_KEY(){return\"bs.\"+this.NAME}static get EVENT_KEY(){return\".\"+this.DATA_KEY}}class z extends q{static get NAME(){return\"alert\"}close(t){const e=t?this._getRootElement(t):this._element,s=this._triggerCloseEvent(e);null===s||s.defaultPrevented||this._removeElement(e)}_getRootElement(t){return a(t)||t.closest(\".alert\")}_triggerCloseEvent(t){return B.trigger(t,\"close.bs.alert\")}_removeElement(t){t.classList.remove(\"show\");const e=t.classList.contains(\"fade\");this._queueCallback(()=>this._destroyElement(t),t,e)}_destroyElement(t){t.remove(),B.trigger(t,\"closed.bs.alert\")}static jQueryInterface(t){return this.each((function(){const e=z.getOrCreateInstance(this);\"close\"===t&&e[t](this)}))}static handleDismiss(t){return function(e){e&&e.preventDefault(),t.close(this)}}}B.on(document,\"click.bs.alert.data-api\",'[data-bs-dismiss=\"alert\"]',z.handleDismiss(new z)),y(z);class F extends q{static get NAME(){return\"button\"}toggle(){this._element.setAttribute(\"aria-pressed\",this._element.classList.toggle(\"active\"))}static jQueryInterface(t){return this.each((function(){const e=F.getOrCreateInstance(this);\"toggle\"===t&&e[t]()}))}}function U(t){return\"true\"===t||\"false\"!==t&&(t===Number(t).toString()?Number(t):\"\"===t||\"null\"===t?null:t)}function K(t){return t.replace(/[A-Z]/g,t=>\"-\"+t.toLowerCase())}B.on(document,\"click.bs.button.data-api\",'[data-bs-toggle=\"button\"]',t=>{t.preventDefault();const e=t.target.closest('[data-bs-toggle=\"button\"]');F.getOrCreateInstance(e).toggle()}),y(F);const V={setDataAttribute(t,e,s){t.setAttribute(\"data-bs-\"+K(e),s)},removeDataAttribute(t,e){t.removeAttribute(\"data-bs-\"+K(e))},getDataAttributes(t){if(!t)return{};const e={};return Object.keys(t.dataset).filter(t=>t.startsWith(\"bs\")).forEach(s=>{let i=s.replace(/^bs/,\"\");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),e[i]=U(t.dataset[s])}),e},getDataAttribute:(t,e)=>U(t.getAttribute(\"data-bs-\"+K(e))),offset(t){const e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},position:t=>({top:t.offsetTop,left:t.offsetLeft})},Q={interval:5e3,keyboard:!0,slide:!1,pause:\"hover\",wrap:!0,touch:!0},X={interval:\"(number|boolean)\",keyboard:\"boolean\",slide:\"(boolean|string)\",pause:\"(string|boolean)\",wrap:\"boolean\",touch:\"boolean\"},Y=\"next\",G=\"prev\",Z=\"left\",J=\"right\",tt={ArrowLeft:J,ArrowRight:Z};class et extends q{constructor(t,e){super(t),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._indicatorsElement=i.findOne(\".carousel-indicators\",this._element),this._touchSupported=\"ontouchstart\"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent),this._addEventListeners()}static get Default(){return Q}static get NAME(){return\"carousel\"}next(){this._slide(Y)}nextWhenVisible(){!document.hidden&&u(this._element)&&this.next()}prev(){this._slide(G)}pause(t){t||(this._isPaused=!0),i.findOne(\".carousel-item-next, .carousel-item-prev\",this._element)&&(l(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null}cycle(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))}to(t){this._activeElement=i.findOne(\".active.carousel-item\",this._element);const e=this._getItemIndex(this._activeElement);if(t>this._items.length-1||t<0)return;if(this._isSliding)return void B.one(this._element,\"slid.bs.carousel\",()=>this.to(t));if(e===t)return this.pause(),void this.cycle();const s=t>e?Y:G;this._slide(s,this._items[t])}_getConfig(t){return t={...Q,...V.getDataAttributes(this._element),...\"object\"==typeof t?t:{}},d(\"carousel\",t,X),t}_handleSwipe(){const t=Math.abs(this.touchDeltaX);if(t<=40)return;const e=t/this.touchDeltaX;this.touchDeltaX=0,e&&this._slide(e>0?J:Z)}_addEventListeners(){this._config.keyboard&&B.on(this._element,\"keydown.bs.carousel\",t=>this._keydown(t)),\"hover\"===this._config.pause&&(B.on(this._element,\"mouseenter.bs.carousel\",t=>this.pause(t)),B.on(this._element,\"mouseleave.bs.carousel\",t=>this.cycle(t))),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()}_addTouchEventListeners(){const t=t=>{!this._pointerEvent||\"pen\"!==t.pointerType&&\"touch\"!==t.pointerType?this._pointerEvent||(this.touchStartX=t.touches[0].clientX):this.touchStartX=t.clientX},e=t=>{this.touchDeltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this.touchStartX},s=t=>{!this._pointerEvent||\"pen\"!==t.pointerType&&\"touch\"!==t.pointerType||(this.touchDeltaX=t.clientX-this.touchStartX),this._handleSwipe(),\"hover\"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(t=>this.cycle(t),500+this._config.interval))};i.find(\".carousel-item img\",this._element).forEach(t=>{B.on(t,\"dragstart.bs.carousel\",t=>t.preventDefault())}),this._pointerEvent?(B.on(this._element,\"pointerdown.bs.carousel\",e=>t(e)),B.on(this._element,\"pointerup.bs.carousel\",t=>s(t)),this._element.classList.add(\"pointer-event\")):(B.on(this._element,\"touchstart.bs.carousel\",e=>t(e)),B.on(this._element,\"touchmove.bs.carousel\",t=>e(t)),B.on(this._element,\"touchend.bs.carousel\",t=>s(t)))}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=tt[t.key];e&&(t.preventDefault(),this._slide(e))}_getItemIndex(t){return this._items=t&&t.parentNode?i.find(\".carousel-item\",t.parentNode):[],this._items.indexOf(t)}_getItemByOrder(t,e){const s=t===Y;return A(this._items,e,s,this._config.wrap)}_triggerSlideEvent(t,e){const s=this._getItemIndex(t),n=this._getItemIndex(i.findOne(\".active.carousel-item\",this._element));return B.trigger(this._element,\"slide.bs.carousel\",{relatedTarget:t,direction:e,from:n,to:s})}_setActiveIndicatorElement(t){if(this._indicatorsElement){const e=i.findOne(\".active\",this._indicatorsElement);e.classList.remove(\"active\"),e.removeAttribute(\"aria-current\");const s=i.find(\"[data-bs-target]\",this._indicatorsElement);for(let e=0;e<s.length;e++)if(Number.parseInt(s[e].getAttribute(\"data-bs-slide-to\"),10)===this._getItemIndex(t)){s[e].classList.add(\"active\"),s[e].setAttribute(\"aria-current\",\"true\");break}}}_updateInterval(){const t=this._activeElement||i.findOne(\".active.carousel-item\",this._element);if(!t)return;const e=Number.parseInt(t.getAttribute(\"data-bs-interval\"),10);e?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=e):this._config.interval=this._config.defaultInterval||this._config.interval}_slide(t,e){const s=this._directionToOrder(t),n=i.findOne(\".active.carousel-item\",this._element),o=this._getItemIndex(n),r=e||this._getItemByOrder(s,n),a=this._getItemIndex(r),l=Boolean(this._interval),c=s===Y,h=c?\"carousel-item-start\":\"carousel-item-end\",d=c?\"carousel-item-next\":\"carousel-item-prev\",u=this._orderToDirection(s);if(r&&r.classList.contains(\"active\"))return void(this._isSliding=!1);if(this._isSliding)return;if(this._triggerSlideEvent(r,u).defaultPrevented)return;if(!n||!r)return;this._isSliding=!0,l&&this.pause(),this._setActiveIndicatorElement(r),this._activeElement=r;const g=()=>{B.trigger(this._element,\"slid.bs.carousel\",{relatedTarget:r,direction:u,from:o,to:a})};if(this._element.classList.contains(\"slide\")){r.classList.add(d),m(r),n.classList.add(h),r.classList.add(h);const t=()=>{r.classList.remove(h,d),r.classList.add(\"active\"),n.classList.remove(\"active\",d,h),this._isSliding=!1,setTimeout(g,0)};this._queueCallback(t,n,!0)}else n.classList.remove(\"active\"),r.classList.add(\"active\"),this._isSliding=!1,g();l&&this.cycle()}_directionToOrder(t){return[J,Z].includes(t)?v()?t===Z?G:Y:t===Z?Y:G:t}_orderToDirection(t){return[Y,G].includes(t)?v()?t===G?Z:J:t===G?J:Z:t}static carouselInterface(t,e){const s=et.getOrCreateInstance(t,e);let{_config:i}=s;\"object\"==typeof e&&(i={...i,...e});const n=\"string\"==typeof e?e:i.slide;if(\"number\"==typeof e)s.to(e);else if(\"string\"==typeof n){if(void 0===s[n])throw new TypeError(`No method named \"${n}\"`);s[n]()}else i.interval&&i.ride&&(s.pause(),s.cycle())}static jQueryInterface(t){return this.each((function(){et.carouselInterface(this,t)}))}static dataApiClickHandler(t){const e=a(this);if(!e||!e.classList.contains(\"carousel\"))return;const s={...V.getDataAttributes(e),...V.getDataAttributes(this)},i=this.getAttribute(\"data-bs-slide-to\");i&&(s.interval=!1),et.carouselInterface(e,s),i&&et.getInstance(e).to(i),t.preventDefault()}}B.on(document,\"click.bs.carousel.data-api\",\"[data-bs-slide], [data-bs-slide-to]\",et.dataApiClickHandler),B.on(window,\"load.bs.carousel.data-api\",()=>{const t=i.find('[data-bs-ride=\"carousel\"]');for(let e=0,s=t.length;e<s;e++)et.carouselInterface(t[e],et.getInstance(t[e]))}),y(et);const st={toggle:!0,parent:\"\"},it={toggle:\"boolean\",parent:\"(string|element)\"};class nt extends q{constructor(t,e){super(t),this._isTransitioning=!1,this._config=this._getConfig(e),this._triggerArray=i.find(`[data-bs-toggle=\"collapse\"][href=\"#${this._element.id}\"],[data-bs-toggle=\"collapse\"][data-bs-target=\"#${this._element.id}\"]`);const s=i.find('[data-bs-toggle=\"collapse\"]');for(let t=0,e=s.length;t<e;t++){const e=s[t],n=r(e),o=i.find(n).filter(t=>t===this._element);null!==n&&o.length&&(this._selector=n,this._triggerArray.push(e))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}static get Default(){return st}static get NAME(){return\"collapse\"}toggle(){this._element.classList.contains(\"show\")?this.hide():this.show()}show(){if(this._isTransitioning||this._element.classList.contains(\"show\"))return;let t,e;this._parent&&(t=i.find(\".show, .collapsing\",this._parent).filter(t=>\"string\"==typeof this._config.parent?t.getAttribute(\"data-bs-parent\")===this._config.parent:t.classList.contains(\"collapse\")),0===t.length&&(t=null));const s=i.findOne(this._selector);if(t){const i=t.find(t=>s!==t);if(e=i?nt.getInstance(i):null,e&&e._isTransitioning)return}if(B.trigger(this._element,\"show.bs.collapse\").defaultPrevented)return;t&&t.forEach(t=>{s!==t&&nt.collapseInterface(t,\"hide\"),e||W.set(t,\"bs.collapse\",null)});const n=this._getDimension();this._element.classList.remove(\"collapse\"),this._element.classList.add(\"collapsing\"),this._element.style[n]=0,this._triggerArray.length&&this._triggerArray.forEach(t=>{t.classList.remove(\"collapsed\"),t.setAttribute(\"aria-expanded\",!0)}),this.setTransitioning(!0);const o=\"scroll\"+(n[0].toUpperCase()+n.slice(1));this._queueCallback(()=>{this._element.classList.remove(\"collapsing\"),this._element.classList.add(\"collapse\",\"show\"),this._element.style[n]=\"\",this.setTransitioning(!1),B.trigger(this._element,\"shown.bs.collapse\")},this._element,!0),this._element.style[n]=this._element[o]+\"px\"}hide(){if(this._isTransitioning||!this._element.classList.contains(\"show\"))return;if(B.trigger(this._element,\"hide.bs.collapse\").defaultPrevented)return;const t=this._getDimension();this._element.style[t]=this._element.getBoundingClientRect()[t]+\"px\",m(this._element),this._element.classList.add(\"collapsing\"),this._element.classList.remove(\"collapse\",\"show\");const e=this._triggerArray.length;if(e>0)for(let t=0;t<e;t++){const e=this._triggerArray[t],s=a(e);s&&!s.classList.contains(\"show\")&&(e.classList.add(\"collapsed\"),e.setAttribute(\"aria-expanded\",!1))}this.setTransitioning(!0),this._element.style[t]=\"\",this._queueCallback(()=>{this.setTransitioning(!1),this._element.classList.remove(\"collapsing\"),this._element.classList.add(\"collapse\"),B.trigger(this._element,\"hidden.bs.collapse\")},this._element,!0)}setTransitioning(t){this._isTransitioning=t}_getConfig(t){return(t={...st,...t}).toggle=Boolean(t.toggle),d(\"collapse\",t,it),t}_getDimension(){return this._element.classList.contains(\"width\")?\"width\":\"height\"}_getParent(){let{parent:t}=this._config;t=h(t);const e=`[data-bs-toggle=\"collapse\"][data-bs-parent=\"${t}\"]`;return i.find(e,t).forEach(t=>{const e=a(t);this._addAriaAndCollapsedClass(e,[t])}),t}_addAriaAndCollapsedClass(t,e){if(!t||!e.length)return;const s=t.classList.contains(\"show\");e.forEach(t=>{s?t.classList.remove(\"collapsed\"):t.classList.add(\"collapsed\"),t.setAttribute(\"aria-expanded\",s)})}static collapseInterface(t,e){let s=nt.getInstance(t);const i={...st,...V.getDataAttributes(t),...\"object\"==typeof e&&e?e:{}};if(!s&&i.toggle&&\"string\"==typeof e&&/show|hide/.test(e)&&(i.toggle=!1),s||(s=new nt(t,i)),\"string\"==typeof e){if(void 0===s[e])throw new TypeError(`No method named \"${e}\"`);s[e]()}}static jQueryInterface(t){return this.each((function(){nt.collapseInterface(this,t)}))}}B.on(document,\"click.bs.collapse.data-api\",'[data-bs-toggle=\"collapse\"]',(function(t){(\"A\"===t.target.tagName||t.delegateTarget&&\"A\"===t.delegateTarget.tagName)&&t.preventDefault();const e=V.getDataAttributes(this),s=r(this);i.find(s).forEach(t=>{const s=nt.getInstance(t);let i;s?(null===s._parent&&\"string\"==typeof e.parent&&(s._config.parent=e.parent,s._parent=s._getParent()),i=\"toggle\"):i=e,nt.collapseInterface(t,i)})})),y(nt);const ot=new RegExp(\"ArrowUp|ArrowDown|Escape\"),rt=v()?\"top-end\":\"top-start\",at=v()?\"top-start\":\"top-end\",lt=v()?\"bottom-end\":\"bottom-start\",ct=v()?\"bottom-start\":\"bottom-end\",ht=v()?\"left-start\":\"right-start\",dt=v()?\"right-start\":\"left-start\",ut={offset:[0,2],boundary:\"clippingParents\",reference:\"toggle\",display:\"dynamic\",popperConfig:null,autoClose:!0},gt={offset:\"(array|string|function)\",boundary:\"(string|element)\",reference:\"(string|element|object)\",display:\"string\",popperConfig:\"(null|object|function)\",autoClose:\"(boolean|string)\"};class pt extends q{constructor(t,e){super(t),this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}static get Default(){return ut}static get DefaultType(){return gt}static get NAME(){return\"dropdown\"}toggle(){g(this._element)||(this._element.classList.contains(\"show\")?this.hide():this.show())}show(){if(g(this._element)||this._menu.classList.contains(\"show\"))return;const t=pt.getParentFromElement(this._element),e={relatedTarget:this._element};if(!B.trigger(this._element,\"show.bs.dropdown\",e).defaultPrevented){if(this._inNavbar)V.setDataAttribute(this._menu,\"popper\",\"none\");else{if(void 0===s)throw new TypeError(\"Bootstrap's dropdowns require Popper (https://popper.js.org)\");let e=this._element;\"parent\"===this._config.reference?e=t:c(this._config.reference)?e=h(this._config.reference):\"object\"==typeof this._config.reference&&(e=this._config.reference);const i=this._getPopperConfig(),n=i.modifiers.find(t=>\"applyStyles\"===t.name&&!1===t.enabled);this._popper=s.createPopper(e,this._menu,i),n&&V.setDataAttribute(this._menu,\"popper\",\"static\")}\"ontouchstart\"in document.documentElement&&!t.closest(\".navbar-nav\")&&[].concat(...document.body.children).forEach(t=>B.on(t,\"mouseover\",f)),this._element.focus(),this._element.setAttribute(\"aria-expanded\",!0),this._menu.classList.toggle(\"show\"),this._element.classList.toggle(\"show\"),B.trigger(this._element,\"shown.bs.dropdown\",e)}}hide(){if(g(this._element)||!this._menu.classList.contains(\"show\"))return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_addEventListeners(){B.on(this._element,\"click.bs.dropdown\",t=>{t.preventDefault(),this.toggle()})}_completeHide(t){B.trigger(this._element,\"hide.bs.dropdown\",t).defaultPrevented||(\"ontouchstart\"in document.documentElement&&[].concat(...document.body.children).forEach(t=>B.off(t,\"mouseover\",f)),this._popper&&this._popper.destroy(),this._menu.classList.remove(\"show\"),this._element.classList.remove(\"show\"),this._element.setAttribute(\"aria-expanded\",\"false\"),V.removeDataAttribute(this._menu,\"popper\"),B.trigger(this._element,\"hidden.bs.dropdown\",t))}_getConfig(t){if(t={...this.constructor.Default,...V.getDataAttributes(this._element),...t},d(\"dropdown\",t,this.constructor.DefaultType),\"object\"==typeof t.reference&&!c(t.reference)&&\"function\"!=typeof t.reference.getBoundingClientRect)throw new TypeError(\"dropdown\".toUpperCase()+': Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.');return t}_getMenuElement(){return i.next(this._element,\".dropdown-menu\")[0]}_getPlacement(){const t=this._element.parentNode;if(t.classList.contains(\"dropend\"))return ht;if(t.classList.contains(\"dropstart\"))return dt;const e=\"end\"===getComputedStyle(this._menu).getPropertyValue(\"--bs-position\").trim();return t.classList.contains(\"dropup\")?e?at:rt:e?ct:lt}_detectNavbar(){return null!==this._element.closest(\".navbar\")}_getOffset(){const{offset:t}=this._config;return\"string\"==typeof t?t.split(\",\").map(t=>Number.parseInt(t,10)):\"function\"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:\"preventOverflow\",options:{boundary:this._config.boundary}},{name:\"offset\",options:{offset:this._getOffset()}}]};return\"static\"===this._config.display&&(t.modifiers=[{name:\"applyStyles\",enabled:!1}]),{...t,...\"function\"==typeof this._config.popperConfig?this._config.popperConfig(t):this._config.popperConfig}}_selectMenuItem({key:t,target:e}){const s=i.find(\".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)\",this._menu).filter(u);s.length&&A(s,e,\"ArrowDown\"===t,!s.includes(e)).focus()}static dropdownInterface(t,e){const s=pt.getOrCreateInstance(t,e);if(\"string\"==typeof e){if(void 0===s[e])throw new TypeError(`No method named \"${e}\"`);s[e]()}}static jQueryInterface(t){return this.each((function(){pt.dropdownInterface(this,t)}))}static clearMenus(t){if(t&&(2===t.button||\"keyup\"===t.type&&\"Tab\"!==t.key))return;const e=i.find('[data-bs-toggle=\"dropdown\"]');for(let s=0,i=e.length;s<i;s++){const i=pt.getInstance(e[s]);if(!i||!1===i._config.autoClose)continue;if(!i._element.classList.contains(\"show\"))continue;const n={relatedTarget:i._element};if(t){const e=t.composedPath(),s=e.includes(i._menu);if(e.includes(i._element)||\"inside\"===i._config.autoClose&&!s||\"outside\"===i._config.autoClose&&s)continue;if(i._menu.contains(t.target)&&(\"keyup\"===t.type&&\"Tab\"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;\"click\"===t.type&&(n.clickEvent=t)}i._completeHide(n)}}static getParentFromElement(t){return a(t)||t.parentNode}static dataApiKeydownHandler(t){if(/input|textarea/i.test(t.target.tagName)?\"Space\"===t.key||\"Escape\"!==t.key&&(\"ArrowDown\"!==t.key&&\"ArrowUp\"!==t.key||t.target.closest(\".dropdown-menu\")):!ot.test(t.key))return;const e=this.classList.contains(\"show\");if(!e&&\"Escape\"===t.key)return;if(t.preventDefault(),t.stopPropagation(),g(this))return;const s=()=>this.matches('[data-bs-toggle=\"dropdown\"]')?this:i.prev(this,'[data-bs-toggle=\"dropdown\"]')[0];return\"Escape\"===t.key?(s().focus(),void pt.clearMenus()):\"ArrowUp\"===t.key||\"ArrowDown\"===t.key?(e||s().click(),void pt.getInstance(s())._selectMenuItem(t)):void(e&&\"Space\"!==t.key||pt.clearMenus())}}B.on(document,\"keydown.bs.dropdown.data-api\",'[data-bs-toggle=\"dropdown\"]',pt.dataApiKeydownHandler),B.on(document,\"keydown.bs.dropdown.data-api\",\".dropdown-menu\",pt.dataApiKeydownHandler),B.on(document,\"click.bs.dropdown.data-api\",pt.clearMenus),B.on(document,\"keyup.bs.dropdown.data-api\",pt.clearMenus),B.on(document,\"click.bs.dropdown.data-api\",'[data-bs-toggle=\"dropdown\"]',(function(t){t.preventDefault(),pt.dropdownInterface(this)})),y(pt);class ft{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,\"paddingRight\",e=>e+t),this._setElementAttributes(\".fixed-top, .fixed-bottom, .is-fixed, .sticky-top\",\"paddingRight\",e=>e+t),this._setElementAttributes(\".sticky-top\",\"marginRight\",e=>e-t)}_disableOverFlow(){this._saveInitialAttribute(this._element,\"overflow\"),this._element.style.overflow=\"hidden\"}_setElementAttributes(t,e,s){const i=this.getWidth();this._applyManipulationCallback(t,t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+i)return;this._saveInitialAttribute(t,e);const n=window.getComputedStyle(t)[e];t.style[e]=s(Number.parseFloat(n))+\"px\"})}reset(){this._resetElementAttributes(this._element,\"overflow\"),this._resetElementAttributes(this._element,\"paddingRight\"),this._resetElementAttributes(\".fixed-top, .fixed-bottom, .is-fixed, .sticky-top\",\"paddingRight\"),this._resetElementAttributes(\".sticky-top\",\"marginRight\")}_saveInitialAttribute(t,e){const s=t.style[e];s&&V.setDataAttribute(t,e,s)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,t=>{const s=V.getDataAttribute(t,e);void 0===s?t.style.removeProperty(e):(V.removeDataAttribute(t,e),t.style[e]=s)})}_applyManipulationCallback(t,e){c(t)?e(t):i.find(t,this._element).forEach(e)}isOverflowing(){return this.getWidth()>0}}const mt={isVisible:!0,isAnimated:!1,rootElement:\"body\",clickCallback:null},_t={isVisible:\"boolean\",isAnimated:\"boolean\",rootElement:\"(element|string)\",clickCallback:\"(function|null)\"};class bt{constructor(t){this._config=this._getConfig(t),this._isAppended=!1,this._element=null}show(t){this._config.isVisible?(this._append(),this._config.isAnimated&&m(this._getElement()),this._getElement().classList.add(\"show\"),this._emulateAnimation(()=>{w(t)})):w(t)}hide(t){this._config.isVisible?(this._getElement().classList.remove(\"show\"),this._emulateAnimation(()=>{this.dispose(),w(t)})):w(t)}_getElement(){if(!this._element){const t=document.createElement(\"div\");t.className=\"modal-backdrop\",this._config.isAnimated&&t.classList.add(\"fade\"),this._element=t}return this._element}_getConfig(t){return(t={...mt,...\"object\"==typeof t?t:{}}).rootElement=h(t.rootElement),d(\"backdrop\",t,_t),t}_append(){this._isAppended||(this._config.rootElement.appendChild(this._getElement()),B.on(this._getElement(),\"mousedown.bs.backdrop\",()=>{w(this._config.clickCallback)}),this._isAppended=!0)}dispose(){this._isAppended&&(B.off(this._element,\"mousedown.bs.backdrop\"),this._element.remove(),this._isAppended=!1)}_emulateAnimation(t){E(t,this._getElement(),this._config.isAnimated)}}const vt={backdrop:!0,keyboard:!0,focus:!0},yt={backdrop:\"(boolean|string)\",keyboard:\"boolean\",focus:\"boolean\"};class wt extends q{constructor(t,e){super(t),this._config=this._getConfig(e),this._dialog=i.findOne(\".modal-dialog\",this._element),this._backdrop=this._initializeBackDrop(),this._isShown=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollBar=new ft}static get Default(){return vt}static get NAME(){return\"modal\"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||B.trigger(this._element,\"show.bs.modal\",{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._scrollBar.hide(),document.body.classList.add(\"modal-open\"),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),B.on(this._element,\"click.dismiss.bs.modal\",'[data-bs-dismiss=\"modal\"]',t=>this.hide(t)),B.on(this._dialog,\"mousedown.dismiss.bs.modal\",()=>{B.one(this._element,\"mouseup.dismiss.bs.modal\",t=>{t.target===this._element&&(this._ignoreBackdropClick=!0)})}),this._showBackdrop(()=>this._showElement(t)))}hide(t){if(t&&[\"A\",\"AREA\"].includes(t.target.tagName)&&t.preventDefault(),!this._isShown||this._isTransitioning)return;if(B.trigger(this._element,\"hide.bs.modal\").defaultPrevented)return;this._isShown=!1;const e=this._isAnimated();e&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),B.off(document,\"focusin.bs.modal\"),this._element.classList.remove(\"show\"),B.off(this._element,\"click.dismiss.bs.modal\"),B.off(this._dialog,\"mousedown.dismiss.bs.modal\"),this._queueCallback(()=>this._hideModal(),this._element,e)}dispose(){[window,this._dialog].forEach(t=>B.off(t,\".bs.modal\")),this._backdrop.dispose(),super.dispose(),B.off(document,\"focusin.bs.modal\")}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new bt({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_getConfig(t){return t={...vt,...V.getDataAttributes(this._element),...\"object\"==typeof t?t:{}},d(\"modal\",t,yt),t}_showElement(t){const e=this._isAnimated(),s=i.findOne(\".modal-body\",this._dialog);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display=\"block\",this._element.removeAttribute(\"aria-hidden\"),this._element.setAttribute(\"aria-modal\",!0),this._element.setAttribute(\"role\",\"dialog\"),this._element.scrollTop=0,s&&(s.scrollTop=0),e&&m(this._element),this._element.classList.add(\"show\"),this._config.focus&&this._enforceFocus(),this._queueCallback(()=>{this._config.focus&&this._element.focus(),this._isTransitioning=!1,B.trigger(this._element,\"shown.bs.modal\",{relatedTarget:t})},this._dialog,e)}_enforceFocus(){B.off(document,\"focusin.bs.modal\"),B.on(document,\"focusin.bs.modal\",t=>{document===t.target||this._element===t.target||this._element.contains(t.target)||this._element.focus()})}_setEscapeEvent(){this._isShown?B.on(this._element,\"keydown.dismiss.bs.modal\",t=>{this._config.keyboard&&\"Escape\"===t.key?(t.preventDefault(),this.hide()):this._config.keyboard||\"Escape\"!==t.key||this._triggerBackdropTransition()}):B.off(this._element,\"keydown.dismiss.bs.modal\")}_setResizeEvent(){this._isShown?B.on(window,\"resize.bs.modal\",()=>this._adjustDialog()):B.off(window,\"resize.bs.modal\")}_hideModal(){this._element.style.display=\"none\",this._element.setAttribute(\"aria-hidden\",!0),this._element.removeAttribute(\"aria-modal\"),this._element.removeAttribute(\"role\"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(\"modal-open\"),this._resetAdjustments(),this._scrollBar.reset(),B.trigger(this._element,\"hidden.bs.modal\")})}_showBackdrop(t){B.on(this._element,\"click.dismiss.bs.modal\",t=>{this._ignoreBackdropClick?this._ignoreBackdropClick=!1:t.target===t.currentTarget&&(!0===this._config.backdrop?this.hide():\"static\"===this._config.backdrop&&this._triggerBackdropTransition())}),this._backdrop.show(t)}_isAnimated(){return this._element.classList.contains(\"fade\")}_triggerBackdropTransition(){if(B.trigger(this._element,\"hidePrevented.bs.modal\").defaultPrevented)return;const{classList:t,scrollHeight:e,style:s}=this._element,i=e>document.documentElement.clientHeight;!i&&\"hidden\"===s.overflowY||t.contains(\"modal-static\")||(i||(s.overflowY=\"hidden\"),t.add(\"modal-static\"),this._queueCallback(()=>{t.remove(\"modal-static\"),i||this._queueCallback(()=>{s.overflowY=\"\"},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),s=e>0;(!s&&t&&!v()||s&&!t&&v())&&(this._element.style.paddingLeft=e+\"px\"),(s&&!t&&!v()||!s&&t&&v())&&(this._element.style.paddingRight=e+\"px\")}_resetAdjustments(){this._element.style.paddingLeft=\"\",this._element.style.paddingRight=\"\"}static jQueryInterface(t,e){return this.each((function(){const s=wt.getOrCreateInstance(this,t);if(\"string\"==typeof t){if(void 0===s[t])throw new TypeError(`No method named \"${t}\"`);s[t](e)}}))}}B.on(document,\"click.bs.modal.data-api\",'[data-bs-toggle=\"modal\"]',(function(t){const e=a(this);[\"A\",\"AREA\"].includes(this.tagName)&&t.preventDefault(),B.one(e,\"show.bs.modal\",t=>{t.defaultPrevented||B.one(e,\"hidden.bs.modal\",()=>{u(this)&&this.focus()})}),wt.getOrCreateInstance(e).toggle(this)})),y(wt);const Et={backdrop:!0,keyboard:!0,scroll:!1},At={backdrop:\"boolean\",keyboard:\"boolean\",scroll:\"boolean\"};class Tt extends q{constructor(t,e){super(t),this._config=this._getConfig(e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._addEventListeners()}static get NAME(){return\"offcanvas\"}static get Default(){return Et}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||B.trigger(this._element,\"show.bs.offcanvas\",{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._element.style.visibility=\"visible\",this._backdrop.show(),this._config.scroll||((new ft).hide(),this._enforceFocusOnElement(this._element)),this._element.removeAttribute(\"aria-hidden\"),this._element.setAttribute(\"aria-modal\",!0),this._element.setAttribute(\"role\",\"dialog\"),this._element.classList.add(\"show\"),this._queueCallback(()=>{B.trigger(this._element,\"shown.bs.offcanvas\",{relatedTarget:t})},this._element,!0))}hide(){this._isShown&&(B.trigger(this._element,\"hide.bs.offcanvas\").defaultPrevented||(B.off(document,\"focusin.bs.offcanvas\"),this._element.blur(),this._isShown=!1,this._element.classList.remove(\"show\"),this._backdrop.hide(),this._queueCallback(()=>{this._element.setAttribute(\"aria-hidden\",!0),this._element.removeAttribute(\"aria-modal\"),this._element.removeAttribute(\"role\"),this._element.style.visibility=\"hidden\",this._config.scroll||(new ft).reset(),B.trigger(this._element,\"hidden.bs.offcanvas\")},this._element,!0)))}dispose(){this._backdrop.dispose(),super.dispose(),B.off(document,\"focusin.bs.offcanvas\")}_getConfig(t){return t={...Et,...V.getDataAttributes(this._element),...\"object\"==typeof t?t:{}},d(\"offcanvas\",t,At),t}_initializeBackDrop(){return new bt({isVisible:this._config.backdrop,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:()=>this.hide()})}_enforceFocusOnElement(t){B.off(document,\"focusin.bs.offcanvas\"),B.on(document,\"focusin.bs.offcanvas\",e=>{document===e.target||t===e.target||t.contains(e.target)||t.focus()}),t.focus()}_addEventListeners(){B.on(this._element,\"click.dismiss.bs.offcanvas\",'[data-bs-dismiss=\"offcanvas\"]',()=>this.hide()),B.on(this._element,\"keydown.dismiss.bs.offcanvas\",t=>{this._config.keyboard&&\"Escape\"===t.key&&this.hide()})}static jQueryInterface(t){return this.each((function(){const e=Tt.getOrCreateInstance(this,t);if(\"string\"==typeof t){if(void 0===e[t]||t.startsWith(\"_\")||\"constructor\"===t)throw new TypeError(`No method named \"${t}\"`);e[t](this)}}))}}B.on(document,\"click.bs.offcanvas.data-api\",'[data-bs-toggle=\"offcanvas\"]',(function(t){const e=a(this);if([\"A\",\"AREA\"].includes(this.tagName)&&t.preventDefault(),g(this))return;B.one(e,\"hidden.bs.offcanvas\",()=>{u(this)&&this.focus()});const s=i.findOne(\".offcanvas.show\");s&&s!==e&&Tt.getInstance(s).hide(),Tt.getOrCreateInstance(e).toggle(this)})),B.on(window,\"load.bs.offcanvas.data-api\",()=>i.find(\".offcanvas.show\").forEach(t=>Tt.getOrCreateInstance(t).show())),y(Tt);const Ct=new Set([\"background\",\"cite\",\"href\",\"itemtype\",\"longdesc\",\"poster\",\"src\",\"xlink:href\"]),kt=/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i,Lt=/^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[\\d+/a-z]+=*$/i,Ot=(t,e)=>{const s=t.nodeName.toLowerCase();if(e.includes(s))return!Ct.has(s)||Boolean(kt.test(t.nodeValue)||Lt.test(t.nodeValue));const i=e.filter(t=>t instanceof RegExp);for(let t=0,e=i.length;t<e;t++)if(i[t].test(s))return!0;return!1};function Dt(t,e,s){if(!t.length)return t;if(s&&\"function\"==typeof s)return s(t);const i=(new window.DOMParser).parseFromString(t,\"text/html\"),n=Object.keys(e),o=[].concat(...i.body.querySelectorAll(\"*\"));for(let t=0,s=o.length;t<s;t++){const s=o[t],i=s.nodeName.toLowerCase();if(!n.includes(i)){s.remove();continue}const r=[].concat(...s.attributes),a=[].concat(e[\"*\"]||[],e[i]||[]);r.forEach(t=>{Ot(t,a)||s.removeAttribute(t.nodeName)})}return i.body.innerHTML}const It=new RegExp(\"(^|\\\\s)bs-tooltip\\\\S+\",\"g\"),Nt=new Set([\"sanitize\",\"allowList\",\"sanitizeFn\"]),St={animation:\"boolean\",template:\"string\",title:\"(string|element|function)\",trigger:\"string\",delay:\"(number|object)\",html:\"boolean\",selector:\"(string|boolean)\",placement:\"(string|function)\",offset:\"(array|string|function)\",container:\"(string|element|boolean)\",fallbackPlacements:\"array\",boundary:\"(string|element)\",customClass:\"(string|function)\",sanitize:\"boolean\",sanitizeFn:\"(null|function)\",allowList:\"object\",popperConfig:\"(null|object|function)\"},xt={AUTO:\"auto\",TOP:\"top\",RIGHT:v()?\"left\":\"right\",BOTTOM:\"bottom\",LEFT:v()?\"right\":\"left\"},Mt={animation:!0,template:'<div class=\"tooltip\" role=\"tooltip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\"></div></div>',trigger:\"hover focus\",title:\"\",delay:0,html:!1,selector:!1,placement:\"top\",offset:[0,0],container:!1,fallbackPlacements:[\"top\",\"right\",\"bottom\",\"left\"],boundary:\"clippingParents\",customClass:\"\",sanitize:!0,sanitizeFn:null,allowList:{\"*\":[\"class\",\"dir\",\"id\",\"lang\",\"role\",/^aria-[\\w-]*$/i],a:[\"target\",\"href\",\"title\",\"rel\"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:[\"src\",\"srcset\",\"alt\",\"title\",\"width\",\"height\"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},Pt={HIDE:\"hide.bs.tooltip\",HIDDEN:\"hidden.bs.tooltip\",SHOW:\"show.bs.tooltip\",SHOWN:\"shown.bs.tooltip\",INSERTED:\"inserted.bs.tooltip\",CLICK:\"click.bs.tooltip\",FOCUSIN:\"focusin.bs.tooltip\",FOCUSOUT:\"focusout.bs.tooltip\",MOUSEENTER:\"mouseenter.bs.tooltip\",MOUSELEAVE:\"mouseleave.bs.tooltip\"};class jt extends q{constructor(t,e){if(void 0===s)throw new TypeError(\"Bootstrap's tooltips require Popper (https://popper.js.org)\");super(t),this._isEnabled=!0,this._timeout=0,this._hoverState=\"\",this._activeTrigger={},this._popper=null,this._config=this._getConfig(e),this.tip=null,this._setListeners()}static get Default(){return Mt}static get NAME(){return\"tooltip\"}static get Event(){return Pt}static get DefaultType(){return St}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(t){if(this._isEnabled)if(t){const e=this._initializeOnDelegatedTarget(t);e._activeTrigger.click=!e._activeTrigger.click,e._isWithActiveTrigger()?e._enter(null,e):e._leave(null,e)}else{if(this.getTipElement().classList.contains(\"show\"))return void this._leave(null,this);this._enter(null,this)}}dispose(){clearTimeout(this._timeout),B.off(this._element.closest(\".modal\"),\"hide.bs.modal\",this._hideModalHandler),this.tip&&this.tip.remove(),this._popper&&this._popper.destroy(),super.dispose()}show(){if(\"none\"===this._element.style.display)throw new Error(\"Please use show on visible elements\");if(!this.isWithContent()||!this._isEnabled)return;const t=B.trigger(this._element,this.constructor.Event.SHOW),e=p(this._element),i=null===e?this._element.ownerDocument.documentElement.contains(this._element):e.contains(this._element);if(t.defaultPrevented||!i)return;const o=this.getTipElement(),r=n(this.constructor.NAME);o.setAttribute(\"id\",r),this._element.setAttribute(\"aria-describedby\",r),this.setContent(),this._config.animation&&o.classList.add(\"fade\");const a=\"function\"==typeof this._config.placement?this._config.placement.call(this,o,this._element):this._config.placement,l=this._getAttachment(a);this._addAttachmentClass(l);const{container:c}=this._config;W.set(o,this.constructor.DATA_KEY,this),this._element.ownerDocument.documentElement.contains(this.tip)||(c.appendChild(o),B.trigger(this._element,this.constructor.Event.INSERTED)),this._popper?this._popper.update():this._popper=s.createPopper(this._element,o,this._getPopperConfig(l)),o.classList.add(\"show\");const h=\"function\"==typeof this._config.customClass?this._config.customClass():this._config.customClass;h&&o.classList.add(...h.split(\" \")),\"ontouchstart\"in document.documentElement&&[].concat(...document.body.children).forEach(t=>{B.on(t,\"mouseover\",f)});const d=this.tip.classList.contains(\"fade\");this._queueCallback(()=>{const t=this._hoverState;this._hoverState=null,B.trigger(this._element,this.constructor.Event.SHOWN),\"out\"===t&&this._leave(null,this)},this.tip,d)}hide(){if(!this._popper)return;const t=this.getTipElement();if(B.trigger(this._element,this.constructor.Event.HIDE).defaultPrevented)return;t.classList.remove(\"show\"),\"ontouchstart\"in document.documentElement&&[].concat(...document.body.children).forEach(t=>B.off(t,\"mouseover\",f)),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1;const e=this.tip.classList.contains(\"fade\");this._queueCallback(()=>{this._isWithActiveTrigger()||(\"show\"!==this._hoverState&&t.remove(),this._cleanTipClass(),this._element.removeAttribute(\"aria-describedby\"),B.trigger(this._element,this.constructor.Event.HIDDEN),this._popper&&(this._popper.destroy(),this._popper=null))},this.tip,e),this._hoverState=\"\"}update(){null!==this._popper&&this._popper.update()}isWithContent(){return Boolean(this.getTitle())}getTipElement(){if(this.tip)return this.tip;const t=document.createElement(\"div\");return t.innerHTML=this._config.template,this.tip=t.children[0],this.tip}setContent(){const t=this.getTipElement();this.setElementContent(i.findOne(\".tooltip-inner\",t),this.getTitle()),t.classList.remove(\"fade\",\"show\")}setElementContent(t,e){if(null!==t)return c(e)?(e=h(e),void(this._config.html?e.parentNode!==t&&(t.innerHTML=\"\",t.appendChild(e)):t.textContent=e.textContent)):void(this._config.html?(this._config.sanitize&&(e=Dt(e,this._config.allowList,this._config.sanitizeFn)),t.innerHTML=e):t.textContent=e)}getTitle(){let t=this._element.getAttribute(\"data-bs-original-title\");return t||(t=\"function\"==typeof this._config.title?this._config.title.call(this._element):this._config.title),t}updateAttachment(t){return\"right\"===t?\"end\":\"left\"===t?\"start\":t}_initializeOnDelegatedTarget(t,e){const s=this.constructor.DATA_KEY;return(e=e||W.get(t.delegateTarget,s))||(e=new this.constructor(t.delegateTarget,this._getDelegateConfig()),W.set(t.delegateTarget,s,e)),e}_getOffset(){const{offset:t}=this._config;return\"string\"==typeof t?t.split(\",\").map(t=>Number.parseInt(t,10)):\"function\"==typeof t?e=>t(e,this._element):t}_getPopperConfig(t){const e={placement:t,modifiers:[{name:\"flip\",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:\"offset\",options:{offset:this._getOffset()}},{name:\"preventOverflow\",options:{boundary:this._config.boundary}},{name:\"arrow\",options:{element:`.${this.constructor.NAME}-arrow`}},{name:\"onChange\",enabled:!0,phase:\"afterWrite\",fn:t=>this._handlePopperPlacementChange(t)}],onFirstUpdate:t=>{t.options.placement!==t.placement&&this._handlePopperPlacementChange(t)}};return{...e,...\"function\"==typeof this._config.popperConfig?this._config.popperConfig(e):this._config.popperConfig}}_addAttachmentClass(t){this.getTipElement().classList.add(\"bs-tooltip-\"+this.updateAttachment(t))}_getAttachment(t){return xt[t.toUpperCase()]}_setListeners(){this._config.trigger.split(\" \").forEach(t=>{if(\"click\"===t)B.on(this._element,this.constructor.Event.CLICK,this._config.selector,t=>this.toggle(t));else if(\"manual\"!==t){const e=\"hover\"===t?this.constructor.Event.MOUSEENTER:this.constructor.Event.FOCUSIN,s=\"hover\"===t?this.constructor.Event.MOUSELEAVE:this.constructor.Event.FOCUSOUT;B.on(this._element,e,this._config.selector,t=>this._enter(t)),B.on(this._element,s,this._config.selector,t=>this._leave(t))}}),this._hideModalHandler=()=>{this._element&&this.hide()},B.on(this._element.closest(\".modal\"),\"hide.bs.modal\",this._hideModalHandler),this._config.selector?this._config={...this._config,trigger:\"manual\",selector:\"\"}:this._fixTitle()}_fixTitle(){const t=this._element.getAttribute(\"title\"),e=typeof this._element.getAttribute(\"data-bs-original-title\");(t||\"string\"!==e)&&(this._element.setAttribute(\"data-bs-original-title\",t||\"\"),!t||this._element.getAttribute(\"aria-label\")||this._element.textContent||this._element.setAttribute(\"aria-label\",t),this._element.setAttribute(\"title\",\"\"))}_enter(t,e){e=this._initializeOnDelegatedTarget(t,e),t&&(e._activeTrigger[\"focusin\"===t.type?\"focus\":\"hover\"]=!0),e.getTipElement().classList.contains(\"show\")||\"show\"===e._hoverState?e._hoverState=\"show\":(clearTimeout(e._timeout),e._hoverState=\"show\",e._config.delay&&e._config.delay.show?e._timeout=setTimeout(()=>{\"show\"===e._hoverState&&e.show()},e._config.delay.show):e.show())}_leave(t,e){e=this._initializeOnDelegatedTarget(t,e),t&&(e._activeTrigger[\"focusout\"===t.type?\"focus\":\"hover\"]=e._element.contains(t.relatedTarget)),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=\"out\",e._config.delay&&e._config.delay.hide?e._timeout=setTimeout(()=>{\"out\"===e._hoverState&&e.hide()},e._config.delay.hide):e.hide())}_isWithActiveTrigger(){for(const t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1}_getConfig(t){const e=V.getDataAttributes(this._element);return Object.keys(e).forEach(t=>{Nt.has(t)&&delete e[t]}),(t={...this.constructor.Default,...e,...\"object\"==typeof t&&t?t:{}}).container=!1===t.container?document.body:h(t.container),\"number\"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),\"number\"==typeof t.title&&(t.title=t.title.toString()),\"number\"==typeof t.content&&(t.content=t.content.toString()),d(\"tooltip\",t,this.constructor.DefaultType),t.sanitize&&(t.template=Dt(t.template,t.allowList,t.sanitizeFn)),t}_getDelegateConfig(){const t={};if(this._config)for(const e in this._config)this.constructor.Default[e]!==this._config[e]&&(t[e]=this._config[e]);return t}_cleanTipClass(){const t=this.getTipElement(),e=t.getAttribute(\"class\").match(It);null!==e&&e.length>0&&e.map(t=>t.trim()).forEach(e=>t.classList.remove(e))}_handlePopperPlacementChange(t){const{state:e}=t;e&&(this.tip=e.elements.popper,this._cleanTipClass(),this._addAttachmentClass(this._getAttachment(e.placement)))}static jQueryInterface(t){return this.each((function(){const e=jt.getOrCreateInstance(this,t);if(\"string\"==typeof t){if(void 0===e[t])throw new TypeError(`No method named \"${t}\"`);e[t]()}}))}}y(jt);const Ht=new RegExp(\"(^|\\\\s)bs-popover\\\\S+\",\"g\"),Rt={...jt.Default,placement:\"right\",offset:[0,8],trigger:\"click\",content:\"\",template:'<div class=\"popover\" role=\"tooltip\"><div class=\"popover-arrow\"></div><h3 class=\"popover-header\"></h3><div class=\"popover-body\"></div></div>'},Bt={...jt.DefaultType,content:\"(string|element|function)\"},$t={HIDE:\"hide.bs.popover\",HIDDEN:\"hidden.bs.popover\",SHOW:\"show.bs.popover\",SHOWN:\"shown.bs.popover\",INSERTED:\"inserted.bs.popover\",CLICK:\"click.bs.popover\",FOCUSIN:\"focusin.bs.popover\",FOCUSOUT:\"focusout.bs.popover\",MOUSEENTER:\"mouseenter.bs.popover\",MOUSELEAVE:\"mouseleave.bs.popover\"};class Wt extends jt{static get Default(){return Rt}static get NAME(){return\"popover\"}static get Event(){return $t}static get DefaultType(){return Bt}isWithContent(){return this.getTitle()||this._getContent()}getTipElement(){return this.tip||(this.tip=super.getTipElement(),this.getTitle()||i.findOne(\".popover-header\",this.tip).remove(),this._getContent()||i.findOne(\".popover-body\",this.tip).remove()),this.tip}setContent(){const t=this.getTipElement();this.setElementContent(i.findOne(\".popover-header\",t),this.getTitle());let e=this._getContent();\"function\"==typeof e&&(e=e.call(this._element)),this.setElementContent(i.findOne(\".popover-body\",t),e),t.classList.remove(\"fade\",\"show\")}_addAttachmentClass(t){this.getTipElement().classList.add(\"bs-popover-\"+this.updateAttachment(t))}_getContent(){return this._element.getAttribute(\"data-bs-content\")||this._config.content}_cleanTipClass(){const t=this.getTipElement(),e=t.getAttribute(\"class\").match(Ht);null!==e&&e.length>0&&e.map(t=>t.trim()).forEach(e=>t.classList.remove(e))}static jQueryInterface(t){return this.each((function(){const e=Wt.getOrCreateInstance(this,t);if(\"string\"==typeof t){if(void 0===e[t])throw new TypeError(`No method named \"${t}\"`);e[t]()}}))}}y(Wt);const qt={offset:10,method:\"auto\",target:\"\"},zt={offset:\"number\",method:\"string\",target:\"(string|element)\"};class Ft extends q{constructor(t,e){super(t),this._scrollElement=\"BODY\"===this._element.tagName?window:this._element,this._config=this._getConfig(e),this._selector=`${this._config.target} .nav-link, ${this._config.target} .list-group-item, ${this._config.target} .dropdown-item`,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,B.on(this._scrollElement,\"scroll.bs.scrollspy\",()=>this._process()),this.refresh(),this._process()}static get Default(){return qt}static get NAME(){return\"scrollspy\"}refresh(){const t=this._scrollElement===this._scrollElement.window?\"offset\":\"position\",e=\"auto\"===this._config.method?t:this._config.method,s=\"position\"===e?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),i.find(this._selector).map(t=>{const n=r(t),o=n?i.findOne(n):null;if(o){const t=o.getBoundingClientRect();if(t.width||t.height)return[V[e](o).top+s,n]}return null}).filter(t=>t).sort((t,e)=>t[0]-e[0]).forEach(t=>{this._offsets.push(t[0]),this._targets.push(t[1])})}dispose(){B.off(this._scrollElement,\".bs.scrollspy\"),super.dispose()}_getConfig(t){if(\"string\"!=typeof(t={...qt,...V.getDataAttributes(this._element),...\"object\"==typeof t&&t?t:{}}).target&&c(t.target)){let{id:e}=t.target;e||(e=n(\"scrollspy\"),t.target.id=e),t.target=\"#\"+e}return d(\"scrollspy\",t,zt),t}_getScrollTop(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}_getScrollHeight(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}_getOffsetHeight(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}_process(){const t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),s=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=s){const t=this._targets[this._targets.length-1];this._activeTarget!==t&&this._activate(t)}else{if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(let e=this._offsets.length;e--;)this._activeTarget!==this._targets[e]&&t>=this._offsets[e]&&(void 0===this._offsets[e+1]||t<this._offsets[e+1])&&this._activate(this._targets[e])}}_activate(t){this._activeTarget=t,this._clear();const e=this._selector.split(\",\").map(e=>`${e}[data-bs-target=\"${t}\"],${e}[href=\"${t}\"]`),s=i.findOne(e.join(\",\"));s.classList.contains(\"dropdown-item\")?(i.findOne(\".dropdown-toggle\",s.closest(\".dropdown\")).classList.add(\"active\"),s.classList.add(\"active\")):(s.classList.add(\"active\"),i.parents(s,\".nav, .list-group\").forEach(t=>{i.prev(t,\".nav-link, .list-group-item\").forEach(t=>t.classList.add(\"active\")),i.prev(t,\".nav-item\").forEach(t=>{i.children(t,\".nav-link\").forEach(t=>t.classList.add(\"active\"))})})),B.trigger(this._scrollElement,\"activate.bs.scrollspy\",{relatedTarget:t})}_clear(){i.find(this._selector).filter(t=>t.classList.contains(\"active\")).forEach(t=>t.classList.remove(\"active\"))}static jQueryInterface(t){return this.each((function(){const e=Ft.getOrCreateInstance(this,t);if(\"string\"==typeof t){if(void 0===e[t])throw new TypeError(`No method named \"${t}\"`);e[t]()}}))}}B.on(window,\"load.bs.scrollspy.data-api\",()=>{i.find('[data-bs-spy=\"scroll\"]').forEach(t=>new Ft(t))}),y(Ft);class Ut extends q{static get NAME(){return\"tab\"}show(){if(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&this._element.classList.contains(\"active\"))return;let t;const e=a(this._element),s=this._element.closest(\".nav, .list-group\");if(s){const e=\"UL\"===s.nodeName||\"OL\"===s.nodeName?\":scope > li > .active\":\".active\";t=i.find(e,s),t=t[t.length-1]}const n=t?B.trigger(t,\"hide.bs.tab\",{relatedTarget:this._element}):null;if(B.trigger(this._element,\"show.bs.tab\",{relatedTarget:t}).defaultPrevented||null!==n&&n.defaultPrevented)return;this._activate(this._element,s);const o=()=>{B.trigger(t,\"hidden.bs.tab\",{relatedTarget:this._element}),B.trigger(this._element,\"shown.bs.tab\",{relatedTarget:t})};e?this._activate(e,e.parentNode,o):o()}_activate(t,e,s){const n=(!e||\"UL\"!==e.nodeName&&\"OL\"!==e.nodeName?i.children(e,\".active\"):i.find(\":scope > li > .active\",e))[0],o=s&&n&&n.classList.contains(\"fade\"),r=()=>this._transitionComplete(t,n,s);n&&o?(n.classList.remove(\"show\"),this._queueCallback(r,t,!0)):r()}_transitionComplete(t,e,s){if(e){e.classList.remove(\"active\");const t=i.findOne(\":scope > .dropdown-menu .active\",e.parentNode);t&&t.classList.remove(\"active\"),\"tab\"===e.getAttribute(\"role\")&&e.setAttribute(\"aria-selected\",!1)}t.classList.add(\"active\"),\"tab\"===t.getAttribute(\"role\")&&t.setAttribute(\"aria-selected\",!0),m(t),t.classList.contains(\"fade\")&&t.classList.add(\"show\");let n=t.parentNode;if(n&&\"LI\"===n.nodeName&&(n=n.parentNode),n&&n.classList.contains(\"dropdown-menu\")){const e=t.closest(\".dropdown\");e&&i.find(\".dropdown-toggle\",e).forEach(t=>t.classList.add(\"active\")),t.setAttribute(\"aria-expanded\",!0)}s&&s()}static jQueryInterface(t){return this.each((function(){const e=Ut.getOrCreateInstance(this);if(\"string\"==typeof t){if(void 0===e[t])throw new TypeError(`No method named \"${t}\"`);e[t]()}}))}}B.on(document,\"click.bs.tab.data-api\",'[data-bs-toggle=\"tab\"], [data-bs-toggle=\"pill\"], [data-bs-toggle=\"list\"]',(function(t){[\"A\",\"AREA\"].includes(this.tagName)&&t.preventDefault(),g(this)||Ut.getOrCreateInstance(this).show()})),y(Ut);const Kt={animation:\"boolean\",autohide:\"boolean\",delay:\"number\"},Vt={animation:!0,autohide:!0,delay:5e3};class Qt extends q{constructor(t,e){super(t),this._config=this._getConfig(e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get DefaultType(){return Kt}static get Default(){return Vt}static get NAME(){return\"toast\"}show(){B.trigger(this._element,\"show.bs.toast\").defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add(\"fade\"),this._element.classList.remove(\"hide\"),m(this._element),this._element.classList.add(\"showing\"),this._queueCallback(()=>{this._element.classList.remove(\"showing\"),this._element.classList.add(\"show\"),B.trigger(this._element,\"shown.bs.toast\"),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this._element.classList.contains(\"show\")&&(B.trigger(this._element,\"hide.bs.toast\").defaultPrevented||(this._element.classList.remove(\"show\"),this._queueCallback(()=>{this._element.classList.add(\"hide\"),B.trigger(this._element,\"hidden.bs.toast\")},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this._element.classList.contains(\"show\")&&this._element.classList.remove(\"show\"),super.dispose()}_getConfig(t){return t={...Vt,...V.getDataAttributes(this._element),...\"object\"==typeof t&&t?t:{}},d(\"toast\",t,this.constructor.DefaultType),t}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(t,e){switch(t.type){case\"mouseover\":case\"mouseout\":this._hasMouseInteraction=e;break;case\"focusin\":case\"focusout\":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const s=t.relatedTarget;this._element===s||this._element.contains(s)||this._maybeScheduleHide()}_setListeners(){B.on(this._element,\"click.dismiss.bs.toast\",'[data-bs-dismiss=\"toast\"]',()=>this.hide()),B.on(this._element,\"mouseover.bs.toast\",t=>this._onInteraction(t,!0)),B.on(this._element,\"mouseout.bs.toast\",t=>this._onInteraction(t,!1)),B.on(this._element,\"focusin.bs.toast\",t=>this._onInteraction(t,!0)),B.on(this._element,\"focusout.bs.toast\",t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=Qt.getOrCreateInstance(this,t);if(\"string\"==typeof t){if(void 0===e[t])throw new TypeError(`No method named \"${t}\"`);e[t](this)}}))}}return y(Qt),{Alert:z,Button:F,Carousel:et,Collapse:nt,Dropdown:pt,Modal:wt,Offcanvas:Tt,Popover:Wt,ScrollSpy:Ft,Tab:Ut,Toast:Qt,Tooltip:jt}}));\n//# sourceMappingURL=bootstrap.min.js.map\n","Mageplaza_Core/js/jquery.ui.touch-punch.min.js":"/*!\r\n * jQuery UI Touch Punch 0.2.3\r\n *\r\n * Copyright 2011\u20132014, Dave Furfero\r\n * Dual licensed under the MIT or GPL Version 2 licenses.\r\n *\r\n * Depends:\r\n * jquery.ui.widget.js\r\n * jquery.ui.mouse.js\r\n */\r\n!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent(\"MouseEvents\");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch=\"ontouchend\"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,\"mouseover\"),f(a,\"mousemove\"),f(a,\"mousedown\"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,\"mousemove\"))},b._touchEnd=function(a){e&&(f(a,\"mouseup\"),f(a,\"mouseout\"),this._touchMoved||f(a,\"click\"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,\"_touchStart\"),touchmove:a.proxy(b,\"_touchMove\"),touchend:a.proxy(b,\"_touchEnd\")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,\"_touchStart\"),touchmove:a.proxy(b,\"_touchMove\"),touchend:a.proxy(b,\"_touchEnd\")}),d.call(b)}}}(jQuery);\r\n","Mageplaza_Core/js/ion.rangeSlider.min.js":"// Ion.RangeSlider | version 2.1.6 | https://github.com/IonDen/ion.rangeSlider\r\n;(function(f){\"function\"===typeof define&&define.amd?define([\"jquery\"],function(p){return f(p,document,window,navigator)}):\"object\"===typeof exports?f(require(\"jquery\"),document,window,navigator):f(jQuery,document,window,navigator)})(function(f,p,h,t,q){var u=0,m=function(){var a=t.userAgent,b=/msie\\s\\d+/i;return 0<a.search(b)&&(a=b.exec(a).toString(),a=a.split(\" \")[1],9>a)?(f(\"html\").addClass(\"lt-ie9\"),!0):!1}();Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,d=[].slice;if(\"function\"!=\r\n typeof b)throw new TypeError;var c=d.call(arguments,1),e=function(){if(this instanceof e){var g=function(){};g.prototype=b.prototype;var g=new g,l=b.apply(g,c.concat(d.call(arguments)));return Object(l)===l?l:g}return b.apply(a,c.concat(d.call(arguments)))};return e});Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var d;if(null==this)throw new TypeError('\"this\" is null or not defined');var c=Object(this),e=c.length>>>0;if(0===e)return-1;d=+b||0;Infinity===Math.abs(d)&&(d=0);if(d>=\r\n e)return-1;for(d=Math.max(0<=d?d:e-Math.abs(d),0);d<e;){if(d in c&&c[d]===a)return d;d++}return-1});var r=function(a,b,d){this.VERSION=\"2.1.6\";this.input=a;this.plugin_count=d;this.old_to=this.old_from=this.update_tm=this.calc_count=this.current_plugin=0;this.raf_id=this.old_min_interval=null;this.is_update=this.is_key=this.no_diapason=this.force_redraw=this.dragging=!1;this.is_start=this.is_first_update=!0;this.is_click=this.is_resize=this.is_active=this.is_finish=!1;b=b||{};this.$cache={win:f(h),\r\n body:f(p.body),input:f(a),cont:null,rs:null,min:null,max:null,from:null,to:null,single:null,bar:null,line:null,s_single:null,s_from:null,s_to:null,shad_single:null,shad_from:null,shad_to:null,edge:null,grid:null,grid_labels:[]};this.coords={x_gap:0,x_pointer:0,w_rs:0,w_rs_old:0,w_handle:0,p_gap:0,p_gap_left:0,p_gap_right:0,p_step:0,p_pointer:0,p_handle:0,p_single_fake:0,p_single_real:0,p_from_fake:0,p_from_real:0,p_to_fake:0,p_to_real:0,p_bar_x:0,p_bar_w:0,grid_gap:0,big_num:0,big:[],big_w:[],big_p:[],\r\n big_x:[]};this.labels={w_min:0,w_max:0,w_from:0,w_to:0,w_single:0,p_min:0,p_max:0,p_from_fake:0,p_from_left:0,p_to_fake:0,p_to_left:0,p_single_fake:0,p_single_left:0};var c=this.$cache.input;a=c.prop(\"value\");var e;d={type:\"single\",min:10,max:100,from:null,to:null,step:1,min_interval:0,max_interval:0,drag_interval:!1,values:[],p_values:[],from_fixed:!1,from_min:null,from_max:null,from_shadow:!1,to_fixed:!1,to_min:null,to_max:null,to_shadow:!1,prettify_enabled:!0,prettify_separator:\" \",prettify:null,\r\n force_edges:!1,keyboard:!1,keyboard_step:5,grid:!1,grid_margin:!0,grid_num:4,grid_snap:!1,hide_min_max:!1,hide_from_to:!1,prefix:\"\",postfix:\"\",max_postfix:\"\",decorate_both:!0,values_separator:\" \\u2014 \",input_values_separator:\";\",disable:!1,onStart:null,onChange:null,onFinish:null,onUpdate:null};\"INPUT\"!==c[0].nodeName&&console&&console.warn&&console.warn(\"Base element should be <input>!\",c[0]);c={type:c.data(\"type\"),min:c.data(\"min\"),max:c.data(\"max\"),from:c.data(\"from\"),to:c.data(\"to\"),step:c.data(\"step\"),\r\n min_interval:c.data(\"minInterval\"),max_interval:c.data(\"maxInterval\"),drag_interval:c.data(\"dragInterval\"),values:c.data(\"values\"),from_fixed:c.data(\"fromFixed\"),from_min:c.data(\"fromMin\"),from_max:c.data(\"fromMax\"),from_shadow:c.data(\"fromShadow\"),to_fixed:c.data(\"toFixed\"),to_min:c.data(\"toMin\"),to_max:c.data(\"toMax\"),to_shadow:c.data(\"toShadow\"),prettify_enabled:c.data(\"prettifyEnabled\"),prettify_separator:c.data(\"prettifySeparator\"),force_edges:c.data(\"forceEdges\"),keyboard:c.data(\"keyboard\"),\r\n keyboard_step:c.data(\"keyboardStep\"),grid:c.data(\"grid\"),grid_margin:c.data(\"gridMargin\"),grid_num:c.data(\"gridNum\"),grid_snap:c.data(\"gridSnap\"),hide_min_max:c.data(\"hideMinMax\"),hide_from_to:c.data(\"hideFromTo\"),prefix:c.data(\"prefix\"),postfix:c.data(\"postfix\"),max_postfix:c.data(\"maxPostfix\"),decorate_both:c.data(\"decorateBoth\"),values_separator:c.data(\"valuesSeparator\"),input_values_separator:c.data(\"inputValuesSeparator\"),disable:c.data(\"disable\")};c.values=c.values&&c.values.split(\",\");for(e in c)c.hasOwnProperty(e)&&\r\n(c[e]!==q&&\"\"!==c[e]||delete c[e]);a!==q&&\"\"!==a&&(a=a.split(c.input_values_separator||b.input_values_separator||\";\"),a[0]&&a[0]==+a[0]&&(a[0]=+a[0]),a[1]&&a[1]==+a[1]&&(a[1]=+a[1]),b&&b.values&&b.values.length?(d.from=a[0]&&b.values.indexOf(a[0]),d.to=a[1]&&b.values.indexOf(a[1])):(d.from=a[0]&&+a[0],d.to=a[1]&&+a[1]));f.extend(d,b);f.extend(d,c);this.options=d;this.update_check={};this.validate();this.result={input:this.$cache.input,slider:null,min:this.options.min,max:this.options.max,from:this.options.from,\r\n from_percent:0,from_value:null,to:this.options.to,to_percent:0,to_value:null};this.init()};r.prototype={init:function(a){this.no_diapason=!1;this.coords.p_step=this.convertToPercent(this.options.step,!0);this.target=\"base\";this.toggleInput();this.append();this.setMinMax();a?(this.force_redraw=!0,this.calc(!0),this.callOnUpdate()):(this.force_redraw=!0,this.calc(!0),this.callOnStart());this.updateScene()},append:function(){this.$cache.input.before('<span class=\"irs js-irs-'+this.plugin_count+'\"></span>');\r\n this.$cache.input.prop(\"readonly\",!0);this.$cache.cont=this.$cache.input.prev();this.result.slider=this.$cache.cont;this.$cache.cont.html('<span class=\"irs\"><span class=\"irs-line\" tabindex=\"-1\"><span class=\"irs-line-left\"></span><span class=\"irs-line-mid\"></span><span class=\"irs-line-right\"></span></span><span class=\"irs-min\">0</span><span class=\"irs-max\">1</span><span class=\"irs-from\">0</span><span class=\"irs-to\">0</span><span class=\"irs-single\">0</span></span><span class=\"irs-grid\"></span><span class=\"irs-bar\"></span>');\r\n this.$cache.rs=this.$cache.cont.find(\".irs\");this.$cache.min=this.$cache.cont.find(\".irs-min\");this.$cache.max=this.$cache.cont.find(\".irs-max\");this.$cache.from=this.$cache.cont.find(\".irs-from\");this.$cache.to=this.$cache.cont.find(\".irs-to\");this.$cache.single=this.$cache.cont.find(\".irs-single\");this.$cache.bar=this.$cache.cont.find(\".irs-bar\");this.$cache.line=this.$cache.cont.find(\".irs-line\");this.$cache.grid=this.$cache.cont.find(\".irs-grid\");\"single\"===this.options.type?(this.$cache.cont.append('<span class=\"irs-bar-edge\"></span><span class=\"irs-shadow shadow-single\"></span><span class=\"irs-slider single\"></span>'),\r\n this.$cache.edge=this.$cache.cont.find(\".irs-bar-edge\"),this.$cache.s_single=this.$cache.cont.find(\".single\"),this.$cache.from[0].style.visibility=\"hidden\",this.$cache.to[0].style.visibility=\"hidden\",this.$cache.shad_single=this.$cache.cont.find(\".shadow-single\")):(this.$cache.cont.append('<span class=\"irs-shadow shadow-from\"></span><span class=\"irs-shadow shadow-to\"></span><span class=\"irs-slider from\"></span><span class=\"irs-slider to\"></span>'),this.$cache.s_from=this.$cache.cont.find(\".from\"),\r\n this.$cache.s_to=this.$cache.cont.find(\".to\"),this.$cache.shad_from=this.$cache.cont.find(\".shadow-from\"),this.$cache.shad_to=this.$cache.cont.find(\".shadow-to\"),this.setTopHandler());this.options.hide_from_to&&(this.$cache.from[0].style.display=\"none\",this.$cache.to[0].style.display=\"none\",this.$cache.single[0].style.display=\"none\");this.appendGrid();this.options.disable?(this.appendDisableMask(),this.$cache.input[0].disabled=!0):(this.$cache.cont.removeClass(\"irs-disabled\"),this.$cache.input[0].disabled=\r\n !1,this.bindEvents());this.options.drag_interval&&(this.$cache.bar[0].style.cursor=\"ew-resize\")},setTopHandler:function(){var a=this.options.max,b=this.options.to;this.options.from>this.options.min&&b===a?this.$cache.s_from.addClass(\"type_last\"):b<a&&this.$cache.s_to.addClass(\"type_last\")},changeLevel:function(a){switch(a){case \"single\":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single_fake);break;case \"from\":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake);\r\n this.$cache.s_from.addClass(\"state_hover\");this.$cache.s_from.addClass(\"type_last\");this.$cache.s_to.removeClass(\"type_last\");break;case \"to\":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_to_fake);this.$cache.s_to.addClass(\"state_hover\");this.$cache.s_to.addClass(\"type_last\");this.$cache.s_from.removeClass(\"type_last\");break;case \"both\":this.coords.p_gap_left=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake),this.coords.p_gap_right=this.toFixed(this.coords.p_to_fake-\r\n this.coords.p_pointer),this.$cache.s_to.removeClass(\"type_last\"),this.$cache.s_from.removeClass(\"type_last\")}},appendDisableMask:function(){this.$cache.cont.append('<span class=\"irs-disable-mask\"></span>');this.$cache.cont.addClass(\"irs-disabled\")},remove:function(){this.$cache.cont.remove();this.$cache.cont=null;this.$cache.line.off(\"keydown.irs_\"+this.plugin_count);this.$cache.body.off(\"touchmove.irs_\"+this.plugin_count);this.$cache.body.off(\"mousemove.irs_\"+this.plugin_count);this.$cache.win.off(\"touchend.irs_\"+\r\n this.plugin_count);this.$cache.win.off(\"mouseup.irs_\"+this.plugin_count);m&&(this.$cache.body.off(\"mouseup.irs_\"+this.plugin_count),this.$cache.body.off(\"mouseleave.irs_\"+this.plugin_count));this.$cache.grid_labels=[];this.coords.big=[];this.coords.big_w=[];this.coords.big_p=[];this.coords.big_x=[];cancelAnimationFrame(this.raf_id)},bindEvents:function(){if(!this.no_diapason){this.$cache.body.on(\"touchmove.irs_\"+this.plugin_count,this.pointerMove.bind(this));this.$cache.body.on(\"mousemove.irs_\"+this.plugin_count,\r\n this.pointerMove.bind(this));this.$cache.win.on(\"touchend.irs_\"+this.plugin_count,this.pointerUp.bind(this));this.$cache.win.on(\"mouseup.irs_\"+this.plugin_count,this.pointerUp.bind(this));this.$cache.line.on(\"touchstart.irs_\"+this.plugin_count,this.pointerClick.bind(this,\"click\"));this.$cache.line.on(\"mousedown.irs_\"+this.plugin_count,this.pointerClick.bind(this,\"click\"));this.options.drag_interval&&\"double\"===this.options.type?(this.$cache.bar.on(\"touchstart.irs_\"+this.plugin_count,this.pointerDown.bind(this,\r\n \"both\")),this.$cache.bar.on(\"mousedown.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"both\"))):(this.$cache.bar.on(\"touchstart.irs_\"+this.plugin_count,this.pointerClick.bind(this,\"click\")),this.$cache.bar.on(\"mousedown.irs_\"+this.plugin_count,this.pointerClick.bind(this,\"click\")));\"single\"===this.options.type?(this.$cache.single.on(\"touchstart.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"single\")),this.$cache.s_single.on(\"touchstart.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"single\")),\r\n this.$cache.shad_single.on(\"touchstart.irs_\"+this.plugin_count,this.pointerClick.bind(this,\"click\")),this.$cache.single.on(\"mousedown.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"single\")),this.$cache.s_single.on(\"mousedown.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"single\")),this.$cache.edge.on(\"mousedown.irs_\"+this.plugin_count,this.pointerClick.bind(this,\"click\")),this.$cache.shad_single.on(\"mousedown.irs_\"+this.plugin_count,this.pointerClick.bind(this,\"click\"))):(this.$cache.single.on(\"touchstart.irs_\"+\r\n this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.single.on(\"mousedown.irs_\"+this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.from.on(\"touchstart.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"from\")),this.$cache.s_from.on(\"touchstart.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"from\")),this.$cache.to.on(\"touchstart.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"to\")),this.$cache.s_to.on(\"touchstart.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"to\")),\r\n this.$cache.shad_from.on(\"touchstart.irs_\"+this.plugin_count,this.pointerClick.bind(this,\"click\")),this.$cache.shad_to.on(\"touchstart.irs_\"+this.plugin_count,this.pointerClick.bind(this,\"click\")),this.$cache.from.on(\"mousedown.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"from\")),this.$cache.s_from.on(\"mousedown.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"from\")),this.$cache.to.on(\"mousedown.irs_\"+this.plugin_count,this.pointerDown.bind(this,\"to\")),this.$cache.s_to.on(\"mousedown.irs_\"+\r\n this.plugin_count,this.pointerDown.bind(this,\"to\")),this.$cache.shad_from.on(\"mousedown.irs_\"+this.plugin_count,this.pointerClick.bind(this,\"click\")),this.$cache.shad_to.on(\"mousedown.irs_\"+this.plugin_count,this.pointerClick.bind(this,\"click\")));if(this.options.keyboard)this.$cache.line.on(\"keydown.irs_\"+this.plugin_count,this.key.bind(this,\"keyboard\"));m&&(this.$cache.body.on(\"mouseup.irs_\"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.body.on(\"mouseleave.irs_\"+this.plugin_count,this.pointerUp.bind(this)))}},\r\n pointerMove:function(a){this.dragging&&(this.coords.x_pointer=(a.pageX||a.originalEvent.touches&&a.originalEvent.touches[0].pageX)-this.coords.x_gap,this.calc())},pointerUp:function(a){this.current_plugin===this.plugin_count&&this.is_active&&(this.is_active=!1,this.$cache.cont.find(\".state_hover\").removeClass(\"state_hover\"),this.force_redraw=!0,m&&f(\"*\").prop(\"unselectable\",!1),this.updateScene(),this.restoreOriginalMinInterval(),(f.contains(this.$cache.cont[0],a.target)||this.dragging)&&this.callOnFinish(),\r\n this.dragging=!1)},pointerDown:function(a,b){b.preventDefault();var d=b.pageX||b.originalEvent.touches&&b.originalEvent.touches[0].pageX;2!==b.button&&(\"both\"===a&&this.setTempMinInterval(),a||(a=this.target||\"from\"),this.current_plugin=this.plugin_count,this.target=a,this.dragging=this.is_active=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=d-this.coords.x_gap,this.calcPointerPercent(),this.changeLevel(a),m&&f(\"*\").prop(\"unselectable\",!0),this.$cache.line.trigger(\"focus\"),\r\n this.updateScene())},pointerClick:function(a,b){b.preventDefault();var d=b.pageX||b.originalEvent.touches&&b.originalEvent.touches[0].pageX;2!==b.button&&(this.current_plugin=this.plugin_count,this.target=a,this.is_click=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(d-this.coords.x_gap).toFixed(),this.force_redraw=!0,this.calc(),this.$cache.line.trigger(\"focus\"))},key:function(a,b){if(!(this.current_plugin!==this.plugin_count||b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)){switch(b.which){case 83:case 65:case 40:case 37:b.preventDefault();\r\n this.moveByKey(!1);break;case 87:case 68:case 38:case 39:b.preventDefault(),this.moveByKey(!0)}return!0}},moveByKey:function(a){var b=this.coords.p_pointer,b=a?b+this.options.keyboard_step:b-this.options.keyboard_step;this.coords.x_pointer=this.toFixed(this.coords.w_rs/100*b);this.is_key=!0;this.calc()},setMinMax:function(){this.options&&(this.options.hide_min_max?(this.$cache.min[0].style.display=\"none\",this.$cache.max[0].style.display=\"none\"):(this.options.values.length?(this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])),\r\n this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]))):(this.$cache.min.html(this.decorate(this._prettify(this.options.min),this.options.min)),this.$cache.max.html(this.decorate(this._prettify(this.options.max),this.options.max))),this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1)))},setTempMinInterval:function(){var a=this.result.to-this.result.from;null===this.old_min_interval&&(this.old_min_interval=this.options.min_interval);\r\n this.options.min_interval=a},restoreOriginalMinInterval:function(){null!==this.old_min_interval&&(this.options.min_interval=this.old_min_interval,this.old_min_interval=null)},calc:function(a){if(this.options){this.calc_count++;if(10===this.calc_count||a)this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.calcHandlePercent();if(this.coords.w_rs){this.calcPointerPercent();a=this.getHandleX();\"both\"===this.target&&(this.coords.p_gap=0,a=this.getHandleX());\"click\"===this.target&&(this.coords.p_gap=\r\n this.coords.p_handle/2,a=this.getHandleX(),this.target=this.options.drag_interval?\"both_one\":this.chooseHandle(a));switch(this.target){case \"base\":var b=(this.options.max-this.options.min)/100;a=(this.result.from-this.options.min)/b;b=(this.result.to-this.options.min)/b;this.coords.p_single_real=this.toFixed(a);this.coords.p_from_real=this.toFixed(a);this.coords.p_to_real=this.toFixed(b);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);\r\n this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real);this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);this.target=null;break;case \"single\":if(this.options.from_fixed)break;\r\n this.coords.p_single_real=this.convertToRealPercent(a);this.coords.p_single_real=this.calcWithStep(this.coords.p_single_real);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real);break;case \"from\":if(this.options.from_fixed)break;this.coords.p_from_real=this.convertToRealPercent(a);this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real);this.coords.p_from_real>\r\n this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,\"from\");this.coords.p_from_real=this.checkMaxInterval(this.coords.p_from_real,this.coords.p_to_real,\"from\");this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);break;case \"to\":if(this.options.to_fixed)break;\r\n this.coords.p_to_real=this.convertToRealPercent(a);this.coords.p_to_real=this.calcWithStep(this.coords.p_to_real);this.coords.p_to_real<this.coords.p_from_real&&(this.coords.p_to_real=this.coords.p_from_real);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,\"to\");this.coords.p_to_real=this.checkMaxInterval(this.coords.p_to_real,this.coords.p_from_real,\"to\");\r\n this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);break;case \"both\":if(this.options.from_fixed||this.options.to_fixed)break;a=this.toFixed(a+.001*this.coords.p_handle);this.coords.p_from_real=this.convertToRealPercent(a)-this.coords.p_gap_left;this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,\r\n this.coords.p_to_real,\"from\");this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);this.coords.p_to_real=this.convertToRealPercent(a)+this.coords.p_gap_right;this.coords.p_to_real=this.calcWithStep(this.coords.p_to_real);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,\"to\");this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);\r\n break;case \"both_one\":if(!this.options.from_fixed&&!this.options.to_fixed){var d=this.convertToRealPercent(a);a=this.result.to_percent-this.result.from_percent;var c=a/2,b=d-c,d=d+c;0>b&&(b=0,d=b+a);100<d&&(d=100,b=d-a);this.coords.p_from_real=this.calcWithStep(b);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);this.coords.p_to_real=this.calcWithStep(d);this.coords.p_to_real=\r\n this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real)}}\"single\"===this.options.type?(this.coords.p_bar_x=this.coords.p_handle/2,this.coords.p_bar_w=this.coords.p_single_fake,this.result.from_percent=this.coords.p_single_real,this.result.from=this.convertToValue(this.coords.p_single_real),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from])):(this.coords.p_bar_x=\r\n this.toFixed(this.coords.p_from_fake+this.coords.p_handle/2),this.coords.p_bar_w=this.toFixed(this.coords.p_to_fake-this.coords.p_from_fake),this.result.from_percent=this.coords.p_from_real,this.result.from=this.convertToValue(this.coords.p_from_real),this.result.to_percent=this.coords.p_to_real,this.result.to=this.convertToValue(this.coords.p_to_real),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from],this.result.to_value=this.options.values[this.result.to]));\r\n this.calcMinMax();this.calcLabels()}}},calcPointerPercent:function(){this.coords.w_rs?(0>this.coords.x_pointer||isNaN(this.coords.x_pointer)?this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100)):this.coords.p_pointer=0},convertToRealPercent:function(a){return a/(100-this.coords.p_handle)*100},convertToFakePercent:function(a){return a/100*(100-this.coords.p_handle)},getHandleX:function(){var a=\r\n 100-this.coords.p_handle,b=this.toFixed(this.coords.p_pointer-this.coords.p_gap);0>b?b=0:b>a&&(b=a);return b},calcHandlePercent:function(){this.coords.w_handle=\"single\"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1);this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100)},chooseHandle:function(a){return\"single\"===this.options.type?\"single\":a>=this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2?this.options.to_fixed?\r\n \"from\":\"to\":this.options.from_fixed?\"to\":\"from\"},calcMinMax:function(){this.coords.w_rs&&(this.labels.p_min=this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=this.labels.w_max/this.coords.w_rs*100)},calcLabels:function(){this.coords.w_rs&&!this.options.hide_from_to&&(\"single\"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single_fake+this.coords.p_handle/\r\n 2-this.labels.p_single_fake/2):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from_fake=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=this.coords.p_from_fake+this.coords.p_handle/2-this.labels.p_from_fake/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from_fake),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to_fake=this.labels.w_to/this.coords.w_rs*100,\r\n this.labels.p_to_left=this.coords.p_to_fake+this.coords.p_handle/2-this.labels.p_to_fake/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=this.checkEdges(this.labels.p_to_left,this.labels.p_to_fake),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to_fake)/2-this.labels.p_single_fake/2,this.labels.p_single_left=\r\n this.toFixed(this.labels.p_single_left)),this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single_fake))},updateScene:function(){this.raf_id&&(cancelAnimationFrame(this.raf_id),this.raf_id=null);clearTimeout(this.update_tm);this.update_tm=null;this.options&&(this.drawHandles(),this.is_active?this.raf_id=requestAnimationFrame(this.updateScene.bind(this)):this.update_tm=setTimeout(this.updateScene.bind(this),300))},drawHandles:function(){this.coords.w_rs=this.$cache.rs.outerWidth(!1);\r\n if(this.coords.w_rs){this.coords.w_rs!==this.coords.w_rs_old&&(this.target=\"base\",this.is_resize=!0);if(this.coords.w_rs!==this.coords.w_rs_old||this.force_redraw)this.setMinMax(),this.calc(!0),this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow();if(this.coords.w_rs&&(this.dragging||this.force_redraw||this.is_key)){if(this.old_from!==this.result.from||this.old_to!==this.result.to||this.force_redraw||\r\n this.is_key){this.drawLabels();this.$cache.bar[0].style.left=this.coords.p_bar_x+\"%\";this.$cache.bar[0].style.width=this.coords.p_bar_w+\"%\";if(\"single\"===this.options.type)this.$cache.s_single[0].style.left=this.coords.p_single_fake+\"%\";else{this.$cache.s_from[0].style.left=this.coords.p_from_fake+\"%\";this.$cache.s_to[0].style.left=this.coords.p_to_fake+\"%\";if(this.old_from!==this.result.from||this.force_redraw)this.$cache.from[0].style.left=this.labels.p_from_left+\"%\";if(this.old_to!==this.result.to||\r\n this.force_redraw)this.$cache.to[0].style.left=this.labels.p_to_left+\"%\"}this.$cache.single[0].style.left=this.labels.p_single_left+\"%\";this.writeToInput();this.old_from===this.result.from&&this.old_to===this.result.to||this.is_start||(this.$cache.input.trigger(\"change\"),this.$cache.input.trigger(\"input\"));this.old_from=this.result.from;this.old_to=this.result.to;this.is_resize||this.is_update||this.is_start||this.is_finish||this.callOnChange();if(this.is_key||this.is_click||this.is_first_update)this.is_first_update=\r\n this.is_click=this.is_key=!1,this.callOnFinish();this.is_finish=this.is_resize=this.is_update=!1}this.force_redraw=this.is_click=this.is_key=this.is_start=!1}}},drawLabels:function(){if(this.options){var a=this.options.values.length,b=this.options.p_values,d;if(!this.options.hide_from_to)if(\"single\"===this.options.type)a=a?this.decorate(b[this.result.from]):this.decorate(this._prettify(this.result.from),this.result.from),this.$cache.single.html(a),this.calcLabels(),this.$cache.min[0].style.visibility=\r\n this.labels.p_single_left<this.labels.p_min+1?\"hidden\":\"visible\",this.$cache.max[0].style.visibility=this.labels.p_single_left+this.labels.p_single_fake>100-this.labels.p_max-1?\"hidden\":\"visible\";else{a?(this.options.decorate_both?(a=this.decorate(b[this.result.from]),a+=this.options.values_separator,a+=this.decorate(b[this.result.to])):a=this.decorate(b[this.result.from]+this.options.values_separator+b[this.result.to]),d=this.decorate(b[this.result.from]),b=this.decorate(b[this.result.to])):(this.options.decorate_both?\r\n (a=this.decorate(this._prettify(this.result.from),this.result.from),a+=this.options.values_separator,a+=this.decorate(this._prettify(this.result.to),this.result.to)):a=this.decorate(this._prettify(this.result.from)+this.options.values_separator+this._prettify(this.result.to),this.result.to),d=this.decorate(this._prettify(this.result.from),this.result.from),b=this.decorate(this._prettify(this.result.to),this.result.to));this.$cache.single.html(a);this.$cache.from.html(d);this.$cache.to.html(b);this.calcLabels();\r\n b=Math.min(this.labels.p_single_left,this.labels.p_from_left);a=this.labels.p_single_left+this.labels.p_single_fake;d=this.labels.p_to_left+this.labels.p_to_fake;var c=Math.max(a,d);this.labels.p_from_left+this.labels.p_from_fake>=this.labels.p_to_left?(this.$cache.from[0].style.visibility=\"hidden\",this.$cache.to[0].style.visibility=\"hidden\",this.$cache.single[0].style.visibility=\"visible\",this.result.from===this.result.to?(\"from\"===this.target?this.$cache.from[0].style.visibility=\"visible\":\"to\"===\r\n this.target?this.$cache.to[0].style.visibility=\"visible\":this.target||(this.$cache.from[0].style.visibility=\"visible\"),this.$cache.single[0].style.visibility=\"hidden\",c=d):(this.$cache.from[0].style.visibility=\"hidden\",this.$cache.to[0].style.visibility=\"hidden\",this.$cache.single[0].style.visibility=\"visible\",c=Math.max(a,d))):(this.$cache.from[0].style.visibility=\"visible\",this.$cache.to[0].style.visibility=\"visible\",this.$cache.single[0].style.visibility=\"hidden\");this.$cache.min[0].style.visibility=\r\n b<this.labels.p_min+1?\"hidden\":\"visible\";this.$cache.max[0].style.visibility=c>100-this.labels.p_max-1?\"hidden\":\"visible\"}}},drawShadow:function(){var a=this.options,b=this.$cache,d=\"number\"===typeof a.from_min&&!isNaN(a.from_min),c=\"number\"===typeof a.from_max&&!isNaN(a.from_max),e=\"number\"===typeof a.to_min&&!isNaN(a.to_min),g=\"number\"===typeof a.to_max&&!isNaN(a.to_max);\"single\"===a.type?a.from_shadow&&(d||c)?(d=this.convertToPercent(d?a.from_min:a.min),c=this.convertToPercent(c?a.from_max:a.max)-\r\n d,d=this.toFixed(d-this.coords.p_handle/100*d),c=this.toFixed(c-this.coords.p_handle/100*c),d+=this.coords.p_handle/2,b.shad_single[0].style.display=\"block\",b.shad_single[0].style.left=d+\"%\",b.shad_single[0].style.width=c+\"%\"):b.shad_single[0].style.display=\"none\":(a.from_shadow&&(d||c)?(d=this.convertToPercent(d?a.from_min:a.min),c=this.convertToPercent(c?a.from_max:a.max)-d,d=this.toFixed(d-this.coords.p_handle/100*d),c=this.toFixed(c-this.coords.p_handle/100*c),d+=this.coords.p_handle/2,b.shad_from[0].style.display=\r\n \"block\",b.shad_from[0].style.left=d+\"%\",b.shad_from[0].style.width=c+\"%\"):b.shad_from[0].style.display=\"none\",a.to_shadow&&(e||g)?(e=this.convertToPercent(e?a.to_min:a.min),a=this.convertToPercent(g?a.to_max:a.max)-e,e=this.toFixed(e-this.coords.p_handle/100*e),a=this.toFixed(a-this.coords.p_handle/100*a),e+=this.coords.p_handle/2,b.shad_to[0].style.display=\"block\",b.shad_to[0].style.left=e+\"%\",b.shad_to[0].style.width=a+\"%\"):b.shad_to[0].style.display=\"none\")},writeToInput:function(){\"single\"===\r\n this.options.type?(this.options.values.length?this.$cache.input.prop(\"value\",this.result.from_value):this.$cache.input.prop(\"value\",this.result.from),this.$cache.input.data(\"from\",this.result.from)):(this.options.values.length?this.$cache.input.prop(\"value\",this.result.from_value+this.options.input_values_separator+this.result.to_value):this.$cache.input.prop(\"value\",this.result.from+this.options.input_values_separator+this.result.to),this.$cache.input.data(\"from\",this.result.from),this.$cache.input.data(\"to\",\r\n this.result.to))},callOnStart:function(){this.writeToInput();if(this.options.onStart&&\"function\"===typeof this.options.onStart)this.options.onStart(this.result)},callOnChange:function(){this.writeToInput();if(this.options.onChange&&\"function\"===typeof this.options.onChange)this.options.onChange(this.result)},callOnFinish:function(){this.writeToInput();if(this.options.onFinish&&\"function\"===typeof this.options.onFinish)this.options.onFinish(this.result)},callOnUpdate:function(){this.writeToInput();\r\n if(this.options.onUpdate&&\"function\"===typeof this.options.onUpdate)this.options.onUpdate(this.result)},toggleInput:function(){this.$cache.input.toggleClass(\"irs-hidden-input\")},convertToPercent:function(a,b){var d=this.options.max-this.options.min;return d?this.toFixed((b?a:a-this.options.min)/(d/100)):(this.no_diapason=!0,0)},convertToValue:function(a){var b=this.options.min,d=this.options.max,c=b.toString().split(\".\")[1],e=d.toString().split(\".\")[1],g,l,f=0,k=0;if(0===a)return this.options.min;\r\n if(100===a)return this.options.max;c&&(f=g=c.length);e&&(f=l=e.length);g&&l&&(f=g>=l?g:l);0>b&&(k=Math.abs(b),b=+(b+k).toFixed(f),d=+(d+k).toFixed(f));a=(d-b)/100*a+b;(b=this.options.step.toString().split(\".\")[1])?a=+a.toFixed(b.length):(a/=this.options.step,a*=this.options.step,a=+a.toFixed(0));k&&(a-=k);k=b?+a.toFixed(b.length):this.toFixed(a);k<this.options.min?k=this.options.min:k>this.options.max&&(k=this.options.max);return k},calcWithStep:function(a){var b=Math.round(a/this.coords.p_step)*\r\n this.coords.p_step;100<b&&(b=100);100===a&&(b=100);return this.toFixed(b)},checkMinInterval:function(a,b,d){var c=this.options;if(!c.min_interval)return a;a=this.convertToValue(a);b=this.convertToValue(b);\"from\"===d?b-a<c.min_interval&&(a=b-c.min_interval):a-b<c.min_interval&&(a=b+c.min_interval);return this.convertToPercent(a)},checkMaxInterval:function(a,b,d){var c=this.options;if(!c.max_interval)return a;a=this.convertToValue(a);b=this.convertToValue(b);\"from\"===d?b-a>c.max_interval&&(a=b-c.max_interval):\r\n a-b>c.max_interval&&(a=b+c.max_interval);return this.convertToPercent(a)},checkDiapason:function(a,b,d){a=this.convertToValue(a);var c=this.options;\"number\"!==typeof b&&(b=c.min);\"number\"!==typeof d&&(d=c.max);a<b&&(a=b);a>d&&(a=d);return this.convertToPercent(a)},toFixed:function(a){a=a.toFixed(20);return+a},_prettify:function(a){return this.options.prettify_enabled?this.options.prettify&&\"function\"===typeof this.options.prettify?this.options.prettify(a):this.prettify(a):a},prettify:function(a){return a.toString().replace(/(\\d{1,3}(?=(?:\\d\\d\\d)+(?!\\d)))/g,\r\n \"$1\"+this.options.prettify_separator)},checkEdges:function(a,b){if(!this.options.force_edges)return this.toFixed(a);0>a?a=0:a>100-b&&(a=100-b);return this.toFixed(a)},validate:function(){var a=this.options,b=this.result,d=a.values,c=d.length,e,g;\"string\"===typeof a.min&&(a.min=+a.min);\"string\"===typeof a.max&&(a.max=+a.max);\"string\"===typeof a.from&&(a.from=+a.from);\"string\"===typeof a.to&&(a.to=+a.to);\"string\"===typeof a.step&&(a.step=+a.step);\"string\"===typeof a.from_min&&(a.from_min=+a.from_min);\r\n \"string\"===typeof a.from_max&&(a.from_max=+a.from_max);\"string\"===typeof a.to_min&&(a.to_min=+a.to_min);\"string\"===typeof a.to_max&&(a.to_max=+a.to_max);\"string\"===typeof a.keyboard_step&&(a.keyboard_step=+a.keyboard_step);\"string\"===typeof a.grid_num&&(a.grid_num=+a.grid_num);a.max<a.min&&(a.max=a.min);if(c)for(a.p_values=[],a.min=0,a.max=c-1,a.step=1,a.grid_num=a.max,a.grid_snap=!0,g=0;g<c;g++)e=+d[g],isNaN(e)?e=d[g]:(d[g]=e,e=this._prettify(e)),a.p_values.push(e);if(\"number\"!==typeof a.from||isNaN(a.from))a.from=\r\n a.min;if(\"number\"!==typeof a.to||isNaN(a.to))a.to=a.max;\"single\"===a.type?(a.from<a.min&&(a.from=a.min),a.from>a.max&&(a.from=a.max)):(a.from<a.min&&(a.from=a.min),a.from>a.max&&(a.from=a.max),a.to<a.min&&(a.to=a.min),a.to>a.max&&(a.to=a.max),this.update_check.from&&(this.update_check.from!==a.from&&a.from>a.to&&(a.from=a.to),this.update_check.to!==a.to&&a.to<a.from&&(a.to=a.from)),a.from>a.to&&(a.from=a.to),a.to<a.from&&(a.to=a.from));if(\"number\"!==typeof a.step||isNaN(a.step)||!a.step||0>a.step)a.step=\r\n 1;if(\"number\"!==typeof a.keyboard_step||isNaN(a.keyboard_step)||!a.keyboard_step||0>a.keyboard_step)a.keyboard_step=5;\"number\"===typeof a.from_min&&a.from<a.from_min&&(a.from=a.from_min);\"number\"===typeof a.from_max&&a.from>a.from_max&&(a.from=a.from_max);\"number\"===typeof a.to_min&&a.to<a.to_min&&(a.to=a.to_min);\"number\"===typeof a.to_max&&a.from>a.to_max&&(a.to=a.to_max);if(b){b.min!==a.min&&(b.min=a.min);b.max!==a.max&&(b.max=a.max);if(b.from<b.min||b.from>b.max)b.from=a.from;if(b.to<b.min||b.to>\r\n b.max)b.to=a.to}if(\"number\"!==typeof a.min_interval||isNaN(a.min_interval)||!a.min_interval||0>a.min_interval)a.min_interval=0;if(\"number\"!==typeof a.max_interval||isNaN(a.max_interval)||!a.max_interval||0>a.max_interval)a.max_interval=0;a.min_interval&&a.min_interval>a.max-a.min&&(a.min_interval=a.max-a.min);a.max_interval&&a.max_interval>a.max-a.min&&(a.max_interval=a.max-a.min)},decorate:function(a,b){var d=\"\",c=this.options;c.prefix&&(d+=c.prefix);d+=a;c.max_postfix&&(c.values.length&&a===c.p_values[c.max]?\r\n (d+=c.max_postfix,c.postfix&&(d+=\" \")):b===c.max&&(d+=c.max_postfix,c.postfix&&(d+=\" \")));c.postfix&&(d+=c.postfix);return d},updateFrom:function(){this.result.from=this.options.from;this.result.from_percent=this.convertToPercent(this.result.from);this.options.values&&(this.result.from_value=this.options.values[this.result.from])},updateTo:function(){this.result.to=this.options.to;this.result.to_percent=this.convertToPercent(this.result.to);this.options.values&&(this.result.to_value=this.options.values[this.result.to])},\r\n updateResult:function(){this.result.min=this.options.min;this.result.max=this.options.max;this.updateFrom();this.updateTo()},appendGrid:function(){if(this.options.grid){var a=this.options,b,d;b=a.max-a.min;var c=a.grid_num,e,g,f=4,h,k,m,n=\"\";this.calcGridMargin();a.grid_snap?(c=b/a.step,e=this.toFixed(a.step/(b/100))):e=this.toFixed(100/c);4<c&&(f=3);7<c&&(f=2);14<c&&(f=1);28<c&&(f=0);for(b=0;b<c+1;b++){h=f;g=this.toFixed(e*b);100<g&&(g=100,h-=2,0>h&&(h=0));this.coords.big[b]=g;k=(g-e*(b-1))/(h+1);\r\n for(d=1;d<=h&&0!==g;d++)m=this.toFixed(g-k*d),n+='<span class=\"irs-grid-pol small\" style=\"left: '+m+'%\"></span>';n+='<span class=\"irs-grid-pol\" style=\"left: '+g+'%\"></span>';d=this.convertToValue(g);d=a.values.length?a.p_values[d]:this._prettify(d);n+='<span class=\"irs-grid-text js-grid-text-'+b+'\" style=\"left: '+g+'%\">'+d+\"</span>\"}this.coords.big_num=Math.ceil(c+1);this.$cache.cont.addClass(\"irs-with-grid\");this.$cache.grid.html(n);this.cacheGridLabels()}},cacheGridLabels:function(){var a,b,d=this.coords.big_num;\r\n for(b=0;b<d;b++)a=this.$cache.grid.find(\".js-grid-text-\"+b),this.$cache.grid_labels.push(a);this.calcGridLabels()},calcGridLabels:function(){var a,b;b=[];var d=[],c=this.coords.big_num;for(a=0;a<c;a++)this.coords.big_w[a]=this.$cache.grid_labels[a].outerWidth(!1),this.coords.big_p[a]=this.toFixed(this.coords.big_w[a]/this.coords.w_rs*100),this.coords.big_x[a]=this.toFixed(this.coords.big_p[a]/2),b[a]=this.toFixed(this.coords.big[a]-this.coords.big_x[a]),d[a]=this.toFixed(b[a]+this.coords.big_p[a]);\r\n this.options.force_edges&&(b[0]<-this.coords.grid_gap&&(b[0]=-this.coords.grid_gap,d[0]=this.toFixed(b[0]+this.coords.big_p[0]),this.coords.big_x[0]=this.coords.grid_gap),d[c-1]>100+this.coords.grid_gap&&(d[c-1]=100+this.coords.grid_gap,b[c-1]=this.toFixed(d[c-1]-this.coords.big_p[c-1]),this.coords.big_x[c-1]=this.toFixed(this.coords.big_p[c-1]-this.coords.grid_gap)));this.calcGridCollision(2,b,d);this.calcGridCollision(4,b,d);for(a=0;a<c;a++)b=this.$cache.grid_labels[a][0],this.coords.big_x[a]!==\r\n Number.POSITIVE_INFINITY&&(b.style.marginLeft=-this.coords.big_x[a]+\"%\")},calcGridCollision:function(a,b,d){var c,e,g,f=this.coords.big_num;for(c=0;c<f;c+=a){e=c+a/2;if(e>=f)break;g=this.$cache.grid_labels[e][0];g.style.visibility=d[c]<=b[e]?\"visible\":\"hidden\"}},calcGridMargin:function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_handle=\"single\"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1),\r\n this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+\"%\",this.$cache.grid[0].style.left=this.coords.grid_gap+\"%\"))},update:function(a){this.input&&(this.is_update=!0,this.options.from=this.result.from,this.options.to=this.result.to,this.update_check.from=this.result.from,this.update_check.to=this.result.to,this.options=f.extend(this.options,a),\r\n this.validate(),this.updateResult(a),this.toggleInput(),this.remove(),this.init(!0))},reset:function(){this.input&&(this.updateResult(),this.update())},destroy:function(){this.input&&(this.toggleInput(),this.$cache.input.prop(\"readonly\",!1),f.data(this.input,\"ionRangeSlider\",null),this.remove(),this.options=this.input=null)}};f.fn.ionRangeSlider=function(a){return this.each(function(){f.data(this,\"ionRangeSlider\")||f.data(this,\"ionRangeSlider\",new r(this,a,u++))})};(function(){for(var a=0,b=[\"ms\",\r\n \"moz\",\"webkit\",\"o\"],d=0;d<b.length&&!h.requestAnimationFrame;++d)h.requestAnimationFrame=h[b[d]+\"RequestAnimationFrame\"],h.cancelAnimationFrame=h[b[d]+\"CancelAnimationFrame\"]||h[b[d]+\"CancelRequestAnimationFrame\"];h.requestAnimationFrame||(h.requestAnimationFrame=function(b,d){var c=(new Date).getTime(),e=Math.max(0,16-(c-a)),f=h.setTimeout(function(){b(c+e)},e);a=c+e;return f});h.cancelAnimationFrame||(h.cancelAnimationFrame=function(a){clearTimeout(a)})})()});\r\n","Mageplaza_Core/js/jquery.magnific-popup.min.js":"// Magnific Popup v1.1.0 by Dmitry Semenov\r\n// http://bit.ly/magnific-popup#build=inline+image+ajax+iframe+gallery+retina+imagezoom\r\n(function(a){typeof define==\"function\"&&define.amd?define([\"jquery\"],a):typeof exports==\"object\"?a(require(\"jquery\")):a(window.jQuery||window.Zepto)})(function(a){var b=\"Close\",c=\"BeforeClose\",d=\"AfterClose\",e=\"BeforeAppend\",f=\"MarkupParse\",g=\"Open\",h=\"Change\",i=\"mfp\",j=\".\"+i,k=\"mfp-ready\",l=\"mfp-removing\",m=\"mfp-prevent-close\",n,o=function(){},p=!!window.jQuery,q,r=a(window),s,t,u,v,w=function(a,b){n.ev.on(i+a+j,b)},x=function(b,c,d,e){var f=document.createElement(\"div\");return f.className=\"mfp-\"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(b,c){n.ev.triggerHandler(i+b,c),n.st.callbacks&&(b=b.charAt(0).toLowerCase()+b.slice(1),n.st.callbacks[b]&&n.st.callbacks[b].apply(n,a.isArray(c)?c:[c]))},z=function(b){if(b!==v||!n.currTemplate.closeBtn)n.currTemplate.closeBtn=a(n.st.closeMarkup.replace(\"%title%\",n.st.tClose)),v=b;return n.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(n=new o,n.init(),a.magnificPopup.instance=n)},B=function(){var a=document.createElement(\"p\").style,b=[\"ms\",\"O\",\"Moz\",\"Webkit\"];if(a.transition!==undefined)return!0;while(b.length)if(b.pop()+\"Transition\"in a)return!0;return!1};o.prototype={constructor:o,init:function(){var b=navigator.appVersion;n.isLowIE=n.isIE8=document.all&&!document.addEventListener,n.isAndroid=/android/gi.test(b),n.isIOS=/iphone|ipad|ipod/gi.test(b),n.supportsTransition=B(),n.probablyMobile=n.isAndroid||n.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),s=a(document),n.popupsCache={}},open:function(b){var c;if(b.isObj===!1){n.items=b.items.toArray(),n.index=0;var d=b.items,e;for(c=0;c<d.length;c++){e=d[c],e.parsed&&(e=e.el[0]);if(e===b.el[0]){n.index=c;break}}}else n.items=a.isArray(b.items)?b.items:[b.items],n.index=b.index||0;if(n.isOpen){n.updateItemHTML();return}n.types=[],u=\"\",b.mainEl&&b.mainEl.length?n.ev=b.mainEl.eq(0):n.ev=s,b.key?(n.popupsCache[b.key]||(n.popupsCache[b.key]={}),n.currTemplate=n.popupsCache[b.key]):n.currTemplate={},n.st=a.extend(!0,{},a.magnificPopup.defaults,b),n.fixedContentPos=n.st.fixedContentPos===\"auto\"?!n.probablyMobile:n.st.fixedContentPos,n.st.modal&&(n.st.closeOnContentClick=!1,n.st.closeOnBgClick=!1,n.st.showCloseBtn=!1,n.st.enableEscapeKey=!1),n.bgOverlay||(n.bgOverlay=x(\"bg\").on(\"click\"+j,function(){n.close()}),n.wrap=x(\"wrap\").attr(\"tabindex\",-1).on(\"click\"+j,function(a){n._checkIfClose(a.target)&&n.close()}),n.container=x(\"container\",n.wrap)),n.contentContainer=x(\"content\"),n.st.preloader&&(n.preloader=x(\"preloader\",n.container,n.st.tLoading));var h=a.magnificPopup.modules;for(c=0;c<h.length;c++){var i=h[c];i=i.charAt(0).toUpperCase()+i.slice(1),n[\"init\"+i].call(n)}y(\"BeforeOpen\"),n.st.showCloseBtn&&(n.st.closeBtnInside?(w(f,function(a,b,c,d){c.close_replaceWith=z(d.type)}),u+=\" mfp-close-btn-in\"):n.wrap.append(z())),n.st.alignTop&&(u+=\" mfp-align-top\"),n.fixedContentPos?n.wrap.css({overflow:n.st.overflowY,overflowX:\"hidden\",overflowY:n.st.overflowY}):n.wrap.css({top:r.scrollTop(),position:\"absolute\"}),(n.st.fixedBgPos===!1||n.st.fixedBgPos===\"auto\"&&!n.fixedContentPos)&&n.bgOverlay.css({height:s.height(),position:\"absolute\"}),n.st.enableEscapeKey&&s.on(\"keyup\"+j,function(a){a.keyCode===27&&n.close()}),r.on(\"resize\"+j,function(){n.updateSize()}),n.st.closeOnContentClick||(u+=\" mfp-auto-cursor\"),u&&n.wrap.addClass(u);var l=n.wH=r.height(),m={};if(n.fixedContentPos&&n._hasScrollBar(l)){var o=n._getScrollbarSize();o&&(m.marginRight=o)}n.fixedContentPos&&(n.isIE7?a(\"body, html\").css(\"overflow\",\"hidden\"):m.overflow=\"hidden\");var p=n.st.mainClass;return n.isIE7&&(p+=\" mfp-ie7\"),p&&n._addClassToMFP(p),n.updateItemHTML(),y(\"BuildControls\"),a(\"html\").css(m),n.bgOverlay.add(n.wrap).prependTo(n.st.prependTo||a(document.body)),n._lastFocusedEl=document.activeElement,setTimeout(function(){n.content?(n._addClassToMFP(k),n._setFocus()):n.bgOverlay.addClass(k),s.on(\"focusin\"+j,n._onFocusIn)},16),n.isOpen=!0,n.updateSize(l),y(g),b},close:function(){if(!n.isOpen)return;y(c),n.isOpen=!1,n.st.removalDelay&&!n.isLowIE&&n.supportsTransition?(n._addClassToMFP(l),setTimeout(function(){n._close()},n.st.removalDelay)):n._close()},_close:function(){y(b);var c=l+\" \"+k+\" \";n.bgOverlay.detach(),n.wrap.detach(),n.container.empty(),n.st.mainClass&&(c+=n.st.mainClass+\" \"),n._removeClassFromMFP(c);if(n.fixedContentPos){var e={marginRight:\"\"};n.isIE7?a(\"body, html\").css(\"overflow\",\"\"):e.overflow=\"\",a(\"html\").css(e)}s.off(\"keyup\"+j+\" focusin\"+j),n.ev.off(j),n.wrap.attr(\"class\",\"mfp-wrap\").removeAttr(\"style\"),n.bgOverlay.attr(\"class\",\"mfp-bg\"),n.container.attr(\"class\",\"mfp-container\"),n.st.showCloseBtn&&(!n.st.closeBtnInside||n.currTemplate[n.currItem.type]===!0)&&n.currTemplate.closeBtn&&n.currTemplate.closeBtn.detach(),n.st.autoFocusLast&&n._lastFocusedEl&&a(n._lastFocusedEl).focus(),n.currItem=null,n.content=null,n.currTemplate=null,n.prevHeight=0,y(d)},updateSize:function(a){if(n.isIOS){var b=document.documentElement.clientWidth/window.innerWidth,c=window.innerHeight*b;n.wrap.css(\"height\",c),n.wH=c}else n.wH=a||r.height();n.fixedContentPos||n.wrap.css(\"height\",n.wH),y(\"Resize\")},updateItemHTML:function(){var b=n.items[n.index];n.contentContainer.detach(),n.content&&n.content.detach(),b.parsed||(b=n.parseEl(n.index));var c=b.type;y(\"BeforeChange\",[n.currItem?n.currItem.type:\"\",c]),n.currItem=b;if(!n.currTemplate[c]){var d=n.st[c]?n.st[c].markup:!1;y(\"FirstMarkupParse\",d),d?n.currTemplate[c]=a(d):n.currTemplate[c]=!0}t&&t!==b.type&&n.container.removeClass(\"mfp-\"+t+\"-holder\");var e=n[\"get\"+c.charAt(0).toUpperCase()+c.slice(1)](b,n.currTemplate[c]);n.appendContent(e,c),b.preloaded=!0,y(h,b),t=b.type,n.container.prepend(n.contentContainer),y(\"AfterChange\")},appendContent:function(a,b){n.content=a,a?n.st.showCloseBtn&&n.st.closeBtnInside&&n.currTemplate[b]===!0?n.content.find(\".mfp-close\").length||n.content.append(z()):n.content=a:n.content=\"\",y(e),n.container.addClass(\"mfp-\"+b+\"-holder\"),n.contentContainer.append(n.content)},parseEl:function(b){var c=n.items[b],d;c.tagName?c={el:a(c)}:(d=c.type,c={data:c,src:c.src});if(c.el){var e=n.types;for(var f=0;f<e.length;f++)if(c.el.hasClass(\"mfp-\"+e[f])){d=e[f];break}c.src=c.el.attr(\"data-mfp-src\"),c.src||(c.src=c.el.attr(\"href\"))}return c.type=d||n.st.type||\"inline\",c.index=b,c.parsed=!0,n.items[b]=c,y(\"ElementParse\",c),n.items[b]},addGroup:function(a,b){var c=function(c){c.mfpEl=this,n._openClick(c,a,b)};b||(b={});var d=\"click.magnificPopup\";b.mainEl=a,b.items?(b.isObj=!0,a.off(d).on(d,c)):(b.isObj=!1,b.delegate?a.off(d).on(d,b.delegate,c):(b.items=a,a.off(d).on(d,c)))},_openClick:function(b,c,d){var e=d.midClick!==undefined?d.midClick:a.magnificPopup.defaults.midClick;if(!e&&(b.which===2||b.ctrlKey||b.metaKey||b.altKey||b.shiftKey))return;var f=d.disableOn!==undefined?d.disableOn:a.magnificPopup.defaults.disableOn;if(f)if(a.isFunction(f)){if(!f.call(n))return!0}else if(r.width()<f)return!0;b.type&&(b.preventDefault(),n.isOpen&&b.stopPropagation()),d.el=a(b.mfpEl),d.delegate&&(d.items=c.find(d.delegate)),n.open(d)},updateStatus:function(a,b){if(n.preloader){q!==a&&n.container.removeClass(\"mfp-s-\"+q),!b&&a===\"loading\"&&(b=n.st.tLoading);var c={status:a,text:b};y(\"UpdateStatus\",c),a=c.status,b=c.text,n.preloader.html(b),n.preloader.find(\"a\").on(\"click\",function(a){a.stopImmediatePropagation()}),n.container.addClass(\"mfp-s-\"+a),q=a}},_checkIfClose:function(b){if(a(b).hasClass(m))return;var c=n.st.closeOnContentClick,d=n.st.closeOnBgClick;if(c&&d)return!0;if(!n.content||a(b).hasClass(\"mfp-close\")||n.preloader&&b===n.preloader[0])return!0;if(b!==n.content[0]&&!a.contains(n.content[0],b)){if(d&&a.contains(document,b))return!0}else if(c)return!0;return!1},_addClassToMFP:function(a){n.bgOverlay.addClass(a),n.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),n.wrap.removeClass(a)},_hasScrollBar:function(a){return(n.isIE7?s.height():document.body.scrollHeight)>(a||r.height())},_setFocus:function(){(n.st.focus?n.content.find(n.st.focus).eq(0):n.wrap).focus()},_onFocusIn:function(b){if(b.target!==n.wrap[0]&&!a.contains(n.wrap[0],b.target))return n._setFocus(),!1},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(f,[b,c,d]),a.each(c,function(c,d){if(d===undefined||d===!1)return!0;e=c.split(\"_\");if(e.length>1){var f=b.find(j+\"-\"+e[0]);if(f.length>0){var g=e[1];g===\"replaceWith\"?f[0]!==d[0]&&f.replaceWith(d):g===\"img\"?f.is(\"img\")?f.attr(\"src\",d):f.replaceWith(a(\"<img>\").attr(\"src\",d).attr(\"class\",f.attr(\"class\"))):f.attr(e[1],d)}}else b.find(j+\"-\"+c).html(d)})},_getScrollbarSize:function(){if(n.scrollbarSize===undefined){var a=document.createElement(\"div\");a.style.cssText=\"width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;\",document.body.appendChild(a),n.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return n.scrollbarSize}},a.magnificPopup={instance:null,proto:o.prototype,modules:[],open:function(b,c){return A(),b?b=a.extend(!0,{},b):b={},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:\"\",preloader:!0,focus:\"\",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:\"auto\",fixedBgPos:\"auto\",overflowY:\"auto\",closeMarkup:'<button title=\"%title%\" type=\"button\" class=\"mfp-close\">×</button>',tClose:\"Close (Esc)\",tLoading:\"Loading...\",autoFocusLast:!0}},a.fn.magnificPopup=function(b){A();var c=a(this);if(typeof b==\"string\")if(b===\"open\"){var d,e=p?c.data(\"magnificPopup\"):c[0].magnificPopup,f=parseInt(arguments[1],10)||0;e.items?d=e.items[f]:(d=c,e.delegate&&(d=d.find(e.delegate)),d=d.eq(f)),n._openClick({mfpEl:d},c,e)}else n.isOpen&&n[b].apply(n,Array.prototype.slice.call(arguments,1));else b=a.extend(!0,{},b),p?c.data(\"magnificPopup\",b):c[0].magnificPopup=b,n.addGroup(c,b);return c};var C=\"inline\",D,E,F,G=function(){F&&(E.after(F.addClass(D)).detach(),F=null)};a.magnificPopup.registerModule(C,{options:{hiddenClass:\"hide\",markup:\"\",tNotFound:\"Content not found\"},proto:{initInline:function(){n.types.push(C),w(b+\".\"+C,function(){G()})},getInline:function(b,c){G();if(b.src){var d=n.st.inline,e=a(b.src);if(e.length){var f=e[0].parentNode;f&&f.tagName&&(E||(D=d.hiddenClass,E=x(D),D=\"mfp-\"+D),F=e.after(E).detach().removeClass(D)),n.updateStatus(\"ready\")}else n.updateStatus(\"error\",d.tNotFound),e=a(\"<div>\");return b.inlineElement=e,e}return n.updateStatus(\"ready\"),n._parseMarkup(c,{},b),c}}});var H=\"ajax\",I,J=function(){I&&a(document.body).removeClass(I)},K=function(){J(),n.req&&n.req.abort()};a.magnificPopup.registerModule(H,{options:{settings:null,cursor:\"mfp-ajax-cur\",tError:'<a href=\"%url%\">The content</a> could not be loaded.'},proto:{initAjax:function(){n.types.push(H),I=n.st.ajax.cursor,w(b+\".\"+H,K),w(\"BeforeChange.\"+H,K)},getAjax:function(b){I&&a(document.body).addClass(I),n.updateStatus(\"loading\");var c=a.extend({url:b.src,success:function(c,d,e){var f={data:c,xhr:e};y(\"ParseAjax\",f),n.appendContent(a(f.data),H),b.finished=!0,J(),n._setFocus(),setTimeout(function(){n.wrap.addClass(k)},16),n.updateStatus(\"ready\"),y(\"AjaxContentAdded\")},error:function(){J(),b.finished=b.loadError=!0,n.updateStatus(\"error\",n.st.ajax.tError.replace(\"%url%\",b.src))}},n.st.ajax.settings);return n.req=a.ajax(c),\"\"}}});var L,M=function(b){if(b.data&&b.data.title!==undefined)return b.data.title;var c=n.st.image.titleSrc;if(c){if(a.isFunction(c))return c.call(n,b);if(b.el)return b.el.attr(c)||\"\"}return\"\"};a.magnificPopup.registerModule(\"image\",{options:{markup:'<div class=\"mfp-figure\"><div class=\"mfp-close\"></div><figure><div class=\"mfp-img\"></div><figcaption><div class=\"mfp-bottom-bar\"><div class=\"mfp-title\"></div><div class=\"mfp-counter\"></div></div></figcaption></figure></div>',cursor:\"mfp-zoom-out-cur\",titleSrc:\"title\",verticalFit:!0,tError:'<a href=\"%url%\">The image</a> could not be loaded.'},proto:{initImage:function(){var c=n.st.image,d=\".image\";n.types.push(\"image\"),w(g+d,function(){n.currItem.type===\"image\"&&c.cursor&&a(document.body).addClass(c.cursor)}),w(b+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),r.off(\"resize\"+j)}),w(\"Resize\"+d,n.resizeImage),n.isLowIE&&w(\"AfterChange\",n.resizeImage)},resizeImage:function(){var a=n.currItem;if(!a||!a.img)return;if(n.st.image.verticalFit){var b=0;n.isLowIE&&(b=parseInt(a.img.css(\"padding-top\"),10)+parseInt(a.img.css(\"padding-bottom\"),10)),a.img.css(\"max-height\",n.wH-b)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y(\"ImageHasSize\",a),a.imgHidden&&(n.content&&n.content.removeClass(\"mfp-loading\"),a.imgHidden=!1))},findImageSize:function(a){var b=0,c=a.img[0],d=function(e){L&&clearInterval(L),L=setInterval(function(){if(c.naturalWidth>0){n._onImageHasSize(a);return}b>200&&clearInterval(L),b++,b===3?d(10):b===40?d(50):b===100&&d(500)},e)};d(1)},getImage:function(b,c){var d=0,e=function(){b&&(b.img[0].complete?(b.img.off(\".mfploader\"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus(\"ready\")),b.hasSize=!0,b.loaded=!0,y(\"ImageLoadComplete\")):(d++,d<200?setTimeout(e,100):f()))},f=function(){b&&(b.img.off(\".mfploader\"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus(\"error\",g.tError.replace(\"%url%\",b.src))),b.hasSize=!0,b.loaded=!0,b.loadError=!0)},g=n.st.image,h=c.find(\".mfp-img\");if(h.length){var i=document.createElement(\"img\");i.className=\"mfp-img\",b.el&&b.el.find(\"img\").length&&(i.alt=b.el.find(\"img\").attr(\"alt\")),b.img=a(i).on(\"load.mfploader\",e).on(\"error.mfploader\",f),i.src=b.src,h.is(\"img\")&&(b.img=b.img.clone()),i=b.img[0],i.naturalWidth>0?b.hasSize=!0:i.width||(b.hasSize=!1)}return n._parseMarkup(c,{title:M(b),img_replaceWith:b.img},b),n.resizeImage(),b.hasSize?(L&&clearInterval(L),b.loadError?(c.addClass(\"mfp-loading\"),n.updateStatus(\"error\",g.tError.replace(\"%url%\",b.src))):(c.removeClass(\"mfp-loading\"),n.updateStatus(\"ready\")),c):(n.updateStatus(\"loading\"),b.loading=!0,b.hasSize||(b.imgHidden=!0,c.addClass(\"mfp-loading\"),n.findImageSize(b)),c)}}});var N,O=function(){return N===undefined&&(N=document.createElement(\"p\").style.MozTransform!==undefined),N};a.magnificPopup.registerModule(\"zoom\",{options:{enabled:!1,easing:\"ease-in-out\",duration:300,opener:function(a){return a.is(\"img\")?a:a.find(\"img\")}},proto:{initZoom:function(){var a=n.st.zoom,d=\".zoom\",e;if(!a.enabled||!n.supportsTransition)return;var f=a.duration,g=function(b){var c=b.clone().removeAttr(\"style\").removeAttr(\"class\").addClass(\"mfp-animated-image\"),d=\"all \"+a.duration/1e3+\"s \"+a.easing,e={position:\"fixed\",zIndex:9999,left:0,top:0,\"-webkit-backface-visibility\":\"hidden\"},f=\"transition\";return e[\"-webkit-\"+f]=e[\"-moz-\"+f]=e[\"-o-\"+f]=e[f]=d,c.css(e),c},h=function(){n.content.css(\"visibility\",\"visible\")},i,j;w(\"BuildControls\"+d,function(){if(n._allowZoom()){clearTimeout(i),n.content.css(\"visibility\",\"hidden\"),e=n._getItemToZoom();if(!e){h();return}j=g(e),j.css(n._getOffset()),n.wrap.append(j),i=setTimeout(function(){j.css(n._getOffset(!0)),i=setTimeout(function(){h(),setTimeout(function(){j.remove(),e=j=null,y(\"ZoomAnimationEnded\")},16)},f)},16)}}),w(c+d,function(){if(n._allowZoom()){clearTimeout(i),n.st.removalDelay=f;if(!e){e=n._getItemToZoom();if(!e)return;j=g(e)}j.css(n._getOffset(!0)),n.wrap.append(j),n.content.css(\"visibility\",\"hidden\"),setTimeout(function(){j.css(n._getOffset())},16)}}),w(b+d,function(){n._allowZoom()&&(h(),j&&j.remove(),e=null)})},_allowZoom:function(){return n.currItem.type===\"image\"},_getItemToZoom:function(){return n.currItem.hasSize?n.currItem.img:!1},_getOffset:function(b){var c;b?c=n.currItem.img:c=n.st.zoom.opener(n.currItem.el||n.currItem);var d=c.offset(),e=parseInt(c.css(\"padding-top\"),10),f=parseInt(c.css(\"padding-bottom\"),10);d.top-=a(window).scrollTop()-e;var g={width:c.width(),height:(p?c.innerHeight():c[0].offsetHeight)-f-e};return O()?g[\"-moz-transform\"]=g.transform=\"translate(\"+d.left+\"px,\"+d.top+\"px)\":(g.left=d.left,g.top=d.top),g}}});var P=\"iframe\",Q=\"//about:blank\",R=function(a){if(n.currTemplate[P]){var b=n.currTemplate[P].find(\"iframe\");b.length&&(a||(b[0].src=Q),n.isIE8&&b.css(\"display\",a?\"block\":\"none\"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class=\"mfp-iframe-scaler\"><div class=\"mfp-close\"></div><iframe class=\"mfp-iframe\" src=\"//about:blank\" frameborder=\"0\" allowfullscreen></iframe></div>',srcAction:\"iframe_src\",patterns:{youtube:{index:\"youtube.com\",id:\"v=\",src:\"//www.youtube.com/embed/%id%?autoplay=1\"},vimeo:{index:\"vimeo.com/\",id:\"/\",src:\"//player.vimeo.com/video/%id%?autoplay=1\"},gmaps:{index:\"//maps.google.\",src:\"%id%&output=embed\"}}},proto:{initIframe:function(){n.types.push(P),w(\"BeforeChange\",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(b+\".\"+P,function(){R()})},getIframe:function(b,c){var d=b.src,e=n.st.iframe;a.each(e.patterns,function(){if(d.indexOf(this.index)>-1)return this.id&&(typeof this.id==\"string\"?d=d.substr(d.lastIndexOf(this.id)+this.id.length,d.length):d=this.id.call(this,d)),d=this.src.replace(\"%id%\",d),!1});var f={};return e.srcAction&&(f[e.srcAction]=d),n._parseMarkup(c,f,b),n.updateStatus(\"ready\"),c}}});var S=function(a){var b=n.items.length;return a>b-1?a-b:a<0?b+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule(\"gallery\",{options:{enabled:!1,arrowMarkup:'<button title=\"%title%\" type=\"button\" class=\"mfp-arrow mfp-arrow-%dir%\"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:\"Previous (Left arrow key)\",tNext:\"Next (Right arrow key)\",tCounter:\"%curr% of %total%\"},proto:{initGallery:function(){var c=n.st.gallery,d=\".mfp-gallery\";n.direction=!0;if(!c||!c.enabled)return!1;u+=\" mfp-gallery\",w(g+d,function(){c.navigateByImgClick&&n.wrap.on(\"click\"+d,\".mfp-img\",function(){if(n.items.length>1)return n.next(),!1}),s.on(\"keydown\"+d,function(a){a.keyCode===37?n.prev():a.keyCode===39&&n.next()})}),w(\"UpdateStatus\"+d,function(a,b){b.text&&(b.text=T(b.text,n.currItem.index,n.items.length))}),w(f+d,function(a,b,d,e){var f=n.items.length;d.counter=f>1?T(c.tCounter,e.index,f):\"\"}),w(\"BuildControls\"+d,function(){if(n.items.length>1&&c.arrows&&!n.arrowLeft){var b=c.arrowMarkup,d=n.arrowLeft=a(b.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,\"left\")).addClass(m),e=n.arrowRight=a(b.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,\"right\")).addClass(m);d.click(function(){n.prev()}),e.click(function(){n.next()}),n.container.append(d.add(e))}}),w(h+d,function(){n._preloadTimeout&&clearTimeout(n._preloadTimeout),n._preloadTimeout=setTimeout(function(){n.preloadNearbyImages(),n._preloadTimeout=null},16)}),w(b+d,function(){s.off(d),n.wrap.off(\"click\"+d),n.arrowRight=n.arrowLeft=null})},next:function(){n.direction=!0,n.index=S(n.index+1),n.updateItemHTML()},prev:function(){n.direction=!1,n.index=S(n.index-1),n.updateItemHTML()},goTo:function(a){n.direction=a>=n.index,n.index=a,n.updateItemHTML()},preloadNearbyImages:function(){var a=n.st.gallery.preload,b=Math.min(a[0],n.items.length),c=Math.min(a[1],n.items.length),d;for(d=1;d<=(n.direction?c:b);d++)n._preloadItem(n.index+d);for(d=1;d<=(n.direction?b:c);d++)n._preloadItem(n.index-d)},_preloadItem:function(b){b=S(b);if(n.items[b].preloaded)return;var c=n.items[b];c.parsed||(c=n.parseEl(b)),y(\"LazyLoad\",c),c.type===\"image\"&&(c.img=a('<img class=\"mfp-img\" />').on(\"load.mfploader\",function(){c.hasSize=!0}).on(\"error.mfploader\",function(){c.hasSize=!0,c.loadError=!0,y(\"LazyLoadError\",c)}).attr(\"src\",c.src)),c.preloaded=!0}}});var U=\"retina\";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\\.\\w+$/,function(a){return\"@2x\"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=n.st.retina,b=a.ratio;b=isNaN(b)?b():b,b>1&&(w(\"ImageHasSize.\"+U,function(a,c){c.img.css({\"max-width\":c.img[0].naturalWidth/b,width:\"100%\"})}),w(\"ElementParse.\"+U,function(c,d){d.src=a.replaceSrc(d,b)}))}}}}),A()})","Mageplaza_Core/js/jquery.autocomplete.min.js":"/**\r\n * Ajax Autocomplete for jQuery, version 1.3.0\r\n * (c) 2017 Tomas Kirda\r\n *\r\n * Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.\r\n * For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete\r\n */\r\n!function(a){\"use strict\";\"function\"==typeof define&&define.amd?define([\"jquery\"],a):a(\"object\"==typeof exports&&\"function\"==typeof require?require(\"jquery\"):jQuery)}(function(a){\"use strict\";function b(c,d){var e=a.noop,f=this,g={ajaxSettings:{},autoSelectFirst:!1,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,width:\"auto\",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:b.formatResult,formatGroup:b.formatGroup,delimiter:null,zIndex:9999,type:\"GET\",noCache:!1,onSearchStart:e,onSearchComplete:e,onSearchError:e,preserveInput:!1,containerClass:\"autocomplete-suggestions\",tabDisabled:!1,dataType:\"text\",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(a,b,c){return-1!==a.value.toLowerCase().indexOf(c)},paramName:\"query\",transformResult:function(b){return\"string\"==typeof b?a.parseJSON(b):b},showNoSuggestionNotice:!1,noSuggestionNotice:\"No results\",orientation:\"bottom\",forceFixPosition:!1};f.element=c,f.el=a(c),f.suggestions=[],f.badQueries=[],f.selectedIndex=-1,f.currentValue=f.element.value,f.intervalId=0,f.cachedResponse={},f.onChangeInterval=null,f.onChange=null,f.isLocal=!1,f.suggestionsContainer=null,f.noSuggestionsContainer=null,f.options=a.extend({},g,d),f.classes={selected:\"autocomplete-selected\",suggestion:\"autocomplete-suggestion\"},f.hint=null,f.hintValue=\"\",f.selection=null,f.initialize(),f.setOptions(d)}var c=function(){return{escapeRegExChars:function(a){return a.replace(/[|\\\\{}()[\\]^$+*?.]/g,\"\\\\$&\")},createNode:function(a){var b=document.createElement(\"div\");return b.className=a,b.style.position=\"absolute\",b.style.display=\"none\",b}}}(),d={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40};b.utils=c,a.Autocomplete=b,b.formatResult=function(a,b){if(!b)return a.value;var d=\"(\"+c.escapeRegExChars(b)+\")\";return a.value.replace(new RegExp(d,\"gi\"),\"<strong>$1</strong>\").replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\").replace(/\"/g,\""\").replace(/<(\\/?strong)>/g,\"<$1>\")},b.formatGroup=function(a,b){return'<div class=\"autocomplete-group\"><strong>'+b+\"</strong></div>\"},b.prototype={killerFn:null,initialize:function(){var c,d=this,e=\".\"+d.classes.suggestion,f=d.classes.selected,g=d.options;d.element.setAttribute(\"autocomplete\",\"off\"),d.killerFn=function(b){a(b.target).closest(\".\"+d.options.containerClass).length||(d.killSuggestions(),d.disableKillerFn())},d.noSuggestionsContainer=a('<div class=\"autocomplete-no-suggestion\"></div>').html(this.options.noSuggestionNotice).get(0),d.suggestionsContainer=b.utils.createNode(g.containerClass),c=a(d.suggestionsContainer),c.appendTo(g.appendTo),\"auto\"!==g.width&&c.css(\"width\",g.width),c.on(\"mouseover.autocomplete\",e,function(){d.activate(a(this).data(\"index\"))}),c.on(\"mouseout.autocomplete\",function(){d.selectedIndex=-1,c.children(\".\"+f).removeClass(f)}),c.on(\"click.autocomplete\",e,function(){return d.select(a(this).data(\"index\")),!1}),d.fixPositionCapture=function(){d.visible&&d.fixPosition()},a(window).on(\"resize.autocomplete\",d.fixPositionCapture),d.el.on(\"keydown.autocomplete\",function(a){d.onKeyPress(a)}),d.el.on(\"keyup.autocomplete\",function(a){d.onKeyUp(a)}),d.el.on(\"blur.autocomplete\",function(){d.onBlur()}),d.el.on(\"focus.autocomplete\",function(){d.onFocus()}),d.el.on(\"change.autocomplete\",function(a){d.onKeyUp(a)}),d.el.on(\"input.autocomplete\",function(a){d.onKeyUp(a)})},onFocus:function(){var a=this;a.fixPosition(),a.el.val().length>=a.options.minChars&&a.onValueChange()},onBlur:function(){this.enableKillerFn()},abortAjax:function(){var a=this;a.currentRequest&&(a.currentRequest.abort(),a.currentRequest=null)},setOptions:function(b){var c=this,d=c.options;a.extend(d,b),c.isLocal=a.isArray(d.lookup),c.isLocal&&(d.lookup=c.verifySuggestionsFormat(d.lookup)),d.orientation=c.validateOrientation(d.orientation,\"bottom\"),a(c.suggestionsContainer).css({\"max-height\":d.maxHeight+\"px\",width:d.width+\"px\",\"z-index\":d.zIndex})},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue=\"\",this.suggestions=[]},disable:function(){var a=this;a.disabled=!0,clearInterval(a.onChangeInterval),a.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var b=this,c=a(b.suggestionsContainer),d=c.parent().get(0);if(d===document.body||b.options.forceFixPosition){var e=b.options.orientation,f=c.outerHeight(),g=b.el.outerHeight(),h=b.el.offset(),i={top:h.top,left:h.left};if(\"auto\"===e){var j=a(window).height(),k=a(window).scrollTop(),l=-k+h.top-f,m=k+j-(h.top+g+f);e=Math.max(l,m)===l?\"top\":\"bottom\"}if(\"top\"===e?i.top+=-f:i.top+=g,d!==document.body){var n,o=c.css(\"opacity\");b.visible||c.css(\"opacity\",0).show(),n=c.offsetParent().offset(),i.top-=n.top,i.left-=n.left,b.visible||c.css(\"opacity\",o).hide()}\"auto\"===b.options.width&&(i.width=b.el.outerWidth()+\"px\"),c.css(i)}},enableKillerFn:function(){var b=this;a(document).on(\"click.autocomplete\",b.killerFn)},disableKillerFn:function(){var b=this;a(document).off(\"click.autocomplete\",b.killerFn)},killSuggestions:function(){var a=this;a.stopKillSuggestions(),a.intervalId=window.setInterval(function(){a.visible&&(a.options.preserveInput||a.el.val(a.currentValue),a.hide()),a.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var a,b=this,c=b.el.val().length,d=b.element.selectionStart;return\"number\"==typeof d?d===c:document.selection?(a=document.selection.createRange(),a.moveStart(\"character\",-c),c===a.text.length):!0},onKeyPress:function(a){var b=this;if(!b.disabled&&!b.visible&&a.which===d.DOWN&&b.currentValue)return void b.suggest();if(!b.disabled&&b.visible){switch(a.which){case d.ESC:b.el.val(b.currentValue),b.hide();break;case d.RIGHT:if(b.hint&&b.options.onHint&&b.isCursorAtEnd()){b.selectHint();break}return;case d.TAB:if(b.hint&&b.options.onHint)return void b.selectHint();if(-1===b.selectedIndex)return void b.hide();if(b.select(b.selectedIndex),b.options.tabDisabled===!1)return;break;case d.RETURN:if(-1===b.selectedIndex)return void b.hide();b.select(b.selectedIndex);break;case d.UP:b.moveUp();break;case d.DOWN:b.moveDown();break;default:return}a.stopImmediatePropagation(),a.preventDefault()}},onKeyUp:function(a){var b=this;if(!b.disabled){switch(a.which){case d.UP:case d.DOWN:return}clearInterval(b.onChangeInterval),b.currentValue!==b.el.val()&&(b.findBestHint(),b.options.deferRequestBy>0?b.onChangeInterval=setInterval(function(){b.onValueChange()},b.options.deferRequestBy):b.onValueChange())}},onValueChange:function(){var b=this,c=b.options,d=b.el.val(),e=b.getQuery(d);return b.selection&&b.currentValue!==e&&(b.selection=null,(c.onInvalidateSelection||a.noop).call(b.element)),clearInterval(b.onChangeInterval),b.currentValue=d,b.selectedIndex=-1,c.triggerSelectOnValidInput&&b.isExactMatch(e)?void b.select(0):void(e.length<c.minChars?b.hide():b.getSuggestions(e))},isExactMatch:function(a){var b=this.suggestions;return 1===b.length&&b[0].value.toLowerCase()===a.toLowerCase()},getQuery:function(b){var c,d=this.options.delimiter;return d?(c=b.split(d),a.trim(c[c.length-1])):b},getSuggestionsLocal:function(b){var c,d=this,e=d.options,f=b.toLowerCase(),g=e.lookupFilter,h=parseInt(e.lookupLimit,10);return c={suggestions:a.grep(e.lookup,function(a){return g(a,b,f)})},h&&c.suggestions.length>h&&(c.suggestions=c.suggestions.slice(0,h)),c},getSuggestions:function(b){var c,d,e,f,g=this,h=g.options,i=h.serviceUrl;if(h.params[h.paramName]=b,d=h.ignoreParams?null:h.params,h.onSearchStart.call(g.element,h.params)!==!1){if(a.isFunction(h.lookup))return void h.lookup(b,function(a){g.suggestions=a.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,a.suggestions)});g.isLocal?c=g.getSuggestionsLocal(b):(a.isFunction(i)&&(i=i.call(g.element,b)),e=i+\"?\"+a.param(d||{}),c=g.cachedResponse[e]),c&&a.isArray(c.suggestions)?(g.suggestions=c.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,c.suggestions)):g.isBadQuery(b)?h.onSearchComplete.call(g.element,b,[]):(g.abortAjax(),f={url:i,data:d,type:h.type,dataType:h.dataType},a.extend(f,h.ajaxSettings),g.currentRequest=a.ajax(f).done(function(a){var c;g.currentRequest=null,c=h.transformResult(a,b),g.processResponse(c,b,e),h.onSearchComplete.call(g.element,b,c.suggestions)}).fail(function(a,c,d){h.onSearchError.call(g.element,b,a,c,d)}))}},isBadQuery:function(a){if(!this.options.preventBadQueries)return!1;for(var b=this.badQueries,c=b.length;c--;)if(0===a.indexOf(b[c]))return!0;return!1},hide:function(){var b=this,c=a(b.suggestionsContainer);a.isFunction(b.options.onHide)&&b.visible&&b.options.onHide.call(b.element,c),b.visible=!1,b.selectedIndex=-1,clearInterval(b.onChangeInterval),a(b.suggestionsContainer).hide(),b.signalHint(null)},suggest:function(){if(!this.suggestions.length)return void(this.options.showNoSuggestionNotice?this.noSuggestions():this.hide());var b,c=this,d=c.options,e=d.groupBy,f=d.formatResult,g=c.getQuery(c.currentValue),h=c.classes.suggestion,i=c.classes.selected,j=a(c.suggestionsContainer),k=a(c.noSuggestionsContainer),l=d.beforeRender,m=\"\",n=function(a,c){var f=a.data[e];return b===f?\"\":(b=f,d.formatGroup(a,b))};return d.triggerSelectOnValidInput&&c.isExactMatch(g)?void c.select(0):(a.each(c.suggestions,function(a,b){e&&(m+=n(b,g,a)),m+='<div class=\"'+h+'\" data-index=\"'+a+'\">'+f(b,g,a)+\"</div>\"}),this.adjustContainerWidth(),k.detach(),j.html(m),a.isFunction(l)&&l.call(c.element,j,c.suggestions),c.fixPosition(),j.show(),d.autoSelectFirst&&(c.selectedIndex=0,j.scrollTop(0),j.children(\".\"+h).first().addClass(i)),c.visible=!0,void c.findBestHint())},noSuggestions:function(){var b=this,c=a(b.suggestionsContainer),d=a(b.noSuggestionsContainer);this.adjustContainerWidth(),d.detach(),c.empty(),c.append(d),b.fixPosition(),c.show(),b.visible=!0},adjustContainerWidth:function(){var b,c=this,d=c.options,e=a(c.suggestionsContainer);\"auto\"===d.width?(b=c.el.outerWidth(),e.css(\"width\",b>0?b:300)):\"flex\"===d.width&&e.css(\"width\",\"\")},findBestHint:function(){var b=this,c=b.el.val().toLowerCase(),d=null;c&&(a.each(b.suggestions,function(a,b){var e=0===b.value.toLowerCase().indexOf(c);return e&&(d=b),!e}),b.signalHint(d))},signalHint:function(b){var c=\"\",d=this;b&&(c=d.currentValue+b.value.substr(d.currentValue.length)),d.hintValue!==c&&(d.hintValue=c,d.hint=b,(this.options.onHint||a.noop)(c))},verifySuggestionsFormat:function(b){return b.length&&\"string\"==typeof b[0]?a.map(b,function(a){return{value:a,data:null}}):b},validateOrientation:function(b,c){return b=a.trim(b||\"\").toLowerCase(),-1===a.inArray(b,[\"auto\",\"bottom\",\"top\"])&&(b=c),b},processResponse:function(a,b,c){var d=this,e=d.options;a.suggestions=d.verifySuggestionsFormat(a.suggestions),e.noCache||(d.cachedResponse[c]=a,e.preventBadQueries&&!a.suggestions.length&&d.badQueries.push(b)),b===d.getQuery(d.currentValue)&&(d.suggestions=a.suggestions,d.suggest())},activate:function(b){var c,d=this,e=d.classes.selected,f=a(d.suggestionsContainer),g=f.find(\".\"+d.classes.suggestion);return f.find(\".\"+e).removeClass(e),d.selectedIndex=b,-1!==d.selectedIndex&&g.length>d.selectedIndex?(c=g.get(d.selectedIndex),a(c).addClass(e),c):null},selectHint:function(){var b=this,c=a.inArray(b.hint,b.suggestions);b.select(c)},select:function(a){var b=this;b.hide(),b.onSelect(a),b.disableKillerFn()},moveUp:function(){var b=this;if(-1!==b.selectedIndex)return 0===b.selectedIndex?(a(b.suggestionsContainer).children().first().removeClass(b.classes.selected),b.selectedIndex=-1,b.el.val(b.currentValue),void b.findBestHint()):void b.adjustScroll(b.selectedIndex-1)},moveDown:function(){var a=this;a.selectedIndex!==a.suggestions.length-1&&a.adjustScroll(a.selectedIndex+1)},adjustScroll:function(b){var c=this,d=c.activate(b);if(d){var e,f,g,h=a(d).outerHeight();e=d.offsetTop,f=a(c.suggestionsContainer).scrollTop(),g=f+c.options.maxHeight-h,f>e?a(c.suggestionsContainer).scrollTop(e):e>g&&a(c.suggestionsContainer).scrollTop(e-c.options.maxHeight+h),c.options.preserveInput||c.el.val(c.getValue(c.suggestions[b].value)),c.signalHint(null)}},onSelect:function(b){var c=this,d=c.options.onSelect,e=c.suggestions[b];c.currentValue=c.getValue(e.value),c.currentValue===c.el.val()||c.options.preserveInput||c.el.val(c.currentValue),c.signalHint(null),c.suggestions=[],c.selection=e,a.isFunction(d)&&d.call(c.element,e)},getValue:function(a){var b,c,d=this,e=d.options.delimiter;return e?(b=d.currentValue,c=b.split(e),1===c.length?a:b.substr(0,b.length-c[c.length-1].length)+a):a},dispose:function(){var b=this;b.el.off(\".autocomplete\").removeData(\"autocomplete\"),b.disableKillerFn(),a(window).off(\"resize.autocomplete\",b.fixPositionCapture),a(b.suggestionsContainer).remove()}},a.fn.autocomplete=a.fn.devbridgeAutocomplete=function(c,d){var e=\"autocomplete\";return arguments.length?this.each(function(){var f=a(this),g=f.data(e);\"string\"==typeof c?g&&\"function\"==typeof g[c]&&g[c](d):(g&&g.dispose&&g.dispose(),g=new b(this,c),f.data(e,g))}):this.first().data(e)}});","Mageplaza_Core/js/owl.carousel.min.js":"/**\r\n * Owl Carousel v2.3.4\r\n * Copyright 2013-2018 David Deutsch\r\n * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE\r\n */\r\n!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:[\"busy\"],animating:[\"busy\"],dragging:[\"interacting\"]}},a.each([\"onResize\",\"onThrottledResize\"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:\"swing\",slideTransition:\"\",info:!1,nestedItemSelector:!1,itemElement:\"div\",stageElement:\"div\",refreshClass:\"owl-refresh\",loadedClass:\"owl-loaded\",loadingClass:\"owl-loading\",rtlClass:\"owl-rtl\",responsiveClass:\"owl-responsive\",dragClass:\"owl-drag\",itemClass:\"owl-item\",stageClass:\"owl-stage\",stageOuterClass:\"owl-stage-outer\",grabClass:\"owl-grab\"},e.Width={Default:\"default\",Inner:\"inner\",Outer:\"outer\"},e.Type={Event:\"event\",State:\"state\"},e.Plugins={},e.Workers=[{filter:[\"width\",\"settings\"],run:function(){this._width=this.$element.width()}},{filter:[\"width\",\"items\",\"settings\"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:[\"items\",\"settings\"],run:function(){this.$stage.children(\".cloned\").remove()}},{filter:[\"width\",\"items\",\"settings\"],run:function(a){var b=this.settings.margin||\"\",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:\"auto\",\"margin-left\":d?b:\"\",\"margin-right\":d?\"\":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:[\"width\",\"items\",\"settings\"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:[\"items\",\"settings\"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h=\"\",i=\"\";for(g/=2;g>0;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i,g-=1;this._clones=b,a(h).addClass(\"cloned\").appendTo(this.$stage),a(i).addClass(\"cloned\").prependTo(this.$stage)}},{filter:[\"width\",\"items\",\"settings\"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c<b;)d=f[c-1]||0,e=this._widths[this.relative(c)]+this.settings.margin,f.push(d+e*a);this._coordinates=f}},{filter:[\"width\",\"items\",\"settings\"],run:function(){var a=this.settings.stagePadding,b=this._coordinates,c={width:Math.ceil(Math.abs(b[b.length-1]))+2*a,\"padding-left\":a||\"\",\"padding-right\":a||\"\"};this.$stage.css(c)}},{filter:[\"width\",\"items\",\"settings\"],run:function(a){var b=this._coordinates.length,c=!this.settings.autoWidth,d=this.$stage.children();if(c&&a.items.merge)for(;b--;)a.css.width=this._widths[this.relative(b)],d.eq(b).css(a.css);else c&&(a.css.width=a.items.width,d.css(a.css))}},{filter:[\"items\"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr(\"style\")}},{filter:[\"width\",\"items\",\"settings\"],run:function(a){a.current=a.current?this.$stage.children().index(a.current):0,a.current=Math.max(this.minimum(),Math.min(this.maximum(),a.current)),this.reset(a.current)}},{filter:[\"position\"],run:function(){this.animate(this.coordinates(this._current))}},{filter:[\"width\",\"position\",\"items\",\"settings\"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;c<d;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,\"<=\",g)&&this.op(a,\">\",h)||this.op(b,\"<\",g)&&this.op(b,\">\",h))&&i.push(c);this.$stage.children(\".active\").removeClass(\"active\"),this.$stage.children(\":eq(\"+i.join(\"), :eq(\")+\")\").addClass(\"active\"),this.$stage.children(\".center\").removeClass(\"center\"),this.settings.center&&this.$stage.children().eq(this.current()).addClass(\"center\")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find(\".\"+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=a(\"<\"+this.settings.stageElement+\">\",{class:this.settings.stageClass}).wrap(a(\"<div/>\",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},e.prototype.initializeItems=function(){var b=this.$element.find(\".owl-item\");if(b.length)return this._items=b.get().map(function(b){return a(b)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate(\"width\"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},e.prototype.initialize=function(){if(this.enter(\"initializing\"),this.trigger(\"initialize\"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is(\"pre-loading\")){var a,b,c;a=this.$element.find(\"img\"),b=this.settings.nestedItemSelector?\".\"+this.settings.nestedItemSelector:d,c=this.$element.children(b).width(),a.length&&c<=0&&this.preloadAutoWidthImages(a)}this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave(\"initializing\"),this.trigger(\"initialized\")},e.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(\":visible\")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),\"function\"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr(\"class\",this.$element.attr(\"class\").replace(new RegExp(\"(\"+this.options.responsiveClass+\"-)\\\\S+\\\\s\",\"g\"),\"$1\"+d))):e=a.extend({},this.options),this.trigger(\"change\",{property:{name:\"settings\",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate(\"settings\"),this.trigger(\"changed\",{property:{name:\"settings\",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger(\"prepare\",{content:b});return c.data||(c.data=a(\"<\"+this.settings.itemElement+\"/>\").addClass(this.options.itemClass).append(b)),this.trigger(\"prepared\",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b<c;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is(\"valid\")&&this.enter(\"valid\")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter(\"refreshing\"),this.trigger(\"refresh\"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave(\"refreshing\"),this.trigger(\"refreshed\")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter(\"resizing\"),this.trigger(\"resize\").isDefaultPrevented()?(this.leave(\"resizing\"),!1):(this.invalidate(\"width\"),this.refresh(),this.leave(\"resizing\"),void this.trigger(\"resized\")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+\".owl.core\",a.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(b,\"resize\",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on(\"mousedown.owl.core\",a.proxy(this.onDragStart,this)),this.$stage.on(\"dragstart.owl.core selectstart.owl.core\",function(){return!1})),this.settings.touchDrag&&(this.$stage.on(\"touchstart.owl.core\",a.proxy(this.onDragStart,this)),this.$stage.on(\"touchcancel.owl.core\",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css(\"transform\").replace(/.*\\(|\\)| /g,\"\").split(\",\"),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is(\"animating\")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate(\"position\")),this.$element.toggleClass(this.options.grabClass,\"mousedown\"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on(\"mouseup.owl.core touchend.owl.core\",a.proxy(this.onDragEnd,this)),a(c).one(\"mousemove.owl.core touchmove.owl.core\",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on(\"mousemove.owl.core touchmove.owl.core\",a.proxy(this.onDragMove,this)),Math.abs(d.x)<Math.abs(d.y)&&this.is(\"valid\")||(b.preventDefault(),this.enter(\"dragging\"),this.trigger(\"drag\"))},this)))},e.prototype.onDragMove=function(a){var b=null,c=null,d=null,e=this.difference(this._drag.pointer,this.pointer(a)),f=this.difference(this._drag.stage.start,e);this.is(\"dragging\")&&(a.preventDefault(),this.settings.loop?(b=this.coordinates(this.minimum()),c=this.coordinates(this.maximum()+1)-b,f.x=((f.x-b)%c+c)%c+b):(b=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),c=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),d=this.settings.pullDrag?-1*e.x/5:0,f.x=Math.max(Math.min(f.x,b+d),c+d)),this._drag.stage.current=f,this.animate(f.x))},e.prototype.onDragEnd=function(b){var d=this.difference(this._drag.pointer,this.pointer(b)),e=this._drag.stage.current,f=d.x>0^this.settings.rtl?\"left\":\"right\";a(c).off(\".owl.core\"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is(\"dragging\")||!this.is(\"valid\"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate(\"position\"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one(\"click.owl.core\",function(){return!1})),this.is(\"dragging\")&&(this.leave(\"dragging\"),this.trigger(\"dragged\"))},e.prototype.closest=function(b,c){var e=-1,f=30,g=this.width(),h=this.coordinates();return this.settings.freeDrag||a.each(h,a.proxy(function(a,i){return\"left\"===c&&b>i-f&&b<i+f?e=a:\"right\"===c&&b>i-g-f&&b<i-g+f?e=a+1:this.op(b,\"<\",i)&&this.op(b,\">\",h[a+1]!==d?h[a+1]:i-g)&&(e=\"left\"===c?a+1:a),-1===e},this)),this.settings.loop||(this.op(b,\">\",h[this.minimum()])?e=b=this.minimum():this.op(b,\"<\",h[this.maximum()])&&(e=b=this.maximum())),e},e.prototype.animate=function(b){var c=this.speed()>0;this.is(\"animating\")&&this.onTransitionEnd(),c&&(this.enter(\"animating\"),this.trigger(\"translate\")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:\"translate3d(\"+b+\"px,0px,0px)\",transition:this.speed()/1e3+\"s\"+(this.settings.slideTransition?\" \"+this.settings.slideTransition:\"\")}):c?this.$stage.animate({left:b+\"px\"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+\"px\"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger(\"change\",{property:{name:\"position\",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate(\"position\"),this.trigger(\"changed\",{property:{name:\"position\",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return\"string\"===a.type(b)&&(this._invalidated[b]=!0,this.is(\"valid\")&&this.leave(\"valid\")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){(a=this.normalize(a))!==d&&(this._speed=0,this._current=a,this.suppress([\"translate\",\"translated\"]),this.animate(this.coordinates(a)),this.release([\"translate\",\"translated\"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){if(b=this._items.length)for(c=this._items[--b].width(),d=this.$element.width();b--&&!((c+=this._items[b].width()+this.settings.margin)>d););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2==0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,(d=((a-h)%g+g)%g+h)!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.isVisible()&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave(\"animating\"),this.trigger(\"translated\")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn(\"Can not detect viewport width.\"),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find(\".\"+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find(\"[data-merge]\").addBack(\"[data-merge]\").attr(\"data-merge\")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate(\"items\")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger(\"add\",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find(\"[data-merge]\").addBack(\"[data-merge]\").attr(\"data-merge\")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find(\"[data-merge]\").addBack(\"[data-merge]\").attr(\"data-merge\")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate(\"items\"),this.trigger(\"added\",{content:b,position:c})},e.prototype.remove=function(a){(a=this.normalize(a,!0))!==d&&(this.trigger(\"remove\",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate(\"items\"),this.trigger(\"removed\",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter(\"pre-loading\"),c=a(c),a(new Image).one(\"load\",a.proxy(function(a){c.attr(\"src\",a.target.src),c.css(\"opacity\",1),this.leave(\"pre-loading\"),!this.is(\"pre-loading\")&&!this.is(\"initializing\")&&this.refresh()},this)).attr(\"src\",c.attr(\"src\")||c.attr(\"data-src\")||c.attr(\"data-src-retina\"))},this))},e.prototype.destroy=function(){this.$element.off(\".owl.core\"),this.$stage.off(\".owl.core\"),a(c).off(\".owl.core\"),!1!==this.settings.responsive&&(b.clearTimeout(this.resizeTimer),this.off(b,\"resize\",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(\".cloned\").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr(\"class\",this.$element.attr(\"class\").replace(new RegExp(this.options.responsiveClass+\"-\\\\S+\\\\s\",\"g\"),\"\")).removeData(\"owl.carousel\")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case\"<\":return d?a>c:a<c;case\">\":return d?a<c:a>c;case\">=\":return d?a<=c:a>=c;case\"<=\":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent(\"on\"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent(\"on\"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep([\"on\",b,d],function(a){return a}).join(\"-\").toLowerCase()),j=a.Event([b,\"owl\",d||\"carousel\"].join(\".\").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&\"function\"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf(\"owl\")?a.namespace&&a.namespace.indexOf(\"owl\")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data(\"owl.carousel\");f||(f=new e(this,\"object\"==typeof b&&b),d.data(\"owl.carousel\",f),a.each([\"next\",\"prev\",\"to\",\"destroy\",\"refresh\",\"replace\",\"add\",\"remove\"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+\".owl.carousel.core\",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),\"string\"==typeof b&&\"_\"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={\"initialized.owl.carousel\":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass(\"owl-hidden\",!this._visible),this._visible&&this._core.invalidate(\"width\")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))\"function\"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={\"initialized.owl.carousel change.owl.carousel resized.owl.carousel\":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&\"position\"==b.property.name||\"initialized\"==b.type)){var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);for(c.lazyLoadEager>0&&(e+=c.lazyLoadEager,c.loop&&(g-=c.lazyLoadEager,e++));f++<e;)this.load(h/2+this._core.relative(g)),h&&a.each(this._core.clones(this._core.relative(g)),i),g++}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1,lazyLoadEager:0},e.prototype.load=function(c){var d=this._core.$stage.children().eq(c),e=d&&d.find(\".owl-lazy\");!e||a.inArray(d.get(0),this._loaded)>-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr(\"data-src-retina\")||f.attr(\"data-src\")||f.attr(\"data-srcset\");this._core.trigger(\"load\",{element:f,url:g},\"lazy\"),f.is(\"img\")?f.one(\"load.owl.lazy\",a.proxy(function(){f.css(\"opacity\",1),this._core.trigger(\"loaded\",{element:f,url:g},\"lazy\")},this)).attr(\"src\",g):f.is(\"source\")?f.one(\"load.owl.lazy\",a.proxy(function(){this._core.trigger(\"loaded\",{element:f,url:g},\"lazy\")},this)).attr(\"srcset\",g):(e=new Image,e.onload=a.proxy(function(){f.css({\"background-image\":'url(\"'+g+'\")',opacity:\"1\"}),this._core.trigger(\"loaded\",{element:f,url:g},\"lazy\")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))\"function\"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(c){this._core=c,this._previousHeight=null,this._handlers={\"initialized.owl.carousel refreshed.owl.carousel\":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),\"changed.owl.carousel\":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&\"position\"===a.property.name&&this.update()},this),\"loaded.owl.lazy\":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest(\".\"+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var d=this;a(b).on(\"load\",function(){d._core.settings.autoHeight&&d.update()}),a(b).resize(function(){d._core.settings.autoHeight&&(null!=d._intervalId&&clearTimeout(d._intervalId),d._intervalId=setTimeout(function(){d.update()},250))})};e.Defaults={autoHeight:!1,autoHeightClass:\"owl-height\"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.settings.lazyLoad,e=this._core.$stage.children().toArray().slice(b,c),f=[],g=0;a.each(e,function(b,c){f.push(a(c).height())}),g=Math.max.apply(null,f),g<=1&&d&&this._previousHeight&&(g=this._previousHeight),this._previousHeight=g,this._core.$stage.parent().height(g).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))\"function\"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={\"initialized.owl.carousel\":a.proxy(function(a){a.namespace&&this._core.register({type:\"state\",name:\"playing\",tags:[\"interacting\"]})},this),\"resize.owl.carousel\":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),\"refreshed.owl.carousel\":a.proxy(function(a){a.namespace&&this._core.is(\"resizing\")&&this._core.$stage.find(\".cloned .owl-video-frame\").remove()},this),\"changed.owl.carousel\":a.proxy(function(a){a.namespace&&\"position\"===a.property.name&&this._playing&&this.stop()},this),\"prepared.owl.carousel\":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(\".owl-video\");c.length&&(c.css(\"display\",\"none\"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on(\"click.owl.video\",\".owl-video-play-icon\",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr(\"data-vimeo-id\")?\"vimeo\":a.attr(\"data-vzaar-id\")?\"vzaar\":\"youtube\"}(),d=a.attr(\"data-vimeo-id\")||a.attr(\"data-youtube-id\")||a.attr(\"data-vzaar-id\"),e=a.attr(\"data-width\")||this._core.settings.videoWidth,f=a.attr(\"data-height\")||this._core.settings.videoHeight,g=a.attr(\"href\");if(!g)throw new Error(\"Missing video URL.\");if(d=g.match(/(http:|https:|)\\/\\/(player.|www.|app.)?(vimeo\\.com|youtu(be\\.com|\\.be|be\\.googleapis\\.com|be\\-nocookie\\.com)|vzaar\\.com)\\/(video\\/|videos\\/|embed\\/|channels\\/.+\\/|groups\\/.+\\/|watch\\?v=|v\\/)?([A-Za-z0-9._%-]*)(\\&\\S+)?/),d[3].indexOf(\"youtu\")>-1)c=\"youtube\";else if(d[3].indexOf(\"vimeo\")>-1)c=\"vimeo\";else{if(!(d[3].indexOf(\"vzaar\")>-1))throw new Error(\"Video URL not supported.\");c=\"vzaar\"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr(\"data-video\",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?\"width:\"+c.width+\"px;height:\"+c.height+\"px;\":\"\",h=b.find(\"img\"),i=\"src\",j=\"\",k=this._core.settings,l=function(c){e='<div class=\"owl-video-play-icon\"></div>',d=k.lazyLoad?a(\"<div/>\",{class:\"owl-video-tn \"+j,srcType:c}):a(\"<div/>\",{class:\"owl-video-tn\",style:\"opacity:1;background-image:url(\"+c+\")\"}),b.after(d),b.after(e)};if(b.wrap(a(\"<div/>\",{class:\"owl-video-wrapper\",style:g})),this._core.settings.lazyLoad&&(i=\"data-src\",j=\"owl-lazy\"),h.length)return l(h.attr(i)),h.remove(),!1;\"youtube\"===c.type?(f=\"//img.youtube.com/vi/\"+c.id+\"/hqdefault.jpg\",l(f)):\"vimeo\"===c.type?a.ajax({type:\"GET\",url:\"//vimeo.com/api/v2/video/\"+c.id+\".json\",jsonp:\"callback\",dataType:\"jsonp\",success:function(a){f=a[0].thumbnail_large,l(f)}}):\"vzaar\"===c.type&&a.ajax({type:\"GET\",url:\"//vzaar.com/api/videos/\"+c.id+\".json\",jsonp:\"callback\",dataType:\"jsonp\",success:function(a){f=a.framegrab_url,l(f)}})},e.prototype.stop=function(){this._core.trigger(\"stop\",null,\"video\"),this._playing.find(\".owl-video-frame\").remove(),this._playing.removeClass(\"owl-video-playing\"),this._playing=null,this._core.leave(\"playing\"),this._core.trigger(\"stopped\",null,\"video\")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest(\".\"+this._core.settings.itemClass),f=this._videos[e.attr(\"data-video\")],g=f.width||\"100%\",h=f.height||this._core.$stage.height();this._playing||(this._core.enter(\"playing\"),this._core.trigger(\"play\",null,\"video\"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),c=a('<iframe frameborder=\"0\" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>'),c.attr(\"height\",h),c.attr(\"width\",g),\"youtube\"===f.type?c.attr(\"src\",\"//www.youtube.com/embed/\"+f.id+\"?autoplay=1&rel=0&v=\"+f.id):\"vimeo\"===f.type?c.attr(\"src\",\"//player.vimeo.com/video/\"+f.id+\"?autoplay=1\"):\"vzaar\"===f.type&&c.attr(\"src\",\"//view.vzaar.com/\"+f.id+\"/player?autoplay=true\"),a(c).wrap('<div class=\"owl-video-frame\" />').insertAfter(e.find(\".owl-video\")),this._playing=e.addClass(\"owl-video-playing\"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass(\"owl-video-frame\")},e.prototype.destroy=function(){var a,b;this._core.$element.off(\"click.owl.video\");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))\"function\"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={\"change.owl.carousel\":a.proxy(function(a){a.namespace&&\"position\"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),\"drag.owl.carousel dragged.owl.carousel translated.owl.carousel\":a.proxy(function(a){a.namespace&&(this.swapping=\"translated\"==a.type)},this),\"translate.owl.carousel\":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,\r\nanimateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+\"px\"}).addClass(\"animated owl-animated-out\").addClass(g)),f&&e.one(a.support.animation.end,c).addClass(\"animated owl-animated-in\").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:\"\"}).removeClass(\"animated owl-animated-out owl-animated-in\").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))\"function\"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={\"changed.owl.carousel\":a.proxy(function(a){a.namespace&&\"settings\"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&\"position\"===a.property.name&&this._paused&&(this._time=0)},this),\"initialized.owl.carousel\":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),\"play.owl.autoplay\":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),\"stop.owl.autoplay\":a.proxy(function(a){a.namespace&&this.stop()},this),\"mouseover.owl.autoplay\":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is(\"rotating\")&&this.pause()},this),\"mouseleave.owl.autoplay\":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is(\"rotating\")&&this.play()},this),\"touchstart.owl.core\":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is(\"rotating\")&&this.pause()},this),\"touchend.owl.core\":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is(\"interacting\")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is(\"rotating\")||this._core.enter(\"rotating\"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is(\"rotating\")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave(\"rotating\"))},e.prototype.pause=function(){this._core.is(\"rotating\")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))\"function\"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){\"use strict\";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={\"prepared.owl.carousel\":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('<div class=\"'+this._core.settings.dotClass+'\">'+a(b.content).find(\"[data-dot]\").addBack(\"[data-dot]\").attr(\"data-dot\")+\"</div>\")},this),\"added.owl.carousel\":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),\"remove.owl.carousel\":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),\"changed.owl.carousel\":a.proxy(function(a){a.namespace&&\"position\"==a.property.name&&this.draw()},this),\"initialized.owl.carousel\":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger(\"initialize\",null,\"navigation\"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger(\"initialized\",null,\"navigation\"))},this),\"refreshed.owl.carousel\":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger(\"refresh\",null,\"navigation\"),this.update(),this.draw(),this._core.trigger(\"refreshed\",null,\"navigation\"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['<span aria-label=\"Previous\">‹</span>','<span aria-label=\"Next\">›</span>'],navSpeed:!1,navElement:'button type=\"button\" role=\"presentation\"',navContainer:!1,navContainerClass:\"owl-nav\",navClass:[\"owl-prev\",\"owl-next\"],slideBy:1,dotClass:\"owl-dot\",dotsClass:\"owl-dots\",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a(\"<div>\").addClass(c.navContainerClass).appendTo(this.$element)).addClass(\"disabled\"),this._controls.$previous=a(\"<\"+c.navElement+\">\").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on(\"click\",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a(\"<\"+c.navElement+\">\").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on(\"click\",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a('<button role=\"button\">').addClass(c.dotClass).append(a(\"<span>\")).prop(\"outerHTML\")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a(\"<div>\").addClass(c.dotsClass).appendTo(this.$element)).addClass(\"disabled\"),this._controls.$absolute.on(\"click\",\"button\",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d,e;e=this._core.settings;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)\"$relative\"===b&&e.navContainer?this._controls[b].html(\"\"):this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))\"function\"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if(\"page\"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||\"page\"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;a<e;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass(\"disabled\",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass(\"disabled\",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass(\"disabled\",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass(\"disabled\",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join(\"\")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):b<0&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(\".active\").removeClass(\"active\"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass(\"active\"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return\"page\"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;!d&&this._pages.length?(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c)):a.proxy(this._overrides.to,this._core)(b,c)},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){\"use strict\";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={\"initialized.owl.carousel\":a.proxy(function(c){c.namespace&&\"URLHash\"===this._core.settings.startPosition&&a(b).trigger(\"hashchange.owl.navigation\")},this),\"prepared.owl.carousel\":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(\"[data-hash]\").addBack(\"[data-hash]\").attr(\"data-hash\");if(!c)return;this._hashes[c]=b.content}},this),\"changed.owl.carousel\":a.proxy(function(c){if(c.namespace&&\"position\"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on(\"hashchange.owl.navigation\",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off(\"hashchange.owl.navigation\");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))\"function\"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+\" \"+h.join(f+\" \")+f).split(\" \"),function(a,b){if(g[b]!==d)return e=!c||b,!1}),e}function f(a){return e(a,!0)}var g=a(\"<support>\").get(0).style,h=\"Webkit Moz O ms\".split(\" \"),i={transition:{end:{WebkitTransition:\"webkitTransitionEnd\",MozTransition:\"transitionend\",OTransition:\"oTransitionEnd\",transition:\"transitionend\"}},animation:{end:{WebkitAnimation:\"webkitAnimationEnd\",MozAnimation:\"animationend\",OAnimation:\"oAnimationEnd\",animation:\"animationend\"}}},j={csstransforms:function(){return!!e(\"transform\")},csstransforms3d:function(){return!!e(\"perspective\")},csstransitions:function(){return!!e(\"transition\")},cssanimations:function(){return!!e(\"animation\")}};j.csstransitions()&&(a.support.transition=new String(f(\"transition\")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f(\"animation\")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f(\"transform\")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document);","Mageplaza_Core/js/help.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Core\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\nrequire([\n 'jquery',\n 'underscore'\n], function ($, _) {\n 'use strict';\n\n var mpHelpDb = {\n 'admin/system_config/index': [\n {\n 'css_selector': '#general_single_store_mode_enabled',\n 'type': 'link',\n 'text': 'How to enable Single Store Mode, {link}.',\n 'url': 'https://www.mageplaza.com/kb/how-enable-single-store-mode-magento-2.html',\n 'anchor': 'learn more'\n }\n ],\n 'theme/design_config/edit/scope/websites/scope_id': [\n {\n 'css_selector': 'input[name*=\"header_welcome\"]',\n 'type': 'link',\n 'text': 'How to change the welcome message, {link}.',\n 'url': 'https://www.mageplaza.com/kb/how-change-welcome-message-magento-2.html',\n 'anchor': 'learn more'\n }\n ],\n 'system_config/edit/section/contact': [\n {\n 'css_selector': '#contact_contact_enabled',\n 'type': 'link',\n 'text': 'How to configure Contact Us form, {link}.',\n 'url': 'https://www.mageplaza.com/kb/how-configure-contacts-email-address-magento-2.html',\n 'anchor': 'learn more'\n }\n ],\n //Not Configuration\n 'catalog/product/edit': [\n {\n 'css_selector': '#media_gallery_content',\n 'type': 'link',\n 'text': 'How to upload Images Product, {link}.',\n 'url': 'https://www.mageplaza.com/kb/how-to-upload-images-product-in-magento-2.html',\n 'anchor': 'learn more'\n }\n ],\n 'type/configurable/key/': [\n {\n 'css_selector': '.page-actions-placeholder',\n 'type': 'link',\n 'text': 'Create Configurable Product, {link}.',\n 'url': 'https://www.mageplaza.com/kb/how-create-configurable-product-magento-2.html',\n 'anchor': 'learn more'\n }\n ],\n 'system_config/edit/section/general': [\n {\n 'css_selector': '#general_region_state_required',\n 'type': 'link',\n 'text': 'How to setup State, {link}.',\n 'url': 'https://www.mageplaza.com/kb/how-setup-locale-state-country-magento-2.html#set-up-state',\n 'anchor': 'learn more'\n },\n {\n 'css_selector': '#general_country_default',\n 'type': 'link',\n 'text': 'How to setup Country, {link}.',\n 'url': 'https://www.mageplaza.com/kb/how-setup-locale-state-country-magento-2.html#set-up-country',\n 'anchor': 'learn more'\n },\n {\n 'css_selector': '#general_locale_timezone',\n 'type': 'link',\n 'text': 'How to setup Locale, {link}.',\n 'url': 'https://www.mageplaza.com/kb/how-setup-locale-state-country-magento-2.html#login-magento-2',\n 'anchor': 'learn more'\n },\n {\n 'css_selector': '#general_store_information_name',\n 'type': 'link',\n 'text': 'How to setup store information, {link}.',\n 'url': 'https://www.mageplaza.com/kb/how-setup-store-information-magento-2.html',\n 'anchor': 'learn more'\n }\n\n ],\n 'system_config/edit/section/trans_email': [\n {\n 'css_selector': '#trans_email_ident_sales_email',\n 'type': 'link',\n 'text': 'About 79% of visitors drop their shopping cart at the checkout page. This proven abandoned cart email templates that can improve that number, {link}.',\n 'url': 'https://pages.mageplaza.com/abandoned-cart-email-templates-for-magento/',\n 'anchor': 'learn more'\n },\n ],\n 'system_config/edit/section/newsletter': [\n {\n 'css_selector': '#newsletter_subscription_success_email_template',\n 'type': 'link',\n 'text': 'Welcome emails generate 4 times the total open rates and 5 times the click rates compared to other bulk promotions. Get proven welcome email templates, {link}.',\n 'url': 'https://pages.mageplaza.com/welcome-email-templates-for-magento-2/',\n 'anchor': 'get a copy'\n }\n\n\n ],\n 'admin/email_template/new': [\n {\n 'css_selector': '#template_select',\n 'type': 'link',\n 'text': 'Get {link} templates that convert',\n 'url': 'https://pages.mageplaza.com/bundle-of-email-follow-up-templates/',\n 'anchor': 'bundle of follow up emails'\n }\n\n\n ]\n };\n\n function buildHtml(data) {\n var link = '<a href=\"' + data.url + '?utm_source=store&utm_medium=link&utm_campaign=mageplaza-helps\" target=\"_blank\">' + data.anchor + '</a>';\n var text = data.text.replace('{link}', link);\n\n return '<p class=\"note\">' + text + '</p>';\n }\n\n var url = window.location.href;\n for (var path in mpHelpDb) {\n if (mpHelpDb.hasOwnProperty(path) && url.search(path)) {\n var datas = mpHelpDb[path];\n _.each(datas, function (data) {\n var html = buildHtml(data);\n html && $(html).insertAfter(data.css_selector); //only insert if html is not empty\n });\n }\n }\n});","Mageplaza_Core/js/process/popup.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Core\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/modal/confirm',\n 'Magento_Ui/js/modal/alert',\n 'Magento_Ui/js/modal/modal'\n], function ($, confirmation, alert) {\n \"use strict\";\n var btnProcess = $('#mp-btn-progress'),\n isStopBtnClicked = false;\n\n $.widget('mageplaza.mpProcessBar', {\n options: {\n index: 0,\n itemError: 0,\n confirmMessage: $.mage.__('Do you want to proceed with the process?')\n },\n\n _create: function () {\n this.initListener();\n },\n\n initListener: function () {\n var self = this;\n\n btnProcess.on('click', function (event) {\n event.preventDefault();\n if (self.options.isEnabled === '0') {\n alert({\n title: $.mage.__('Warning'),\n content: $.mage.__('The module has been disabled.')\n });\n\n return;\n }\n self.openConfirmModal();\n });\n },\n\n openConfirmModal: function () {\n var collection = this.options.collection;\n\n if (collection.length > 0) {\n this.getConfirmModal();\n } else {\n alert({\n title: $.mage.__('Warning'),\n content: $.mage.__('You need to scan all images before starting optimization process.')\n });\n }\n },\n\n getConfirmModal: function () {\n var self = this;\n self.options.index = 0;\n confirmation({\n title: $.mage.__('Action'),\n content: this.options.confirmMessage,\n actions: {\n confirm: function () {\n var processModal = $('#mp-process-modal');\n isStopBtnClicked = false;\n processModal.modal({\n 'type': 'popup',\n 'title': $.mage.__('Processing...'),\n 'responsive': true,\n 'modalClass': 'mp-process-modal-popup',\n 'buttons': [\n {\n text: $.mage.__('Stop'),\n class: 'mp-action-stop action-primary',\n click: function () {\n isStopBtnClicked = true;\n confirmation({\n content: $.mage.__('Are you sure you want to stop processing?'),\n actions: {\n confirm: function () {\n processModal.modal('closeModal');\n },\n cancel: function () {\n isStopBtnClicked = false;\n self.loadAjax();\n }\n }\n });\n }\n },\n {\n text: $.mage.__('Close'),\n class: 'mp-action-close action-secondary',\n click: function () {\n processModal.modal('closeModal');\n }\n },\n {\n text: $.mage.__('Reprocess'),\n class: 'mp-action-reprocess action-primary',\n click: function () {\n self.processLoading();\n }\n }\n ]\n });\n\n $('.action-close').hide();\n $('#mp-process-modal-content').remove();\n $('#mp-process-modal-content-line').remove();\n $('.modal-footer').after('<div id=\"mp-process-modal-content\" style=\"padding: 2rem 3rem;\"></div>')\n .after('<div style=\"padding:0 3rem\"><div id=\"mp-process-modal-content-line\" style=\"height: 1px; background:#DCDCDC;\"></div></div>');\n $('.modal-slide .modal-content').css('padding-bottom', 'unset');\n $('.modal-popup .modal-footer').css('padding-top', 'unset');\n processModal.modal('openModal');\n self.processLoading();\n }\n }\n });\n },\n\n processLoading: function () {\n this.options.index = 0;\n this.options.itemError = 0;\n var parentElement = document.querySelectorAll(\"#mp-error-item\"),\n progressBar = $('#mp-progress-bar');\n parentElement.forEach(function (element) {\n element.parentNode.removeChild(element);\n });\n $('.mp-process-modal-popup .modal-title').text($.mage.__('Processing...'));\n progressBar.width('0%');\n $('#mp-process-modal-percent').text('0/0 (0.00%)');\n progressBar.removeClass('progress-bar-success');\n progressBar.removeClass('progress-bar-danger');\n progressBar.removeClass('progress-bar-info');\n progressBar.addClass('progress-bar-info');\n this.loadAjax();\n },\n\n loadAjax: function () {\n if (isStopBtnClicked) {\n return;\n }\n\n var self = this,\n collection = this.options.collection,\n progressBar = $('#mp-progress-bar'),\n modalPercent = $('#mp-process-modal-percent'),\n item = collection[this.options.index],\n collectionLength = collection.length,\n percent = 100 * (this.options.index + 1) / collectionLength,\n btnClose = $('button.mp-action-close'),\n btnStop = $('button.mp-action-stop'),\n btnReprocess = $('button.mp-action-reprocess'),\n popupTitle = $('.mp-process-modal-popup .modal-title');\n\n btnStop.show();\n btnReprocess.hide();\n btnClose.hide();\n if (this.options.itemError === collectionLength) {\n popupTitle.text($.mage.__('Process failed'));\n btnClose.css({\n 'position': 'relative',\n 'left': '-5px'\n });\n btnStop.hide();\n btnClose.show();\n btnReprocess.show();\n\n return;\n }\n\n if (this.options.index >= collectionLength) {\n if (this.options.itemError !== 0) {\n popupTitle.text($.mage.__('Complete'));\n progressBar.removeClass('progress-bar-info');\n progressBar.addClass('progress-bar-success');\n btnStop.hide();\n btnReprocess.show();\n btnClose.show();\n\n return;\n } else {\n popupTitle.text($.mage.__('Complete'));\n progressBar.removeClass('progress-bar-info');\n progressBar.addClass('progress-bar-success');\n btnStop.hide();\n btnClose.show();\n\n return;\n }\n }\n\n self.options.index++;\n\n return $.ajax({\n url: this.options.url,\n data: {\n item_id: item.id,\n item_name: item.name,\n form_key: window.FORM_KEY\n }\n }).done(function (data) {\n if (data.status === 'Error') {\n self.options.itemError++;\n if (percent === 100 && self.options.itemError === collectionLength) {\n progressBar.removeClass('progress-bar-info');\n progressBar.addClass('progress-bar-danger');\n\n }\n self.getContent(percent, data.item_error, data.status);\n }\n\n progressBar.width(percent.toFixed(2) + '%');\n modalPercent.text(self.options.index + '/' + collectionLength + ' (' + percent.toFixed(2) + '%)');\n\n self.loadAjax();\n }).fail(function (data) {\n self.getContent(percent, data.item_error, data.status);\n self.loadAjax();\n });\n },\n\n getContent: function (percent, itemError, status) {\n var modalContent = $('#mp-process-modal-content');\n\n modalContent.append('<p id=\"mp-error-item\" style=\"text-align: left\">' + '<strong style=\"color: red\">' + status + '</strong>' + ': ' + itemError + '</p>');\n }\n });\n\n return $.mageplaza.mpProcessBar;\n});\n","Mageplaza_Core/lib/fileUploader/jquery.fileupload-validate.js":"/*\n * jQuery File Upload Validation Plugin\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2013, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, require */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['jquery', 'Mageplaza_Core/lib/fileUploader/jquery.fileupload-process'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(require('jquery'), require('Mageplaza_Core/lib/fileUploader/jquery.fileupload-process'));\n } else {\n // Browser globals:\n factory(window.jQuery);\n }\n})(function ($) {\n 'use strict';\n\n // Append to the default processQueue:\n $.blueimp.fileupload.prototype.options.processQueue.push({\n action: 'validate',\n // Always trigger this action,\n // even if the previous action was rejected:\n always: true,\n // Options taken from the global options map:\n acceptFileTypes: '@',\n maxFileSize: '@',\n minFileSize: '@',\n maxNumberOfFiles: '@',\n disabled: '@disableValidation'\n });\n\n // The File Upload Validation plugin extends the fileupload widget\n // with file validation functionality:\n $.widget('blueimp.fileupload', $.blueimp.fileupload, {\n options: {\n /*\n // The regular expression for allowed file types, matches\n // against either file type or file name:\n acceptFileTypes: /(\\.|\\/)(gif|jpe?g|png)$/i,\n // The maximum allowed file size in bytes:\n maxFileSize: 10000000, // 10 MB\n // The minimum allowed file size in bytes:\n minFileSize: undefined, // No minimal file size\n // The limit of files to be uploaded:\n maxNumberOfFiles: 10,\n */\n\n // Function returning the current number of files,\n // has to be overridden for maxNumberOfFiles validation:\n getNumberOfFiles: $.noop,\n\n // Error and info messages:\n messages: {\n maxNumberOfFiles: 'Maximum number of files exceeded',\n acceptFileTypes: 'File type not allowed',\n maxFileSize: 'File is too large',\n minFileSize: 'File is too small'\n }\n },\n\n processActions: {\n validate: function (data, options) {\n if (options.disabled) {\n return data;\n }\n // eslint-disable-next-line new-cap\n var dfd = $.Deferred(),\n settings = this.options,\n file = data.files[data.index],\n fileSize;\n if (options.minFileSize || options.maxFileSize) {\n fileSize = file.size;\n }\n if (\n $.type(options.maxNumberOfFiles) === 'number' &&\n (settings.getNumberOfFiles() || 0) + data.files.length >\n options.maxNumberOfFiles\n ) {\n file.error = settings.i18n('maxNumberOfFiles');\n } else if (\n options.acceptFileTypes &&\n !(\n options.acceptFileTypes.test(file.type) ||\n options.acceptFileTypes.test(file.name)\n )\n ) {\n file.error = settings.i18n('acceptFileTypes');\n } else if (fileSize > options.maxFileSize) {\n file.error = settings.i18n('maxFileSize');\n } else if (\n $.type(fileSize) === 'number' &&\n fileSize < options.minFileSize\n ) {\n file.error = settings.i18n('minFileSize');\n } else {\n delete file.error;\n }\n if (file.error || data.files.error) {\n data.files.error = true;\n dfd.rejectWith(this, [data]);\n } else {\n dfd.resolveWith(this, [data]);\n }\n return dfd.promise();\n }\n }\n });\n});\n","Mageplaza_Core/lib/fileUploader/jquery.fileupload.js":"/*\n * jQuery File Upload Plugin\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2010, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, require */\n/* eslint-disable new-cap */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['jquery', 'Mageplaza_Core/lib/fileUploader/vendor/jquery.ui.widget'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(require('jquery'), require('Mageplaza_Core/lib/fileUploader/vendor/jquery.ui.widget'));\n } else {\n // Browser globals:\n factory(window.jQuery);\n }\n})(function ($) {\n 'use strict';\n\n // Detect file input support, based on\n // https://viljamis.com/2012/file-upload-support-on-mobile/\n $.support.fileInput = !(\n new RegExp(\n // Handle devices which give false positives for the feature detection:\n '(Android (1\\\\.[0156]|2\\\\.[01]))' +\n '|(Windows Phone (OS 7|8\\\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' +\n '|(w(eb)?OSBrowser)|(webOS)' +\n '|(Kindle/(1\\\\.0|2\\\\.[05]|3\\\\.0))'\n ).test(window.navigator.userAgent) ||\n // Feature detection for all other devices:\n $('<input type=\"file\"/>').prop('disabled')\n );\n\n // The FileReader API is not actually used, but works as feature detection,\n // as some Safari versions (5?) support XHR file uploads via the FormData API,\n // but not non-multipart XHR file uploads.\n // window.XMLHttpRequestUpload is not available on IE10, so we check for\n // window.ProgressEvent instead to detect XHR2 file upload capability:\n $.support.xhrFileUpload = !!(window.ProgressEvent && window.FileReader);\n $.support.xhrFormDataFileUpload = !!window.FormData;\n\n // Detect support for Blob slicing (required for chunked uploads):\n $.support.blobSlice =\n window.Blob &&\n (Blob.prototype.slice ||\n Blob.prototype.webkitSlice ||\n Blob.prototype.mozSlice);\n\n /**\n * Helper function to create drag handlers for dragover/dragenter/dragleave\n *\n * @param {string} type Event type\n * @returns {Function} Drag handler\n */\n function getDragHandler(type) {\n var isDragOver = type === 'dragover';\n return function (e) {\n e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;\n var dataTransfer = e.dataTransfer;\n if (\n dataTransfer &&\n $.inArray('Files', dataTransfer.types) !== -1 &&\n this._trigger(type, $.Event(type, { delegatedEvent: e })) !== false\n ) {\n e.preventDefault();\n if (isDragOver) {\n dataTransfer.dropEffect = 'copy';\n }\n }\n };\n }\n\n // The fileupload widget listens for change events on file input fields defined\n // via fileInput setting and paste or drop events of the given dropZone.\n // In addition to the default jQuery Widget methods, the fileupload widget\n // exposes the \"add\" and \"send\" methods, to add or directly send files using\n // the fileupload API.\n // By default, files added via file input selection, paste, drag & drop or\n // \"add\" method are uploaded immediately, but it is possible to override\n // the \"add\" callback option to queue file uploads.\n $.widget('blueimp.fileupload', {\n options: {\n // The drop target element(s), by the default the complete document.\n // Set to null to disable drag & drop support:\n dropZone: $(document),\n // The paste target element(s), by the default undefined.\n // Set to a DOM node or jQuery object to enable file pasting:\n pasteZone: undefined,\n // The file input field(s), that are listened to for change events.\n // If undefined, it is set to the file input fields inside\n // of the widget element on plugin initialization.\n // Set to null to disable the change listener.\n fileInput: undefined,\n // By default, the file input field is replaced with a clone after\n // each input field change event. This is required for iframe transport\n // queues and allows change events to be fired for the same file\n // selection, but can be disabled by setting the following option to false:\n replaceFileInput: true,\n // The parameter name for the file form data (the request argument name).\n // If undefined or empty, the name property of the file input field is\n // used, or \"files[]\" if the file input name property is also empty,\n // can be a string or an array of strings:\n paramName: undefined,\n // By default, each file of a selection is uploaded using an individual\n // request for XHR type uploads. Set to false to upload file\n // selections in one request each:\n singleFileUploads: true,\n // To limit the number of files uploaded with one XHR request,\n // set the following option to an integer greater than 0:\n limitMultiFileUploads: undefined,\n // The following option limits the number of files uploaded with one\n // XHR request to keep the request size under or equal to the defined\n // limit in bytes:\n limitMultiFileUploadSize: undefined,\n // Multipart file uploads add a number of bytes to each uploaded file,\n // therefore the following option adds an overhead for each file used\n // in the limitMultiFileUploadSize configuration:\n limitMultiFileUploadSizeOverhead: 512,\n // Set the following option to true to issue all file upload requests\n // in a sequential order:\n sequentialUploads: false,\n // To limit the number of concurrent uploads,\n // set the following option to an integer greater than 0:\n limitConcurrentUploads: undefined,\n // Set the following option to true to force iframe transport uploads:\n forceIframeTransport: false,\n // Set the following option to the location of a redirect url on the\n // origin server, for cross-domain iframe transport uploads:\n redirect: undefined,\n // The parameter name for the redirect url, sent as part of the form\n // data and set to 'redirect' if this option is empty:\n redirectParamName: undefined,\n // Set the following option to the location of a postMessage window,\n // to enable postMessage transport uploads:\n postMessage: undefined,\n // By default, XHR file uploads are sent as multipart/form-data.\n // The iframe transport is always using multipart/form-data.\n // Set to false to enable non-multipart XHR uploads:\n multipart: true,\n // To upload large files in smaller chunks, set the following option\n // to a preferred maximum chunk size. If set to 0, null or undefined,\n // or the browser does not support the required Blob API, files will\n // be uploaded as a whole.\n maxChunkSize: undefined,\n // When a non-multipart upload or a chunked multipart upload has been\n // aborted, this option can be used to resume the upload by setting\n // it to the size of the already uploaded bytes. This option is most\n // useful when modifying the options object inside of the \"add\" or\n // \"send\" callbacks, as the options are cloned for each file upload.\n uploadedBytes: undefined,\n // By default, failed (abort or error) file uploads are removed from the\n // global progress calculation. Set the following option to false to\n // prevent recalculating the global progress data:\n recalculateProgress: true,\n // Interval in milliseconds to calculate and trigger progress events:\n progressInterval: 100,\n // Interval in milliseconds to calculate progress bitrate:\n bitrateInterval: 500,\n // By default, uploads are started automatically when adding files:\n autoUpload: true,\n // By default, duplicate file names are expected to be handled on\n // the server-side. If this is not possible (e.g. when uploading\n // files directly to Amazon S3), the following option can be set to\n // an empty object or an object mapping existing filenames, e.g.:\n // { \"image.jpg\": true, \"image (1).jpg\": true }\n // If it is set, all files will be uploaded with unique filenames,\n // adding increasing number suffixes if necessary, e.g.:\n // \"image (2).jpg\"\n uniqueFilenames: undefined,\n\n // Error and info messages:\n messages: {\n uploadedBytes: 'Uploaded bytes exceed file size'\n },\n\n // Translation function, gets the message key to be translated\n // and an object with context specific data as arguments:\n i18n: function (message, context) {\n // eslint-disable-next-line no-param-reassign\n message = this.messages[message] || message.toString();\n if (context) {\n $.each(context, function (key, value) {\n // eslint-disable-next-line no-param-reassign\n message = message.replace('{' + key + '}', value);\n });\n }\n return message;\n },\n\n // Additional form data to be sent along with the file uploads can be set\n // using this option, which accepts an array of objects with name and\n // value properties, a function returning such an array, a FormData\n // object (for XHR file uploads), or a simple object.\n // The form of the first fileInput is given as parameter to the function:\n formData: function (form) {\n return form.serializeArray();\n },\n\n // The add callback is invoked as soon as files are added to the fileupload\n // widget (via file input selection, drag & drop, paste or add API call).\n // If the singleFileUploads option is enabled, this callback will be\n // called once for each file in the selection for XHR file uploads, else\n // once for each file selection.\n //\n // The upload starts when the submit method is invoked on the data parameter.\n // The data object contains a files property holding the added files\n // and allows you to override plugin options as well as define ajax settings.\n //\n // Listeners for this callback can also be bound the following way:\n // .on('fileuploadadd', func);\n //\n // data.submit() returns a Promise object and allows to attach additional\n // handlers using jQuery's Deferred callbacks:\n // data.submit().done(func).fail(func).always(func);\n add: function (e, data) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n if (\n data.autoUpload ||\n (data.autoUpload !== false &&\n $(this).fileupload('option', 'autoUpload'))\n ) {\n data.process().done(function () {\n data.submit();\n });\n }\n },\n\n // Other callbacks:\n\n // Callback for the submit event of each file upload:\n // submit: function (e, data) {}, // .on('fileuploadsubmit', func);\n\n // Callback for the start of each file upload request:\n // send: function (e, data) {}, // .on('fileuploadsend', func);\n\n // Callback for successful uploads:\n // done: function (e, data) {}, // .on('fileuploaddone', func);\n\n // Callback for failed (abort or error) uploads:\n // fail: function (e, data) {}, // .on('fileuploadfail', func);\n\n // Callback for completed (success, abort or error) requests:\n // always: function (e, data) {}, // .on('fileuploadalways', func);\n\n // Callback for upload progress events:\n // progress: function (e, data) {}, // .on('fileuploadprogress', func);\n\n // Callback for global upload progress events:\n // progressall: function (e, data) {}, // .on('fileuploadprogressall', func);\n\n // Callback for uploads start, equivalent to the global ajaxStart event:\n // start: function (e) {}, // .on('fileuploadstart', func);\n\n // Callback for uploads stop, equivalent to the global ajaxStop event:\n // stop: function (e) {}, // .on('fileuploadstop', func);\n\n // Callback for change events of the fileInput(s):\n // change: function (e, data) {}, // .on('fileuploadchange', func);\n\n // Callback for paste events to the pasteZone(s):\n // paste: function (e, data) {}, // .on('fileuploadpaste', func);\n\n // Callback for drop events of the dropZone(s):\n // drop: function (e, data) {}, // .on('fileuploaddrop', func);\n\n // Callback for dragover events of the dropZone(s):\n // dragover: function (e) {}, // .on('fileuploaddragover', func);\n\n // Callback before the start of each chunk upload request (before form data initialization):\n // chunkbeforesend: function (e, data) {}, // .on('fileuploadchunkbeforesend', func);\n\n // Callback for the start of each chunk upload request:\n // chunksend: function (e, data) {}, // .on('fileuploadchunksend', func);\n\n // Callback for successful chunk uploads:\n // chunkdone: function (e, data) {}, // .on('fileuploadchunkdone', func);\n\n // Callback for failed (abort or error) chunk uploads:\n // chunkfail: function (e, data) {}, // .on('fileuploadchunkfail', func);\n\n // Callback for completed (success, abort or error) chunk upload requests:\n // chunkalways: function (e, data) {}, // .on('fileuploadchunkalways', func);\n\n // The plugin options are used as settings object for the ajax calls.\n // The following are jQuery ajax settings required for the file uploads:\n processData: false,\n contentType: false,\n cache: false,\n timeout: 0\n },\n\n // jQuery versions before 1.8 require promise.pipe if the return value is\n // used, as promise.then in older versions has a different behavior, see:\n // https://blog.jquery.com/2012/08/09/jquery-1-8-released/\n // https://bugs.jquery.com/ticket/11010\n // https://github.com/blueimp/jQuery-File-Upload/pull/3435\n _promisePipe: (function () {\n var parts = $.fn.jquery.split('.');\n return Number(parts[0]) > 1 || Number(parts[1]) > 7 ? 'then' : 'pipe';\n })(),\n\n // A list of options that require reinitializing event listeners and/or\n // special initialization code:\n _specialOptions: [\n 'fileInput',\n 'dropZone',\n 'pasteZone',\n 'multipart',\n 'forceIframeTransport'\n ],\n\n _blobSlice:\n $.support.blobSlice &&\n function () {\n var slice = this.slice || this.webkitSlice || this.mozSlice;\n return slice.apply(this, arguments);\n },\n\n _BitrateTimer: function () {\n this.timestamp = Date.now ? Date.now() : new Date().getTime();\n this.loaded = 0;\n this.bitrate = 0;\n this.getBitrate = function (now, loaded, interval) {\n var timeDiff = now - this.timestamp;\n if (!this.bitrate || !interval || timeDiff > interval) {\n this.bitrate = (loaded - this.loaded) * (1000 / timeDiff) * 8;\n this.loaded = loaded;\n this.timestamp = now;\n }\n return this.bitrate;\n };\n },\n\n _isXHRUpload: function (options) {\n return (\n !options.forceIframeTransport &&\n ((!options.multipart && $.support.xhrFileUpload) ||\n $.support.xhrFormDataFileUpload)\n );\n },\n\n _getFormData: function (options) {\n var formData;\n if ($.type(options.formData) === 'function') {\n return options.formData(options.form);\n }\n if ($.isArray(options.formData)) {\n return options.formData;\n }\n if ($.type(options.formData) === 'object') {\n formData = [];\n $.each(options.formData, function (name, value) {\n formData.push({ name: name, value: value });\n });\n return formData;\n }\n return [];\n },\n\n _getTotal: function (files) {\n var total = 0;\n $.each(files, function (index, file) {\n total += file.size || 1;\n });\n return total;\n },\n\n _initProgressObject: function (obj) {\n var progress = {\n loaded: 0,\n total: 0,\n bitrate: 0\n };\n if (obj._progress) {\n $.extend(obj._progress, progress);\n } else {\n obj._progress = progress;\n }\n },\n\n _initResponseObject: function (obj) {\n var prop;\n if (obj._response) {\n for (prop in obj._response) {\n if (Object.prototype.hasOwnProperty.call(obj._response, prop)) {\n delete obj._response[prop];\n }\n }\n } else {\n obj._response = {};\n }\n },\n\n _onProgress: function (e, data) {\n if (e.lengthComputable) {\n var now = Date.now ? Date.now() : new Date().getTime(),\n loaded;\n if (\n data._time &&\n data.progressInterval &&\n now - data._time < data.progressInterval &&\n e.loaded !== e.total\n ) {\n return;\n }\n data._time = now;\n loaded =\n Math.floor(\n (e.loaded / e.total) * (data.chunkSize || data._progress.total)\n ) + (data.uploadedBytes || 0);\n // Add the difference from the previously loaded state\n // to the global loaded counter:\n this._progress.loaded += loaded - data._progress.loaded;\n this._progress.bitrate = this._bitrateTimer.getBitrate(\n now,\n this._progress.loaded,\n data.bitrateInterval\n );\n data._progress.loaded = data.loaded = loaded;\n data._progress.bitrate = data.bitrate = data._bitrateTimer.getBitrate(\n now,\n loaded,\n data.bitrateInterval\n );\n // Trigger a custom progress event with a total data property set\n // to the file size(s) of the current upload and a loaded data\n // property calculated accordingly:\n this._trigger(\n 'progress',\n $.Event('progress', { delegatedEvent: e }),\n data\n );\n // Trigger a global progress event for all current file uploads,\n // including ajax calls queued for sequential file uploads:\n this._trigger(\n 'progressall',\n $.Event('progressall', { delegatedEvent: e }),\n this._progress\n );\n }\n },\n\n _initProgressListener: function (options) {\n var that = this,\n xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();\n // Access to the native XHR object is required to add event listeners\n // for the upload progress event:\n if (xhr.upload) {\n $(xhr.upload).on('progress', function (e) {\n var oe = e.originalEvent;\n // Make sure the progress event properties get copied over:\n e.lengthComputable = oe.lengthComputable;\n e.loaded = oe.loaded;\n e.total = oe.total;\n that._onProgress(e, options);\n });\n options.xhr = function () {\n return xhr;\n };\n }\n },\n\n _deinitProgressListener: function (options) {\n var xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();\n if (xhr.upload) {\n $(xhr.upload).off('progress');\n }\n },\n\n _isInstanceOf: function (type, obj) {\n // Cross-frame instanceof check\n return Object.prototype.toString.call(obj) === '[object ' + type + ']';\n },\n\n _getUniqueFilename: function (name, map) {\n // eslint-disable-next-line no-param-reassign\n name = String(name);\n if (map[name]) {\n // eslint-disable-next-line no-param-reassign\n name = name.replace(\n /(?: \\(([\\d]+)\\))?(\\.[^.]+)?$/,\n function (_, p1, p2) {\n var index = p1 ? Number(p1) + 1 : 1;\n var ext = p2 || '';\n return ' (' + index + ')' + ext;\n }\n );\n return this._getUniqueFilename(name, map);\n }\n map[name] = true;\n return name;\n },\n\n _initXHRData: function (options) {\n var that = this,\n formData,\n file = options.files[0],\n // Ignore non-multipart setting if not supported:\n multipart = options.multipart || !$.support.xhrFileUpload,\n paramName =\n $.type(options.paramName) === 'array'\n ? options.paramName[0]\n : options.paramName;\n options.headers = $.extend({}, options.headers);\n if (options.contentRange) {\n options.headers['Content-Range'] = options.contentRange;\n }\n if (!multipart || options.blob || !this._isInstanceOf('File', file)) {\n options.headers['Content-Disposition'] =\n 'attachment; filename=\"' +\n encodeURI(file.uploadName || file.name) +\n '\"';\n }\n if (!multipart) {\n options.contentType = file.type || 'application/octet-stream';\n options.data = options.blob || file;\n } else if ($.support.xhrFormDataFileUpload) {\n if (options.postMessage) {\n // window.postMessage does not allow sending FormData\n // objects, so we just add the File/Blob objects to\n // the formData array and let the postMessage window\n // create the FormData object out of this array:\n formData = this._getFormData(options);\n if (options.blob) {\n formData.push({\n name: paramName,\n value: options.blob\n });\n } else {\n $.each(options.files, function (index, file) {\n formData.push({\n name:\n ($.type(options.paramName) === 'array' &&\n options.paramName[index]) ||\n paramName,\n value: file\n });\n });\n }\n } else {\n if (that._isInstanceOf('FormData', options.formData)) {\n formData = options.formData;\n } else {\n formData = new FormData();\n $.each(this._getFormData(options), function (index, field) {\n formData.append(field.name, field.value);\n });\n }\n if (options.blob) {\n formData.append(\n paramName,\n options.blob,\n file.uploadName || file.name\n );\n } else {\n $.each(options.files, function (index, file) {\n // This check allows the tests to run with\n // dummy objects:\n if (\n that._isInstanceOf('File', file) ||\n that._isInstanceOf('Blob', file)\n ) {\n var fileName = file.uploadName || file.name;\n if (options.uniqueFilenames) {\n fileName = that._getUniqueFilename(\n fileName,\n options.uniqueFilenames\n );\n }\n formData.append(\n ($.type(options.paramName) === 'array' &&\n options.paramName[index]) ||\n paramName,\n file,\n fileName\n );\n }\n });\n }\n }\n options.data = formData;\n }\n // Blob reference is not needed anymore, free memory:\n options.blob = null;\n },\n\n _initIframeSettings: function (options) {\n var targetHost = $('<a></a>').prop('href', options.url).prop('host');\n // Setting the dataType to iframe enables the iframe transport:\n options.dataType = 'iframe ' + (options.dataType || '');\n // The iframe transport accepts a serialized array as form data:\n options.formData = this._getFormData(options);\n // Add redirect url to form data on cross-domain uploads:\n if (options.redirect && targetHost && targetHost !== location.host) {\n options.formData.push({\n name: options.redirectParamName || 'redirect',\n value: options.redirect\n });\n }\n },\n\n _initDataSettings: function (options) {\n if (this._isXHRUpload(options)) {\n if (!this._chunkedUpload(options, true)) {\n if (!options.data) {\n this._initXHRData(options);\n }\n this._initProgressListener(options);\n }\n if (options.postMessage) {\n // Setting the dataType to postmessage enables the\n // postMessage transport:\n options.dataType = 'postmessage ' + (options.dataType || '');\n }\n } else {\n this._initIframeSettings(options);\n }\n },\n\n _getParamName: function (options) {\n var fileInput = $(options.fileInput),\n paramName = options.paramName;\n if (!paramName) {\n paramName = [];\n fileInput.each(function () {\n var input = $(this),\n name = input.prop('name') || 'files[]',\n i = (input.prop('files') || [1]).length;\n while (i) {\n paramName.push(name);\n i -= 1;\n }\n });\n if (!paramName.length) {\n paramName = [fileInput.prop('name') || 'files[]'];\n }\n } else if (!$.isArray(paramName)) {\n paramName = [paramName];\n }\n return paramName;\n },\n\n _initFormSettings: function (options) {\n // Retrieve missing options from the input field and the\n // associated form, if available:\n if (!options.form || !options.form.length) {\n options.form = $(options.fileInput.prop('form'));\n // If the given file input doesn't have an associated form,\n // use the default widget file input's form:\n if (!options.form.length) {\n options.form = $(this.options.fileInput.prop('form'));\n }\n }\n options.paramName = this._getParamName(options);\n if (!options.url) {\n options.url = options.form.prop('action') || location.href;\n }\n // The HTTP request method must be \"POST\" or \"PUT\":\n options.type = (\n options.type ||\n ($.type(options.form.prop('method')) === 'string' &&\n options.form.prop('method')) ||\n ''\n ).toUpperCase();\n if (\n options.type !== 'POST' &&\n options.type !== 'PUT' &&\n options.type !== 'PATCH'\n ) {\n options.type = 'POST';\n }\n if (!options.formAcceptCharset) {\n options.formAcceptCharset = options.form.attr('accept-charset');\n }\n },\n\n _getAJAXSettings: function (data) {\n var options = $.extend({}, this.options, data);\n this._initFormSettings(options);\n this._initDataSettings(options);\n return options;\n },\n\n // jQuery 1.6 doesn't provide .state(),\n // while jQuery 1.8+ removed .isRejected() and .isResolved():\n _getDeferredState: function (deferred) {\n if (deferred.state) {\n return deferred.state();\n }\n if (deferred.isResolved()) {\n return 'resolved';\n }\n if (deferred.isRejected()) {\n return 'rejected';\n }\n return 'pending';\n },\n\n // Maps jqXHR callbacks to the equivalent\n // methods of the given Promise object:\n _enhancePromise: function (promise) {\n promise.success = promise.done;\n promise.error = promise.fail;\n promise.complete = promise.always;\n return promise;\n },\n\n // Creates and returns a Promise object enhanced with\n // the jqXHR methods abort, success, error and complete:\n _getXHRPromise: function (resolveOrReject, context, args) {\n var dfd = $.Deferred(),\n promise = dfd.promise();\n // eslint-disable-next-line no-param-reassign\n context = context || this.options.context || promise;\n if (resolveOrReject === true) {\n dfd.resolveWith(context, args);\n } else if (resolveOrReject === false) {\n dfd.rejectWith(context, args);\n }\n promise.abort = dfd.promise;\n return this._enhancePromise(promise);\n },\n\n // Adds convenience methods to the data callback argument:\n _addConvenienceMethods: function (e, data) {\n var that = this,\n getPromise = function (args) {\n return $.Deferred().resolveWith(that, args).promise();\n };\n data.process = function (resolveFunc, rejectFunc) {\n if (resolveFunc || rejectFunc) {\n data._processQueue = this._processQueue = (this._processQueue ||\n getPromise([this]))\n [that._promisePipe](function () {\n if (data.errorThrown) {\n return $.Deferred().rejectWith(that, [data]).promise();\n }\n return getPromise(arguments);\n })\n [that._promisePipe](resolveFunc, rejectFunc);\n }\n return this._processQueue || getPromise([this]);\n };\n data.submit = function () {\n if (this.state() !== 'pending') {\n data.jqXHR = this.jqXHR =\n that._trigger(\n 'submit',\n $.Event('submit', { delegatedEvent: e }),\n this\n ) !== false && that._onSend(e, this);\n }\n return this.jqXHR || that._getXHRPromise();\n };\n data.abort = function () {\n if (this.jqXHR) {\n return this.jqXHR.abort();\n }\n this.errorThrown = 'abort';\n that._trigger('fail', null, this);\n return that._getXHRPromise(false);\n };\n data.state = function () {\n if (this.jqXHR) {\n return that._getDeferredState(this.jqXHR);\n }\n if (this._processQueue) {\n return that._getDeferredState(this._processQueue);\n }\n };\n data.processing = function () {\n return (\n !this.jqXHR &&\n this._processQueue &&\n that._getDeferredState(this._processQueue) === 'pending'\n );\n };\n data.progress = function () {\n return this._progress;\n };\n data.response = function () {\n return this._response;\n };\n },\n\n // Parses the Range header from the server response\n // and returns the uploaded bytes:\n _getUploadedBytes: function (jqXHR) {\n var range = jqXHR.getResponseHeader('Range'),\n parts = range && range.split('-'),\n upperBytesPos = parts && parts.length > 1 && parseInt(parts[1], 10);\n return upperBytesPos && upperBytesPos + 1;\n },\n\n // Uploads a file in multiple, sequential requests\n // by splitting the file up in multiple blob chunks.\n // If the second parameter is true, only tests if the file\n // should be uploaded in chunks, but does not invoke any\n // upload requests:\n _chunkedUpload: function (options, testOnly) {\n options.uploadedBytes = options.uploadedBytes || 0;\n var that = this,\n file = options.files[0],\n fs = file.size,\n ub = options.uploadedBytes,\n mcs = options.maxChunkSize || fs,\n slice = this._blobSlice,\n dfd = $.Deferred(),\n promise = dfd.promise(),\n jqXHR,\n upload;\n if (\n !(\n this._isXHRUpload(options) &&\n slice &&\n (ub || ($.type(mcs) === 'function' ? mcs(options) : mcs) < fs)\n ) ||\n options.data\n ) {\n return false;\n }\n if (testOnly) {\n return true;\n }\n if (ub >= fs) {\n file.error = options.i18n('uploadedBytes');\n return this._getXHRPromise(false, options.context, [\n null,\n 'error',\n file.error\n ]);\n }\n // The chunk upload method:\n upload = function () {\n // Clone the options object for each chunk upload:\n var o = $.extend({}, options),\n currentLoaded = o._progress.loaded;\n o.blob = slice.call(\n file,\n ub,\n ub + ($.type(mcs) === 'function' ? mcs(o) : mcs),\n file.type\n );\n // Store the current chunk size, as the blob itself\n // will be dereferenced after data processing:\n o.chunkSize = o.blob.size;\n // Expose the chunk bytes position range:\n o.contentRange =\n 'bytes ' + ub + '-' + (ub + o.chunkSize - 1) + '/' + fs;\n // Trigger chunkbeforesend to allow form data to be updated for this chunk\n that._trigger('chunkbeforesend', null, o);\n // Process the upload data (the blob and potential form data):\n that._initXHRData(o);\n // Add progress listeners for this chunk upload:\n that._initProgressListener(o);\n jqXHR = (\n (that._trigger('chunksend', null, o) !== false && $.ajax(o)) ||\n that._getXHRPromise(false, o.context)\n )\n .done(function (result, textStatus, jqXHR) {\n ub = that._getUploadedBytes(jqXHR) || ub + o.chunkSize;\n // Create a progress event if no final progress event\n // with loaded equaling total has been triggered\n // for this chunk:\n if (currentLoaded + o.chunkSize - o._progress.loaded) {\n that._onProgress(\n $.Event('progress', {\n lengthComputable: true,\n loaded: ub - o.uploadedBytes,\n total: ub - o.uploadedBytes\n }),\n o\n );\n }\n options.uploadedBytes = o.uploadedBytes = ub;\n o.result = result;\n o.textStatus = textStatus;\n o.jqXHR = jqXHR;\n that._trigger('chunkdone', null, o);\n that._trigger('chunkalways', null, o);\n if (ub < fs) {\n // File upload not yet complete,\n // continue with the next chunk:\n upload();\n } else {\n dfd.resolveWith(o.context, [result, textStatus, jqXHR]);\n }\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n o.jqXHR = jqXHR;\n o.textStatus = textStatus;\n o.errorThrown = errorThrown;\n that._trigger('chunkfail', null, o);\n that._trigger('chunkalways', null, o);\n dfd.rejectWith(o.context, [jqXHR, textStatus, errorThrown]);\n })\n .always(function () {\n that._deinitProgressListener(o);\n });\n };\n this._enhancePromise(promise);\n promise.abort = function () {\n return jqXHR.abort();\n };\n upload();\n return promise;\n },\n\n _beforeSend: function (e, data) {\n if (this._active === 0) {\n // the start callback is triggered when an upload starts\n // and no other uploads are currently running,\n // equivalent to the global ajaxStart event:\n this._trigger('start');\n // Set timer for global bitrate progress calculation:\n this._bitrateTimer = new this._BitrateTimer();\n // Reset the global progress values:\n this._progress.loaded = this._progress.total = 0;\n this._progress.bitrate = 0;\n }\n // Make sure the container objects for the .response() and\n // .progress() methods on the data object are available\n // and reset to their initial state:\n this._initResponseObject(data);\n this._initProgressObject(data);\n data._progress.loaded = data.loaded = data.uploadedBytes || 0;\n data._progress.total = data.total = this._getTotal(data.files) || 1;\n data._progress.bitrate = data.bitrate = 0;\n this._active += 1;\n // Initialize the global progress values:\n this._progress.loaded += data.loaded;\n this._progress.total += data.total;\n },\n\n _onDone: function (result, textStatus, jqXHR, options) {\n var total = options._progress.total,\n response = options._response;\n if (options._progress.loaded < total) {\n // Create a progress event if no final progress event\n // with loaded equaling total has been triggered:\n this._onProgress(\n $.Event('progress', {\n lengthComputable: true,\n loaded: total,\n total: total\n }),\n options\n );\n }\n response.result = options.result = result;\n response.textStatus = options.textStatus = textStatus;\n response.jqXHR = options.jqXHR = jqXHR;\n this._trigger('done', null, options);\n },\n\n _onFail: function (jqXHR, textStatus, errorThrown, options) {\n var response = options._response;\n if (options.recalculateProgress) {\n // Remove the failed (error or abort) file upload from\n // the global progress calculation:\n this._progress.loaded -= options._progress.loaded;\n this._progress.total -= options._progress.total;\n }\n response.jqXHR = options.jqXHR = jqXHR;\n response.textStatus = options.textStatus = textStatus;\n response.errorThrown = options.errorThrown = errorThrown;\n this._trigger('fail', null, options);\n },\n\n _onAlways: function (jqXHRorResult, textStatus, jqXHRorError, options) {\n // jqXHRorResult, textStatus and jqXHRorError are added to the\n // options object via done and fail callbacks\n this._trigger('always', null, options);\n },\n\n _onSend: function (e, data) {\n if (!data.submit) {\n this._addConvenienceMethods(e, data);\n }\n var that = this,\n jqXHR,\n aborted,\n slot,\n pipe,\n options = that._getAJAXSettings(data),\n send = function () {\n that._sending += 1;\n // Set timer for bitrate progress calculation:\n options._bitrateTimer = new that._BitrateTimer();\n jqXHR =\n jqXHR ||\n (\n ((aborted ||\n that._trigger(\n 'send',\n $.Event('send', { delegatedEvent: e }),\n options\n ) === false) &&\n that._getXHRPromise(false, options.context, aborted)) ||\n that._chunkedUpload(options) ||\n $.ajax(options)\n )\n .done(function (result, textStatus, jqXHR) {\n that._onDone(result, textStatus, jqXHR, options);\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n that._onFail(jqXHR, textStatus, errorThrown, options);\n })\n .always(function (jqXHRorResult, textStatus, jqXHRorError) {\n that._deinitProgressListener(options);\n that._onAlways(\n jqXHRorResult,\n textStatus,\n jqXHRorError,\n options\n );\n that._sending -= 1;\n that._active -= 1;\n if (\n options.limitConcurrentUploads &&\n options.limitConcurrentUploads > that._sending\n ) {\n // Start the next queued upload,\n // that has not been aborted:\n var nextSlot = that._slots.shift();\n while (nextSlot) {\n if (that._getDeferredState(nextSlot) === 'pending') {\n nextSlot.resolve();\n break;\n }\n nextSlot = that._slots.shift();\n }\n }\n if (that._active === 0) {\n // The stop callback is triggered when all uploads have\n // been completed, equivalent to the global ajaxStop event:\n that._trigger('stop');\n }\n });\n return jqXHR;\n };\n this._beforeSend(e, options);\n if (\n this.options.sequentialUploads ||\n (this.options.limitConcurrentUploads &&\n this.options.limitConcurrentUploads <= this._sending)\n ) {\n if (this.options.limitConcurrentUploads > 1) {\n slot = $.Deferred();\n this._slots.push(slot);\n pipe = slot[that._promisePipe](send);\n } else {\n this._sequence = this._sequence[that._promisePipe](send, send);\n pipe = this._sequence;\n }\n // Return the piped Promise object, enhanced with an abort method,\n // which is delegated to the jqXHR object of the current upload,\n // and jqXHR callbacks mapped to the equivalent Promise methods:\n pipe.abort = function () {\n aborted = [undefined, 'abort', 'abort'];\n if (!jqXHR) {\n if (slot) {\n slot.rejectWith(options.context, aborted);\n }\n return send();\n }\n return jqXHR.abort();\n };\n return this._enhancePromise(pipe);\n }\n return send();\n },\n\n _onAdd: function (e, data) {\n var that = this,\n result = true,\n options = $.extend({}, this.options, data),\n files = data.files,\n filesLength = files.length,\n limit = options.limitMultiFileUploads,\n limitSize = options.limitMultiFileUploadSize,\n overhead = options.limitMultiFileUploadSizeOverhead,\n batchSize = 0,\n paramName = this._getParamName(options),\n paramNameSet,\n paramNameSlice,\n fileSet,\n i,\n j = 0;\n if (!filesLength) {\n return false;\n }\n if (limitSize && files[0].size === undefined) {\n limitSize = undefined;\n }\n if (\n !(options.singleFileUploads || limit || limitSize) ||\n !this._isXHRUpload(options)\n ) {\n fileSet = [files];\n paramNameSet = [paramName];\n } else if (!(options.singleFileUploads || limitSize) && limit) {\n fileSet = [];\n paramNameSet = [];\n for (i = 0; i < filesLength; i += limit) {\n fileSet.push(files.slice(i, i + limit));\n paramNameSlice = paramName.slice(i, i + limit);\n if (!paramNameSlice.length) {\n paramNameSlice = paramName;\n }\n paramNameSet.push(paramNameSlice);\n }\n } else if (!options.singleFileUploads && limitSize) {\n fileSet = [];\n paramNameSet = [];\n for (i = 0; i < filesLength; i = i + 1) {\n batchSize += files[i].size + overhead;\n if (\n i + 1 === filesLength ||\n batchSize + files[i + 1].size + overhead > limitSize ||\n (limit && i + 1 - j >= limit)\n ) {\n fileSet.push(files.slice(j, i + 1));\n paramNameSlice = paramName.slice(j, i + 1);\n if (!paramNameSlice.length) {\n paramNameSlice = paramName;\n }\n paramNameSet.push(paramNameSlice);\n j = i + 1;\n batchSize = 0;\n }\n }\n } else {\n paramNameSet = paramName;\n }\n data.originalFiles = files;\n $.each(fileSet || files, function (index, element) {\n var newData = $.extend({}, data);\n newData.files = fileSet ? element : [element];\n newData.paramName = paramNameSet[index];\n that._initResponseObject(newData);\n that._initProgressObject(newData);\n that._addConvenienceMethods(e, newData);\n result = that._trigger(\n 'add',\n $.Event('add', { delegatedEvent: e }),\n newData\n );\n return result;\n });\n return result;\n },\n\n _replaceFileInput: function (data) {\n var input = data.fileInput,\n inputClone = input.clone(true),\n restoreFocus = input.is(document.activeElement);\n // Add a reference for the new cloned file input to the data argument:\n data.fileInputClone = inputClone;\n $('<form></form>').append(inputClone)[0].reset();\n // Detaching allows to insert the fileInput on another form\n // without losing the file input value:\n input.after(inputClone).detach();\n // If the fileInput had focus before it was detached,\n // restore focus to the inputClone.\n if (restoreFocus) {\n inputClone.trigger('focus');\n }\n // Avoid memory leaks with the detached file input:\n $.cleanData(input.off('remove'));\n // Replace the original file input element in the fileInput\n // elements set with the clone, which has been copied including\n // event handlers:\n this.options.fileInput = this.options.fileInput.map(function (i, el) {\n if (el === input[0]) {\n return inputClone[0];\n }\n return el;\n });\n // If the widget has been initialized on the file input itself,\n // override this.element with the file input clone:\n if (input[0] === this.element[0]) {\n this.element = inputClone;\n }\n },\n\n _handleFileTreeEntry: function (entry, path) {\n var that = this,\n dfd = $.Deferred(),\n entries = [],\n dirReader,\n errorHandler = function (e) {\n if (e && !e.entry) {\n e.entry = entry;\n }\n // Since $.when returns immediately if one\n // Deferred is rejected, we use resolve instead.\n // This allows valid files and invalid items\n // to be returned together in one set:\n dfd.resolve([e]);\n },\n successHandler = function (entries) {\n that\n ._handleFileTreeEntries(entries, path + entry.name + '/')\n .done(function (files) {\n dfd.resolve(files);\n })\n .fail(errorHandler);\n },\n readEntries = function () {\n dirReader.readEntries(function (results) {\n if (!results.length) {\n successHandler(entries);\n } else {\n entries = entries.concat(results);\n readEntries();\n }\n }, errorHandler);\n };\n // eslint-disable-next-line no-param-reassign\n path = path || '';\n if (entry.isFile) {\n if (entry._file) {\n // Workaround for Chrome bug #149735\n entry._file.relativePath = path;\n dfd.resolve(entry._file);\n } else {\n entry.file(function (file) {\n file.relativePath = path;\n dfd.resolve(file);\n }, errorHandler);\n }\n } else if (entry.isDirectory) {\n dirReader = entry.createReader();\n readEntries();\n } else {\n // Return an empty list for file system items\n // other than files or directories:\n dfd.resolve([]);\n }\n return dfd.promise();\n },\n\n _handleFileTreeEntries: function (entries, path) {\n var that = this;\n return $.when\n .apply(\n $,\n $.map(entries, function (entry) {\n return that._handleFileTreeEntry(entry, path);\n })\n )\n [this._promisePipe](function () {\n return Array.prototype.concat.apply([], arguments);\n });\n },\n\n _getDroppedFiles: function (dataTransfer) {\n // eslint-disable-next-line no-param-reassign\n dataTransfer = dataTransfer || {};\n var items = dataTransfer.items;\n if (\n items &&\n items.length &&\n (items[0].webkitGetAsEntry || items[0].getAsEntry)\n ) {\n return this._handleFileTreeEntries(\n $.map(items, function (item) {\n var entry;\n if (item.webkitGetAsEntry) {\n entry = item.webkitGetAsEntry();\n if (entry) {\n // Workaround for Chrome bug #149735:\n entry._file = item.getAsFile();\n }\n return entry;\n }\n return item.getAsEntry();\n })\n );\n }\n return $.Deferred().resolve($.makeArray(dataTransfer.files)).promise();\n },\n\n _getSingleFileInputFiles: function (fileInput) {\n // eslint-disable-next-line no-param-reassign\n fileInput = $(fileInput);\n var entries = fileInput.prop('entries'),\n files,\n value;\n if (entries && entries.length) {\n return this._handleFileTreeEntries(entries);\n }\n files = $.makeArray(fileInput.prop('files'));\n if (!files.length) {\n value = fileInput.prop('value');\n if (!value) {\n return $.Deferred().resolve([]).promise();\n }\n // If the files property is not available, the browser does not\n // support the File API and we add a pseudo File object with\n // the input value as name with path information removed:\n files = [{ name: value.replace(/^.*\\\\/, '') }];\n } else if (files[0].name === undefined && files[0].fileName) {\n // File normalization for Safari 4 and Firefox 3:\n $.each(files, function (index, file) {\n file.name = file.fileName;\n file.size = file.fileSize;\n });\n }\n return $.Deferred().resolve(files).promise();\n },\n\n _getFileInputFiles: function (fileInput) {\n if (!(fileInput instanceof $) || fileInput.length === 1) {\n return this._getSingleFileInputFiles(fileInput);\n }\n return $.when\n .apply($, $.map(fileInput, this._getSingleFileInputFiles))\n [this._promisePipe](function () {\n return Array.prototype.concat.apply([], arguments);\n });\n },\n\n _onChange: function (e) {\n var that = this,\n data = {\n fileInput: $(e.target),\n form: $(e.target.form)\n };\n this._getFileInputFiles(data.fileInput).always(function (files) {\n data.files = files;\n if (that.options.replaceFileInput) {\n that._replaceFileInput(data);\n }\n if (\n that._trigger(\n 'change',\n $.Event('change', { delegatedEvent: e }),\n data\n ) !== false\n ) {\n that._onAdd(e, data);\n }\n });\n },\n\n _onPaste: function (e) {\n var items =\n e.originalEvent &&\n e.originalEvent.clipboardData &&\n e.originalEvent.clipboardData.items,\n data = { files: [] };\n if (items && items.length) {\n $.each(items, function (index, item) {\n var file = item.getAsFile && item.getAsFile();\n if (file) {\n data.files.push(file);\n }\n });\n if (\n this._trigger(\n 'paste',\n $.Event('paste', { delegatedEvent: e }),\n data\n ) !== false\n ) {\n this._onAdd(e, data);\n }\n }\n },\n\n _onDrop: function (e) {\n e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;\n var that = this,\n dataTransfer = e.dataTransfer,\n data = {};\n if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {\n e.preventDefault();\n this._getDroppedFiles(dataTransfer).always(function (files) {\n data.files = files;\n if (\n that._trigger(\n 'drop',\n $.Event('drop', { delegatedEvent: e }),\n data\n ) !== false\n ) {\n that._onAdd(e, data);\n }\n });\n }\n },\n\n _onDragOver: getDragHandler('dragover'),\n\n _onDragEnter: getDragHandler('dragenter'),\n\n _onDragLeave: getDragHandler('dragleave'),\n\n _initEventHandlers: function () {\n if (this._isXHRUpload(this.options)) {\n this._on(this.options.dropZone, {\n dragover: this._onDragOver,\n drop: this._onDrop,\n // event.preventDefault() on dragenter is required for IE10+:\n dragenter: this._onDragEnter,\n // dragleave is not required, but added for completeness:\n dragleave: this._onDragLeave\n });\n this._on(this.options.pasteZone, {\n paste: this._onPaste\n });\n }\n if ($.support.fileInput) {\n this._on(this.options.fileInput, {\n change: this._onChange\n });\n }\n },\n\n _destroyEventHandlers: function () {\n this._off(this.options.dropZone, 'dragenter dragleave dragover drop');\n this._off(this.options.pasteZone, 'paste');\n this._off(this.options.fileInput, 'change');\n },\n\n _destroy: function () {\n this._destroyEventHandlers();\n },\n\n _setOption: function (key, value) {\n var reinit = $.inArray(key, this._specialOptions) !== -1;\n if (reinit) {\n this._destroyEventHandlers();\n }\n this._super(key, value);\n if (reinit) {\n this._initSpecialOptions();\n this._initEventHandlers();\n }\n },\n\n _initSpecialOptions: function () {\n var options = this.options;\n if (options.fileInput === undefined) {\n options.fileInput = this.element.is('input[type=\"file\"]')\n ? this.element\n : this.element.find('input[type=\"file\"]');\n } else if (!(options.fileInput instanceof $)) {\n options.fileInput = $(options.fileInput);\n }\n if (!(options.dropZone instanceof $)) {\n options.dropZone = $(options.dropZone);\n }\n if (!(options.pasteZone instanceof $)) {\n options.pasteZone = $(options.pasteZone);\n }\n },\n\n _getRegExp: function (str) {\n var parts = str.split('/'),\n modifiers = parts.pop();\n parts.shift();\n return new RegExp(parts.join('/'), modifiers);\n },\n\n _isRegExpOption: function (key, value) {\n return (\n key !== 'url' &&\n $.type(value) === 'string' &&\n /^\\/.*\\/[igm]{0,3}$/.test(value)\n );\n },\n\n _initDataAttributes: function () {\n var that = this,\n options = this.options,\n data = this.element.data();\n // Initialize options set via HTML5 data-attributes:\n $.each(this.element[0].attributes, function (index, attr) {\n var key = attr.name.toLowerCase(),\n value;\n if (/^data-/.test(key)) {\n // Convert hyphen-ated key to camelCase:\n key = key.slice(5).replace(/-[a-z]/g, function (str) {\n return str.charAt(1).toUpperCase();\n });\n value = data[key];\n if (that._isRegExpOption(key, value)) {\n value = that._getRegExp(value);\n }\n options[key] = value;\n }\n });\n },\n\n _create: function () {\n this._initDataAttributes();\n this._initSpecialOptions();\n this._slots = [];\n this._sequence = this._getXHRPromise(true);\n this._sending = this._active = 0;\n this._initProgressObject(this);\n this._initEventHandlers();\n },\n\n // This method is exposed to the widget API and allows to query\n // the number of active uploads:\n active: function () {\n return this._active;\n },\n\n // This method is exposed to the widget API and allows to query\n // the widget upload progress.\n // It returns an object with loaded, total and bitrate properties\n // for the running uploads:\n progress: function () {\n return this._progress;\n },\n\n // This method is exposed to the widget API and allows adding files\n // using the fileupload API. The data parameter accepts an object which\n // must have a files property and can contain additional options:\n // .fileupload('add', {files: filesList});\n add: function (data) {\n var that = this;\n if (!data || this.options.disabled) {\n return;\n }\n if (data.fileInput && !data.files) {\n this._getFileInputFiles(data.fileInput).always(function (files) {\n data.files = files;\n that._onAdd(null, data);\n });\n } else {\n data.files = $.makeArray(data.files);\n this._onAdd(null, data);\n }\n },\n\n // This method is exposed to the widget API and allows sending files\n // using the fileupload API. The data parameter accepts an object which\n // must have a files or fileInput property and can contain additional options:\n // .fileupload('send', {files: filesList});\n // The method returns a Promise object for the file upload call.\n send: function (data) {\n if (data && !this.options.disabled) {\n if (data.fileInput && !data.files) {\n var that = this,\n dfd = $.Deferred(),\n promise = dfd.promise(),\n jqXHR,\n aborted;\n promise.abort = function () {\n aborted = true;\n if (jqXHR) {\n return jqXHR.abort();\n }\n dfd.reject(null, 'abort', 'abort');\n return promise;\n };\n this._getFileInputFiles(data.fileInput).always(function (files) {\n if (aborted) {\n return;\n }\n if (!files.length) {\n dfd.reject();\n return;\n }\n data.files = files;\n jqXHR = that._onSend(null, data);\n jqXHR.then(\n function (result, textStatus, jqXHR) {\n dfd.resolve(result, textStatus, jqXHR);\n },\n function (jqXHR, textStatus, errorThrown) {\n dfd.reject(jqXHR, textStatus, errorThrown);\n }\n );\n });\n return this._enhancePromise(promise);\n }\n data.files = $.makeArray(data.files);\n if (data.files.length) {\n return this._onSend(null, data);\n }\n }\n return this._getXHRPromise(false, data && data.context);\n }\n });\n});\n","Mageplaza_Core/lib/fileUploader/jquery.iframe-transport.js":"/*\n * jQuery Iframe Transport Plugin\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, require */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['jquery'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(require('jquery'));\n } else {\n // Browser globals:\n factory(window.jQuery);\n }\n})(function ($) {\n 'use strict';\n\n // Helper variable to create unique names for the transport iframes:\n var counter = 0,\n jsonAPI = $,\n jsonParse = 'parseJSON';\n\n if ('JSON' in window && 'parse' in JSON) {\n jsonAPI = JSON;\n jsonParse = 'parse';\n }\n\n // The iframe transport accepts four additional options:\n // options.fileInput: a jQuery collection of file input fields\n // options.paramName: the parameter name for the file form data,\n // overrides the name property of the file input field(s),\n // can be a string or an array of strings.\n // options.formData: an array of objects with name and value properties,\n // equivalent to the return data of .serializeArray(), e.g.:\n // [{name: 'a', value: 1}, {name: 'b', value: 2}]\n // options.initialIframeSrc: the URL of the initial iframe src,\n // by default set to \"javascript:false;\"\n $.ajaxTransport('iframe', function (options) {\n if (options.async) {\n // javascript:false as initial iframe src\n // prevents warning popups on HTTPS in IE6:\n // eslint-disable-next-line no-script-url\n var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',\n form,\n iframe,\n addParamChar;\n return {\n send: function (_, completeCallback) {\n form = $('<form style=\"display:none;\"></form>');\n form.attr('accept-charset', options.formAcceptCharset);\n addParamChar = /\\?/.test(options.url) ? '&' : '?';\n // XDomainRequest only supports GET and POST:\n if (options.type === 'DELETE') {\n options.url = options.url + addParamChar + '_method=DELETE';\n options.type = 'POST';\n } else if (options.type === 'PUT') {\n options.url = options.url + addParamChar + '_method=PUT';\n options.type = 'POST';\n } else if (options.type === 'PATCH') {\n options.url = options.url + addParamChar + '_method=PATCH';\n options.type = 'POST';\n }\n // IE versions below IE8 cannot set the name property of\n // elements that have already been added to the DOM,\n // so we set the name along with the iframe HTML markup:\n counter += 1;\n iframe = $(\n '<iframe src=\"' +\n initialIframeSrc +\n '\" name=\"iframe-transport-' +\n counter +\n '\"></iframe>'\n ).on('load', function () {\n var fileInputClones,\n paramNames = $.isArray(options.paramName)\n ? options.paramName\n : [options.paramName];\n iframe.off('load').on('load', function () {\n var response;\n // Wrap in a try/catch block to catch exceptions thrown\n // when trying to access cross-domain iframe contents:\n try {\n response = iframe.contents();\n // Google Chrome and Firefox do not throw an\n // exception when calling iframe.contents() on\n // cross-domain requests, so we unify the response:\n if (!response.length || !response[0].firstChild) {\n throw new Error();\n }\n } catch (e) {\n response = undefined;\n }\n // The complete callback returns the\n // iframe content document as response object:\n completeCallback(200, 'success', { iframe: response });\n // Fix for IE endless progress bar activity bug\n // (happens on form submits to iframe targets):\n $('<iframe src=\"' + initialIframeSrc + '\"></iframe>').appendTo(\n form\n );\n window.setTimeout(function () {\n // Removing the form in a setTimeout call\n // allows Chrome's developer tools to display\n // the response result\n form.remove();\n }, 0);\n });\n form\n .prop('target', iframe.prop('name'))\n .prop('action', options.url)\n .prop('method', options.type);\n if (options.formData) {\n $.each(options.formData, function (index, field) {\n $('<input type=\"hidden\"/>')\n .prop('name', field.name)\n .val(field.value)\n .appendTo(form);\n });\n }\n if (\n options.fileInput &&\n options.fileInput.length &&\n options.type === 'POST'\n ) {\n fileInputClones = options.fileInput.clone();\n // Insert a clone for each file input field:\n options.fileInput.after(function (index) {\n return fileInputClones[index];\n });\n if (options.paramName) {\n options.fileInput.each(function (index) {\n $(this).prop('name', paramNames[index] || options.paramName);\n });\n }\n // Appending the file input fields to the hidden form\n // removes them from their original location:\n form\n .append(options.fileInput)\n .prop('enctype', 'multipart/form-data')\n // enctype must be set as encoding for IE:\n .prop('encoding', 'multipart/form-data');\n // Remove the HTML5 form attribute from the input(s):\n options.fileInput.removeAttr('form');\n }\n window.setTimeout(function () {\n // Submitting the form in a setTimeout call fixes an issue with\n // Safari 13 not triggering the iframe load event after resetting\n // the load event handler, see also:\n // https://github.com/blueimp/jQuery-File-Upload/issues/3633\n form.submit();\n // Insert the file input fields at their original location\n // by replacing the clones with the originals:\n if (fileInputClones && fileInputClones.length) {\n options.fileInput.each(function (index, input) {\n var clone = $(fileInputClones[index]);\n // Restore the original name and form properties:\n $(input)\n .prop('name', clone.prop('name'))\n .attr('form', clone.attr('form'));\n clone.replaceWith(input);\n });\n }\n }, 0);\n });\n form.append(iframe).appendTo(document.body);\n },\n abort: function () {\n if (iframe) {\n // javascript:false as iframe src aborts the request\n // and prevents warning popups on HTTPS in IE6.\n iframe.off('load').prop('src', initialIframeSrc);\n }\n if (form) {\n form.remove();\n }\n }\n };\n }\n });\n\n // The iframe transport returns the iframe content document as response.\n // The following adds converters from iframe to text, json, html, xml\n // and script.\n // Please note that the Content-Type for JSON responses has to be text/plain\n // or text/html, if the browser doesn't include application/json in the\n // Accept header, else IE will show a download dialog.\n // The Content-Type for XML responses on the other hand has to be always\n // application/xml or text/xml, so IE properly parses the XML response.\n // See also\n // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation\n $.ajaxSetup({\n converters: {\n 'iframe text': function (iframe) {\n return iframe && $(iframe[0].body).text();\n },\n 'iframe json': function (iframe) {\n return iframe && jsonAPI[jsonParse]($(iframe[0].body).text());\n },\n 'iframe html': function (iframe) {\n return iframe && $(iframe[0].body).html();\n },\n 'iframe xml': function (iframe) {\n var xmlDoc = iframe && iframe[0];\n return xmlDoc && $.isXMLDoc(xmlDoc)\n ? xmlDoc\n : $.parseXML(\n (xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||\n $(xmlDoc.body).html()\n );\n },\n 'iframe script': function (iframe) {\n return iframe && $.globalEval($(iframe[0].body).text());\n }\n }\n });\n});\n","Mageplaza_Core/lib/fileUploader/jquery.fileupload-video.js":"/*\n * jQuery File Upload Video Preview Plugin\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2013, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, require */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['jquery', 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image', 'Mageplaza_Core/lib/fileUploader/jquery.fileupload-process'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(\n require('jquery'),\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'),\n require('Mageplaza_Core/lib/fileUploader/jquery.fileupload-process')\n );\n } else {\n // Browser globals:\n factory(window.jQuery, window.loadImage);\n }\n})(function ($, loadImage) {\n 'use strict';\n\n // Prepend to the default processQueue:\n $.blueimp.fileupload.prototype.options.processQueue.unshift(\n {\n action: 'loadVideo',\n // Use the action as prefix for the \"@\" options:\n prefix: true,\n fileTypes: '@',\n maxFileSize: '@',\n disabled: '@disableVideoPreview'\n },\n {\n action: 'setVideo',\n name: '@videoPreviewName',\n disabled: '@disableVideoPreview'\n }\n );\n\n // The File Upload Video Preview plugin extends the fileupload widget\n // with video preview functionality:\n $.widget('blueimp.fileupload', $.blueimp.fileupload, {\n options: {\n // The regular expression for the types of video files to load,\n // matched against the file type:\n loadVideoFileTypes: /^video\\/.*$/\n },\n\n _videoElement: document.createElement('video'),\n\n processActions: {\n // Loads the video file given via data.files and data.index\n // as video element if the browser supports playing it.\n // Accepts the options fileTypes (regular expression)\n // and maxFileSize (integer) to limit the files to load:\n loadVideo: function (data, options) {\n if (options.disabled) {\n return data;\n }\n var file = data.files[data.index],\n url,\n video;\n if (\n this._videoElement.canPlayType &&\n this._videoElement.canPlayType(file.type) &&\n ($.type(options.maxFileSize) !== 'number' ||\n file.size <= options.maxFileSize) &&\n (!options.fileTypes || options.fileTypes.test(file.type))\n ) {\n url = loadImage.createObjectURL(file);\n if (url) {\n video = this._videoElement.cloneNode(false);\n video.src = url;\n video.controls = true;\n data.video = video;\n return data;\n }\n }\n return data;\n },\n\n // Sets the video element as a property of the file object:\n setVideo: function (data, options) {\n if (data.video && !options.disabled) {\n data.files[data.index][options.name || 'preview'] = data.video;\n }\n return data;\n }\n }\n });\n});\n","Mageplaza_Core/lib/fileUploader/jquery.fileupload-process.js":"/*\n * jQuery File Upload Processing Plugin\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2012, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, require */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['jquery', 'Mageplaza_Core/lib/fileUploader/jquery.fileupload'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(require('jquery'), require('Mageplaza_Core/lib/fileUploader/jquery.fileupload'));\n } else {\n // Browser globals:\n factory(window.jQuery);\n }\n})(function ($) {\n 'use strict';\n\n var originalAdd = $.blueimp.fileupload.prototype.options.add;\n\n // The File Upload Processing plugin extends the fileupload widget\n // with file processing functionality:\n $.widget('blueimp.fileupload', $.blueimp.fileupload, {\n options: {\n // The list of processing actions:\n processQueue: [\n /*\n {\n action: 'log',\n type: 'debug'\n }\n */\n ],\n add: function (e, data) {\n var $this = $(this);\n data.process(function () {\n return $this.fileupload('process', data);\n });\n originalAdd.call(this, e, data);\n }\n },\n\n processActions: {\n /*\n log: function (data, options) {\n console[options.type](\n 'Processing \"' + data.files[data.index].name + '\"'\n );\n }\n */\n },\n\n _processFile: function (data, originalData) {\n var that = this,\n // eslint-disable-next-line new-cap\n dfd = $.Deferred().resolveWith(that, [data]),\n chain = dfd.promise();\n this._trigger('process', null, data);\n $.each(data.processQueue, function (i, settings) {\n var func = function (data) {\n if (originalData.errorThrown) {\n // eslint-disable-next-line new-cap\n return $.Deferred().rejectWith(that, [originalData]).promise();\n }\n return that.processActions[settings.action].call(\n that,\n data,\n settings\n );\n };\n chain = chain[that._promisePipe](func, settings.always && func);\n });\n chain\n .done(function () {\n that._trigger('processdone', null, data);\n that._trigger('processalways', null, data);\n })\n .fail(function () {\n that._trigger('processfail', null, data);\n that._trigger('processalways', null, data);\n });\n return chain;\n },\n\n // Replaces the settings of each processQueue item that\n // are strings starting with an \"@\", using the remaining\n // substring as key for the option map,\n // e.g. \"@autoUpload\" is replaced with options.autoUpload:\n _transformProcessQueue: function (options) {\n var processQueue = [];\n $.each(options.processQueue, function () {\n var settings = {},\n action = this.action,\n prefix = this.prefix === true ? action : this.prefix;\n $.each(this, function (key, value) {\n if ($.type(value) === 'string' && value.charAt(0) === '@') {\n settings[key] =\n options[\n value.slice(1) ||\n (prefix\n ? prefix + key.charAt(0).toUpperCase() + key.slice(1)\n : key)\n ];\n } else {\n settings[key] = value;\n }\n });\n processQueue.push(settings);\n });\n options.processQueue = processQueue;\n },\n\n // Returns the number of files currently in the processing queue:\n processing: function () {\n return this._processing;\n },\n\n // Processes the files given as files property of the data parameter,\n // returns a Promise object that allows to bind callbacks:\n process: function (data) {\n var that = this,\n options = $.extend({}, this.options, data);\n if (options.processQueue && options.processQueue.length) {\n this._transformProcessQueue(options);\n if (this._processing === 0) {\n this._trigger('processstart');\n }\n $.each(data.files, function (index) {\n var opts = index ? $.extend({}, options) : options,\n func = function () {\n if (data.errorThrown) {\n // eslint-disable-next-line new-cap\n return $.Deferred().rejectWith(that, [data]).promise();\n }\n return that._processFile(opts, data);\n };\n opts.index = index;\n that._processing += 1;\n that._processingQueue = that._processingQueue[that._promisePipe](\n func,\n func\n ).always(function () {\n that._processing -= 1;\n if (that._processing === 0) {\n that._trigger('processstop');\n }\n });\n });\n }\n return this._processingQueue;\n },\n\n _create: function () {\n this._super();\n this._processing = 0;\n // eslint-disable-next-line new-cap\n this._processingQueue = $.Deferred().resolveWith(this).promise();\n }\n });\n});\n","Mageplaza_Core/lib/fileUploader/jquery.fileupload-ui.js":"/*\n * jQuery File Upload User Interface Plugin\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2010, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, require */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define([\n 'jquery',\n 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-tmpl/js/tmpl',\n 'Mageplaza_Core/lib/fileUploader/jquery.fileupload-image',\n 'Mageplaza_Core/lib/fileUploader/jquery.fileupload-audio',\n 'Mageplaza_Core/lib/fileUploader/jquery.fileupload-video',\n 'Mageplaza_Core/lib/fileUploader/jquery.fileupload-validate'\n ], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(\n require('jquery'),\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-tmpl/js/tmpl'),\n require('Mageplaza_Core/lib/fileUploader/jquery.fileupload-image'),\n require('Mageplaza_Core/lib/fileUploader/jquery.fileupload-audio'),\n require('Mageplaza_Core/lib/fileUploader/jquery.fileupload-video'),\n require('Mageplaza_Core/lib/fileUploader/jquery.fileupload-validate')\n );\n } else {\n // Browser globals:\n factory(window.jQuery, window.tmpl);\n }\n})(function ($, tmpl) {\n 'use strict';\n\n $.blueimp.fileupload.prototype._specialOptions.push(\n 'filesContainer',\n 'uploadTemplateId',\n 'downloadTemplateId'\n );\n\n // The UI version extends the file upload widget\n // and adds complete user interface interaction:\n $.widget('blueimp.fileupload', $.blueimp.fileupload, {\n options: {\n // By default, files added to the widget are uploaded as soon\n // as the user clicks on the start buttons. To enable automatic\n // uploads, set the following option to true:\n autoUpload: false,\n // The class to show/hide UI elements:\n showElementClass: 'in',\n // The ID of the upload template:\n uploadTemplateId: 'template-upload',\n // The ID of the download template:\n downloadTemplateId: 'template-download',\n // The container for the list of files. If undefined, it is set to\n // an element with class \"files\" inside of the widget element:\n filesContainer: undefined,\n // By default, files are appended to the files container.\n // Set the following option to true, to prepend files instead:\n prependFiles: false,\n // The expected data type of the upload response, sets the dataType\n // option of the $.ajax upload requests:\n dataType: 'json',\n\n // Error and info messages:\n messages: {\n unknownError: 'Unknown error'\n },\n\n // Function returning the current number of files,\n // used by the maxNumberOfFiles validation:\n getNumberOfFiles: function () {\n return this.filesContainer.children().not('.processing').length;\n },\n\n // Callback to retrieve the list of files from the server response:\n getFilesFromResponse: function (data) {\n if (data.result && $.isArray(data.result.files)) {\n return data.result.files;\n }\n return [];\n },\n\n // The add callback is invoked as soon as files are added to the fileupload\n // widget (via file input selection, drag & drop or add API call).\n // See the basic file upload widget for more information:\n add: function (e, data) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n var $this = $(this),\n that = $this.data('blueimp-fileupload') || $this.data('fileupload'),\n options = that.options;\n data.context = that\n ._renderUpload(data.files)\n .data('data', data)\n .addClass('processing');\n options.filesContainer[options.prependFiles ? 'prepend' : 'append'](\n data.context\n );\n that._forceReflow(data.context);\n that._transition(data.context);\n data\n .process(function () {\n return $this.fileupload('process', data);\n })\n .always(function () {\n data.context\n .each(function (index) {\n $(this)\n .find('.size')\n .text(that._formatFileSize(data.files[index].size));\n })\n .removeClass('processing');\n that._renderPreviews(data);\n })\n .done(function () {\n data.context.find('.edit,.start').prop('disabled', false);\n if (\n that._trigger('added', e, data) !== false &&\n (options.autoUpload || data.autoUpload) &&\n data.autoUpload !== false\n ) {\n data.submit();\n }\n })\n .fail(function () {\n if (data.files.error) {\n data.context.each(function (index) {\n var error = data.files[index].error;\n if (error) {\n $(this).find('.error').text(error);\n }\n });\n }\n });\n },\n // Callback for the start of each file upload request:\n send: function (e, data) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n var that =\n $(this).data('blueimp-fileupload') || $(this).data('fileupload');\n if (\n data.context &&\n data.dataType &&\n data.dataType.substr(0, 6) === 'iframe'\n ) {\n // Iframe Transport does not support progress events.\n // In lack of an indeterminate progress bar, we set\n // the progress to 100%, showing the full animated bar:\n data.context\n .find('.progress')\n .addClass(!$.support.transition && 'progress-animated')\n .attr('aria-valuenow', 100)\n .children()\n .first()\n .css('width', '100%');\n }\n return that._trigger('sent', e, data);\n },\n // Callback for successful uploads:\n done: function (e, data) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n var that =\n $(this).data('blueimp-fileupload') || $(this).data('fileupload'),\n getFilesFromResponse =\n data.getFilesFromResponse || that.options.getFilesFromResponse,\n files = getFilesFromResponse(data),\n template,\n deferred;\n if (data.context) {\n data.context.each(function (index) {\n var file = files[index] || { error: 'Empty file upload result' };\n deferred = that._addFinishedDeferreds();\n that._transition($(this)).done(function () {\n var node = $(this);\n template = that._renderDownload([file]).replaceAll(node);\n that._forceReflow(template);\n that._transition(template).done(function () {\n data.context = $(this);\n that._trigger('completed', e, data);\n that._trigger('finished', e, data);\n deferred.resolve();\n });\n });\n });\n } else {\n template = that\n ._renderDownload(files)\n [that.options.prependFiles ? 'prependTo' : 'appendTo'](\n that.options.filesContainer\n );\n that._forceReflow(template);\n deferred = that._addFinishedDeferreds();\n that._transition(template).done(function () {\n data.context = $(this);\n that._trigger('completed', e, data);\n that._trigger('finished', e, data);\n deferred.resolve();\n });\n }\n },\n // Callback for failed (abort or error) uploads:\n fail: function (e, data) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n var that =\n $(this).data('blueimp-fileupload') || $(this).data('fileupload'),\n template,\n deferred;\n if (data.context) {\n data.context.each(function (index) {\n if (data.errorThrown !== 'abort') {\n var file = data.files[index];\n file.error =\n file.error || data.errorThrown || data.i18n('unknownError');\n deferred = that._addFinishedDeferreds();\n that._transition($(this)).done(function () {\n var node = $(this);\n template = that._renderDownload([file]).replaceAll(node);\n that._forceReflow(template);\n that._transition(template).done(function () {\n data.context = $(this);\n that._trigger('failed', e, data);\n that._trigger('finished', e, data);\n deferred.resolve();\n });\n });\n } else {\n deferred = that._addFinishedDeferreds();\n that._transition($(this)).done(function () {\n $(this).remove();\n that._trigger('failed', e, data);\n that._trigger('finished', e, data);\n deferred.resolve();\n });\n }\n });\n } else if (data.errorThrown !== 'abort') {\n data.context = that\n ._renderUpload(data.files)\n [that.options.prependFiles ? 'prependTo' : 'appendTo'](\n that.options.filesContainer\n )\n .data('data', data);\n that._forceReflow(data.context);\n deferred = that._addFinishedDeferreds();\n that._transition(data.context).done(function () {\n data.context = $(this);\n that._trigger('failed', e, data);\n that._trigger('finished', e, data);\n deferred.resolve();\n });\n } else {\n that._trigger('failed', e, data);\n that._trigger('finished', e, data);\n that._addFinishedDeferreds().resolve();\n }\n },\n // Callback for upload progress events:\n progress: function (e, data) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n var progress = Math.floor((data.loaded / data.total) * 100);\n if (data.context) {\n data.context.each(function () {\n $(this)\n .find('.progress')\n .attr('aria-valuenow', progress)\n .children()\n .first()\n .css('width', progress + '%');\n });\n }\n },\n // Callback for global upload progress events:\n progressall: function (e, data) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n var $this = $(this),\n progress = Math.floor((data.loaded / data.total) * 100),\n globalProgressNode = $this.find('.fileupload-progress'),\n extendedProgressNode = globalProgressNode.find('.progress-extended');\n if (extendedProgressNode.length) {\n extendedProgressNode.html(\n (\n $this.data('blueimp-fileupload') || $this.data('fileupload')\n )._renderExtendedProgress(data)\n );\n }\n globalProgressNode\n .find('.progress')\n .attr('aria-valuenow', progress)\n .children()\n .first()\n .css('width', progress + '%');\n },\n // Callback for uploads start, equivalent to the global ajaxStart event:\n start: function (e) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n var that =\n $(this).data('blueimp-fileupload') || $(this).data('fileupload');\n that._resetFinishedDeferreds();\n that\n ._transition($(this).find('.fileupload-progress'))\n .done(function () {\n that._trigger('started', e);\n });\n },\n // Callback for uploads stop, equivalent to the global ajaxStop event:\n stop: function (e) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n var that =\n $(this).data('blueimp-fileupload') || $(this).data('fileupload'),\n deferred = that._addFinishedDeferreds();\n $.when.apply($, that._getFinishedDeferreds()).done(function () {\n that._trigger('stopped', e);\n });\n that\n ._transition($(this).find('.fileupload-progress'))\n .done(function () {\n $(this)\n .find('.progress')\n .attr('aria-valuenow', '0')\n .children()\n .first()\n .css('width', '0%');\n $(this).find('.progress-extended').html(' ');\n deferred.resolve();\n });\n },\n processstart: function (e) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n $(this).addClass('fileupload-processing');\n },\n processstop: function (e) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n $(this).removeClass('fileupload-processing');\n },\n // Callback for file deletion:\n destroy: function (e, data) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n var that =\n $(this).data('blueimp-fileupload') || $(this).data('fileupload'),\n removeNode = function () {\n that._transition(data.context).done(function () {\n $(this).remove();\n that._trigger('destroyed', e, data);\n });\n };\n if (data.url) {\n data.dataType = data.dataType || that.options.dataType;\n $.ajax(data)\n .done(removeNode)\n .fail(function () {\n that._trigger('destroyfailed', e, data);\n });\n } else {\n removeNode();\n }\n }\n },\n\n _resetFinishedDeferreds: function () {\n this._finishedUploads = [];\n },\n\n _addFinishedDeferreds: function (deferred) {\n // eslint-disable-next-line new-cap\n var promise = deferred || $.Deferred();\n this._finishedUploads.push(promise);\n return promise;\n },\n\n _getFinishedDeferreds: function () {\n return this._finishedUploads;\n },\n\n // Link handler, that allows to download files\n // by drag & drop of the links to the desktop:\n _enableDragToDesktop: function () {\n var link = $(this),\n url = link.prop('href'),\n name = link.prop('download'),\n type = 'application/octet-stream';\n link.on('dragstart', function (e) {\n try {\n e.originalEvent.dataTransfer.setData(\n 'DownloadURL',\n [type, name, url].join(':')\n );\n } catch (ignore) {\n // Ignore exceptions\n }\n });\n },\n\n _formatFileSize: function (bytes) {\n if (typeof bytes !== 'number') {\n return '';\n }\n if (bytes >= 1000000000) {\n return (bytes / 1000000000).toFixed(2) + ' GB';\n }\n if (bytes >= 1000000) {\n return (bytes / 1000000).toFixed(2) + ' MB';\n }\n return (bytes / 1000).toFixed(2) + ' KB';\n },\n\n _formatBitrate: function (bits) {\n if (typeof bits !== 'number') {\n return '';\n }\n if (bits >= 1000000000) {\n return (bits / 1000000000).toFixed(2) + ' Gbit/s';\n }\n if (bits >= 1000000) {\n return (bits / 1000000).toFixed(2) + ' Mbit/s';\n }\n if (bits >= 1000) {\n return (bits / 1000).toFixed(2) + ' kbit/s';\n }\n return bits.toFixed(2) + ' bit/s';\n },\n\n _formatTime: function (seconds) {\n var date = new Date(seconds * 1000),\n days = Math.floor(seconds / 86400);\n days = days ? days + 'd ' : '';\n return (\n days +\n ('0' + date.getUTCHours()).slice(-2) +\n ':' +\n ('0' + date.getUTCMinutes()).slice(-2) +\n ':' +\n ('0' + date.getUTCSeconds()).slice(-2)\n );\n },\n\n _formatPercentage: function (floatValue) {\n return (floatValue * 100).toFixed(2) + ' %';\n },\n\n _renderExtendedProgress: function (data) {\n return (\n this._formatBitrate(data.bitrate) +\n ' | ' +\n this._formatTime(((data.total - data.loaded) * 8) / data.bitrate) +\n ' | ' +\n this._formatPercentage(data.loaded / data.total) +\n ' | ' +\n this._formatFileSize(data.loaded) +\n ' / ' +\n this._formatFileSize(data.total)\n );\n },\n\n _renderTemplate: function (func, files) {\n if (!func) {\n return $();\n }\n var result = func({\n files: files,\n formatFileSize: this._formatFileSize,\n options: this.options\n });\n if (result instanceof $) {\n return result;\n }\n return $(this.options.templatesContainer).html(result).children();\n },\n\n _renderPreviews: function (data) {\n data.context.find('.preview').each(function (index, elm) {\n $(elm).empty().append(data.files[index].preview);\n });\n },\n\n _renderUpload: function (files) {\n return this._renderTemplate(this.options.uploadTemplate, files);\n },\n\n _renderDownload: function (files) {\n return this._renderTemplate(this.options.downloadTemplate, files)\n .find('a[download]')\n .each(this._enableDragToDesktop)\n .end();\n },\n\n _editHandler: function (e) {\n e.preventDefault();\n if (!this.options.edit) return;\n var that = this,\n button = $(e.currentTarget),\n template = button.closest('.template-upload'),\n data = template.data('data'),\n index = button.data().index;\n this.options.edit(data.files[index]).then(function (file) {\n if (!file) return;\n data.files[index] = file;\n data.context.addClass('processing');\n template.find('.edit,.start').prop('disabled', true);\n $(that.element)\n .fileupload('process', data)\n .always(function () {\n template\n .find('.size')\n .text(that._formatFileSize(data.files[index].size));\n data.context.removeClass('processing');\n that._renderPreviews(data);\n })\n .done(function () {\n template.find('.edit,.start').prop('disabled', false);\n })\n .fail(function () {\n template.find('.edit').prop('disabled', false);\n var error = data.files[index].error;\n if (error) {\n template.find('.error').text(error);\n }\n });\n });\n },\n\n _startHandler: function (e) {\n e.preventDefault();\n var button = $(e.currentTarget),\n template = button.closest('.template-upload'),\n data = template.data('data');\n button.prop('disabled', true);\n if (data && data.submit) {\n data.submit();\n }\n },\n\n _cancelHandler: function (e) {\n e.preventDefault();\n var template = $(e.currentTarget).closest(\n '.template-upload,.template-download'\n ),\n data = template.data('data') || {};\n data.context = data.context || template;\n if (data.abort) {\n data.abort();\n } else {\n data.errorThrown = 'abort';\n this._trigger('fail', e, data);\n }\n },\n\n _deleteHandler: function (e) {\n e.preventDefault();\n var button = $(e.currentTarget);\n this._trigger(\n 'destroy',\n e,\n $.extend(\n {\n context: button.closest('.template-download'),\n type: 'DELETE'\n },\n button.data()\n )\n );\n },\n\n _forceReflow: function (node) {\n return $.support.transition && node.length && node[0].offsetWidth;\n },\n\n _transition: function (node) {\n // eslint-disable-next-line new-cap\n var dfd = $.Deferred();\n if (\n $.support.transition &&\n node.hasClass('fade') &&\n node.is(':visible')\n ) {\n var transitionEndHandler = function (e) {\n // Make sure we don't respond to other transition events\n // in the container element, e.g. from button elements:\n if (e.target === node[0]) {\n node.off($.support.transition.end, transitionEndHandler);\n dfd.resolveWith(node);\n }\n };\n node\n .on($.support.transition.end, transitionEndHandler)\n .toggleClass(this.options.showElementClass);\n } else {\n node.toggleClass(this.options.showElementClass);\n dfd.resolveWith(node);\n }\n return dfd;\n },\n\n _initButtonBarEventHandlers: function () {\n var fileUploadButtonBar = this.element.find('.fileupload-buttonbar'),\n filesList = this.options.filesContainer;\n this._on(fileUploadButtonBar.find('.start'), {\n click: function (e) {\n e.preventDefault();\n filesList.find('.start').trigger('click');\n }\n });\n this._on(fileUploadButtonBar.find('.cancel'), {\n click: function (e) {\n e.preventDefault();\n filesList.find('.cancel').trigger('click');\n }\n });\n this._on(fileUploadButtonBar.find('.delete'), {\n click: function (e) {\n e.preventDefault();\n filesList\n .find('.toggle:checked')\n .closest('.template-download')\n .find('.delete')\n .trigger('click');\n fileUploadButtonBar.find('.toggle').prop('checked', false);\n }\n });\n this._on(fileUploadButtonBar.find('.toggle'), {\n change: function (e) {\n filesList\n .find('.toggle')\n .prop('checked', $(e.currentTarget).is(':checked'));\n }\n });\n },\n\n _destroyButtonBarEventHandlers: function () {\n this._off(\n this.element\n .find('.fileupload-buttonbar')\n .find('.start, .cancel, .delete'),\n 'click'\n );\n this._off(this.element.find('.fileupload-buttonbar .toggle'), 'change.');\n },\n\n _initEventHandlers: function () {\n this._super();\n this._on(this.options.filesContainer, {\n 'click .edit': this._editHandler,\n 'click .start': this._startHandler,\n 'click .cancel': this._cancelHandler,\n 'click .delete': this._deleteHandler\n });\n this._initButtonBarEventHandlers();\n },\n\n _destroyEventHandlers: function () {\n this._destroyButtonBarEventHandlers();\n this._off(this.options.filesContainer, 'click');\n this._super();\n },\n\n _enableFileInputButton: function () {\n this.element\n .find('.fileinput-button input')\n .prop('disabled', false)\n .parent()\n .removeClass('disabled');\n },\n\n _disableFileInputButton: function () {\n this.element\n .find('.fileinput-button input')\n .prop('disabled', true)\n .parent()\n .addClass('disabled');\n },\n\n _initTemplates: function () {\n var options = this.options;\n options.templatesContainer = this.document[0].createElement(\n options.filesContainer.prop('nodeName')\n );\n if (tmpl) {\n if (options.uploadTemplateId) {\n options.uploadTemplate = tmpl(options.uploadTemplateId);\n }\n if (options.downloadTemplateId) {\n options.downloadTemplate = tmpl(options.downloadTemplateId);\n }\n }\n },\n\n _initFilesContainer: function () {\n var options = this.options;\n if (options.filesContainer === undefined) {\n options.filesContainer = this.element.find('.files');\n } else if (!(options.filesContainer instanceof $)) {\n options.filesContainer = $(options.filesContainer);\n }\n },\n\n _initSpecialOptions: function () {\n this._super();\n this._initFilesContainer();\n // this._initTemplates();\n },\n\n _create: function () {\n this._super();\n this._resetFinishedDeferreds();\n if (!$.support.fileInput) {\n this._disableFileInputButton();\n }\n },\n\n enable: function () {\n var wasDisabled = false;\n if (this.options.disabled) {\n wasDisabled = true;\n }\n this._super();\n if (wasDisabled) {\n this.element.find('input, button').prop('disabled', false);\n this._enableFileInputButton();\n }\n },\n\n disable: function () {\n if (!this.options.disabled) {\n this.element.find('input, button').prop('disabled', true);\n this._disableFileInputButton();\n }\n this._super();\n }\n });\n});\n","Mageplaza_Core/lib/fileUploader/jquery.fileuploader.js":"/**\n * Custom Uploader\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* global define, require */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define([\n 'jquery',\n 'Mageplaza_Core/lib/fileUploader/jquery.fileupload-image',\n 'Mageplaza_Core/lib/fileUploader/jquery.fileupload-audio',\n 'Mageplaza_Core/lib/fileUploader/jquery.fileupload-video',\n 'Mageplaza_Core/lib/fileUploader/jquery.iframe-transport',\n ], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(\n require('jquery'),\n require('Mageplaza_Core/lib/fileUploader/jquery.fileupload-image'),\n require('Mageplaza_Core/lib/fileUploader/jquery.fileupload-audio'),\n require('Mageplaza_Core/lib/fileUploader/jquery.fileupload-video'),\n require('Mageplaza_Core/lib/fileUploader/jquery.iframe-transport')\n );\n } else {\n // Browser globals:\n factory(window.jQuery);\n }\n})();\n","Mageplaza_Core/lib/fileUploader/jquery.fileupload-image.js":"/*\n * jQuery File Upload Image Preview & Resize Plugin\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2013, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, require */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define([\n 'jquery',\n 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image',\n 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-meta',\n 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-scale',\n 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-exif',\n 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-orientation',\n 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-canvas-to-blob/js/canvas-to-blob',\n 'Mageplaza_Core/lib/fileUploader/jquery.fileupload-process'\n ], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(\n require('jquery'),\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'),\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-meta'),\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-scale'),\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-exif'),\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-orientation'),\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-canvas-to-blob/js/canvas-to-blob'),\n require('Mageplaza_Core/lib/fileUploader/jquery.fileupload-process')\n );\n } else {\n // Browser globals:\n factory(window.jQuery, window.loadImage);\n }\n})(function ($, loadImage) {\n 'use strict';\n\n // Prepend to the default processQueue:\n $.blueimp.fileupload.prototype.options.processQueue.unshift(\n {\n action: 'loadImageMetaData',\n maxMetaDataSize: '@',\n disableImageHead: '@',\n disableMetaDataParsers: '@',\n disableExif: '@',\n disableExifOffsets: '@',\n includeExifTags: '@',\n excludeExifTags: '@',\n disableIptc: '@',\n disableIptcOffsets: '@',\n includeIptcTags: '@',\n excludeIptcTags: '@',\n disabled: '@disableImageMetaDataLoad'\n },\n {\n action: 'loadImage',\n // Use the action as prefix for the \"@\" options:\n prefix: true,\n fileTypes: '@',\n maxFileSize: '@',\n noRevoke: '@',\n disabled: '@disableImageLoad'\n },\n {\n action: 'resizeImage',\n // Use \"image\" as prefix for the \"@\" options:\n prefix: 'image',\n maxWidth: '@',\n maxHeight: '@',\n minWidth: '@',\n minHeight: '@',\n crop: '@',\n orientation: '@',\n forceResize: '@',\n disabled: '@disableImageResize'\n },\n {\n action: 'saveImage',\n quality: '@imageQuality',\n type: '@imageType',\n disabled: '@disableImageResize'\n },\n {\n action: 'saveImageMetaData',\n disabled: '@disableImageMetaDataSave'\n },\n {\n action: 'resizeImage',\n // Use \"preview\" as prefix for the \"@\" options:\n prefix: 'preview',\n maxWidth: '@',\n maxHeight: '@',\n minWidth: '@',\n minHeight: '@',\n crop: '@',\n orientation: '@',\n thumbnail: '@',\n canvas: '@',\n disabled: '@disableImagePreview'\n },\n {\n action: 'setImage',\n name: '@imagePreviewName',\n disabled: '@disableImagePreview'\n },\n {\n action: 'deleteImageReferences',\n disabled: '@disableImageReferencesDeletion'\n }\n );\n\n // The File Upload Resize plugin extends the fileupload widget\n // with image resize functionality:\n $.widget('blueimp.fileupload', $.blueimp.fileupload, {\n options: {\n // The regular expression for the types of images to load:\n // matched against the file type:\n loadImageFileTypes: /^image\\/(gif|jpeg|png|svg\\+xml)$/,\n // The maximum file size of images to load:\n loadImageMaxFileSize: 10000000, // 10MB\n // The maximum width of resized images:\n imageMaxWidth: 1920,\n // The maximum height of resized images:\n imageMaxHeight: 1080,\n // Defines the image orientation (1-8) or takes the orientation\n // value from Exif data if set to true:\n imageOrientation: true,\n // Define if resized images should be cropped or only scaled:\n imageCrop: false,\n // Disable the resize image functionality by default:\n disableImageResize: true,\n // The maximum width of the preview images:\n previewMaxWidth: 80,\n // The maximum height of the preview images:\n previewMaxHeight: 80,\n // Defines the preview orientation (1-8) or takes the orientation\n // value from Exif data if set to true:\n previewOrientation: true,\n // Create the preview using the Exif data thumbnail:\n previewThumbnail: true,\n // Define if preview images should be cropped or only scaled:\n previewCrop: false,\n // Define if preview images should be resized as canvas elements:\n previewCanvas: true\n },\n\n processActions: {\n // Loads the image given via data.files and data.index\n // as img element, if the browser supports the File API.\n // Accepts the options fileTypes (regular expression)\n // and maxFileSize (integer) to limit the files to load:\n loadImage: function (data, options) {\n if (options.disabled) {\n return data;\n }\n var that = this,\n file = data.files[data.index],\n // eslint-disable-next-line new-cap\n dfd = $.Deferred();\n if (\n ($.type(options.maxFileSize) === 'number' &&\n file.size > options.maxFileSize) ||\n (options.fileTypes && !options.fileTypes.test(file.type)) ||\n !loadImage(\n file,\n function (img) {\n if (img.src) {\n data.img = img;\n }\n dfd.resolveWith(that, [data]);\n },\n options\n )\n ) {\n return data;\n }\n return dfd.promise();\n },\n\n // Resizes the image given as data.canvas or data.img\n // and updates data.canvas or data.img with the resized image.\n // Also stores the resized image as preview property.\n // Accepts the options maxWidth, maxHeight, minWidth,\n // minHeight, canvas and crop:\n resizeImage: function (data, options) {\n if (options.disabled || !(data.canvas || data.img)) {\n return data;\n }\n // eslint-disable-next-line no-param-reassign\n options = $.extend({ canvas: true }, options);\n var that = this,\n // eslint-disable-next-line new-cap\n dfd = $.Deferred(),\n img = (options.canvas && data.canvas) || data.img,\n resolve = function (newImg) {\n if (\n newImg &&\n (newImg.width !== img.width ||\n newImg.height !== img.height ||\n options.forceResize)\n ) {\n data[newImg.getContext ? 'canvas' : 'img'] = newImg;\n }\n data.preview = newImg;\n dfd.resolveWith(that, [data]);\n },\n thumbnail,\n thumbnailBlob;\n if (data.exif && options.thumbnail) {\n thumbnail = data.exif.get('Thumbnail');\n thumbnailBlob = thumbnail && thumbnail.get('Blob');\n if (thumbnailBlob) {\n options.orientation = data.exif.get('Orientation');\n loadImage(thumbnailBlob, resolve, options);\n return dfd.promise();\n }\n }\n if (data.orientation) {\n // Prevent orienting the same image twice:\n delete options.orientation;\n } else {\n data.orientation = options.orientation || loadImage.orientation;\n }\n if (img) {\n resolve(loadImage.scale(img, options, data));\n return dfd.promise();\n }\n return data;\n },\n\n // Saves the processed image given as data.canvas\n // inplace at data.index of data.files:\n saveImage: function (data, options) {\n if (!data.canvas || options.disabled) {\n return data;\n }\n var that = this,\n file = data.files[data.index],\n // eslint-disable-next-line new-cap\n dfd = $.Deferred();\n if (data.canvas.toBlob) {\n data.canvas.toBlob(\n function (blob) {\n if (!blob.name) {\n if (file.type === blob.type) {\n blob.name = file.name;\n } else if (file.name) {\n blob.name = file.name.replace(\n /\\.\\w+$/,\n '.' + blob.type.substr(6)\n );\n }\n }\n // Don't restore invalid meta data:\n if (file.type !== blob.type) {\n delete data.imageHead;\n }\n // Store the created blob at the position\n // of the original file in the files list:\n data.files[data.index] = blob;\n dfd.resolveWith(that, [data]);\n },\n options.type || file.type,\n options.quality\n );\n } else {\n return data;\n }\n return dfd.promise();\n },\n\n loadImageMetaData: function (data, options) {\n if (options.disabled) {\n return data;\n }\n var that = this,\n // eslint-disable-next-line new-cap\n dfd = $.Deferred();\n loadImage.parseMetaData(\n data.files[data.index],\n function (result) {\n $.extend(data, result);\n dfd.resolveWith(that, [data]);\n },\n options\n );\n return dfd.promise();\n },\n\n saveImageMetaData: function (data, options) {\n if (\n !(\n data.imageHead &&\n data.canvas &&\n data.canvas.toBlob &&\n !options.disabled\n )\n ) {\n return data;\n }\n var that = this,\n file = data.files[data.index],\n // eslint-disable-next-line new-cap\n dfd = $.Deferred();\n if (data.orientation === true && data.exifOffsets) {\n // Reset Exif Orientation data:\n loadImage.writeExifData(data.imageHead, data, 'Orientation', 1);\n }\n loadImage.replaceHead(file, data.imageHead, function (blob) {\n blob.name = file.name;\n data.files[data.index] = blob;\n dfd.resolveWith(that, [data]);\n });\n return dfd.promise();\n },\n\n // Sets the resized version of the image as a property of the\n // file object, must be called after \"saveImage\":\n setImage: function (data, options) {\n if (data.preview && !options.disabled) {\n data.files[data.index][options.name || 'preview'] = data.preview;\n }\n return data;\n },\n\n deleteImageReferences: function (data, options) {\n if (!options.disabled) {\n delete data.img;\n delete data.canvas;\n delete data.preview;\n delete data.imageHead;\n }\n return data;\n }\n }\n });\n});\n","Mageplaza_Core/lib/fileUploader/jquery.fileupload-audio.js":"/*\n * jQuery File Upload Audio Preview Plugin\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2013, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, require */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['jquery', 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image', 'Mageplaza_Core/lib/fileUploader/jquery.fileupload-process'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(\n require('jquery'),\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'),\n require('Mageplaza_Core/lib/fileUploader/jquery.fileupload-process')\n );\n } else {\n // Browser globals:\n factory(window.jQuery, window.loadImage);\n }\n})(function ($, loadImage) {\n 'use strict';\n\n // Prepend to the default processQueue:\n $.blueimp.fileupload.prototype.options.processQueue.unshift(\n {\n action: 'loadAudio',\n // Use the action as prefix for the \"@\" options:\n prefix: true,\n fileTypes: '@',\n maxFileSize: '@',\n disabled: '@disableAudioPreview'\n },\n {\n action: 'setAudio',\n name: '@audioPreviewName',\n disabled: '@disableAudioPreview'\n }\n );\n\n // The File Upload Audio Preview plugin extends the fileupload widget\n // with audio preview functionality:\n $.widget('blueimp.fileupload', $.blueimp.fileupload, {\n options: {\n // The regular expression for the types of audio files to load,\n // matched against the file type:\n loadAudioFileTypes: /^audio\\/.*$/\n },\n\n _audioElement: document.createElement('audio'),\n\n processActions: {\n // Loads the audio file given via data.files and data.index\n // as audio element if the browser supports playing it.\n // Accepts the options fileTypes (regular expression)\n // and maxFileSize (integer) to limit the files to load:\n loadAudio: function (data, options) {\n if (options.disabled) {\n return data;\n }\n var file = data.files[data.index],\n url,\n audio;\n if (\n this._audioElement.canPlayType &&\n this._audioElement.canPlayType(file.type) &&\n ($.type(options.maxFileSize) !== 'number' ||\n file.size <= options.maxFileSize) &&\n (!options.fileTypes || options.fileTypes.test(file.type))\n ) {\n url = loadImage.createObjectURL(file);\n if (url) {\n audio = this._audioElement.cloneNode(false);\n audio.src = url;\n audio.controls = true;\n data.audio = audio;\n return data;\n }\n }\n return data;\n },\n\n // Sets the audio element as a property of the file object:\n setAudio: function (data, options) {\n if (data.audio && !options.disabled) {\n data.files[data.index][options.name || 'preview'] = data.audio;\n }\n return data;\n }\n }\n });\n});\n","Mageplaza_Core/lib/fileUploader/vendor/jquery.ui.widget.js":"/*! jQuery UI - v1.12.1+0b7246b6eeadfa9e2696e22f3230f6452f8129dc - 2020-02-20\n * http://jqueryui.com\n * Includes: widget.js\n * Copyright jQuery Foundation and other contributors; Licensed MIT */\n\n/* global define, require */\n/* eslint-disable no-param-reassign, new-cap, jsdoc/require-jsdoc */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['jquery'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS\n factory(require('jquery'));\n } else {\n // Browser globals\n factory(window.jQuery);\n }\n})(function ($) {\n ('use strict');\n\n $.ui = $.ui || {};\n\n $.ui.version = '1.12.1';\n\n /*!\n * jQuery UI Widget 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n //>>label: Widget\n //>>group: Core\n //>>description: Provides a factory for creating stateful widgets with a common API.\n //>>docs: http://api.jqueryui.com/jQuery.widget/\n //>>demos: http://jqueryui.com/widget/\n\n // Support: jQuery 1.9.x or older\n // $.expr[ \":\" ] is deprecated.\n if (!$.expr.pseudos) {\n $.expr.pseudos = $.expr[':'];\n }\n\n // Support: jQuery 1.11.x or older\n // $.unique has been renamed to $.uniqueSort\n if (!$.uniqueSort) {\n $.uniqueSort = $.unique;\n }\n\n var widgetUuid = 0;\n var widgetHasOwnProperty = Array.prototype.hasOwnProperty;\n var widgetSlice = Array.prototype.slice;\n\n $.cleanData = (function (orig) {\n return function (elems) {\n var events, elem, i;\n // eslint-disable-next-line eqeqeq\n for (i = 0; (elem = elems[i]) != null; i++) {\n // Only trigger remove when necessary to save time\n events = $._data(elem, 'events');\n if (events && events.remove) {\n $(elem).triggerHandler('remove');\n }\n }\n orig(elems);\n };\n })($.cleanData);\n\n $.widget = function (name, base, prototype) {\n var existingConstructor, constructor, basePrototype;\n\n // ProxiedPrototype allows the provided prototype to remain unmodified\n // so that it can be used as a mixin for multiple widgets (#8876)\n var proxiedPrototype = {};\n\n var namespace = name.split('.')[0];\n name = name.split('.')[1];\n var fullName = namespace + '-' + name;\n\n if (!prototype) {\n prototype = base;\n base = $.Widget;\n }\n\n if ($.isArray(prototype)) {\n prototype = $.extend.apply(null, [{}].concat(prototype));\n }\n\n // Create selector for plugin\n $.expr.pseudos[fullName.toLowerCase()] = function (elem) {\n return !!$.data(elem, fullName);\n };\n\n $[namespace] = $[namespace] || {};\n existingConstructor = $[namespace][name];\n constructor = $[namespace][name] = function (options, element) {\n // Allow instantiation without \"new\" keyword\n if (!this._createWidget) {\n return new constructor(options, element);\n }\n\n // Allow instantiation without initializing for simple inheritance\n // must use \"new\" keyword (the code above always passes args)\n if (arguments.length) {\n this._createWidget(options, element);\n }\n };\n\n // Extend with the existing constructor to carry over any static properties\n $.extend(constructor, existingConstructor, {\n version: prototype.version,\n\n // Copy the object used to create the prototype in case we need to\n // redefine the widget later\n _proto: $.extend({}, prototype),\n\n // Track widgets that inherit from this widget in case this widget is\n // redefined after a widget inherits from it\n _childConstructors: []\n });\n\n basePrototype = new base();\n\n // We need to make the options hash a property directly on the new instance\n // otherwise we'll modify the options hash on the prototype that we're\n // inheriting from\n basePrototype.options = $.widget.extend({}, basePrototype.options);\n $.each(prototype, function (prop, value) {\n if (!$.isFunction(value)) {\n proxiedPrototype[prop] = value;\n return;\n }\n proxiedPrototype[prop] = (function () {\n function _super() {\n return base.prototype[prop].apply(this, arguments);\n }\n\n function _superApply(args) {\n return base.prototype[prop].apply(this, args);\n }\n\n return function () {\n var __super = this._super;\n var __superApply = this._superApply;\n var returnValue;\n\n this._super = _super;\n this._superApply = _superApply;\n\n returnValue = value.apply(this, arguments);\n\n this._super = __super;\n this._superApply = __superApply;\n\n return returnValue;\n };\n })();\n });\n constructor.prototype = $.widget.extend(\n basePrototype,\n {\n // TODO: remove support for widgetEventPrefix\n // always use the name + a colon as the prefix, e.g., draggable:start\n // don't prefix for widgets that aren't DOM-based\n widgetEventPrefix: existingConstructor\n ? basePrototype.widgetEventPrefix || name\n : name\n },\n proxiedPrototype,\n {\n constructor: constructor,\n namespace: namespace,\n widgetName: name,\n widgetFullName: fullName\n }\n );\n\n // If this widget is being redefined then we need to find all widgets that\n // are inheriting from it and redefine all of them so that they inherit from\n // the new version of this widget. We're essentially trying to replace one\n // level in the prototype chain.\n if (existingConstructor) {\n $.each(existingConstructor._childConstructors, function (i, child) {\n var childPrototype = child.prototype;\n\n // Redefine the child widget using the same prototype that was\n // originally used, but inherit from the new version of the base\n $.widget(\n childPrototype.namespace + '.' + childPrototype.widgetName,\n constructor,\n child._proto\n );\n });\n\n // Remove the list of existing child constructors from the old constructor\n // so the old child constructors can be garbage collected\n delete existingConstructor._childConstructors;\n } else {\n base._childConstructors.push(constructor);\n }\n\n $.widget.bridge(name, constructor);\n\n return constructor;\n };\n\n $.widget.extend = function (target) {\n var input = widgetSlice.call(arguments, 1);\n var inputIndex = 0;\n var inputLength = input.length;\n var key;\n var value;\n\n for (; inputIndex < inputLength; inputIndex++) {\n for (key in input[inputIndex]) {\n value = input[inputIndex][key];\n if (\n widgetHasOwnProperty.call(input[inputIndex], key) &&\n value !== undefined\n ) {\n // Clone objects\n if ($.isPlainObject(value)) {\n target[key] = $.isPlainObject(target[key])\n ? $.widget.extend({}, target[key], value)\n : // Don't extend strings, arrays, etc. with objects\n $.widget.extend({}, value);\n\n // Copy everything else by reference\n } else {\n target[key] = value;\n }\n }\n }\n }\n return target;\n };\n\n $.widget.bridge = function (name, object) {\n var fullName = object.prototype.widgetFullName || name;\n $.fn[name] = function (options) {\n var isMethodCall = typeof options === 'string';\n var args = widgetSlice.call(arguments, 1);\n var returnValue = this;\n\n if (isMethodCall) {\n // If this is an empty collection, we need to have the instance method\n // return undefined instead of the jQuery instance\n if (!this.length && options === 'instance') {\n returnValue = undefined;\n } else {\n this.each(function () {\n var methodValue;\n var instance = $.data(this, fullName);\n\n if (options === 'instance') {\n returnValue = instance;\n return false;\n }\n\n if (!instance) {\n return $.error(\n 'cannot call methods on ' +\n name +\n ' prior to initialization; ' +\n \"attempted to call method '\" +\n options +\n \"'\"\n );\n }\n\n if (!$.isFunction(instance[options]) || options.charAt(0) === '_') {\n return $.error(\n \"no such method '\" +\n options +\n \"' for \" +\n name +\n ' widget instance'\n );\n }\n\n methodValue = instance[options].apply(instance, args);\n\n if (methodValue !== instance && methodValue !== undefined) {\n returnValue =\n methodValue && methodValue.jquery\n ? returnValue.pushStack(methodValue.get())\n : methodValue;\n return false;\n }\n });\n }\n } else {\n // Allow multiple hashes to be passed on init\n if (args.length) {\n options = $.widget.extend.apply(null, [options].concat(args));\n }\n\n this.each(function () {\n var instance = $.data(this, fullName);\n if (instance) {\n instance.option(options || {});\n if (instance._init) {\n instance._init();\n }\n } else {\n $.data(this, fullName, new object(options, this));\n }\n });\n }\n\n return returnValue;\n };\n };\n\n $.Widget = function (/* options, element */) {};\n $.Widget._childConstructors = [];\n\n $.Widget.prototype = {\n widgetName: 'widget',\n widgetEventPrefix: '',\n defaultElement: '<div>',\n\n options: {\n classes: {},\n disabled: false,\n\n // Callbacks\n create: null\n },\n\n _createWidget: function (options, element) {\n element = $(element || this.defaultElement || this)[0];\n this.element = $(element);\n this.uuid = widgetUuid++;\n this.eventNamespace = '.' + this.widgetName + this.uuid;\n\n this.bindings = $();\n this.hoverable = $();\n this.focusable = $();\n this.classesElementLookup = {};\n\n if (element !== this) {\n $.data(element, this.widgetFullName, this);\n this._on(true, this.element, {\n remove: function (event) {\n if (event.target === element) {\n this.destroy();\n }\n }\n });\n this.document = $(\n element.style\n ? // Element within the document\n element.ownerDocument\n : // Element is window or document\n element.document || element\n );\n this.window = $(\n this.document[0].defaultView || this.document[0].parentWindow\n );\n }\n\n this.options = $.widget.extend(\n {},\n this.options,\n this._getCreateOptions(),\n options\n );\n\n this._create();\n\n if (this.options.disabled) {\n this._setOptionDisabled(this.options.disabled);\n }\n\n this._trigger('create', null, this._getCreateEventData());\n this._init();\n },\n\n _getCreateOptions: function () {\n return {};\n },\n\n _getCreateEventData: $.noop,\n\n _create: $.noop,\n\n _init: $.noop,\n\n destroy: function () {\n var that = this;\n\n this._destroy();\n $.each(this.classesElementLookup, function (key, value) {\n that._removeClass(value, key);\n });\n\n // We can probably remove the unbind calls in 2.0\n // all event bindings should go through this._on()\n this.element.off(this.eventNamespace).removeData(this.widgetFullName);\n this.widget().off(this.eventNamespace).removeAttr('aria-disabled');\n\n // Clean up events and states\n this.bindings.off(this.eventNamespace);\n },\n\n _destroy: $.noop,\n\n widget: function () {\n return this.element;\n },\n\n option: function (key, value) {\n var options = key;\n var parts;\n var curOption;\n var i;\n\n if (arguments.length === 0) {\n // Don't return a reference to the internal hash\n return $.widget.extend({}, this.options);\n }\n\n if (typeof key === 'string') {\n // Handle nested keys, e.g., \"foo.bar\" => { foo: { bar: ___ } }\n options = {};\n parts = key.split('.');\n key = parts.shift();\n if (parts.length) {\n curOption = options[key] = $.widget.extend({}, this.options[key]);\n for (i = 0; i < parts.length - 1; i++) {\n curOption[parts[i]] = curOption[parts[i]] || {};\n curOption = curOption[parts[i]];\n }\n key = parts.pop();\n if (arguments.length === 1) {\n return curOption[key] === undefined ? null : curOption[key];\n }\n curOption[key] = value;\n } else {\n if (arguments.length === 1) {\n return this.options[key] === undefined ? null : this.options[key];\n }\n options[key] = value;\n }\n }\n\n this._setOptions(options);\n\n return this;\n },\n\n _setOptions: function (options) {\n var key;\n\n for (key in options) {\n this._setOption(key, options[key]);\n }\n\n return this;\n },\n\n _setOption: function (key, value) {\n if (key === 'classes') {\n this._setOptionClasses(value);\n }\n\n this.options[key] = value;\n\n if (key === 'disabled') {\n this._setOptionDisabled(value);\n }\n\n return this;\n },\n\n _setOptionClasses: function (value) {\n var classKey, elements, currentElements;\n\n for (classKey in value) {\n currentElements = this.classesElementLookup[classKey];\n if (\n value[classKey] === this.options.classes[classKey] ||\n !currentElements ||\n !currentElements.length\n ) {\n continue;\n }\n\n // We are doing this to create a new jQuery object because the _removeClass() call\n // on the next line is going to destroy the reference to the current elements being\n // tracked. We need to save a copy of this collection so that we can add the new classes\n // below.\n elements = $(currentElements.get());\n this._removeClass(currentElements, classKey);\n\n // We don't use _addClass() here, because that uses this.options.classes\n // for generating the string of classes. We want to use the value passed in from\n // _setOption(), this is the new value of the classes option which was passed to\n // _setOption(). We pass this value directly to _classes().\n elements.addClass(\n this._classes({\n element: elements,\n keys: classKey,\n classes: value,\n add: true\n })\n );\n }\n },\n\n _setOptionDisabled: function (value) {\n this._toggleClass(\n this.widget(),\n this.widgetFullName + '-disabled',\n null,\n !!value\n );\n\n // If the widget is becoming disabled, then nothing is interactive\n if (value) {\n this._removeClass(this.hoverable, null, 'ui-state-hover');\n this._removeClass(this.focusable, null, 'ui-state-focus');\n }\n },\n\n enable: function () {\n return this._setOptions({ disabled: false });\n },\n\n disable: function () {\n return this._setOptions({ disabled: true });\n },\n\n _classes: function (options) {\n var full = [];\n var that = this;\n\n options = $.extend(\n {\n element: this.element,\n classes: this.options.classes || {}\n },\n options\n );\n\n function bindRemoveEvent() {\n options.element.each(function (_, element) {\n var isTracked = $.map(that.classesElementLookup, function (elements) {\n return elements;\n }).some(function (elements) {\n return elements.is(element);\n });\n\n if (!isTracked) {\n that._on($(element), {\n remove: '_untrackClassesElement'\n });\n }\n });\n }\n\n function processClassString(classes, checkOption) {\n var current, i;\n for (i = 0; i < classes.length; i++) {\n current = that.classesElementLookup[classes[i]] || $();\n if (options.add) {\n bindRemoveEvent();\n current = $(\n $.uniqueSort(current.get().concat(options.element.get()))\n );\n } else {\n current = $(current.not(options.element).get());\n }\n that.classesElementLookup[classes[i]] = current;\n full.push(classes[i]);\n if (checkOption && options.classes[classes[i]]) {\n full.push(options.classes[classes[i]]);\n }\n }\n }\n\n if (options.keys) {\n processClassString(options.keys.match(/\\S+/g) || [], true);\n }\n if (options.extra) {\n processClassString(options.extra.match(/\\S+/g) || []);\n }\n\n return full.join(' ');\n },\n\n _untrackClassesElement: function (event) {\n var that = this;\n $.each(that.classesElementLookup, function (key, value) {\n if ($.inArray(event.target, value) !== -1) {\n that.classesElementLookup[key] = $(value.not(event.target).get());\n }\n });\n\n this._off($(event.target));\n },\n\n _removeClass: function (element, keys, extra) {\n return this._toggleClass(element, keys, extra, false);\n },\n\n _addClass: function (element, keys, extra) {\n return this._toggleClass(element, keys, extra, true);\n },\n\n _toggleClass: function (element, keys, extra, add) {\n add = typeof add === 'boolean' ? add : extra;\n var shift = typeof element === 'string' || element === null,\n options = {\n extra: shift ? keys : extra,\n keys: shift ? element : keys,\n element: shift ? this.element : element,\n add: add\n };\n options.element.toggleClass(this._classes(options), add);\n return this;\n },\n\n _on: function (suppressDisabledCheck, element, handlers) {\n var delegateElement;\n var instance = this;\n\n // No suppressDisabledCheck flag, shuffle arguments\n if (typeof suppressDisabledCheck !== 'boolean') {\n handlers = element;\n element = suppressDisabledCheck;\n suppressDisabledCheck = false;\n }\n\n // No element argument, shuffle and use this.element\n if (!handlers) {\n handlers = element;\n element = this.element;\n delegateElement = this.widget();\n } else {\n element = delegateElement = $(element);\n this.bindings = this.bindings.add(element);\n }\n\n $.each(handlers, function (event, handler) {\n function handlerProxy() {\n // Allow widgets to customize the disabled handling\n // - disabled as an array instead of boolean\n // - disabled class as method for disabling individual parts\n if (\n !suppressDisabledCheck &&\n (instance.options.disabled === true ||\n $(this).hasClass('ui-state-disabled'))\n ) {\n return;\n }\n return (\n typeof handler === 'string' ? instance[handler] : handler\n ).apply(instance, arguments);\n }\n\n // Copy the guid so direct unbinding works\n if (typeof handler !== 'string') {\n handlerProxy.guid = handler.guid =\n handler.guid || handlerProxy.guid || $.guid++;\n }\n\n var match = event.match(/^([\\w:-]*)\\s*(.*)$/);\n var eventName = match[1] + instance.eventNamespace;\n var selector = match[2];\n\n if (selector) {\n delegateElement.on(eventName, selector, handlerProxy);\n } else {\n element.on(eventName, handlerProxy);\n }\n });\n },\n\n _off: function (element, eventName) {\n eventName =\n (eventName || '').split(' ').join(this.eventNamespace + ' ') +\n this.eventNamespace;\n element.off(eventName);\n\n // Clear the stack to avoid memory leaks (#10056)\n this.bindings = $(this.bindings.not(element).get());\n this.focusable = $(this.focusable.not(element).get());\n this.hoverable = $(this.hoverable.not(element).get());\n },\n\n _delay: function (handler, delay) {\n var instance = this;\n function handlerProxy() {\n return (\n typeof handler === 'string' ? instance[handler] : handler\n ).apply(instance, arguments);\n }\n return setTimeout(handlerProxy, delay || 0);\n },\n\n _hoverable: function (element) {\n this.hoverable = this.hoverable.add(element);\n this._on(element, {\n mouseenter: function (event) {\n this._addClass($(event.currentTarget), null, 'ui-state-hover');\n },\n mouseleave: function (event) {\n this._removeClass($(event.currentTarget), null, 'ui-state-hover');\n }\n });\n },\n\n _focusable: function (element) {\n this.focusable = this.focusable.add(element);\n this._on(element, {\n focusin: function (event) {\n this._addClass($(event.currentTarget), null, 'ui-state-focus');\n },\n focusout: function (event) {\n this._removeClass($(event.currentTarget), null, 'ui-state-focus');\n }\n });\n },\n\n _trigger: function (type, event, data) {\n var prop, orig;\n var callback = this.options[type];\n\n data = data || {};\n event = $.Event(event);\n event.type = (\n type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type\n ).toLowerCase();\n\n // The original event may come from any element\n // so we need to reset the target on the new event\n event.target = this.element[0];\n\n // Copy original event properties over to the new event\n orig = event.originalEvent;\n if (orig) {\n for (prop in orig) {\n if (!(prop in event)) {\n event[prop] = orig[prop];\n }\n }\n }\n\n this.element.trigger(event, data);\n return !(\n ($.isFunction(callback) &&\n callback.apply(this.element[0], [event].concat(data)) === false) ||\n event.isDefaultPrevented()\n );\n }\n };\n\n $.each({ show: 'fadeIn', hide: 'fadeOut' }, function (method, defaultEffect) {\n $.Widget.prototype['_' + method] = function (element, options, callback) {\n if (typeof options === 'string') {\n options = { effect: options };\n }\n\n var hasOptions;\n var effectName = !options\n ? method\n : options === true || typeof options === 'number'\n ? defaultEffect\n : options.effect || defaultEffect;\n\n options = options || {};\n if (typeof options === 'number') {\n options = { duration: options };\n }\n\n hasOptions = !$.isEmptyObject(options);\n options.complete = callback;\n\n if (options.delay) {\n element.delay(options.delay);\n }\n\n if (hasOptions && $.effects && $.effects.effect[effectName]) {\n element[method](options);\n } else if (effectName !== method && element[effectName]) {\n element[effectName](options.duration, options.easing, callback);\n } else {\n element.queue(function (next) {\n $(this)[method]();\n if (callback) {\n callback.call(element[0]);\n }\n next();\n });\n }\n };\n });\n});\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-iptc.js":"/*\n * JavaScript Load Image IPTC Parser\n * https://github.com/blueimp/JavaScript-Load-Image\n *\n * Copyright 2013, Sebastian Tschan\n * Copyright 2018, Dave Bevan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, module, require, DataView */\n\n;(function (factory) {\n 'use strict'\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image', 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-meta'], factory)\n } else if (typeof module === 'object' && module.exports) {\n factory(require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'), require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-meta'))\n } else {\n // Browser globals:\n factory(window.loadImage)\n }\n})(function (loadImage) {\n 'use strict'\n\n /**\n * IPTC tag map\n *\n * @name IptcMap\n * @class\n */\n function IptcMap() {}\n\n IptcMap.prototype.map = {\n ObjectName: 5\n }\n\n IptcMap.prototype.types = {\n 0: 'Uint16', // ApplicationRecordVersion\n 200: 'Uint16', // ObjectPreviewFileFormat\n 201: 'Uint16', // ObjectPreviewFileVersion\n 202: 'binary' // ObjectPreviewData\n }\n\n /**\n * Retrieves IPTC tag value\n *\n * @param {number|string} id IPTC tag code or name\n * @returns {object} IPTC tag value\n */\n IptcMap.prototype.get = function (id) {\n return this[id] || this[this.map[id]]\n }\n\n /**\n * Retrieves string for the given DataView and range\n *\n * @param {DataView} dataView Data view interface\n * @param {number} offset Offset start\n * @param {number} length Offset length\n * @returns {string} String value\n */\n function getStringValue(dataView, offset, length) {\n var outstr = ''\n var end = offset + length\n for (var n = offset; n < end; n += 1) {\n outstr += String.fromCharCode(dataView.getUint8(n))\n }\n return outstr\n }\n\n /**\n * Retrieves tag value for the given DataView and range\n *\n * @param {number} tagCode tag code\n * @param {IptcMap} map IPTC tag map\n * @param {DataView} dataView Data view interface\n * @param {number} offset Range start\n * @param {number} length Range length\n * @returns {object} Tag value\n */\n function getTagValue(tagCode, map, dataView, offset, length) {\n if (map.types[tagCode] === 'binary') {\n return new Blob([dataView.buffer.slice(offset, offset + length)])\n }\n if (map.types[tagCode] === 'Uint16') {\n return dataView.getUint16(offset)\n }\n return getStringValue(dataView, offset, length)\n }\n\n /**\n * Combines IPTC value with existing ones.\n *\n * @param {object} value Existing IPTC field value\n * @param {object} newValue New IPTC field value\n * @returns {object} Resulting IPTC field value\n */\n function combineTagValues(value, newValue) {\n if (value === undefined) return newValue\n if (value instanceof Array) {\n value.push(newValue)\n return value\n }\n return [value, newValue]\n }\n\n /**\n * Parses IPTC tags.\n *\n * @param {DataView} dataView Data view interface\n * @param {number} segmentOffset Segment offset\n * @param {number} segmentLength Segment length\n * @param {object} data Data export object\n * @param {object} includeTags Map of tags to include\n * @param {object} excludeTags Map of tags to exclude\n */\n function parseIptcTags(\n dataView,\n segmentOffset,\n segmentLength,\n data,\n includeTags,\n excludeTags\n ) {\n var value, tagSize, tagCode\n var segmentEnd = segmentOffset + segmentLength\n var offset = segmentOffset\n while (offset < segmentEnd) {\n if (\n dataView.getUint8(offset) === 0x1c && // tag marker\n dataView.getUint8(offset + 1) === 0x02 // record number, only handles v2\n ) {\n tagCode = dataView.getUint8(offset + 2)\n if (\n (!includeTags || includeTags[tagCode]) &&\n (!excludeTags || !excludeTags[tagCode])\n ) {\n tagSize = dataView.getInt16(offset + 3)\n value = getTagValue(tagCode, data.iptc, dataView, offset + 5, tagSize)\n data.iptc[tagCode] = combineTagValues(data.iptc[tagCode], value)\n if (data.iptcOffsets) {\n data.iptcOffsets[tagCode] = offset\n }\n }\n }\n offset += 1\n }\n }\n\n /**\n * Tests if field segment starts at offset.\n *\n * @param {DataView} dataView Data view interface\n * @param {number} offset Segment offset\n * @returns {boolean} True if '8BIM<EOT><EOT>' exists at offset\n */\n function isSegmentStart(dataView, offset) {\n return (\n dataView.getUint32(offset) === 0x3842494d && // Photoshop segment start\n dataView.getUint16(offset + 4) === 0x0404 // IPTC segment start\n )\n }\n\n /**\n * Returns header length.\n *\n * @param {DataView} dataView Data view interface\n * @param {number} offset Segment offset\n * @returns {number} Header length\n */\n function getHeaderLength(dataView, offset) {\n var length = dataView.getUint8(offset + 7)\n if (length % 2 !== 0) length += 1\n // Check for pre photoshop 6 format\n if (length === 0) {\n // Always 4\n length = 4\n }\n return length\n }\n\n loadImage.parseIptcData = function (dataView, offset, length, data, options) {\n if (options.disableIptc) {\n return\n }\n var markerLength = offset + length\n while (offset + 8 < markerLength) {\n if (isSegmentStart(dataView, offset)) {\n var headerLength = getHeaderLength(dataView, offset)\n var segmentOffset = offset + 8 + headerLength\n if (segmentOffset > markerLength) {\n // eslint-disable-next-line no-console\n console.log('Invalid IPTC data: Invalid segment offset.')\n break\n }\n var segmentLength = dataView.getUint16(offset + 6 + headerLength)\n if (offset + segmentLength > markerLength) {\n // eslint-disable-next-line no-console\n console.log('Invalid IPTC data: Invalid segment size.')\n break\n }\n // Create the iptc object to store the tags:\n data.iptc = new IptcMap()\n if (!options.disableIptcOffsets) {\n data.iptcOffsets = new IptcMap()\n }\n parseIptcTags(\n dataView,\n segmentOffset,\n segmentLength,\n data,\n options.includeIptcTags,\n options.excludeIptcTags || { 202: true } // ObjectPreviewData\n )\n return\n }\n // eslint-disable-next-line no-param-reassign\n offset += 1\n }\n }\n\n // Registers this IPTC parser for the APP13 JPEG metadata segment:\n loadImage.metaDataParsers.jpeg[0xffed].push(loadImage.parseIptcData)\n\n loadImage.IptcMap = IptcMap\n\n // Adds the following properties to the parseMetaData callback data:\n // - iptc: The iptc tags, parsed by the parseIptcData method\n\n // Adds the following options to the parseMetaData method:\n // - disableIptc: Disables IPTC parsing when true.\n // - disableIptcOffsets: Disables storing IPTC tag offsets when true.\n // - includeIptcTags: A map of IPTC tags to include for parsing.\n // - excludeIptcTags: A map of IPTC tags to exclude from parsing.\n})\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-exif.js":"/*\n * JavaScript Load Image Exif Parser\n * https://github.com/blueimp/JavaScript-Load-Image\n *\n * Copyright 2013, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, module, require, DataView */\n\n/* eslint-disable no-console */\n\n;(function (factory) {\n 'use strict'\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image', 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-meta'], factory)\n } else if (typeof module === 'object' && module.exports) {\n factory(require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'), require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-meta'))\n } else {\n // Browser globals:\n factory(window.loadImage)\n }\n})(function (loadImage) {\n 'use strict'\n\n /**\n * Exif tag map\n *\n * @name ExifMap\n * @class\n * @param {number|string} tagCode IFD tag code\n */\n function ExifMap(tagCode) {\n if (tagCode) {\n Object.defineProperty(this, 'map', {\n value: this.ifds[tagCode].map\n })\n Object.defineProperty(this, 'tags', {\n value: (this.tags && this.tags[tagCode]) || {}\n })\n }\n }\n\n ExifMap.prototype.map = {\n Orientation: 0x0112,\n Thumbnail: 'ifd1',\n Blob: 0x0201, // Alias for JPEGInterchangeFormat\n Exif: 0x8769,\n GPSInfo: 0x8825,\n Interoperability: 0xa005\n }\n\n ExifMap.prototype.ifds = {\n ifd1: { name: 'Thumbnail', map: ExifMap.prototype.map },\n 0x8769: { name: 'Exif', map: {} },\n 0x8825: { name: 'GPSInfo', map: {} },\n 0xa005: { name: 'Interoperability', map: {} }\n }\n\n /**\n * Retrieves exif tag value\n *\n * @param {number|string} id Exif tag code or name\n * @returns {object} Exif tag value\n */\n ExifMap.prototype.get = function (id) {\n return this[id] || this[this.map[id]]\n }\n\n /**\n * Returns the Exif Thumbnail data as Blob.\n *\n * @param {DataView} dataView Data view interface\n * @param {number} offset Thumbnail data offset\n * @param {number} length Thumbnail data length\n * @returns {undefined|Blob} Returns the Thumbnail Blob or undefined\n */\n function getExifThumbnail(dataView, offset, length) {\n if (!length) return\n if (offset + length > dataView.byteLength) {\n console.log('Invalid Exif data: Invalid thumbnail data.')\n return\n }\n return new Blob(\n [loadImage.bufferSlice.call(dataView.buffer, offset, offset + length)],\n {\n type: 'image/jpeg'\n }\n )\n }\n\n var ExifTagTypes = {\n // byte, 8-bit unsigned int:\n 1: {\n getValue: function (dataView, dataOffset) {\n return dataView.getUint8(dataOffset)\n },\n size: 1\n },\n // ascii, 8-bit byte:\n 2: {\n getValue: function (dataView, dataOffset) {\n return String.fromCharCode(dataView.getUint8(dataOffset))\n },\n size: 1,\n ascii: true\n },\n // short, 16 bit int:\n 3: {\n getValue: function (dataView, dataOffset, littleEndian) {\n return dataView.getUint16(dataOffset, littleEndian)\n },\n size: 2\n },\n // long, 32 bit int:\n 4: {\n getValue: function (dataView, dataOffset, littleEndian) {\n return dataView.getUint32(dataOffset, littleEndian)\n },\n size: 4\n },\n // rational = two long values, first is numerator, second is denominator:\n 5: {\n getValue: function (dataView, dataOffset, littleEndian) {\n return (\n dataView.getUint32(dataOffset, littleEndian) /\n dataView.getUint32(dataOffset + 4, littleEndian)\n )\n },\n size: 8\n },\n // slong, 32 bit signed int:\n 9: {\n getValue: function (dataView, dataOffset, littleEndian) {\n return dataView.getInt32(dataOffset, littleEndian)\n },\n size: 4\n },\n // srational, two slongs, first is numerator, second is denominator:\n 10: {\n getValue: function (dataView, dataOffset, littleEndian) {\n return (\n dataView.getInt32(dataOffset, littleEndian) /\n dataView.getInt32(dataOffset + 4, littleEndian)\n )\n },\n size: 8\n }\n }\n // undefined, 8-bit byte, value depending on field:\n ExifTagTypes[7] = ExifTagTypes[1]\n\n /**\n * Returns Exif tag value.\n *\n * @param {DataView} dataView Data view interface\n * @param {number} tiffOffset TIFF offset\n * @param {number} offset Tag offset\n * @param {number} type Tag type\n * @param {number} length Tag length\n * @param {boolean} littleEndian Little endian encoding\n * @returns {object} Tag value\n */\n function getExifValue(\n dataView,\n tiffOffset,\n offset,\n type,\n length,\n littleEndian\n ) {\n var tagType = ExifTagTypes[type]\n var tagSize\n var dataOffset\n var values\n var i\n var str\n var c\n if (!tagType) {\n console.log('Invalid Exif data: Invalid tag type.')\n return\n }\n tagSize = tagType.size * length\n // Determine if the value is contained in the dataOffset bytes,\n // or if the value at the dataOffset is a pointer to the actual data:\n dataOffset =\n tagSize > 4\n ? tiffOffset + dataView.getUint32(offset + 8, littleEndian)\n : offset + 8\n if (dataOffset + tagSize > dataView.byteLength) {\n console.log('Invalid Exif data: Invalid data offset.')\n return\n }\n if (length === 1) {\n return tagType.getValue(dataView, dataOffset, littleEndian)\n }\n values = []\n for (i = 0; i < length; i += 1) {\n values[i] = tagType.getValue(\n dataView,\n dataOffset + i * tagType.size,\n littleEndian\n )\n }\n if (tagType.ascii) {\n str = ''\n // Concatenate the chars:\n for (i = 0; i < values.length; i += 1) {\n c = values[i]\n // Ignore the terminating NULL byte(s):\n if (c === '\\u0000') {\n break\n }\n str += c\n }\n return str\n }\n return values\n }\n\n /**\n * Determines if the given tag should be included.\n *\n * @param {object} includeTags Map of tags to include\n * @param {object} excludeTags Map of tags to exclude\n * @param {number|string} tagCode Tag code to check\n * @returns {boolean} True if the tag should be included\n */\n function shouldIncludeTag(includeTags, excludeTags, tagCode) {\n return (\n (!includeTags || includeTags[tagCode]) &&\n (!excludeTags || excludeTags[tagCode] !== true)\n )\n }\n\n /**\n * Parses Exif tags.\n *\n * @param {DataView} dataView Data view interface\n * @param {number} tiffOffset TIFF offset\n * @param {number} dirOffset Directory offset\n * @param {boolean} littleEndian Little endian encoding\n * @param {ExifMap} tags Map to store parsed exif tags\n * @param {ExifMap} tagOffsets Map to store parsed exif tag offsets\n * @param {object} includeTags Map of tags to include\n * @param {object} excludeTags Map of tags to exclude\n * @returns {number} Next directory offset\n */\n function parseExifTags(\n dataView,\n tiffOffset,\n dirOffset,\n littleEndian,\n tags,\n tagOffsets,\n includeTags,\n excludeTags\n ) {\n var tagsNumber, dirEndOffset, i, tagOffset, tagNumber, tagValue\n if (dirOffset + 6 > dataView.byteLength) {\n console.log('Invalid Exif data: Invalid directory offset.')\n return\n }\n tagsNumber = dataView.getUint16(dirOffset, littleEndian)\n dirEndOffset = dirOffset + 2 + 12 * tagsNumber\n if (dirEndOffset + 4 > dataView.byteLength) {\n console.log('Invalid Exif data: Invalid directory size.')\n return\n }\n for (i = 0; i < tagsNumber; i += 1) {\n tagOffset = dirOffset + 2 + 12 * i\n tagNumber = dataView.getUint16(tagOffset, littleEndian)\n if (!shouldIncludeTag(includeTags, excludeTags, tagNumber)) continue\n tagValue = getExifValue(\n dataView,\n tiffOffset,\n tagOffset,\n dataView.getUint16(tagOffset + 2, littleEndian), // tag type\n dataView.getUint32(tagOffset + 4, littleEndian), // tag length\n littleEndian\n )\n tags[tagNumber] = tagValue\n if (tagOffsets) {\n tagOffsets[tagNumber] = tagOffset\n }\n }\n // Return the offset to the next directory:\n return dataView.getUint32(dirEndOffset, littleEndian)\n }\n\n /**\n * Parses tags in a given IFD (Image File Directory).\n *\n * @param {object} data Data object to store exif tags and offsets\n * @param {number|string} tagCode IFD tag code\n * @param {DataView} dataView Data view interface\n * @param {number} tiffOffset TIFF offset\n * @param {boolean} littleEndian Little endian encoding\n * @param {object} includeTags Map of tags to include\n * @param {object} excludeTags Map of tags to exclude\n */\n function parseExifIFD(\n data,\n tagCode,\n dataView,\n tiffOffset,\n littleEndian,\n includeTags,\n excludeTags\n ) {\n var dirOffset = data.exif[tagCode]\n if (dirOffset) {\n data.exif[tagCode] = new ExifMap(tagCode)\n if (data.exifOffsets) {\n data.exifOffsets[tagCode] = new ExifMap(tagCode)\n }\n parseExifTags(\n dataView,\n tiffOffset,\n tiffOffset + dirOffset,\n littleEndian,\n data.exif[tagCode],\n data.exifOffsets && data.exifOffsets[tagCode],\n includeTags && includeTags[tagCode],\n excludeTags && excludeTags[tagCode]\n )\n }\n }\n\n loadImage.parseExifData = function (dataView, offset, length, data, options) {\n if (options.disableExif) {\n return\n }\n var includeTags = options.includeExifTags\n var excludeTags = options.excludeExifTags || {\n 0x8769: {\n // ExifIFDPointer\n 0x927c: true // MakerNote\n }\n }\n var tiffOffset = offset + 10\n var littleEndian\n var dirOffset\n var thumbnailIFD\n // Check for the ASCII code for \"Exif\" (0x45786966):\n if (dataView.getUint32(offset + 4) !== 0x45786966) {\n // No Exif data, might be XMP data instead\n return\n }\n if (tiffOffset + 8 > dataView.byteLength) {\n console.log('Invalid Exif data: Invalid segment size.')\n return\n }\n // Check for the two null bytes:\n if (dataView.getUint16(offset + 8) !== 0x0000) {\n console.log('Invalid Exif data: Missing byte alignment offset.')\n return\n }\n // Check the byte alignment:\n switch (dataView.getUint16(tiffOffset)) {\n case 0x4949:\n littleEndian = true\n break\n case 0x4d4d:\n littleEndian = false\n break\n default:\n console.log('Invalid Exif data: Invalid byte alignment marker.')\n return\n }\n // Check for the TIFF tag marker (0x002A):\n if (dataView.getUint16(tiffOffset + 2, littleEndian) !== 0x002a) {\n console.log('Invalid Exif data: Missing TIFF marker.')\n return\n }\n // Retrieve the directory offset bytes, usually 0x00000008 or 8 decimal:\n dirOffset = dataView.getUint32(tiffOffset + 4, littleEndian)\n // Create the exif object to store the tags:\n data.exif = new ExifMap()\n if (!options.disableExifOffsets) {\n data.exifOffsets = new ExifMap()\n data.exifTiffOffset = tiffOffset\n data.exifLittleEndian = littleEndian\n }\n // Parse the tags of the main image directory (IFD0) and retrieve the\n // offset to the next directory (IFD1), usually the thumbnail directory:\n dirOffset = parseExifTags(\n dataView,\n tiffOffset,\n tiffOffset + dirOffset,\n littleEndian,\n data.exif,\n data.exifOffsets,\n includeTags,\n excludeTags\n )\n if (dirOffset && shouldIncludeTag(includeTags, excludeTags, 'ifd1')) {\n data.exif.ifd1 = dirOffset\n if (data.exifOffsets) {\n data.exifOffsets.ifd1 = tiffOffset + dirOffset\n }\n }\n Object.keys(data.exif.ifds).forEach(function (tagCode) {\n parseExifIFD(\n data,\n tagCode,\n dataView,\n tiffOffset,\n littleEndian,\n includeTags,\n excludeTags\n )\n })\n thumbnailIFD = data.exif.ifd1\n // Check for JPEG Thumbnail offset and data length:\n if (thumbnailIFD && thumbnailIFD[0x0201]) {\n thumbnailIFD[0x0201] = getExifThumbnail(\n dataView,\n tiffOffset + thumbnailIFD[0x0201],\n thumbnailIFD[0x0202] // Thumbnail data length\n )\n }\n }\n\n // Registers the Exif parser for the APP1 JPEG metadata segment:\n loadImage.metaDataParsers.jpeg[0xffe1].push(loadImage.parseExifData)\n\n loadImage.exifWriters = {\n // Orientation writer:\n 0x0112: function (buffer, data, value) {\n var orientationOffset = data.exifOffsets[0x0112]\n if (!orientationOffset) return buffer\n var view = new DataView(buffer, orientationOffset + 8, 2)\n view.setUint16(0, value, data.exifLittleEndian)\n return buffer\n }\n }\n\n loadImage.writeExifData = function (buffer, data, id, value) {\n loadImage.exifWriters[data.exif.map[id]](buffer, data, value)\n }\n\n loadImage.ExifMap = ExifMap\n\n // Adds the following properties to the parseMetaData callback data:\n // - exif: The parsed Exif tags\n // - exifOffsets: The parsed Exif tag offsets\n // - exifTiffOffset: TIFF header offset (used for offset pointers)\n // - exifLittleEndian: little endian order if true, big endian if false\n\n // Adds the following options to the parseMetaData method:\n // - disableExif: Disables Exif parsing when true.\n // - disableExifOffsets: Disables storing Exif tag offsets when true.\n // - includeExifTags: A map of Exif tags to include for parsing.\n // - excludeExifTags: A map of Exif tags to exclude from parsing.\n})\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-fetch.js":"/*\n * JavaScript Load Image Fetch\n * https://github.com/blueimp/JavaScript-Load-Image\n *\n * Copyright 2017, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, module, require, Promise */\n\n;(function (factory) {\n 'use strict'\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'], factory)\n } else if (typeof module === 'object' && module.exports) {\n factory(require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'))\n } else {\n // Browser globals:\n factory(window.loadImage)\n }\n})(function (loadImage) {\n 'use strict'\n\n var global = loadImage.global\n\n if (\n global.fetch &&\n global.Request &&\n global.Response &&\n global.Response.prototype.blob\n ) {\n loadImage.fetchBlob = function (url, callback, options) {\n /**\n * Fetch response handler.\n *\n * @param {Response} response Fetch response\n * @returns {Blob} Fetched Blob.\n */\n function responseHandler(response) {\n return response.blob()\n }\n if (global.Promise && typeof callback !== 'function') {\n return fetch(new Request(url, callback)).then(responseHandler)\n }\n fetch(new Request(url, options))\n .then(responseHandler)\n .then(callback)\n [\n // Avoid parsing error in IE<9, where catch is a reserved word.\n // eslint-disable-next-line dot-notation\n 'catch'\n ](function (err) {\n callback(null, err)\n })\n }\n } else if (\n global.XMLHttpRequest &&\n // https://xhr.spec.whatwg.org/#the-responsetype-attribute\n new XMLHttpRequest().responseType === ''\n ) {\n loadImage.fetchBlob = function (url, callback, options) {\n /**\n * Promise executor\n *\n * @param {Function} resolve Resolution function\n * @param {Function} reject Rejection function\n */\n function executor(resolve, reject) {\n options = options || {} // eslint-disable-line no-param-reassign\n var req = new XMLHttpRequest()\n req.open(options.method || 'GET', url)\n if (options.headers) {\n Object.keys(options.headers).forEach(function (key) {\n req.setRequestHeader(key, options.headers[key])\n })\n }\n req.withCredentials = options.credentials === 'include'\n req.responseType = 'blob'\n req.onload = function () {\n resolve(req.response)\n }\n req.onerror = req.onabort = req.ontimeout = function (err) {\n if (resolve === reject) {\n // Not using Promises\n reject(null, err)\n } else {\n reject(err)\n }\n }\n req.send(options.body)\n }\n if (global.Promise && typeof callback !== 'function') {\n options = callback // eslint-disable-line no-param-reassign\n return new Promise(executor)\n }\n return executor(callback, callback)\n }\n }\n})\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-exif-map.js":"/*\n * JavaScript Load Image Exif Map\n * https://github.com/blueimp/JavaScript-Load-Image\n *\n * Copyright 2013, Sebastian Tschan\n * https://blueimp.net\n *\n * Exif tags mapping based on\n * https://github.com/jseidelin/exif-js\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, module, require */\n\n;(function (factory) {\n 'use strict'\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image', 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-exif'], factory)\n } else if (typeof module === 'object' && module.exports) {\n factory(require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'), require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-exif'))\n } else {\n // Browser globals:\n factory(window.loadImage)\n }\n})(function (loadImage) {\n 'use strict'\n\n var ExifMapProto = loadImage.ExifMap.prototype\n\n ExifMapProto.tags = {\n // =================\n // TIFF tags (IFD0):\n // =================\n 0x0100: 'ImageWidth',\n 0x0101: 'ImageHeight',\n 0x0102: 'BitsPerSample',\n 0x0103: 'Compression',\n 0x0106: 'PhotometricInterpretation',\n 0x0112: 'Orientation',\n 0x0115: 'SamplesPerPixel',\n 0x011c: 'PlanarConfiguration',\n 0x0212: 'YCbCrSubSampling',\n 0x0213: 'YCbCrPositioning',\n 0x011a: 'XResolution',\n 0x011b: 'YResolution',\n 0x0128: 'ResolutionUnit',\n 0x0111: 'StripOffsets',\n 0x0116: 'RowsPerStrip',\n 0x0117: 'StripByteCounts',\n 0x0201: 'JPEGInterchangeFormat',\n 0x0202: 'JPEGInterchangeFormatLength',\n 0x012d: 'TransferFunction',\n 0x013e: 'WhitePoint',\n 0x013f: 'PrimaryChromaticities',\n 0x0211: 'YCbCrCoefficients',\n 0x0214: 'ReferenceBlackWhite',\n 0x0132: 'DateTime',\n 0x010e: 'ImageDescription',\n 0x010f: 'Make',\n 0x0110: 'Model',\n 0x0131: 'Software',\n 0x013b: 'Artist',\n 0x8298: 'Copyright',\n 0x8769: {\n // ExifIFDPointer\n 0x9000: 'ExifVersion', // EXIF version\n 0xa000: 'FlashpixVersion', // Flashpix format version\n 0xa001: 'ColorSpace', // Color space information tag\n 0xa002: 'PixelXDimension', // Valid width of meaningful image\n 0xa003: 'PixelYDimension', // Valid height of meaningful image\n 0xa500: 'Gamma',\n 0x9101: 'ComponentsConfiguration', // Information about channels\n 0x9102: 'CompressedBitsPerPixel', // Compressed bits per pixel\n 0x927c: 'MakerNote', // Any desired information written by the manufacturer\n 0x9286: 'UserComment', // Comments by user\n 0xa004: 'RelatedSoundFile', // Name of related sound file\n 0x9003: 'DateTimeOriginal', // Date and time when the original image was generated\n 0x9004: 'DateTimeDigitized', // Date and time when the image was stored digitally\n 0x9010: 'OffsetTime', // Time zone when the image file was last changed\n 0x9011: 'OffsetTimeOriginal', // Time zone when the image was stored digitally\n 0x9012: 'OffsetTimeDigitized', // Time zone when the image was stored digitally\n 0x9290: 'SubSecTime', // Fractions of seconds for DateTime\n 0x9291: 'SubSecTimeOriginal', // Fractions of seconds for DateTimeOriginal\n 0x9292: 'SubSecTimeDigitized', // Fractions of seconds for DateTimeDigitized\n 0x829a: 'ExposureTime', // Exposure time (in seconds)\n 0x829d: 'FNumber',\n 0x8822: 'ExposureProgram', // Exposure program\n 0x8824: 'SpectralSensitivity', // Spectral sensitivity\n 0x8827: 'PhotographicSensitivity', // EXIF 2.3, ISOSpeedRatings in EXIF 2.2\n 0x8828: 'OECF', // Optoelectric conversion factor\n 0x8830: 'SensitivityType',\n 0x8831: 'StandardOutputSensitivity',\n 0x8832: 'RecommendedExposureIndex',\n 0x8833: 'ISOSpeed',\n 0x8834: 'ISOSpeedLatitudeyyy',\n 0x8835: 'ISOSpeedLatitudezzz',\n 0x9201: 'ShutterSpeedValue', // Shutter speed\n 0x9202: 'ApertureValue', // Lens aperture\n 0x9203: 'BrightnessValue', // Value of brightness\n 0x9204: 'ExposureBias', // Exposure bias\n 0x9205: 'MaxApertureValue', // Smallest F number of lens\n 0x9206: 'SubjectDistance', // Distance to subject in meters\n 0x9207: 'MeteringMode', // Metering mode\n 0x9208: 'LightSource', // Kind of light source\n 0x9209: 'Flash', // Flash status\n 0x9214: 'SubjectArea', // Location and area of main subject\n 0x920a: 'FocalLength', // Focal length of the lens in mm\n 0xa20b: 'FlashEnergy', // Strobe energy in BCPS\n 0xa20c: 'SpatialFrequencyResponse',\n 0xa20e: 'FocalPlaneXResolution', // Number of pixels in width direction per FPRUnit\n 0xa20f: 'FocalPlaneYResolution', // Number of pixels in height direction per FPRUnit\n 0xa210: 'FocalPlaneResolutionUnit', // Unit for measuring the focal plane resolution\n 0xa214: 'SubjectLocation', // Location of subject in image\n 0xa215: 'ExposureIndex', // Exposure index selected on camera\n 0xa217: 'SensingMethod', // Image sensor type\n 0xa300: 'FileSource', // Image source (3 == DSC)\n 0xa301: 'SceneType', // Scene type (1 == directly photographed)\n 0xa302: 'CFAPattern', // Color filter array geometric pattern\n 0xa401: 'CustomRendered', // Special processing\n 0xa402: 'ExposureMode', // Exposure mode\n 0xa403: 'WhiteBalance', // 1 = auto white balance, 2 = manual\n 0xa404: 'DigitalZoomRatio', // Digital zoom ratio\n 0xa405: 'FocalLengthIn35mmFilm',\n 0xa406: 'SceneCaptureType', // Type of scene\n 0xa407: 'GainControl', // Degree of overall image gain adjustment\n 0xa408: 'Contrast', // Direction of contrast processing applied by camera\n 0xa409: 'Saturation', // Direction of saturation processing applied by camera\n 0xa40a: 'Sharpness', // Direction of sharpness processing applied by camera\n 0xa40b: 'DeviceSettingDescription',\n 0xa40c: 'SubjectDistanceRange', // Distance to subject\n 0xa420: 'ImageUniqueID', // Identifier assigned uniquely to each image\n 0xa430: 'CameraOwnerName',\n 0xa431: 'BodySerialNumber',\n 0xa432: 'LensSpecification',\n 0xa433: 'LensMake',\n 0xa434: 'LensModel',\n 0xa435: 'LensSerialNumber'\n },\n 0x8825: {\n // GPSInfoIFDPointer\n 0x0000: 'GPSVersionID',\n 0x0001: 'GPSLatitudeRef',\n 0x0002: 'GPSLatitude',\n 0x0003: 'GPSLongitudeRef',\n 0x0004: 'GPSLongitude',\n 0x0005: 'GPSAltitudeRef',\n 0x0006: 'GPSAltitude',\n 0x0007: 'GPSTimeStamp',\n 0x0008: 'GPSSatellites',\n 0x0009: 'GPSStatus',\n 0x000a: 'GPSMeasureMode',\n 0x000b: 'GPSDOP',\n 0x000c: 'GPSSpeedRef',\n 0x000d: 'GPSSpeed',\n 0x000e: 'GPSTrackRef',\n 0x000f: 'GPSTrack',\n 0x0010: 'GPSImgDirectionRef',\n 0x0011: 'GPSImgDirection',\n 0x0012: 'GPSMapDatum',\n 0x0013: 'GPSDestLatitudeRef',\n 0x0014: 'GPSDestLatitude',\n 0x0015: 'GPSDestLongitudeRef',\n 0x0016: 'GPSDestLongitude',\n 0x0017: 'GPSDestBearingRef',\n 0x0018: 'GPSDestBearing',\n 0x0019: 'GPSDestDistanceRef',\n 0x001a: 'GPSDestDistance',\n 0x001b: 'GPSProcessingMethod',\n 0x001c: 'GPSAreaInformation',\n 0x001d: 'GPSDateStamp',\n 0x001e: 'GPSDifferential',\n 0x001f: 'GPSHPositioningError'\n },\n 0xa005: {\n // InteroperabilityIFDPointer\n 0x0001: 'InteroperabilityIndex'\n }\n }\n\n // IFD1 directory can contain any IFD0 tags:\n ExifMapProto.tags.ifd1 = ExifMapProto.tags\n\n ExifMapProto.stringValues = {\n ExposureProgram: {\n 0: 'Undefined',\n 1: 'Manual',\n 2: 'Normal program',\n 3: 'Aperture priority',\n 4: 'Shutter priority',\n 5: 'Creative program',\n 6: 'Action program',\n 7: 'Portrait mode',\n 8: 'Landscape mode'\n },\n MeteringMode: {\n 0: 'Unknown',\n 1: 'Average',\n 2: 'CenterWeightedAverage',\n 3: 'Spot',\n 4: 'MultiSpot',\n 5: 'Pattern',\n 6: 'Partial',\n 255: 'Other'\n },\n LightSource: {\n 0: 'Unknown',\n 1: 'Daylight',\n 2: 'Fluorescent',\n 3: 'Tungsten (incandescent light)',\n 4: 'Flash',\n 9: 'Fine weather',\n 10: 'Cloudy weather',\n 11: 'Shade',\n 12: 'Daylight fluorescent (D 5700 - 7100K)',\n 13: 'Day white fluorescent (N 4600 - 5400K)',\n 14: 'Cool white fluorescent (W 3900 - 4500K)',\n 15: 'White fluorescent (WW 3200 - 3700K)',\n 17: 'Standard light A',\n 18: 'Standard light B',\n 19: 'Standard light C',\n 20: 'D55',\n 21: 'D65',\n 22: 'D75',\n 23: 'D50',\n 24: 'ISO studio tungsten',\n 255: 'Other'\n },\n Flash: {\n 0x0000: 'Flash did not fire',\n 0x0001: 'Flash fired',\n 0x0005: 'Strobe return light not detected',\n 0x0007: 'Strobe return light detected',\n 0x0009: 'Flash fired, compulsory flash mode',\n 0x000d: 'Flash fired, compulsory flash mode, return light not detected',\n 0x000f: 'Flash fired, compulsory flash mode, return light detected',\n 0x0010: 'Flash did not fire, compulsory flash mode',\n 0x0018: 'Flash did not fire, auto mode',\n 0x0019: 'Flash fired, auto mode',\n 0x001d: 'Flash fired, auto mode, return light not detected',\n 0x001f: 'Flash fired, auto mode, return light detected',\n 0x0020: 'No flash function',\n 0x0041: 'Flash fired, red-eye reduction mode',\n 0x0045: 'Flash fired, red-eye reduction mode, return light not detected',\n 0x0047: 'Flash fired, red-eye reduction mode, return light detected',\n 0x0049: 'Flash fired, compulsory flash mode, red-eye reduction mode',\n 0x004d: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected',\n 0x004f: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected',\n 0x0059: 'Flash fired, auto mode, red-eye reduction mode',\n 0x005d: 'Flash fired, auto mode, return light not detected, red-eye reduction mode',\n 0x005f: 'Flash fired, auto mode, return light detected, red-eye reduction mode'\n },\n SensingMethod: {\n 1: 'Undefined',\n 2: 'One-chip color area sensor',\n 3: 'Two-chip color area sensor',\n 4: 'Three-chip color area sensor',\n 5: 'Color sequential area sensor',\n 7: 'Trilinear sensor',\n 8: 'Color sequential linear sensor'\n },\n SceneCaptureType: {\n 0: 'Standard',\n 1: 'Landscape',\n 2: 'Portrait',\n 3: 'Night scene'\n },\n SceneType: {\n 1: 'Directly photographed'\n },\n CustomRendered: {\n 0: 'Normal process',\n 1: 'Custom process'\n },\n WhiteBalance: {\n 0: 'Auto white balance',\n 1: 'Manual white balance'\n },\n GainControl: {\n 0: 'None',\n 1: 'Low gain up',\n 2: 'High gain up',\n 3: 'Low gain down',\n 4: 'High gain down'\n },\n Contrast: {\n 0: 'Normal',\n 1: 'Soft',\n 2: 'Hard'\n },\n Saturation: {\n 0: 'Normal',\n 1: 'Low saturation',\n 2: 'High saturation'\n },\n Sharpness: {\n 0: 'Normal',\n 1: 'Soft',\n 2: 'Hard'\n },\n SubjectDistanceRange: {\n 0: 'Unknown',\n 1: 'Macro',\n 2: 'Close view',\n 3: 'Distant view'\n },\n FileSource: {\n 3: 'DSC'\n },\n ComponentsConfiguration: {\n 0: '',\n 1: 'Y',\n 2: 'Cb',\n 3: 'Cr',\n 4: 'R',\n 5: 'G',\n 6: 'B'\n },\n Orientation: {\n 1: 'Original',\n 2: 'Horizontal flip',\n 3: 'Rotate 180\u00b0 CCW',\n 4: 'Vertical flip',\n 5: 'Vertical flip + Rotate 90\u00b0 CW',\n 6: 'Rotate 90\u00b0 CW',\n 7: 'Horizontal flip + Rotate 90\u00b0 CW',\n 8: 'Rotate 90\u00b0 CCW'\n }\n }\n\n ExifMapProto.getText = function (name) {\n var value = this.get(name)\n switch (name) {\n case 'LightSource':\n case 'Flash':\n case 'MeteringMode':\n case 'ExposureProgram':\n case 'SensingMethod':\n case 'SceneCaptureType':\n case 'SceneType':\n case 'CustomRendered':\n case 'WhiteBalance':\n case 'GainControl':\n case 'Contrast':\n case 'Saturation':\n case 'Sharpness':\n case 'SubjectDistanceRange':\n case 'FileSource':\n case 'Orientation':\n return this.stringValues[name][value]\n case 'ExifVersion':\n case 'FlashpixVersion':\n if (!value) return\n return String.fromCharCode(value[0], value[1], value[2], value[3])\n case 'ComponentsConfiguration':\n if (!value) return\n return (\n this.stringValues[name][value[0]] +\n this.stringValues[name][value[1]] +\n this.stringValues[name][value[2]] +\n this.stringValues[name][value[3]]\n )\n case 'GPSVersionID':\n if (!value) return\n return value[0] + '.' + value[1] + '.' + value[2] + '.' + value[3]\n }\n return String(value)\n }\n\n ExifMapProto.getAll = function () {\n var map = {}\n var prop\n var obj\n var name\n for (prop in this) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n obj = this[prop]\n if (obj && obj.getAll) {\n map[this.ifds[prop].name] = obj.getAll()\n } else {\n name = this.tags[prop]\n if (name) map[name] = this.getText(name)\n }\n }\n }\n return map\n }\n\n ExifMapProto.getName = function (tagCode) {\n var name = this.tags[tagCode]\n if (typeof name === 'object') return this.ifds[tagCode].name\n return name\n }\n\n // Extend the map of tag names to tag codes:\n ;(function () {\n var tags = ExifMapProto.tags\n var prop\n var ifd\n var subTags\n // Map the tag names to tags:\n for (prop in tags) {\n if (Object.prototype.hasOwnProperty.call(tags, prop)) {\n ifd = ExifMapProto.ifds[prop]\n if (ifd) {\n subTags = tags[prop]\n for (prop in subTags) {\n if (Object.prototype.hasOwnProperty.call(subTags, prop)) {\n ifd.map[subTags[prop]] = Number(prop)\n }\n }\n } else {\n ExifMapProto.map[tags[prop]] = Number(prop)\n }\n }\n }\n })()\n})\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-orientation.js":"/*\n * JavaScript Load Image Orientation\n * https://github.com/blueimp/JavaScript-Load-Image\n *\n * Copyright 2013, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/*\nExif orientation values to correctly display the letter F:\n\n 1 2\n \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\n \u2588\u2588 \u2588\u2588\n \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\n \u2588\u2588 \u2588\u2588\n \u2588\u2588 \u2588\u2588\n\n 3 4\n \u2588\u2588 \u2588\u2588\n \u2588\u2588 \u2588\u2588\n \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\n \u2588\u2588 \u2588\u2588\n \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\n\n 5 6\n\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\n\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\n\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\n\n 7 8\n \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\n \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\n\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\n\n*/\n\n/* global define, module, require */\n\n;(function (factory) {\n 'use strict'\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image', 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-scale', 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-meta'], factory)\n } else if (typeof module === 'object' && module.exports) {\n factory(\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'),\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-scale'),\n require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-meta')\n )\n } else {\n // Browser globals:\n factory(window.loadImage)\n }\n})(function (loadImage) {\n 'use strict'\n\n var originalTransform = loadImage.transform\n var originalRequiresCanvas = loadImage.requiresCanvas\n var originalRequiresMetaData = loadImage.requiresMetaData\n var originalTransformCoordinates = loadImage.transformCoordinates\n var originalGetTransformedOptions = loadImage.getTransformedOptions\n\n ;(function ($) {\n // Guard for non-browser environments (e.g. server-side rendering):\n if (!$.global.document) return\n // black+white 3x2 JPEG, with the following meta information set:\n // - EXIF Orientation: 6 (Rotated 90\u00b0 CCW)\n // Image data layout (B=black, F=white):\n // BFF\n // BBB\n var testImageURL =\n 'data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAA' +\n 'AAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA' +\n 'QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE' +\n 'BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/x' +\n 'ABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAA' +\n 'AAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQ' +\n 'voP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXw' +\n 'H/9k='\n var img = document.createElement('img')\n img.onload = function () {\n // Check if the browser supports automatic image orientation:\n $.orientation = img.width === 2 && img.height === 3\n if ($.orientation) {\n var canvas = $.createCanvas(1, 1, true)\n var ctx = canvas.getContext('2d')\n ctx.drawImage(img, 1, 1, 1, 1, 0, 0, 1, 1)\n // Check if the source image coordinates (sX, sY, sWidth, sHeight) are\n // correctly applied to the auto-orientated image, which should result\n // in a white opaque pixel (e.g. in Safari).\n // Browsers that show a transparent pixel (e.g. Chromium) fail to crop\n // auto-oriented images correctly and require a workaround, e.g.\n // drawing the complete source image to an intermediate canvas first.\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=1074354\n $.orientationCropBug =\n ctx.getImageData(0, 0, 1, 1).data.toString() !== '255,255,255,255'\n }\n }\n img.src = testImageURL\n })(loadImage)\n\n /**\n * Determines if the orientation requires a canvas element.\n *\n * @param {object} [options] Options object\n * @param {boolean} [withMetaData] Is metadata required for orientation\n * @returns {boolean} Returns true if orientation requires canvas/meta\n */\n function requiresCanvasOrientation(options, withMetaData) {\n var orientation = options && options.orientation\n return (\n // Exif orientation for browsers without automatic image orientation:\n (orientation === true && !loadImage.orientation) ||\n // Orientation reset for browsers with automatic image orientation:\n (orientation === 1 && loadImage.orientation) ||\n // Orientation to defined value, requires meta for orientation reset only:\n ((!withMetaData || loadImage.orientation) &&\n orientation > 1 &&\n orientation < 9)\n )\n }\n\n /**\n * Determines if the image requires an orientation change.\n *\n * @param {number} [orientation] Defined orientation value\n * @param {number} [autoOrientation] Auto-orientation based on Exif data\n * @returns {boolean} Returns true if an orientation change is required\n */\n function requiresOrientationChange(orientation, autoOrientation) {\n return (\n orientation !== autoOrientation &&\n ((orientation === 1 && autoOrientation > 1 && autoOrientation < 9) ||\n (orientation > 1 && orientation < 9))\n )\n }\n\n /**\n * Determines orientation combinations that require a rotation by 180\u00b0.\n *\n * The following is a list of combinations that return true:\n *\n * 2 (flip) => 5 (rot90,flip), 7 (rot90,flip), 6 (rot90), 8 (rot90)\n * 4 (flip) => 5 (rot90,flip), 7 (rot90,flip), 6 (rot90), 8 (rot90)\n *\n * 5 (rot90,flip) => 2 (flip), 4 (flip), 6 (rot90), 8 (rot90)\n * 7 (rot90,flip) => 2 (flip), 4 (flip), 6 (rot90), 8 (rot90)\n *\n * 6 (rot90) => 2 (flip), 4 (flip), 5 (rot90,flip), 7 (rot90,flip)\n * 8 (rot90) => 2 (flip), 4 (flip), 5 (rot90,flip), 7 (rot90,flip)\n *\n * @param {number} [orientation] Defined orientation value\n * @param {number} [autoOrientation] Auto-orientation based on Exif data\n * @returns {boolean} Returns true if rotation by 180\u00b0 is required\n */\n function requiresRot180(orientation, autoOrientation) {\n if (autoOrientation > 1 && autoOrientation < 9) {\n switch (orientation) {\n case 2:\n case 4:\n return autoOrientation > 4\n case 5:\n case 7:\n return autoOrientation % 2 === 0\n case 6:\n case 8:\n return (\n autoOrientation === 2 ||\n autoOrientation === 4 ||\n autoOrientation === 5 ||\n autoOrientation === 7\n )\n }\n }\n return false\n }\n\n // Determines if the target image should be a canvas element:\n loadImage.requiresCanvas = function (options) {\n return (\n requiresCanvasOrientation(options) ||\n originalRequiresCanvas.call(loadImage, options)\n )\n }\n\n // Determines if metadata should be loaded automatically:\n loadImage.requiresMetaData = function (options) {\n return (\n requiresCanvasOrientation(options, true) ||\n originalRequiresMetaData.call(loadImage, options)\n )\n }\n\n loadImage.transform = function (img, options, callback, file, data) {\n originalTransform.call(\n loadImage,\n img,\n options,\n function (img, data) {\n if (data) {\n var autoOrientation =\n loadImage.orientation && data.exif && data.exif.get('Orientation')\n if (autoOrientation > 4 && autoOrientation < 9) {\n // Automatic image orientation switched image dimensions\n var originalWidth = data.originalWidth\n var originalHeight = data.originalHeight\n data.originalWidth = originalHeight\n data.originalHeight = originalWidth\n }\n }\n callback(img, data)\n },\n file,\n data\n )\n }\n\n // Transforms coordinate and dimension options\n // based on the given orientation option:\n loadImage.getTransformedOptions = function (img, opts, data) {\n var options = originalGetTransformedOptions.call(loadImage, img, opts)\n var exifOrientation = data.exif && data.exif.get('Orientation')\n var orientation = options.orientation\n var autoOrientation = loadImage.orientation && exifOrientation\n if (orientation === true) orientation = exifOrientation\n if (!requiresOrientationChange(orientation, autoOrientation)) {\n return options\n }\n var top = options.top\n var right = options.right\n var bottom = options.bottom\n var left = options.left\n var newOptions = {}\n for (var i in options) {\n if (Object.prototype.hasOwnProperty.call(options, i)) {\n newOptions[i] = options[i]\n }\n }\n newOptions.orientation = orientation\n if (\n (orientation > 4 && !(autoOrientation > 4)) ||\n (orientation < 5 && autoOrientation > 4)\n ) {\n // Image dimensions and target dimensions are switched\n newOptions.maxWidth = options.maxHeight\n newOptions.maxHeight = options.maxWidth\n newOptions.minWidth = options.minHeight\n newOptions.minHeight = options.minWidth\n newOptions.sourceWidth = options.sourceHeight\n newOptions.sourceHeight = options.sourceWidth\n }\n if (autoOrientation > 1) {\n // Browsers which correctly apply source image coordinates to\n // auto-oriented images\n switch (autoOrientation) {\n case 2:\n // Horizontal flip\n right = options.left\n left = options.right\n break\n case 3:\n // 180\u00b0 Rotate CCW\n top = options.bottom\n right = options.left\n bottom = options.top\n left = options.right\n break\n case 4:\n // Vertical flip\n top = options.bottom\n bottom = options.top\n break\n case 5:\n // Horizontal flip + 90\u00b0 Rotate CCW\n top = options.left\n right = options.bottom\n bottom = options.right\n left = options.top\n break\n case 6:\n // 90\u00b0 Rotate CCW\n top = options.left\n right = options.top\n bottom = options.right\n left = options.bottom\n break\n case 7:\n // Vertical flip + 90\u00b0 Rotate CCW\n top = options.right\n right = options.top\n bottom = options.left\n left = options.bottom\n break\n case 8:\n // 90\u00b0 Rotate CW\n top = options.right\n right = options.bottom\n bottom = options.left\n left = options.top\n break\n }\n // Some orientation combinations require additional rotation by 180\u00b0:\n if (requiresRot180(orientation, autoOrientation)) {\n var tmpTop = top\n var tmpRight = right\n top = bottom\n right = left\n bottom = tmpTop\n left = tmpRight\n }\n }\n newOptions.top = top\n newOptions.right = right\n newOptions.bottom = bottom\n newOptions.left = left\n // Account for defined browser orientation:\n switch (orientation) {\n case 2:\n // Horizontal flip\n newOptions.right = left\n newOptions.left = right\n break\n case 3:\n // 180\u00b0 Rotate CCW\n newOptions.top = bottom\n newOptions.right = left\n newOptions.bottom = top\n newOptions.left = right\n break\n case 4:\n // Vertical flip\n newOptions.top = bottom\n newOptions.bottom = top\n break\n case 5:\n // Vertical flip + 90\u00b0 Rotate CW\n newOptions.top = left\n newOptions.right = bottom\n newOptions.bottom = right\n newOptions.left = top\n break\n case 6:\n // 90\u00b0 Rotate CW\n newOptions.top = right\n newOptions.right = bottom\n newOptions.bottom = left\n newOptions.left = top\n break\n case 7:\n // Horizontal flip + 90\u00b0 Rotate CW\n newOptions.top = right\n newOptions.right = top\n newOptions.bottom = left\n newOptions.left = bottom\n break\n case 8:\n // 90\u00b0 Rotate CCW\n newOptions.top = left\n newOptions.right = top\n newOptions.bottom = right\n newOptions.left = bottom\n break\n }\n return newOptions\n }\n\n // Transform image orientation based on the given EXIF orientation option:\n loadImage.transformCoordinates = function (canvas, options, data) {\n originalTransformCoordinates.call(loadImage, canvas, options, data)\n var orientation = options.orientation\n var autoOrientation =\n loadImage.orientation && data.exif && data.exif.get('Orientation')\n if (!requiresOrientationChange(orientation, autoOrientation)) {\n return\n }\n var ctx = canvas.getContext('2d')\n var width = canvas.width\n var height = canvas.height\n var sourceWidth = width\n var sourceHeight = height\n if (\n (orientation > 4 && !(autoOrientation > 4)) ||\n (orientation < 5 && autoOrientation > 4)\n ) {\n // Image dimensions and target dimensions are switched\n canvas.width = height\n canvas.height = width\n }\n if (orientation > 4) {\n // Destination and source dimensions are switched\n sourceWidth = height\n sourceHeight = width\n }\n // Reset automatic browser orientation:\n switch (autoOrientation) {\n case 2:\n // Horizontal flip\n ctx.translate(sourceWidth, 0)\n ctx.scale(-1, 1)\n break\n case 3:\n // 180\u00b0 Rotate CCW\n ctx.translate(sourceWidth, sourceHeight)\n ctx.rotate(Math.PI)\n break\n case 4:\n // Vertical flip\n ctx.translate(0, sourceHeight)\n ctx.scale(1, -1)\n break\n case 5:\n // Horizontal flip + 90\u00b0 Rotate CCW\n ctx.rotate(-0.5 * Math.PI)\n ctx.scale(-1, 1)\n break\n case 6:\n // 90\u00b0 Rotate CCW\n ctx.rotate(-0.5 * Math.PI)\n ctx.translate(-sourceWidth, 0)\n break\n case 7:\n // Vertical flip + 90\u00b0 Rotate CCW\n ctx.rotate(-0.5 * Math.PI)\n ctx.translate(-sourceWidth, sourceHeight)\n ctx.scale(1, -1)\n break\n case 8:\n // 90\u00b0 Rotate CW\n ctx.rotate(0.5 * Math.PI)\n ctx.translate(0, -sourceHeight)\n break\n }\n // Some orientation combinations require additional rotation by 180\u00b0:\n if (requiresRot180(orientation, autoOrientation)) {\n ctx.translate(sourceWidth, sourceHeight)\n ctx.rotate(Math.PI)\n }\n switch (orientation) {\n case 2:\n // Horizontal flip\n ctx.translate(width, 0)\n ctx.scale(-1, 1)\n break\n case 3:\n // 180\u00b0 Rotate CCW\n ctx.translate(width, height)\n ctx.rotate(Math.PI)\n break\n case 4:\n // Vertical flip\n ctx.translate(0, height)\n ctx.scale(1, -1)\n break\n case 5:\n // Vertical flip + 90\u00b0 Rotate CW\n ctx.rotate(0.5 * Math.PI)\n ctx.scale(1, -1)\n break\n case 6:\n // 90\u00b0 Rotate CW\n ctx.rotate(0.5 * Math.PI)\n ctx.translate(0, -height)\n break\n case 7:\n // Horizontal flip + 90\u00b0 Rotate CW\n ctx.rotate(0.5 * Math.PI)\n ctx.translate(width, -height)\n ctx.scale(-1, 1)\n break\n case 8:\n // 90\u00b0 Rotate CCW\n ctx.rotate(-0.5 * Math.PI)\n ctx.translate(-width, 0)\n break\n }\n }\n})\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-scale.js":"/*\n * JavaScript Load Image Scaling\n * https://github.com/blueimp/JavaScript-Load-Image\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, module, require */\n\n;(function (factory) {\n 'use strict'\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'], factory)\n } else if (typeof module === 'object' && module.exports) {\n factory(require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'))\n } else {\n // Browser globals:\n factory(window.loadImage)\n }\n})(function (loadImage) {\n 'use strict'\n\n var originalTransform = loadImage.transform\n\n loadImage.createCanvas = function (width, height, offscreen) {\n if (offscreen && loadImage.global.OffscreenCanvas) {\n return new OffscreenCanvas(width, height)\n }\n var canvas = document.createElement('canvas')\n canvas.width = width\n canvas.height = height\n return canvas\n }\n\n loadImage.transform = function (img, options, callback, file, data) {\n originalTransform.call(\n loadImage,\n loadImage.scale(img, options, data),\n options,\n callback,\n file,\n data\n )\n }\n\n // Transform image coordinates, allows to override e.g.\n // the canvas orientation based on the orientation option,\n // gets canvas, options and data passed as arguments:\n loadImage.transformCoordinates = function () {}\n\n // Returns transformed options, allows to override e.g.\n // maxWidth, maxHeight and crop options based on the aspectRatio.\n // gets img, options, data passed as arguments:\n loadImage.getTransformedOptions = function (img, options) {\n var aspectRatio = options.aspectRatio\n var newOptions\n var i\n var width\n var height\n if (!aspectRatio) {\n return options\n }\n newOptions = {}\n for (i in options) {\n if (Object.prototype.hasOwnProperty.call(options, i)) {\n newOptions[i] = options[i]\n }\n }\n newOptions.crop = true\n width = img.naturalWidth || img.width\n height = img.naturalHeight || img.height\n if (width / height > aspectRatio) {\n newOptions.maxWidth = height * aspectRatio\n newOptions.maxHeight = height\n } else {\n newOptions.maxWidth = width\n newOptions.maxHeight = width / aspectRatio\n }\n return newOptions\n }\n\n // Canvas render method, allows to implement a different rendering algorithm:\n loadImage.drawImage = function (\n img,\n canvas,\n sourceX,\n sourceY,\n sourceWidth,\n sourceHeight,\n destWidth,\n destHeight,\n options\n ) {\n var ctx = canvas.getContext('2d')\n if (options.imageSmoothingEnabled === false) {\n ctx.msImageSmoothingEnabled = false\n ctx.imageSmoothingEnabled = false\n } else if (options.imageSmoothingQuality) {\n ctx.imageSmoothingQuality = options.imageSmoothingQuality\n }\n ctx.drawImage(\n img,\n sourceX,\n sourceY,\n sourceWidth,\n sourceHeight,\n 0,\n 0,\n destWidth,\n destHeight\n )\n return ctx\n }\n\n // Determines if the target image should be a canvas element:\n loadImage.requiresCanvas = function (options) {\n return options.canvas || options.crop || !!options.aspectRatio\n }\n\n // Scales and/or crops the given image (img or canvas HTML element)\n // using the given options:\n loadImage.scale = function (img, options, data) {\n // eslint-disable-next-line no-param-reassign\n options = options || {}\n // eslint-disable-next-line no-param-reassign\n data = data || {}\n var useCanvas =\n img.getContext ||\n (loadImage.requiresCanvas(options) &&\n !!loadImage.global.HTMLCanvasElement)\n var width = img.naturalWidth || img.width\n var height = img.naturalHeight || img.height\n var destWidth = width\n var destHeight = height\n var maxWidth\n var maxHeight\n var minWidth\n var minHeight\n var sourceWidth\n var sourceHeight\n var sourceX\n var sourceY\n var pixelRatio\n var downsamplingRatio\n var tmp\n var canvas\n /**\n * Scales up image dimensions\n */\n function scaleUp() {\n var scale = Math.max(\n (minWidth || destWidth) / destWidth,\n (minHeight || destHeight) / destHeight\n )\n if (scale > 1) {\n destWidth *= scale\n destHeight *= scale\n }\n }\n /**\n * Scales down image dimensions\n */\n function scaleDown() {\n var scale = Math.min(\n (maxWidth || destWidth) / destWidth,\n (maxHeight || destHeight) / destHeight\n )\n if (scale < 1) {\n destWidth *= scale\n destHeight *= scale\n }\n }\n if (useCanvas) {\n // eslint-disable-next-line no-param-reassign\n options = loadImage.getTransformedOptions(img, options, data)\n sourceX = options.left || 0\n sourceY = options.top || 0\n if (options.sourceWidth) {\n sourceWidth = options.sourceWidth\n if (options.right !== undefined && options.left === undefined) {\n sourceX = width - sourceWidth - options.right\n }\n } else {\n sourceWidth = width - sourceX - (options.right || 0)\n }\n if (options.sourceHeight) {\n sourceHeight = options.sourceHeight\n if (options.bottom !== undefined && options.top === undefined) {\n sourceY = height - sourceHeight - options.bottom\n }\n } else {\n sourceHeight = height - sourceY - (options.bottom || 0)\n }\n destWidth = sourceWidth\n destHeight = sourceHeight\n }\n maxWidth = options.maxWidth\n maxHeight = options.maxHeight\n minWidth = options.minWidth\n minHeight = options.minHeight\n if (useCanvas && maxWidth && maxHeight && options.crop) {\n destWidth = maxWidth\n destHeight = maxHeight\n tmp = sourceWidth / sourceHeight - maxWidth / maxHeight\n if (tmp < 0) {\n sourceHeight = (maxHeight * sourceWidth) / maxWidth\n if (options.top === undefined && options.bottom === undefined) {\n sourceY = (height - sourceHeight) / 2\n }\n } else if (tmp > 0) {\n sourceWidth = (maxWidth * sourceHeight) / maxHeight\n if (options.left === undefined && options.right === undefined) {\n sourceX = (width - sourceWidth) / 2\n }\n }\n } else {\n if (options.contain || options.cover) {\n minWidth = maxWidth = maxWidth || minWidth\n minHeight = maxHeight = maxHeight || minHeight\n }\n if (options.cover) {\n scaleDown()\n scaleUp()\n } else {\n scaleUp()\n scaleDown()\n }\n }\n if (useCanvas) {\n pixelRatio = options.pixelRatio\n if (\n pixelRatio > 1 &&\n // Check if the image has not yet had the device pixel ratio applied:\n !(\n img.style.width &&\n Math.floor(parseFloat(img.style.width, 10)) ===\n Math.floor(width / pixelRatio)\n )\n ) {\n destWidth *= pixelRatio\n destHeight *= pixelRatio\n }\n // Check if workaround for Chromium orientation crop bug is required:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1074354\n if (\n loadImage.orientationCropBug &&\n !img.getContext &&\n (sourceX || sourceY || sourceWidth !== width || sourceHeight !== height)\n ) {\n // Write the complete source image to an intermediate canvas first:\n tmp = img\n // eslint-disable-next-line no-param-reassign\n img = loadImage.createCanvas(width, height, true)\n loadImage.drawImage(\n tmp,\n img,\n 0,\n 0,\n width,\n height,\n width,\n height,\n options\n )\n }\n downsamplingRatio = options.downsamplingRatio\n if (\n downsamplingRatio > 0 &&\n downsamplingRatio < 1 &&\n destWidth < sourceWidth &&\n destHeight < sourceHeight\n ) {\n while (sourceWidth * downsamplingRatio > destWidth) {\n canvas = loadImage.createCanvas(\n sourceWidth * downsamplingRatio,\n sourceHeight * downsamplingRatio,\n true\n )\n loadImage.drawImage(\n img,\n canvas,\n sourceX,\n sourceY,\n sourceWidth,\n sourceHeight,\n canvas.width,\n canvas.height,\n options\n )\n sourceX = 0\n sourceY = 0\n sourceWidth = canvas.width\n sourceHeight = canvas.height\n // eslint-disable-next-line no-param-reassign\n img = canvas\n }\n }\n canvas = loadImage.createCanvas(destWidth, destHeight)\n loadImage.transformCoordinates(canvas, options, data)\n if (pixelRatio > 1) {\n canvas.style.width = canvas.width / pixelRatio + 'px'\n }\n loadImage\n .drawImage(\n img,\n canvas,\n sourceX,\n sourceY,\n sourceWidth,\n sourceHeight,\n destWidth,\n destHeight,\n options\n )\n .setTransform(1, 0, 0, 1, 0, 0) // reset to the identity matrix\n return canvas\n }\n img.width = destWidth\n img.height = destHeight\n return img\n }\n})\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image.js":"/*\n * JavaScript Load Image\n * https://github.com/blueimp/JavaScript-Load-Image\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, module, Promise */\n\n;(function ($) {\n 'use strict'\n\n var urlAPI = $.URL || $.webkitURL\n\n /**\n * Creates an object URL for a given File object.\n *\n * @param {Blob} blob Blob object\n * @returns {string|boolean} Returns object URL if API exists, else false.\n */\n function createObjectURL(blob) {\n return urlAPI ? urlAPI.createObjectURL(blob) : false\n }\n\n /**\n * Revokes a given object URL.\n *\n * @param {string} url Blob object URL\n * @returns {undefined|boolean} Returns undefined if API exists, else false.\n */\n function revokeObjectURL(url) {\n return urlAPI ? urlAPI.revokeObjectURL(url) : false\n }\n\n /**\n * Helper function to revoke an object URL\n *\n * @param {string} url Blob Object URL\n * @param {object} [options] Options object\n */\n function revokeHelper(url, options) {\n if (url && url.slice(0, 5) === 'blob:' && !(options && options.noRevoke)) {\n revokeObjectURL(url)\n }\n }\n\n /**\n * Loads a given File object via FileReader interface.\n *\n * @param {Blob} file Blob object\n * @param {Function} onload Load event callback\n * @param {Function} [onerror] Error/Abort event callback\n * @param {string} [method=readAsDataURL] FileReader method\n * @returns {FileReader|boolean} Returns FileReader if API exists, else false.\n */\n function readFile(file, onload, onerror, method) {\n if (!$.FileReader) return false\n var reader = new FileReader()\n reader.onload = function () {\n onload.call(reader, this.result)\n }\n if (onerror) {\n reader.onabort = reader.onerror = function () {\n onerror.call(reader, this.error)\n }\n }\n var readerMethod = reader[method || 'readAsDataURL']\n if (readerMethod) {\n readerMethod.call(reader, file)\n return reader\n }\n }\n\n /**\n * Cross-frame instanceof check.\n *\n * @param {string} type Instance type\n * @param {object} obj Object instance\n * @returns {boolean} Returns true if the object is of the given instance.\n */\n function isInstanceOf(type, obj) {\n // Cross-frame instanceof check\n return Object.prototype.toString.call(obj) === '[object ' + type + ']'\n }\n\n /**\n * @typedef { HTMLImageElement|HTMLCanvasElement } Result\n */\n\n /**\n * Loads an image for a given File object.\n *\n * @param {Blob|string} file Blob object or image URL\n * @param {Function|object} [callback] Image load event callback or options\n * @param {object} [options] Options object\n * @returns {HTMLImageElement|FileReader|Promise<Result>} Object\n */\n function loadImage(file, callback, options) {\n /**\n * Promise executor\n *\n * @param {Function} resolve Resolution function\n * @param {Function} reject Rejection function\n * @returns {HTMLImageElement|FileReader} Object\n */\n function executor(resolve, reject) {\n var img = document.createElement('img')\n var url\n /**\n * Callback for the fetchBlob call.\n *\n * @param {HTMLImageElement|HTMLCanvasElement} img Error object\n * @param {object} data Data object\n * @returns {undefined} Undefined\n */\n function resolveWrapper(img, data) {\n if (resolve === reject) {\n // Not using Promises\n if (resolve) resolve(img, data)\n return\n } else if (img instanceof Error) {\n reject(img)\n return\n }\n data = data || {} // eslint-disable-line no-param-reassign\n data.image = img\n resolve(data)\n }\n /**\n * Callback for the fetchBlob call.\n *\n * @param {Blob} blob Blob object\n * @param {Error} err Error object\n */\n function fetchBlobCallback(blob, err) {\n if (err && $.console) console.log(err) // eslint-disable-line no-console\n if (blob && isInstanceOf('Blob', blob)) {\n file = blob // eslint-disable-line no-param-reassign\n url = createObjectURL(file)\n } else {\n url = file\n if (options && options.crossOrigin) {\n img.crossOrigin = options.crossOrigin\n }\n }\n img.src = url\n }\n img.onerror = function (event) {\n revokeHelper(url, options)\n if (reject) reject.call(img, event)\n }\n img.onload = function () {\n revokeHelper(url, options)\n var data = {\n originalWidth: img.naturalWidth || img.width,\n originalHeight: img.naturalHeight || img.height\n }\n try {\n loadImage.transform(img, options, resolveWrapper, file, data)\n } catch (error) {\n if (reject) reject(error)\n }\n }\n if (typeof file === 'string') {\n if (loadImage.requiresMetaData(options)) {\n loadImage.fetchBlob(file, fetchBlobCallback, options)\n } else {\n fetchBlobCallback()\n }\n return img\n } else if (isInstanceOf('Blob', file) || isInstanceOf('File', file)) {\n url = createObjectURL(file)\n if (url) {\n img.src = url\n return img\n }\n return readFile(\n file,\n function (url) {\n img.src = url\n },\n reject\n )\n }\n }\n if ($.Promise && typeof callback !== 'function') {\n options = callback // eslint-disable-line no-param-reassign\n return new Promise(executor)\n }\n return executor(callback, callback)\n }\n\n // Determines if metadata should be loaded automatically.\n // Requires the load image meta extension to load metadata.\n loadImage.requiresMetaData = function (options) {\n return options && options.meta\n }\n\n // If the callback given to this function returns a blob, it is used as image\n // source instead of the original url and overrides the file argument used in\n // the onload and onerror event callbacks:\n loadImage.fetchBlob = function (url, callback) {\n callback()\n }\n\n loadImage.transform = function (img, options, callback, file, data) {\n callback(img, data)\n }\n\n loadImage.global = $\n loadImage.readFile = readFile\n loadImage.isInstanceOf = isInstanceOf\n loadImage.createObjectURL = createObjectURL\n loadImage.revokeObjectURL = revokeObjectURL\n\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return loadImage\n })\n } else if (typeof module === 'object' && module.exports) {\n module.exports = loadImage\n } else {\n $.loadImage = loadImage\n }\n})((typeof window !== 'undefined' && window) || this)\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/index.js":"/* global module, require */\n\nmodule.exports = require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image')\n\nrequire('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-scale')\nrequire('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-meta')\nrequire('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-fetch')\nrequire('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-exif')\nrequire('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-exif-map')\nrequire('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-iptc')\nrequire('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-iptc-map')\nrequire('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-orientation')\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-iptc-map.js":"/*\n * JavaScript Load Image IPTC Map\n * https://github.com/blueimp/JavaScript-Load-Image\n *\n * Copyright 2013, Sebastian Tschan\n * Copyright 2018, Dave Bevan\n *\n * IPTC tags mapping based on\n * https://iptc.org/standards/photo-metadata\n * https://exiftool.org/TagNames/IPTC.html\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, module, require */\n\n;(function (factory) {\n 'use strict'\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image', 'Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-iptc'], factory)\n } else if (typeof module === 'object' && module.exports) {\n factory(require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'), require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-iptc'))\n } else {\n // Browser globals:\n factory(window.loadImage)\n }\n})(function (loadImage) {\n 'use strict'\n\n var IptcMapProto = loadImage.IptcMap.prototype\n\n IptcMapProto.tags = {\n 0: 'ApplicationRecordVersion',\n 3: 'ObjectTypeReference',\n 4: 'ObjectAttributeReference',\n 5: 'ObjectName',\n 7: 'EditStatus',\n 8: 'EditorialUpdate',\n 10: 'Urgency',\n 12: 'SubjectReference',\n 15: 'Category',\n 20: 'SupplementalCategories',\n 22: 'FixtureIdentifier',\n 25: 'Keywords',\n 26: 'ContentLocationCode',\n 27: 'ContentLocationName',\n 30: 'ReleaseDate',\n 35: 'ReleaseTime',\n 37: 'ExpirationDate',\n 38: 'ExpirationTime',\n 40: 'SpecialInstructions',\n 42: 'ActionAdvised',\n 45: 'ReferenceService',\n 47: 'ReferenceDate',\n 50: 'ReferenceNumber',\n 55: 'DateCreated',\n 60: 'TimeCreated',\n 62: 'DigitalCreationDate',\n 63: 'DigitalCreationTime',\n 65: 'OriginatingProgram',\n 70: 'ProgramVersion',\n 75: 'ObjectCycle',\n 80: 'Byline',\n 85: 'BylineTitle',\n 90: 'City',\n 92: 'Sublocation',\n 95: 'State',\n 100: 'CountryCode',\n 101: 'Country',\n 103: 'OriginalTransmissionReference',\n 105: 'Headline',\n 110: 'Credit',\n 115: 'Source',\n 116: 'CopyrightNotice',\n 118: 'Contact',\n 120: 'Caption',\n 121: 'LocalCaption',\n 122: 'Writer',\n 125: 'RasterizedCaption',\n 130: 'ImageType',\n 131: 'ImageOrientation',\n 135: 'LanguageIdentifier',\n 150: 'AudioType',\n 151: 'AudioSamplingRate',\n 152: 'AudioSamplingResolution',\n 153: 'AudioDuration',\n 154: 'AudioOutcue',\n 184: 'JobID',\n 185: 'MasterDocumentID',\n 186: 'ShortDocumentID',\n 187: 'UniqueDocumentID',\n 188: 'OwnerID',\n 200: 'ObjectPreviewFileFormat',\n 201: 'ObjectPreviewFileVersion',\n 202: 'ObjectPreviewData',\n 221: 'Prefs',\n 225: 'ClassifyState',\n 228: 'SimilarityIndex',\n 230: 'DocumentNotes',\n 231: 'DocumentHistory',\n 232: 'ExifCameraInfo',\n 255: 'CatalogSets'\n }\n\n IptcMapProto.stringValues = {\n 10: {\n 0: '0 (reserved)',\n 1: '1 (most urgent)',\n 2: '2',\n 3: '3',\n 4: '4',\n 5: '5 (normal urgency)',\n 6: '6',\n 7: '7',\n 8: '8 (least urgent)',\n 9: '9 (user-defined priority)'\n },\n 75: {\n a: 'Morning',\n b: 'Both Morning and Evening',\n p: 'Evening'\n },\n 131: {\n L: 'Landscape',\n P: 'Portrait',\n S: 'Square'\n }\n }\n\n IptcMapProto.getText = function (id) {\n var value = this.get(id)\n var tagCode = this.map[id]\n var stringValue = this.stringValues[tagCode]\n if (stringValue) return stringValue[value]\n return String(value)\n }\n\n IptcMapProto.getAll = function () {\n var map = {}\n var prop\n var name\n for (prop in this) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n name = this.tags[prop]\n if (name) map[name] = this.getText(name)\n }\n }\n return map\n }\n\n IptcMapProto.getName = function (tagCode) {\n return this.tags[tagCode]\n }\n\n // Extend the map of tag names to tag codes:\n ;(function () {\n var tags = IptcMapProto.tags\n var map = IptcMapProto.map || {}\n var prop\n // Map the tag names to tags:\n for (prop in tags) {\n if (Object.prototype.hasOwnProperty.call(tags, prop)) {\n map[tags[prop]] = Number(prop)\n }\n }\n })()\n})\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image-meta.js":"/*\n * JavaScript Load Image Meta\n * https://github.com/blueimp/JavaScript-Load-Image\n *\n * Copyright 2013, Sebastian Tschan\n * https://blueimp.net\n *\n * Image metadata handling implementation\n * based on the help and contribution of\n * Achim St\u00f6hr.\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, module, require, Promise, DataView, Uint8Array, ArrayBuffer */\n\n;(function (factory) {\n 'use strict'\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'], factory)\n } else if (typeof module === 'object' && module.exports) {\n factory(require('Mageplaza_Core/lib/fileUploader/vendor/blueimp-load-image/js/load-image'))\n } else {\n // Browser globals:\n factory(window.loadImage)\n }\n})(function (loadImage) {\n 'use strict'\n\n var global = loadImage.global\n var originalTransform = loadImage.transform\n\n var blobSlice =\n global.Blob &&\n (Blob.prototype.slice ||\n Blob.prototype.webkitSlice ||\n Blob.prototype.mozSlice)\n\n var bufferSlice =\n (global.ArrayBuffer && ArrayBuffer.prototype.slice) ||\n function (begin, end) {\n // Polyfill for IE10, which does not support ArrayBuffer.slice\n // eslint-disable-next-line no-param-reassign\n end = end || this.byteLength - begin\n var arr1 = new Uint8Array(this, begin, end)\n var arr2 = new Uint8Array(end)\n arr2.set(arr1)\n return arr2.buffer\n }\n\n var metaDataParsers = {\n jpeg: {\n 0xffe1: [], // APP1 marker\n 0xffed: [] // APP13 marker\n }\n }\n\n /**\n * Parses image metadata and calls the callback with an object argument\n * with the following property:\n * - imageHead: The complete image head as ArrayBuffer\n * The options argument accepts an object and supports the following\n * properties:\n * - maxMetaDataSize: Defines the maximum number of bytes to parse.\n * - disableImageHead: Disables creating the imageHead property.\n *\n * @param {Blob} file Blob object\n * @param {Function} [callback] Callback function\n * @param {object} [options] Parsing options\n * @param {object} [data] Result data object\n * @returns {Promise<object>|undefined} Returns Promise if no callback given.\n */\n function parseMetaData(file, callback, options, data) {\n var that = this\n /**\n * Promise executor\n *\n * @param {Function} resolve Resolution function\n * @param {Function} reject Rejection function\n * @returns {undefined} Undefined\n */\n function executor(resolve, reject) {\n if (\n !(\n global.DataView &&\n blobSlice &&\n file &&\n file.size >= 12 &&\n file.type === 'image/jpeg'\n )\n ) {\n // Nothing to parse\n return resolve(data)\n }\n // 256 KiB should contain all EXIF/ICC/IPTC segments:\n var maxMetaDataSize = options.maxMetaDataSize || 262144\n if (\n !loadImage.readFile(\n blobSlice.call(file, 0, maxMetaDataSize),\n function (buffer) {\n // Note on endianness:\n // Since the marker and length bytes in JPEG files are always\n // stored in big endian order, we can leave the endian parameter\n // of the DataView methods undefined, defaulting to big endian.\n var dataView = new DataView(buffer)\n // Check for the JPEG marker (0xffd8):\n if (dataView.getUint16(0) !== 0xffd8) {\n return reject(\n new Error('Invalid JPEG file: Missing JPEG marker.')\n )\n }\n var offset = 2\n var maxOffset = dataView.byteLength - 4\n var headLength = offset\n var markerBytes\n var markerLength\n var parsers\n var i\n while (offset < maxOffset) {\n markerBytes = dataView.getUint16(offset)\n // Search for APPn (0xffeN) and COM (0xfffe) markers,\n // which contain application-specific metadata like\n // Exif, ICC and IPTC data and text comments:\n if (\n (markerBytes >= 0xffe0 && markerBytes <= 0xffef) ||\n markerBytes === 0xfffe\n ) {\n // The marker bytes (2) are always followed by\n // the length bytes (2), indicating the length of the\n // marker segment, which includes the length bytes,\n // but not the marker bytes, so we add 2:\n markerLength = dataView.getUint16(offset + 2) + 2\n if (offset + markerLength > dataView.byteLength) {\n // eslint-disable-next-line no-console\n console.log('Invalid JPEG metadata: Invalid segment size.')\n break\n }\n parsers = metaDataParsers.jpeg[markerBytes]\n if (parsers && !options.disableMetaDataParsers) {\n for (i = 0; i < parsers.length; i += 1) {\n parsers[i].call(\n that,\n dataView,\n offset,\n markerLength,\n data,\n options\n )\n }\n }\n offset += markerLength\n headLength = offset\n } else {\n // Not an APPn or COM marker, probably safe to\n // assume that this is the end of the metadata\n break\n }\n }\n // Meta length must be longer than JPEG marker (2)\n // plus APPn marker (2), followed by length bytes (2):\n if (!options.disableImageHead && headLength > 6) {\n data.imageHead = bufferSlice.call(buffer, 0, headLength)\n }\n resolve(data)\n },\n reject,\n 'readAsArrayBuffer'\n )\n ) {\n // No support for the FileReader interface, nothing to parse\n resolve(data)\n }\n }\n options = options || {} // eslint-disable-line no-param-reassign\n if (global.Promise && typeof callback !== 'function') {\n options = callback || {} // eslint-disable-line no-param-reassign\n data = options // eslint-disable-line no-param-reassign\n return new Promise(executor)\n }\n data = data || {} // eslint-disable-line no-param-reassign\n return executor(callback, callback)\n }\n\n /**\n * Replaces the head of a JPEG Blob\n *\n * @param {Blob} blob Blob object\n * @param {ArrayBuffer} oldHead Old JPEG head\n * @param {ArrayBuffer} newHead New JPEG head\n * @returns {Blob} Combined Blob\n */\n function replaceJPEGHead(blob, oldHead, newHead) {\n if (!blob || !oldHead || !newHead) return null\n return new Blob([newHead, blobSlice.call(blob, oldHead.byteLength)], {\n type: 'image/jpeg'\n })\n }\n\n /**\n * Replaces the image head of a JPEG blob with the given one.\n * Returns a Promise or calls the callback with the new Blob.\n *\n * @param {Blob} blob Blob object\n * @param {ArrayBuffer} head New JPEG head\n * @param {Function} [callback] Callback function\n * @returns {Promise<Blob|null>|undefined} Combined Blob\n */\n function replaceHead(blob, head, callback) {\n var options = { maxMetaDataSize: 256, disableMetaDataParsers: true }\n if (!callback && global.Promise) {\n return parseMetaData(blob, options).then(function (data) {\n return replaceJPEGHead(blob, data.imageHead, head)\n })\n }\n parseMetaData(\n blob,\n function (data) {\n callback(replaceJPEGHead(blob, data.imageHead, head))\n },\n options\n )\n }\n\n loadImage.transform = function (img, options, callback, file, data) {\n if (loadImage.requiresMetaData(options)) {\n data = data || {} // eslint-disable-line no-param-reassign\n parseMetaData(\n file,\n function (result) {\n if (result !== data) {\n // eslint-disable-next-line no-console\n if (global.console) console.log(result)\n result = data // eslint-disable-line no-param-reassign\n }\n originalTransform.call(\n loadImage,\n img,\n options,\n callback,\n file,\n result\n )\n },\n options,\n data\n )\n } else {\n originalTransform.apply(loadImage, arguments)\n }\n }\n\n loadImage.blobSlice = blobSlice\n loadImage.bufferSlice = bufferSlice\n loadImage.replaceHead = replaceHead\n loadImage.parseMetaData = parseMetaData\n loadImage.metaDataParsers = metaDataParsers\n})\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-canvas-to-blob/js/canvas-to-blob.js":"/*\n * JavaScript Canvas to Blob\n * https://github.com/blueimp/JavaScript-Canvas-to-Blob\n *\n * Copyright 2012, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on stackoverflow user Stoive's code snippet:\n * http://stackoverflow.com/q/4998908\n */\n\n/* global define, Uint8Array, ArrayBuffer, module */\n\n;(function (window) {\n 'use strict'\n\n var CanvasPrototype =\n window.HTMLCanvasElement && window.HTMLCanvasElement.prototype\n var hasBlobConstructor =\n window.Blob &&\n (function () {\n try {\n return Boolean(new Blob())\n } catch (e) {\n return false\n }\n })()\n var hasArrayBufferViewSupport =\n hasBlobConstructor &&\n window.Uint8Array &&\n (function () {\n try {\n return new Blob([new Uint8Array(100)]).size === 100\n } catch (e) {\n return false\n }\n })()\n var BlobBuilder =\n window.BlobBuilder ||\n window.WebKitBlobBuilder ||\n window.MozBlobBuilder ||\n window.MSBlobBuilder\n var dataURIPattern = /^data:((.*?)(;charset=.*?)?)(;base64)?,/\n var dataURLtoBlob =\n (hasBlobConstructor || BlobBuilder) &&\n window.atob &&\n window.ArrayBuffer &&\n window.Uint8Array &&\n function (dataURI) {\n var matches,\n mediaType,\n isBase64,\n dataString,\n byteString,\n arrayBuffer,\n intArray,\n i,\n bb\n // Parse the dataURI components as per RFC 2397\n matches = dataURI.match(dataURIPattern)\n if (!matches) {\n throw new Error('invalid data URI')\n }\n // Default to text/plain;charset=US-ASCII\n mediaType = matches[2]\n ? matches[1]\n : 'text/plain' + (matches[3] || ';charset=US-ASCII')\n isBase64 = !!matches[4]\n dataString = dataURI.slice(matches[0].length)\n if (isBase64) {\n // Convert base64 to raw binary data held in a string:\n byteString = atob(dataString)\n } else {\n // Convert base64/URLEncoded data component to raw binary:\n byteString = decodeURIComponent(dataString)\n }\n // Write the bytes of the string to an ArrayBuffer:\n arrayBuffer = new ArrayBuffer(byteString.length)\n intArray = new Uint8Array(arrayBuffer)\n for (i = 0; i < byteString.length; i += 1) {\n intArray[i] = byteString.charCodeAt(i)\n }\n // Write the ArrayBuffer (or ArrayBufferView) to a blob:\n if (hasBlobConstructor) {\n return new Blob([hasArrayBufferViewSupport ? intArray : arrayBuffer], {\n type: mediaType\n })\n }\n bb = new BlobBuilder()\n bb.append(arrayBuffer)\n return bb.getBlob(mediaType)\n }\n if (window.HTMLCanvasElement && !CanvasPrototype.toBlob) {\n if (CanvasPrototype.mozGetAsFile) {\n CanvasPrototype.toBlob = function (callback, type, quality) {\n var self = this\n setTimeout(function () {\n if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) {\n callback(dataURLtoBlob(self.toDataURL(type, quality)))\n } else {\n callback(self.mozGetAsFile('blob', type))\n }\n })\n }\n } else if (CanvasPrototype.toDataURL && dataURLtoBlob) {\n if (CanvasPrototype.msToBlob) {\n CanvasPrototype.toBlob = function (callback, type, quality) {\n var self = this\n setTimeout(function () {\n if (\n ((type && type !== 'image/png') || quality) &&\n CanvasPrototype.toDataURL &&\n dataURLtoBlob\n ) {\n callback(dataURLtoBlob(self.toDataURL(type, quality)))\n } else {\n callback(self.msToBlob(type))\n }\n })\n }\n } else {\n CanvasPrototype.toBlob = function (callback, type, quality) {\n var self = this\n setTimeout(function () {\n callback(dataURLtoBlob(self.toDataURL(type, quality)))\n })\n }\n }\n }\n }\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return dataURLtoBlob\n })\n } else if (typeof module === 'object' && module.exports) {\n module.exports = dataURLtoBlob\n } else {\n window.dataURLtoBlob = dataURLtoBlob\n }\n})(window)\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-tmpl/js/runtime.js":"/*\n * JavaScript Templates Runtime\n * https://github.com/blueimp/JavaScript-Templates\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define */\n\n/* eslint-disable strict */\n\n;(function ($) {\n 'use strict'\n var tmpl = function (id, data) {\n var f = tmpl.cache[id]\n return data\n ? f(data, tmpl)\n : function (data) {\n return f(data, tmpl)\n }\n }\n tmpl.cache = {}\n tmpl.encReg = /[<>&\"'\\x00]/g // eslint-disable-line no-control-regex\n tmpl.encMap = {\n '<': '<',\n '>': '>',\n '&': '&',\n '\"': '"',\n \"'\": '''\n }\n tmpl.encode = function (s) {\n // eslint-disable-next-line eqeqeq\n return (s == null ? '' : '' + s).replace(tmpl.encReg, function (c) {\n return tmpl.encMap[c] || ''\n })\n }\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return tmpl\n })\n } else if (typeof module === 'object' && module.exports) {\n module.exports = tmpl\n } else {\n $.tmpl = tmpl\n }\n})(this)\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-tmpl/js/tmpl.js":"/*\n * JavaScript Templates\n * https://github.com/blueimp/JavaScript-Templates\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Inspired by John Resig's JavaScript Micro-Templating:\n * http://ejohn.org/blog/javascript-micro-templating/\n */\n\n/* global define */\n\n/* eslint-disable strict */\n\n;(function ($) {\n 'use strict'\n var tmpl = function (str, data) {\n var f = !/[^\\w\\-.:]/.test(str)\n ? (tmpl.cache[str] = tmpl.cache[str] || tmpl(tmpl.load(str)))\n : new Function( // eslint-disable-line no-new-func\n tmpl.arg + ',tmpl',\n 'var _e=tmpl.encode' +\n tmpl.helper +\n \",_s='\" +\n str.replace(tmpl.regexp, tmpl.func) +\n \"';return _s;\"\n )\n return data\n ? f(data, tmpl)\n : function (data) {\n return f(data, tmpl)\n }\n }\n tmpl.cache = {}\n tmpl.load = function (id) {\n return document.getElementById(id).innerHTML\n }\n tmpl.regexp = /([\\s'\\\\])(?!(?:[^{]|\\{(?!%))*%\\})|(?:\\{%(=|#)([\\s\\S]+?)%\\})|(\\{%)|(%\\})/g\n tmpl.func = function (s, p1, p2, p3, p4, p5) {\n if (p1) {\n // whitespace, quote and backspace in HTML context\n return (\n {\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t',\n ' ': ' '\n }[p1] || '\\\\' + p1\n )\n }\n if (p2) {\n // interpolation: {%=prop%}, or unescaped: {%#prop%}\n if (p2 === '=') {\n return \"'+_e(\" + p3 + \")+'\"\n }\n return \"'+(\" + p3 + \"==null?'':\" + p3 + \")+'\"\n }\n if (p4) {\n // evaluation start tag: {%\n return \"';\"\n }\n if (p5) {\n // evaluation end tag: %}\n return \"_s+='\"\n }\n }\n tmpl.encReg = /[<>&\"'\\x00]/g // eslint-disable-line no-control-regex\n tmpl.encMap = {\n '<': '<',\n '>': '>',\n '&': '&',\n '\"': '"',\n \"'\": '''\n }\n tmpl.encode = function (s) {\n // eslint-disable-next-line eqeqeq\n return (s == null ? '' : '' + s).replace(tmpl.encReg, function (c) {\n return tmpl.encMap[c] || ''\n })\n }\n tmpl.arg = 'o'\n tmpl.helper =\n \",print=function(s,e){_s+=e?(s==null?'':s):_e(s);}\" +\n ',include=function(s,d){_s+=tmpl(s,d);}'\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return tmpl\n })\n } else if (typeof module === 'object' && module.exports) {\n module.exports = tmpl\n } else {\n $.tmpl = tmpl\n }\n})(this)\n","Mageplaza_Core/lib/fileUploader/vendor/blueimp-tmpl/js/compile.js":"#!/usr/bin/env node\n/*\n * JavaScript Templates Compiler\n * https://github.com/blueimp/JavaScript-Templates\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* eslint-disable strict */\n/* eslint-disable no-console */\n\n;(function () {\n 'use strict'\n var path = require('path')\n var tmpl = require(path.join(__dirname, 'tmpl.js'))\n var fs = require('fs')\n // Retrieve the content of the minimal runtime:\n var runtime = fs.readFileSync(path.join(__dirname, 'runtime.js'), 'utf8')\n // A regular expression to parse templates from script tags in a HTML page:\n var regexp = /<script( id=\"([\\w-]+)\")? type=\"text\\/x-tmpl\"( id=\"([\\w-]+)\")?>([\\s\\S]+?)<\\/script>/gi\n // A regular expression to match the helper function names:\n var helperRegexp = new RegExp(\n tmpl.helper.match(/\\w+(?=\\s*=\\s*function\\s*\\()/g).join('\\\\s*\\\\(|') +\n '\\\\s*\\\\('\n )\n // A list to store the function bodies:\n var list = []\n var code\n // Extend the Templating engine with a print method for the generated functions:\n tmpl.print = function (str) {\n // Only add helper functions if they are used inside of the template:\n var helper = helperRegexp.test(str) ? tmpl.helper : ''\n var body = str.replace(tmpl.regexp, tmpl.func)\n if (helper || /_e\\s*\\(/.test(body)) {\n helper = '_e=tmpl.encode' + helper + ','\n }\n return (\n 'function(' +\n tmpl.arg +\n ',tmpl){' +\n ('var ' + helper + \"_s='\" + body + \"';return _s;\")\n .split(\"_s+='';\")\n .join('') +\n '}'\n )\n }\n // Loop through the command line arguments:\n process.argv.forEach(function (file, index) {\n var listLength = list.length\n var stats\n var content\n var result\n var id\n // Skip the first two arguments, which are \"node\" and the script:\n if (index > 1) {\n stats = fs.statSync(file)\n if (!stats.isFile()) {\n console.error(file + ' is not a file.')\n return\n }\n content = fs.readFileSync(file, 'utf8')\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // Find templates in script tags:\n result = regexp.exec(content)\n if (!result) {\n break\n }\n id = result[2] || result[4]\n list.push(\"'\" + id + \"':\" + tmpl.print(result[5]))\n }\n if (listLength === list.length) {\n // No template script tags found, use the complete content:\n id = path.basename(file, path.extname(file))\n list.push(\"'\" + id + \"':\" + tmpl.print(content))\n }\n }\n })\n if (!list.length) {\n console.error('Missing input file.')\n return\n }\n // Combine the generated functions as cache of the minimal runtime:\n code = runtime.replace('{}', '{' + list.join(',') + '}')\n // Print the resulting code to the console output:\n console.log(code)\n})()\n","Mageplaza_Core/lib/fileUploader/cors/jquery.postmessage-transport.js":"/*\n * jQuery postMessage Transport Plugin\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, require */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['jquery'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(require('jquery'));\n } else {\n // Browser globals:\n factory(window.jQuery);\n }\n})(function ($) {\n 'use strict';\n\n var counter = 0,\n names = [\n 'accepts',\n 'cache',\n 'contents',\n 'contentType',\n 'crossDomain',\n 'data',\n 'dataType',\n 'headers',\n 'ifModified',\n 'mimeType',\n 'password',\n 'processData',\n 'timeout',\n 'traditional',\n 'type',\n 'url',\n 'username'\n ],\n convert = function (p) {\n return p;\n };\n\n $.ajaxSetup({\n converters: {\n 'postmessage text': convert,\n 'postmessage json': convert,\n 'postmessage html': convert\n }\n });\n\n $.ajaxTransport('postmessage', function (options) {\n if (options.postMessage && window.postMessage) {\n var iframe,\n loc = $('<a></a>').prop('href', options.postMessage)[0],\n target = loc.protocol + '//' + loc.host,\n xhrUpload = options.xhr().upload;\n // IE always includes the port for the host property of a link\n // element, but not in the location.host or origin property for the\n // default http port 80 and https port 443, so we strip it:\n if (/^(http:\\/\\/.+:80)|(https:\\/\\/.+:443)$/.test(target)) {\n target = target.replace(/:(80|443)$/, '');\n }\n return {\n send: function (_, completeCallback) {\n counter += 1;\n var message = {\n id: 'postmessage-transport-' + counter\n },\n eventName = 'message.' + message.id;\n iframe = $(\n '<iframe style=\"display:none;\" src=\"' +\n options.postMessage +\n '\" name=\"' +\n message.id +\n '\"></iframe>'\n )\n .on('load', function () {\n $.each(names, function (i, name) {\n message[name] = options[name];\n });\n message.dataType = message.dataType.replace('postmessage ', '');\n $(window).on(eventName, function (event) {\n var e = event.originalEvent;\n var data = e.data;\n var ev;\n if (e.origin === target && data.id === message.id) {\n if (data.type === 'progress') {\n ev = document.createEvent('Event');\n ev.initEvent(data.type, false, true);\n $.extend(ev, data);\n xhrUpload.dispatchEvent(ev);\n } else {\n completeCallback(\n data.status,\n data.statusText,\n { postmessage: data.result },\n data.headers\n );\n iframe.remove();\n $(window).off(eventName);\n }\n }\n });\n iframe[0].contentWindow.postMessage(message, target);\n })\n .appendTo(document.body);\n },\n abort: function () {\n if (iframe) {\n iframe.remove();\n }\n }\n };\n }\n });\n});\n","Mageplaza_Core/lib/fileUploader/cors/jquery.xdr-transport.js":"/*\n * jQuery XDomainRequest Transport Plugin\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on Julian Aubourg's ajaxHooks xdr.js:\n * https://github.com/jaubourg/ajaxHooks/\n */\n\n/* global define, require, XDomainRequest */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['jquery'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(require('jquery'));\n } else {\n // Browser globals:\n factory(window.jQuery);\n }\n})(function ($) {\n 'use strict';\n if (window.XDomainRequest && !$.support.cors) {\n $.ajaxTransport(function (s) {\n if (s.crossDomain && s.async) {\n if (s.timeout) {\n s.xdrTimeout = s.timeout;\n delete s.timeout;\n }\n var xdr;\n return {\n send: function (headers, completeCallback) {\n var addParamChar = /\\?/.test(s.url) ? '&' : '?';\n /**\n * Callback wrapper function\n *\n * @param {number} status HTTP status code\n * @param {string} statusText HTTP status text\n * @param {object} [responses] Content-type specific responses\n * @param {string} [responseHeaders] Response headers string\n */\n function callback(status, statusText, responses, responseHeaders) {\n xdr.onload = xdr.onerror = xdr.ontimeout = $.noop;\n xdr = null;\n completeCallback(status, statusText, responses, responseHeaders);\n }\n xdr = new XDomainRequest();\n // XDomainRequest only supports GET and POST:\n if (s.type === 'DELETE') {\n s.url = s.url + addParamChar + '_method=DELETE';\n s.type = 'POST';\n } else if (s.type === 'PUT') {\n s.url = s.url + addParamChar + '_method=PUT';\n s.type = 'POST';\n } else if (s.type === 'PATCH') {\n s.url = s.url + addParamChar + '_method=PATCH';\n s.type = 'POST';\n }\n xdr.open(s.type, s.url);\n xdr.onload = function () {\n callback(\n 200,\n 'OK',\n { text: xdr.responseText },\n 'Content-Type: ' + xdr.contentType\n );\n };\n xdr.onerror = function () {\n callback(404, 'Not Found');\n };\n if (s.xdrTimeout) {\n xdr.ontimeout = function () {\n callback(0, 'timeout');\n };\n xdr.timeout = s.xdrTimeout;\n }\n xdr.send((s.hasContent && s.data) || null);\n },\n abort: function () {\n if (xdr) {\n xdr.onerror = $.noop();\n xdr.abort();\n }\n }\n };\n }\n });\n }\n});\n","Magento_Catalog/js/product-gallery.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'jquery',\n 'underscore',\n 'mage/template',\n 'uiRegistry',\n 'jquery/ui',\n 'baseImage'\n], function ($, _, mageTemplate, registry) {\n 'use strict';\n\n /**\n * Formats incoming bytes value to a readable format.\n *\n * @param {Number} bytes\n * @returns {String}\n */\n function bytesToSize(bytes) {\n var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'],\n i;\n\n if (bytes === 0) {\n return '0 Byte';\n }\n\n i = window.parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));\n\n return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];\n }\n\n /**\n * Product gallery widget\n */\n $.widget('mage.productGallery', {\n options: {\n imageSelector: '[data-role=image]',\n imageElementSelector: '[data-role=image-element]',\n template: '[data-template=image]',\n imageResolutionLabel: '[data-role=resolution]',\n imgTitleSelector: '[data-role=img-title]',\n imageSizeLabel: '[data-role=size]',\n types: null,\n initialized: false\n },\n\n /**\n * Gallery creation\n * @protected\n */\n _create: function () {\n this.options.types = this.options.types || this.element.data('types');\n this.options.images = this.options.images || this.element.data('images');\n this.options.parentComponent = this.options.parentComponent || this.element.data('parent-component');\n\n this.imgTmpl = mageTemplate(this.element.find(this.options.template).html().trim());\n\n this._bind();\n\n this._isInitializingItems = true;\n this._initializedItemCount = 0;\n this._lastInitializedElement = null;\n\n $.each(this.options.images, $.proxy(function (index, imageData) {\n this.element.trigger('addItem', imageData);\n }, this));\n\n this._updateImagesRoles();\n this._contentUpdated();\n\n this._isInitializingItems = false;\n this.options.initialized = true;\n },\n\n /**\n * Bind handler to elements\n * @protected\n */\n _bind: function () {\n this._on({\n updateImageTitle: '_updateImageTitle',\n updateVisibility: '_updateVisibility',\n openDialog: '_onOpenDialog',\n addItem: '_addItem',\n removeItem: '_removeItem',\n setImageType: '_setImageType',\n setPosition: '_setPosition',\n resort: '_resort',\n\n /**\n * @param {jQuery.Event} event\n */\n 'mouseup [data-role=delete-button]': function (event) {\n var $imageContainer;\n\n event.preventDefault();\n $imageContainer = $(event.currentTarget).closest(this.options.imageSelector);\n this.element.find('[data-role=dialog]').trigger('close');\n this.element.trigger('removeItem', $imageContainer.data('imageData'));\n },\n\n /**\n * @param {jQuery.Event} event\n */\n 'mouseup [data-role=make-base-button]': function (event) {\n var $imageContainer,\n imageData;\n\n event.preventDefault();\n event.stopImmediatePropagation();\n $imageContainer = $(event.currentTarget).closest(this.options.imageSelector);\n imageData = $imageContainer.data('imageData');\n this.setBase(imageData);\n }\n });\n\n this.element.sortable({\n distance: 8,\n items: this.options.imageSelector,\n tolerance: 'pointer',\n cancel: 'input, button, .uploader',\n update: $.proxy(function () {\n this.element.trigger('resort');\n }, this)\n });\n },\n\n /**\n * Set image as main\n * @param {Object} imageData\n * @private\n */\n setBase: function (imageData) {\n var baseImage = this.options.types.image,\n sameImages = $.grep(\n $.map(this.options.types, function (el) {\n return el;\n }),\n function (el) {\n return el.value === baseImage.value;\n }\n ),\n isImageOpened = this.findElement(imageData).hasClass('active');\n\n $.each(sameImages, $.proxy(function (index, image) {\n this.element.trigger('setImageType', {\n type: image.code,\n imageData: imageData\n });\n\n if (isImageOpened) {\n this.element.find('.item').addClass('selected');\n this.element.find('[data-role=type-selector]').prop({\n 'checked': true\n });\n }\n }, this));\n },\n\n /**\n * Find element by fileName\n * @param {Object} data\n * @returns {Element}\n */\n findElement: function (data) {\n return this.element.find(this.options.imageSelector).filter(function () {\n return $(this).data('imageData').file === data.file;\n }).first();\n },\n\n /**\n * Mark parent fieldset that content was updated\n */\n _contentUpdated: function () {\n if (this.options.initialized && this.options.parentComponent) {\n registry.async(this.options.parentComponent)(\n function (parentComponent) {\n parentComponent.bubble('update', true);\n }\n );\n }\n },\n\n /**\n * Add image\n * @param {jQuery.Event} event\n * @param {Object} imageData\n * @private\n */\n _addItem: function (event, imageData) {\n var element,\n imgElement,\n lastElement,\n count,\n position;\n\n if (this._isInitializingItems) {\n count = this._initializedItemCount++;\n lastElement = this._lastInitializedElement;\n } else {\n count = this.element.find(this.options.imageSelector).length;\n lastElement = this.element.find(this.options.imageSelector + ':last');\n }\n\n position = count + 1;\n\n if (lastElement && lastElement.length === 1) {\n position = parseInt(lastElement.data('imageData').position || count, 10) + 1;\n }\n imageData = $.extend({\n 'file_id': imageData['value_id'] ? imageData['value_id'] : Math.random().toString(33).substr(2, 18),\n 'disabled': imageData.disabled ? imageData.disabled : 0,\n 'position': position,\n sizeLabel: bytesToSize(imageData.size)\n }, imageData);\n\n element = this.imgTmpl({\n data: imageData\n });\n\n element = $(element).data('imageData', imageData);\n\n if (count === 0) {\n element.prependTo(this.element);\n } else {\n element.insertAfter(lastElement);\n }\n\n this._lastInitializedElement = element;\n\n if (!this.options.initialized &&\n this.options.images.length === 0 ||\n this.options.initialized &&\n this.element.find(this.options.imageSelector + ':not(.removed)').length === 1\n ) {\n this.setBase(imageData);\n }\n\n imgElement = element.find(this.options.imageElementSelector);\n\n imgElement.on('load', this._updateImageDimesions.bind(this, element));\n\n $.each(this.options.types, $.proxy(function (index, image) {\n if (imageData.file === image.value) {\n this.element.trigger('setImageType', {\n type: image.code,\n imageData: imageData\n });\n }\n }, this));\n\n if (!this._isInitializingItems) {\n this._updateImagesRoles();\n this._contentUpdated();\n }\n },\n\n /**\n * Returns a list of current images.\n *\n * @returns {jQueryCollection}\n */\n _getImages: function () {\n return this.element.find(this.options.imageSelector);\n },\n\n /**\n * Returns a list of images roles.\n *\n * @return {Object}\n */\n _getRoles: function () {\n return _.mapObject(this.options.types, function (data, key) {\n var elem = this.element.find('.image-' + key);\n\n return {\n index: key,\n value: elem.val(),\n elem: elem\n };\n }, this);\n },\n\n /**\n * Updates labels with roles information for each image.\n */\n _updateImagesRoles: function () {\n var $images = this._getImages().toArray(),\n roles = this._getRoles();\n\n $images.forEach(function (img) {\n var $img = $(img),\n data = $img.data('imageData');\n\n $img.find('[data-role=roles-labels] li').each(function (index, elem) {\n var $elem = $(elem),\n roleCode = $elem.data('roleCode'),\n role = roles[roleCode];\n\n role.value === data.file ?\n $elem.show() :\n $elem.hide();\n });\n\n });\n },\n\n /**\n * Updates image's dimensions information.\n *\n * @param {jQeuryCollection} imgContainer\n */\n _updateImageDimesions: function (imgContainer) {\n var $img = imgContainer.find(this.options.imageElementSelector)[0],\n $dimens = imgContainer.find('[data-role=image-dimens]');\n\n $dimens.text($img.naturalWidth + 'x' + $img.naturalHeight + ' px');\n },\n\n /**\n *\n * @param {jQuery.Event} event\n * @param {Object} data\n */\n _updateImageTitle: function (event, data) {\n var imageData = data.imageData,\n $imgContainer = this.findElement(imageData),\n $title = $imgContainer.find(this.options.imgTitleSelector),\n value;\n\n value = imageData['media_type'] === 'external-video' ?\n imageData['video_title'] :\n imageData.label;\n\n $title.text(value);\n\n this._contentUpdated();\n },\n\n /**\n * Remove Image\n * @param {jQuery.Event} event\n * @param {Object} imageData\n * @private\n */\n _removeItem: function (event, imageData) {\n var $imageContainer = this.findElement(imageData);\n\n imageData.isRemoved = true;\n $imageContainer.addClass('removed').hide().find('.is-removed').val(1);\n\n this._contentUpdated();\n },\n\n /**\n * Set image type\n * @param {jQuery.Event} event\n * @param {Obejct} data\n * @private\n */\n _setImageType: function (event, data) {\n if (data.type === 'image') {\n this.element.find('.base-image').removeClass('base-image');\n }\n\n if (data.imageData) {\n this.options.types[data.type].value = data.imageData.file;\n\n if (data.type === 'image') {\n this.findElement(data.imageData).addClass('base-image');\n }\n } else {\n this.options.types[data.type].value = 'no_selection';\n }\n this.element.find('.image-' + data.type).val(this.options.types[data.type].value || 'no_selection');\n this._updateImagesRoles();\n this._contentUpdated();\n },\n\n /**\n * Resort images\n * @private\n */\n _resort: function () {\n this.element.find('.position').each($.proxy(function (index, element) {\n var value = $(element).val();\n\n if (value != index) { //eslint-disable-line eqeqeq\n this.element.trigger('moveElement', {\n imageData: $(element).closest(this.options.imageSelector).data('imageData'),\n position: index\n });\n $(element).val(index);\n }\n }, this));\n\n this._contentUpdated();\n },\n\n /**\n * Set image position\n * @param {jQuery.Event} event\n * @param {Object} data\n * @private\n */\n _setPosition: function (event, data) {\n var $element = this.findElement(data.imageData),\n curIndex = this.element.find(this.options.imageSelector).index($element),\n newPosition = data.position + (curIndex > data.position ? -1 : 0);\n\n if (data.position != curIndex) { //eslint-disable-line eqeqeq\n if (data.position === 0) {\n this.element.prepend($element);\n } else {\n $element.insertAfter(\n this.element.find(this.options.imageSelector).eq(newPosition)\n );\n }\n this.element.trigger('resort');\n }\n\n this._contentUpdated();\n }\n });\n\n // Extension for mage.productGallery - Add advanced settings block\n $.widget('mage.productGallery', $.mage.productGallery, {\n options: {\n dialogTemplate: '[data-role=img-dialog-tmpl]',\n dialogContainerTmpl: '[data-role=img-dialog-container-tmpl]'\n },\n\n /** @inheritdoc */\n _create: function () {\n var template = this.element.find(this.options.dialogTemplate),\n containerTmpl = this.element.find(this.options.dialogContainerTmpl);\n\n this._super();\n this.modalPopupInit = false;\n\n if (template.length) {\n this.dialogTmpl = mageTemplate(template.html().trim());\n }\n\n if (containerTmpl.length) {\n this.dialogContainerTmpl = mageTemplate(containerTmpl.html().trim());\n } else {\n this.dialogContainerTmpl = mageTemplate('');\n }\n\n this._initDialog();\n },\n\n /**\n * Bind handler to elements\n * @protected\n */\n _bind: function () {\n var events = {};\n\n this._super();\n\n events['click [data-role=close-panel]'] = $.proxy(function () {\n this.element.find('[data-role=dialog]').trigger('close');\n }, this);\n\n /**\n * @param {jQuery.Event} event\n */\n events['click ' + this.options.imageSelector] = function (event) {\n var imageData, $imageContainer;\n\n if (!$(event.currentTarget).is('.ui-sortable-helper')) {\n $(event.currentTarget).addClass('active');\n imageData = $(event.currentTarget).data('imageData');\n $imageContainer = this.findElement(imageData);\n\n if ($imageContainer.is('.removed')) {\n return;\n }\n this.element.trigger('openDialog', [imageData]);\n }\n };\n this._on(events);\n this.element.on('sortstart', $.proxy(function () {\n this.element.find('[data-role=dialog]').trigger('close');\n }, this));\n },\n\n /**\n * Initializes dialog element.\n */\n _initDialog: function () {\n var $dialog = $(this.dialogContainerTmpl());\n\n $dialog.modal({\n 'type': 'slide',\n title: $.mage.__('Image Detail'),\n buttons: [],\n\n /** @inheritdoc */\n opened: function () {\n $dialog.trigger('open');\n },\n\n /** @inheritdoc */\n closed: function () {\n $dialog.trigger('close');\n }\n });\n\n $dialog.on('open', this.onDialogOpen.bind(this));\n $dialog.on('close', function () {\n var $imageContainer = $dialog.data('imageContainer');\n\n $imageContainer.removeClass('active');\n $dialog.find('#hide-from-product-page').remove();\n });\n\n $dialog.on('change', '[data-role=type-selector]', function () {\n var parent = $(this).closest('.item'),\n selectedClass = 'selected';\n\n parent.toggleClass(selectedClass, $(this).prop('checked'));\n });\n\n $dialog.on('change', '[data-role=type-selector]', $.proxy(this._notifyType, this));\n\n $dialog.on('change', '[data-role=visibility-trigger]', $.proxy(function (e) {\n var imageData = $dialog.data('imageData');\n\n this.element.trigger('updateVisibility', {\n disabled: $(e.currentTarget).is(':checked'),\n imageData: imageData\n });\n }, this));\n\n $dialog.on('change', '[data-role=\"image-description\"]', function (e) {\n var target = $(e.target),\n targetName = target.attr('name'),\n desc = target.val(),\n imageData = $dialog.data('imageData');\n\n this.element.find('input[type=\"hidden\"][name=\"' + targetName + '\"]').val(desc);\n\n imageData.label = desc;\n imageData['label_default'] = desc;\n\n this.element.trigger('updateImageTitle', {\n imageData: imageData\n });\n }.bind(this));\n\n this.$dialog = $dialog;\n },\n\n /**\n * @param {Object} imageData\n * @private\n */\n _showDialog: function (imageData) {\n var $imageContainer = this.findElement(imageData),\n $template;\n\n $template = this.dialogTmpl({\n 'data': imageData\n });\n\n this.$dialog\n .html($template)\n .data('imageData', imageData)\n .data('imageContainer', $imageContainer)\n .modal('openModal');\n },\n\n /**\n * Handles dialog open event.\n *\n * @param {EventObject} event\n */\n onDialogOpen: function (event) {\n var imageData = this.$dialog.data('imageData'),\n imageSizeKb = imageData.sizeLabel,\n image = document.createElement('img'),\n sizeSpan = this.$dialog.find(this.options.imageSizeLabel)\n .find('[data-message]'),\n resolutionSpan = this.$dialog.find(this.options.imageResolutionLabel)\n .find('[data-message]'),\n sizeText = sizeSpan.attr('data-message').replace('{size}', imageSizeKb),\n resolutionText;\n\n image.src = imageData.url;\n\n resolutionText = resolutionSpan\n .attr('data-message')\n .replace('{width}^{height}', image.width + 'x' + image.height);\n\n sizeSpan.text(sizeText);\n resolutionSpan.text(resolutionText);\n\n $(event.target)\n .find('[data-role=type-selector]')\n .each($.proxy(function (index, checkbox) {\n var $checkbox = $(checkbox),\n parent = $checkbox.closest('.item'),\n selectedClass = 'selected',\n isChecked = this.options.types[$checkbox.val()].value == imageData.file; //eslint-disable-line\n\n $checkbox.prop(\n 'checked',\n isChecked\n );\n parent.toggleClass(selectedClass, isChecked);\n }, this));\n },\n\n /**\n *\n * Click by image handler\n *\n * @param {jQuery.Event} e\n * @param {Object} imageData\n * @private\n */\n _onOpenDialog: function (e, imageData) {\n if (imageData['media_type'] && imageData['media_type'] != 'image') { //eslint-disable-line eqeqeq\n return;\n }\n this._showDialog(imageData);\n },\n\n /**\n * Change visibility\n *\n * @param {jQuery.Event} event\n * * @param {Object} data\n * @private\n */\n _updateVisibility: function (event, data) {\n var imageData = data.imageData,\n disabled = +data.disabled,\n $imageContainer = this.findElement(imageData);\n\n !!disabled ? //eslint-disable-line no-extra-boolean-cast\n $imageContainer.addClass('hidden-for-front') :\n $imageContainer.removeClass('hidden-for-front');\n\n $imageContainer.find('[name*=\"disabled\"]').val(disabled);\n imageData.disabled = disabled;\n\n this._contentUpdated();\n },\n\n /**\n * Set image\n * @param {jQuery.Event} event\n * @private\n */\n _notifyType: function (event) {\n var $checkbox = $(event.currentTarget),\n $imageContainer = $checkbox.closest('[data-role=dialog]').data('imageContainer');\n\n this.element.trigger('setImageType', {\n type: $checkbox.val(),\n imageData: $checkbox.is(':checked') ? $imageContainer.data('imageData') : null\n });\n\n this._updateImagesRoles();\n }\n });\n\n return $.mage.productGallery;\n});\n","Magento_Catalog/js/price-box.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'jquery',\n 'Magento_Catalog/js/price-utils',\n 'underscore',\n 'mage/template',\n 'jquery-ui-modules/widget'\n], function ($, utils, _, mageTemplate) {\n 'use strict';\n\n var globalOptions = {\n productId: null,\n priceConfig: null,\n prices: {},\n priceTemplate: '<span class=\"price\"><%- data.formatted %></span>'\n };\n\n $.widget('mage.priceBox', {\n options: globalOptions,\n qtyInfo: '#qty',\n\n /**\n * Widget initialisation.\n * Every time when option changed prices also can be changed. So\n * changed options.prices -> changed cached prices -> recalculation -> redraw price box\n */\n _init: function initPriceBox() {\n var box = this.element;\n\n box.trigger('updatePrice');\n this.cache.displayPrices = utils.deepClone(this.options.prices);\n },\n\n /**\n * Widget creating.\n */\n _create: function createPriceBox() {\n var box = this.element;\n\n this.cache = {};\n this._setDefaultsFromPriceConfig();\n this._setDefaultsFromDataSet();\n\n box.on('reloadPrice', this.reloadPrice.bind(this));\n box.on('updatePrice', this.onUpdatePrice.bind(this));\n $(this.qtyInfo).on('input', this.updateProductTierPrice.bind(this));\n box.trigger('price-box-initialized');\n },\n\n /**\n * Call on event updatePrice. Proxy to updatePrice method.\n * @param {Event} event\n * @param {Object} prices\n */\n onUpdatePrice: function onUpdatePrice(event, prices) {\n return this.updatePrice(prices);\n },\n\n /**\n * Updates price via new (or additional values).\n * It expects object like this:\n * -----\n * \"option-hash\":\n * \"price-code\":\n * \"amount\": 999.99999,\n * ...\n * -----\n * Empty option-hash object or empty price-code object treats as zero amount.\n * @param {Object} newPrices\n */\n updatePrice: function updatePrice(newPrices) {\n var prices = this.cache.displayPrices,\n additionalPrice = {},\n pricesCode = [],\n priceValue, origin, finalPrice;\n\n this.cache.additionalPriceObject = this.cache.additionalPriceObject || {};\n\n if (newPrices) {\n $.extend(this.cache.additionalPriceObject, newPrices);\n }\n\n if (!_.isEmpty(additionalPrice)) {\n pricesCode = _.keys(additionalPrice);\n } else if (!_.isEmpty(prices)) {\n pricesCode = _.keys(prices);\n }\n\n _.each(this.cache.additionalPriceObject, function (additional) {\n if (additional && !_.isEmpty(additional)) {\n pricesCode = _.keys(additional);\n }\n _.each(pricesCode, function (priceCode) {\n priceValue = additional[priceCode] || {};\n priceValue.amount = +priceValue.amount || 0;\n priceValue.adjustments = priceValue.adjustments || {};\n\n additionalPrice[priceCode] = additionalPrice[priceCode] || {\n 'amount': 0,\n 'adjustments': {}\n };\n additionalPrice[priceCode].amount = 0 + (additionalPrice[priceCode].amount || 0) +\n priceValue.amount;\n _.each(priceValue.adjustments, function (adValue, adCode) {\n additionalPrice[priceCode].adjustments[adCode] = 0 +\n (additionalPrice[priceCode].adjustments[adCode] || 0) + adValue;\n });\n });\n });\n\n if (_.isEmpty(additionalPrice)) {\n this.cache.displayPrices = utils.deepClone(this.options.prices);\n } else {\n _.each(additionalPrice, function (option, priceCode) {\n origin = this.options.prices[priceCode] || {};\n finalPrice = prices[priceCode] || {};\n option.amount = option.amount || 0;\n origin.amount = origin.amount || 0;\n origin.adjustments = origin.adjustments || {};\n finalPrice.adjustments = finalPrice.adjustments || {};\n\n finalPrice.amount = 0 + origin.amount + option.amount;\n _.each(option.adjustments, function (pa, paCode) {\n finalPrice.adjustments[paCode] = 0 + (origin.adjustments[paCode] || 0) + pa;\n });\n }, this);\n }\n\n this.element.trigger('priceUpdated', this.cache.displayPrices);\n this.element.trigger('reloadPrice');\n },\n\n /*eslint-disable no-extra-parens*/\n /**\n * Render price unit block.\n */\n reloadPrice: function reDrawPrices() {\n var priceFormat = (this.options.priceConfig && this.options.priceConfig.priceFormat) || {},\n priceTemplate = mageTemplate(this.options.priceTemplate);\n\n _.each(this.cache.displayPrices, function (price, priceCode) {\n price.final = _.reduce(price.adjustments, function (memo, amount) {\n return memo + amount;\n }, price.amount);\n\n price.formatted = utils.formatPriceLocale(price.final, priceFormat);\n\n $('[data-price-type=\"' + priceCode + '\"]', this.element).html(priceTemplate({\n data: price\n }));\n }, this);\n },\n\n /*eslint-enable no-extra-parens*/\n /**\n * Overwrites initial (default) prices object.\n * @param {Object} prices\n */\n setDefault: function setDefaultPrices(prices) {\n this.cache.displayPrices = utils.deepClone(prices);\n this.options.prices = utils.deepClone(prices);\n },\n\n /**\n * Custom behavior on getting options:\n * now widget able to deep merge of accepted configuration.\n * @param {Object} options\n * @return {mage.priceBox}\n */\n _setOptions: function setOptions(options) {\n $.extend(true, this.options, options);\n\n if ('disabled' in options) {\n this._setOption('disabled', options.disabled);\n }\n\n return this;\n },\n\n /**\n * setDefaultsFromDataSet\n */\n _setDefaultsFromDataSet: function _setDefaultsFromDataSet() {\n var box = this.element,\n priceHolders = $('[data-price-type]', box),\n prices = this.options.prices;\n\n this.options.productId = box.data('productId');\n\n if (_.isEmpty(prices)) {\n priceHolders.each(function (index, element) {\n var type = $(element).data('priceType'),\n amount = parseFloat($(element).data('priceAmount'));\n\n if (type && !_.isNaN(amount)) {\n prices[type] = {\n amount: amount\n };\n }\n });\n }\n },\n\n /**\n * setDefaultsFromPriceConfig\n */\n _setDefaultsFromPriceConfig: function _setDefaultsFromPriceConfig() {\n var config = this.options.priceConfig;\n\n if (config && config.prices) {\n this.options.prices = config.prices;\n }\n },\n\n /**\n * Updates product final and base price according to tier prices\n */\n updateProductTierPrice: function updateProductTierPrice() {\n var originalPrice,\n prices = {'prices': {}};\n\n if (this.options.prices.finalPrice) {\n originalPrice = this.options.prices.finalPrice.amount;\n prices.prices.finalPrice = {'amount': this.getPrice('price') - originalPrice};\n }\n\n if (this.options.prices.basePrice) {\n originalPrice = this.options.prices.basePrice.amount;\n prices.prices.basePrice = {'amount': this.getPrice('basePrice') - originalPrice};\n }\n\n this.updatePrice(prices);\n },\n\n /**\n * Returns price.\n *\n * @param {String} priceKey\n * @returns {Number}\n */\n getPrice: function (priceKey) {\n var productQty = $(this.qtyInfo).val(),\n result,\n tierPriceItem,\n i;\n\n for (i = 0; i < this.options.priceConfig.tierPrices.length; i++) {\n tierPriceItem = this.options.priceConfig.tierPrices[i];\n if (productQty >= tierPriceItem.qty && tierPriceItem[priceKey]) {\n result = tierPriceItem[priceKey];\n }\n }\n\n return result;\n }\n });\n\n return $.mage.priceBox;\n});\n","Magento_Catalog/js/price-option-file.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'jquery-ui-modules/widget'\n], function ($) {\n 'use strict';\n\n $.widget('mage.priceOptionFile', {\n options: {\n fileName: '',\n fileNamed: '',\n fieldNameAction: '',\n changeFileSelector: '',\n deleteFileSelector: ''\n },\n\n /**\n * Creates instance of widget\n * @private\n */\n _create: function () {\n this.fileDeleteFlag = this.fileChangeFlag = false;\n this.inputField = this.element.find('input[name=' + this.options.fileName + ']')[0];\n this.inputFieldAction = this.element.find('input[name=' + this.options.fieldNameAction + ']')[0];\n this.fileNameSpan = this.element.parent('dd').find('.' + this.options.fileNamed);\n\n $(this.options.changeFileSelector).on('click', $.proxy(function () {\n this._toggleFileChange();\n }, this));\n $(this.options.deleteFileSelector).on('click', $.proxy(function () {\n this._toggleFileDelete();\n }, this));\n },\n\n /**\n * Toggles whether the current file is being changed or not. If the file is being deleted\n * then the option to change the file is disabled.\n * @private\n */\n _toggleFileChange: function () {\n this.element.toggle();\n this.fileChangeFlag = !this.fileChangeFlag;\n\n if (!this.fileDeleteFlag) {\n $(this.inputFieldAction).attr('value', this.fileChangeFlag ? 'save_new' : 'save_old');\n this.inputField.disabled = !this.fileChangeFlag;\n }\n },\n\n /**\n * Toggles whether the file is to be deleted. When the file is being deleted, the name of\n * the file is decorated with strike-through text and the option to change the file is\n * disabled.\n * @private\n */\n _toggleFileDelete: function () {\n this.fileDeleteFlag = $(this.options.deleteFileSelector + ':checked').val();\n $(this.inputFieldAction).attr('value',\n this.fileDeleteFlag ? '' : this.fileChangeFlag ? 'save_new' : 'save_old');\n this.inputField.disabled = this.fileDeleteFlag || !this.fileChangeFlag;\n this.fileNameSpan.css('text-decoration', this.fileDeleteFlag ? 'line-through' : 'none');\n }\n });\n\n return $.mage.priceOptionFile;\n});\n","Magento_Catalog/js/custom-options.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'mage/template',\n 'Magento_Ui/js/modal/alert',\n 'jquery/ui',\n 'useDefault',\n 'collapsable',\n 'mage/translate',\n 'mage/backend/validation',\n 'Magento_Ui/js/modal/modal'\n], function ($, mageTemplate, alert) {\n 'use strict';\n\n $.widget('mage.customOptions', {\n options: {\n selectionItemCount: {}\n },\n\n /** @inheritdoc */\n _create: function () {\n this.baseTmpl = mageTemplate('#custom-option-base-template');\n this.rowTmpl = mageTemplate('#custom-option-select-type-row-template');\n\n this._initOptionBoxes();\n this._initSortableSelections();\n this._bindCheckboxHandlers();\n this._bindReadOnlyMode();\n this._addValidation();\n },\n\n /**\n * @private\n */\n _addValidation: function () {\n $.validator.addMethod(\n 'required-option-select', function (value) {\n return value !== '';\n }, $.mage.__('Select type of option.'));\n\n $.validator.addMethod(\n 'required-option-select-type-rows', function (value, element) {\n var optionContainerElm = element.up('div[id*=_type_]'),\n selectTypesFlag = false,\n selectTypeElements = $('#' + optionContainerElm.id + ' .select-type-title');\n\n selectTypeElements.each(function () {\n if (!$(this).closest('tr').hasClass('ignore-validate')) {\n selectTypesFlag = true;\n }\n });\n\n return selectTypesFlag;\n }, $.mage.__('Please add rows to option.'));\n },\n\n /**\n * @private\n */\n _initOptionBoxes: function () {\n var syncOptionTitle;\n\n if (!this.options.isReadonly) {\n this.element.sortable({\n axis: 'y',\n handle: '[data-role=draggable-handle]',\n items: '#product_options_container_top > div',\n update: this._updateOptionBoxPositions,\n tolerance: 'pointer'\n });\n }\n\n /**\n * @param {jQuery.Event} event\n */\n syncOptionTitle = function (event) {\n var currentValue = $(event.target).val(),\n optionBoxTitle = $(\n '.admin__collapsible-title > span',\n $(event.target).closest('.fieldset-wrapper')\n ),\n newOptionTitle = $.mage.__('New Option');\n\n optionBoxTitle.text(currentValue === '' ? newOptionTitle : currentValue);\n };\n this._on({\n /**\n * Reset field value to Default\n */\n 'click .use-default-label': function (event) {\n $(event.target).closest('label').find('input').prop('checked', true).trigger('change');\n },\n\n /**\n * Remove custom option or option row for 'select' type of custom option\n */\n 'click button[id^=product_option_][id$=_delete]': function (event) {\n var element = $(event.target).closest('#product_options_container_top > div.fieldset-wrapper,tr');\n\n if (element.length) {\n $('#product_' + element.attr('id').replace('product_', '') + '_is_delete').val(1);\n element.addClass('ignore-validate').hide();\n this.refreshSortableElements();\n }\n },\n\n /**\n * Minimize custom option block\n */\n 'click #product_options_container_top [data-target$=-content]': function () {\n if (this.options.isReadonly) {\n return false;\n }\n },\n\n /**\n * Add new custom option\n */\n 'click #add_new_defined_option': function (event) {\n this.addOption(event);\n },\n\n /**\n * Add new option row for 'select' type of custom option\n */\n 'click button[id^=product_option_][id$=_add_select_row]': function (event) {\n this.addSelection(event);\n },\n\n /**\n * Import custom options from products\n */\n 'click #import_new_defined_option': function () {\n var importContainer = $('#import-container'),\n widget = this;\n\n importContainer.modal({\n title: $.mage.__('Select Product'),\n type: 'slide',\n\n /** @inheritdoc */\n opened: function () {\n $(document).off().on('click', '#productGrid_massaction-form button', function () {\n $('.import-custom-options-apply-button').trigger('click', 'massActionTrigger');\n });\n },\n buttons: [{\n text: $.mage.__('Import'),\n attr: {\n id: 'import-custom-options-apply-button'\n },\n 'class': 'action-primary action-import import-custom-options-apply-button',\n\n /** @inheritdoc */\n click: function (event, massActionTrigger) {\n var request = [];\n\n $(this.element).find('input[name=product]:checked').map(function () {\n request.push(this.value);\n });\n\n if (request.length === 0) {\n if (!massActionTrigger) {\n alert({\n content: $.mage.__('An item needs to be selected. Select and try again.')\n });\n }\n\n return;\n }\n\n $.post(widget.options.customOptionsUrl, {\n 'products[]': request,\n 'form_key': widget.options.formKey\n }, function ($data) {\n $.each(JSON.parse($data), function (el) {\n var i;\n\n el.id = widget.getFreeOptionId(el.id);\n el['option_id'] = el.id;\n\n if (typeof el.optionValues !== 'undefined') {\n for (i = 0; i < el.optionValues.length; i++) {\n el.optionValues[i]['option_id'] = el.id;\n }\n }\n //Adding option\n widget.addOption(el);\n //Will save new option on server side\n $('#product_option_' + el.id + '_option_id').val(0);\n $('#option_' + el.id + ' input[name$=\"option_type_id]\"]').val(-1);\n });\n importContainer.modal('closeModal');\n });\n }\n }]\n });\n importContainer.load(\n this.options.productGridUrl,\n {\n 'form_key': this.options.formKey,\n 'current_product_id': this.options.currentProductId\n },\n function () {\n importContainer.modal('openModal');\n }\n );\n },\n\n /**\n * Change custom option type\n */\n 'change select[id^=product_option_][id$=_type]': function (event, data) {\n var widget = this,\n currentElement = $(event.target),\n parentId = '#' + currentElement.closest('.fieldset-alt').attr('id'),\n group = currentElement.find('[value=\"' + currentElement.val() + '\"]')\n .closest('optgroup').attr('data-optgroup-name'),\n previousGroup = $(parentId + '_previous_group').val(),\n previousBlock = $(parentId + '_type_' + previousGroup),\n tmpl, disabledBlock, priceType;\n\n data = data || {};\n\n if (typeof group !== 'undefined') {\n group = group.toLowerCase();\n }\n\n if (previousGroup !== group) {\n if (previousBlock.length) {\n previousBlock.addClass('ignore-validate').hide();\n }\n $(parentId + '_previous_group').val(group);\n\n if (typeof group === 'undefined') {\n return;\n }\n disabledBlock = $(parentId).find(parentId + '_type_' + group);\n\n if (disabledBlock.length) {\n disabledBlock.removeClass('ignore-validate').show();\n } else {\n if ($.isEmptyObject(data)) { //eslint-disable-line max-depth\n data['option_id'] = $(parentId + '_id').val();\n data.price = data.sku = '';\n }\n data.group = group;\n\n tmpl = widget.element.find('#custom-option-' + group + '-type-template').html();\n tmpl = mageTemplate(tmpl, {\n data: data\n });\n\n $(tmpl).insertAfter($(parentId));\n\n if (data['price_type']) { //eslint-disable-line max-depth\n priceType = $('#' + widget.options.fieldId + '_' + data['option_id'] + '_price_type');\n priceType.val(data['price_type']).attr('data-store-label', data['price_type']);\n }\n this._bindUseDefault(widget.options.fieldId + '_' + data['option_id'], data);\n //Add selections\n\n if (data.optionValues) { //eslint-disable-line max-depth\n data.optionValues.each(function (value) {\n widget.addSelection(value);\n });\n }\n }\n }\n },\n //Sync title\n 'change .field-option-title > .control > input[id$=\"_title\"]': syncOptionTitle,\n 'keyup .field-option-title > .control > input[id$=\"_title\"]': syncOptionTitle,\n 'paste .field-option-title > .control > input[id$=\"_title\"]': syncOptionTitle\n });\n },\n\n /**\n * @private\n */\n _initSortableSelections: function () {\n if (!this.options.isReadonly) {\n this.element.find('[id^=product_option_][id$=_type_select] tbody').sortable({\n axis: 'y',\n handle: '[data-role=draggable-handle]',\n\n /** @inheritdoc */\n helper: function (event, ui) {\n ui.children().each(function () {\n $(this).width($(this).width());\n });\n\n return ui;\n },\n update: this._updateSelectionsPositions,\n tolerance: 'pointer'\n });\n }\n },\n\n /**\n * Sync sort order checkbox with hidden dropdown\n */\n _bindCheckboxHandlers: function () {\n this._on({\n /**\n * @param {jQuery.Event} event\n */\n 'change [id^=product_option_][id$=_required]': function (event) {\n var $this = $(event.target);\n\n $this.closest('#product_options_container_top > div')\n .find('[name$=\"[is_require]\"]').val($this.is(':checked') ? 1 : 0);\n }\n });\n this.element.find('[id^=product_option_][id$=_required]').each(function () {\n $(this).prop('checked', $(this).closest('#product_options_container_top > div')\n .find('[name$=\"[is_require]\"]').val() > 0);\n });\n },\n\n /**\n * Update Custom option position\n */\n _updateOptionBoxPositions: function () {\n $(this).find('div[id^=option_]:not(.ignore-validate) .fieldset-alt > [name$=\"[sort_order]\"]').each(\n function (index) {\n $(this).val(index);\n });\n },\n\n /**\n * Update selections positions for 'select' type of custom option\n */\n _updateSelectionsPositions: function () {\n $(this).find('tr:not(.ignore-validate) [name$=\"[sort_order]\"]').each(function (index) {\n $(this).val(index);\n });\n },\n\n /**\n * Disable input data if \"Read Only\"\n */\n _bindReadOnlyMode: function () {\n if (this.options.isReadonly) {\n $('div.product-custom-options').find('button,input,select,textarea').each(function () {\n $(this).prop('disabled', true);\n\n if ($(this).is('button')) {\n $(this).addClass('disabled');\n }\n });\n }\n },\n\n /**\n * @param {String} id\n * @param {Object} data\n * @private\n */\n _bindUseDefault: function (id, data) {\n var title = $('#' + id + '_title'),\n price = $('#' + id + '_price'),\n priceType = $('#' + id + '_price_type');\n\n //enable 'use default' link for title\n if (data.checkboxScopeTitle) {\n title.useDefault({\n field: '.field',\n useDefault: 'label[for$=_title]',\n checkbox: 'input[id$=_title_use_default]',\n label: 'span'\n });\n }\n //enable 'use default' link for price and price_type\n if (data.checkboxScopePrice) {\n price.useDefault({\n field: '.field',\n useDefault: 'label[for$=_price]',\n checkbox: 'input[id$=_price_use_default]',\n label: 'span'\n });\n //not work set default value for second field\n priceType.useDefault({\n field: '.field',\n useDefault: 'label[for$=_price]',\n checkbox: 'input[id$=_price_use_default]',\n label: 'span'\n });\n }\n },\n\n /**\n * Add selection value for 'select' type of custom option\n */\n addSelection: function (event) {\n var data = {},\n element = event.target || event.srcElement || event.currentTarget,\n rowTmpl, priceType;\n\n if (typeof element !== 'undefined') {\n data.id = $(element).closest('#product_options_container_top > div')\n .find('[name^=\"product[options]\"][name$=\"[id]\"]').val();\n data['option_type_id'] = -1;\n\n if (!this.options.selectionItemCount[data.id]) {\n this.options.selectionItemCount[data.id] = 1;\n }\n\n data['select_id'] = this.options.selectionItemCount[data.id];\n data.price = data.sku = '';\n } else {\n data = event;\n data.id = data['option_id'];\n data['select_id'] = data['option_type_id'];\n this.options.selectionItemCount[data.id] = data['item_count'];\n }\n\n rowTmpl = this.rowTmpl({\n data: data\n });\n\n $(rowTmpl).appendTo($('#select_option_type_row_' + data.id));\n\n //set selected price_type value if set\n if (data['price_type']) {\n priceType = $('#' + this.options.fieldId + '_' + data.id + '_select_' + data['select_id'] +\n '_price_type');\n priceType.val(data['price_type']).attr('data-store-label', data['price_type']);\n }\n\n this._bindUseDefault(this.options.fieldId + '_' + data.id + '_select_' + data['select_id'], data);\n this.refreshSortableElements();\n this.options.selectionItemCount[data.id] = parseInt(this.options.selectionItemCount[data.id], 10) + 1;\n\n $('#' + this.options.fieldId + '_' + data.id + '_select_' + data['select_id'] + '_title').trigger('focus');\n },\n\n /**\n * Add custom option\n */\n addOption: function (event) {\n var data = {},\n element = event.target || event.srcElement || event.currentTarget,\n baseTmpl;\n\n if (typeof element !== 'undefined') {\n data.id = this.options.itemCount;\n data.type = '';\n data['option_id'] = 0;\n } else {\n data = event;\n this.options.itemCount = data['item_count'];\n }\n\n baseTmpl = this.baseTmpl({\n data: data\n });\n\n $(baseTmpl)\n .appendTo(this.element.find('#product_options_container_top'))\n .find('.collapse').collapsable();\n\n //set selected type value if set\n if (data.type) {\n $('#' + this.options.fieldId + '_' + data.id + '_type').val(data.type).trigger('change', data);\n }\n\n //set selected is_require value if set\n if (data['is_require']) {\n $('#' + this.options.fieldId + '_' + data.id + '_is_require').val(data['is_require']).trigger('change');\n }\n\n this.refreshSortableElements();\n this._bindCheckboxHandlers();\n this._bindReadOnlyMode();\n this.options.itemCount++;\n $('#' + this.options.fieldId + '_' + data.id + '_title').trigger('change');\n },\n\n /**\n * @return {Object}\n */\n refreshSortableElements: function () {\n if (!this.options.isReadonly) {\n this.element.sortable('refresh');\n this._updateOptionBoxPositions.apply(this.element);\n this._updateSelectionsPositions.apply(this.element);\n this._initSortableSelections();\n }\n\n return this;\n },\n\n /**\n * @param {String} id\n * @return {*}\n */\n getFreeOptionId: function (id) {\n return $('#' + this.options.fieldId + '_' + id).length ? this.getFreeOptionId(parseInt(id, 10) + 1) : id;\n }\n });\n\n});\n","Magento_Catalog/js/price-option-date.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'priceUtils',\n 'priceOptions',\n 'jquery-ui-modules/widget'\n], function ($, utils) {\n 'use strict';\n\n var globalOptions = {\n fromSelector: 'form',\n dropdownsSelector: '[data-role=calendar-dropdown]'\n },\n optionHandler = {};\n\n optionHandler.optionHandlers = {};\n\n /**\n * Custom handler for Date-with-Dropdowns option type.\n * @param {jQuery} siblings\n * @return {Function} function that return object { optionHash : optionAdditionalPrice }\n */\n function onCalendarDropdownChange(siblings) {\n return function (element, optionConfig) {\n var changes = {},\n optionId = utils.findOptionId(element),\n overhead = optionConfig[optionId].prices,\n isNeedToUpdate = true,\n optionHash = 'price-option-calendar-' + optionId;\n\n siblings.each(function (index, el) {\n isNeedToUpdate = isNeedToUpdate && !!$(el).val();\n });\n\n overhead = isNeedToUpdate ? overhead : {};\n changes[optionHash] = overhead;\n\n return changes;\n };\n }\n\n /**\n * Returns number of days for special month and year\n * @param {Number} month\n * @param {Number} year\n * @return {Number}\n */\n function getDaysInMonth(month, year) {\n return new Date(year, month, 0).getDate();\n }\n\n /**\n * Adjusts the number of days in the day option element based on which month or year\n * is selected (changed). Adjusts the days to 28, 29, 30, or 31 typically.\n * @param {jQuery} dropdowns\n */\n function onDateChange(dropdowns) {\n var daysNodes,\n curMonth, curYear, expectedDays,\n options, needed,\n month = dropdowns.filter('[data-calendar-role=month]'),\n year = dropdowns.filter('[data-calendar-role=year]');\n\n if (month.length && year.length) {\n daysNodes = dropdowns.filter('[data-calendar-role=day]').find('option');\n\n curMonth = month.val() || '01';\n curYear = year.val() || '2000';\n expectedDays = getDaysInMonth(curMonth, curYear);\n\n if (daysNodes.length - 1 > expectedDays) { // remove unnecessary option nodes\n daysNodes.each(function (i, e) {\n if (e.value > expectedDays) {\n $(e).remove();\n }\n });\n } else if (daysNodes.length - 1 < expectedDays) { // add missing option nodes\n options = [];\n needed = expectedDays - daysNodes.length + 1;\n\n while (needed--) { //eslint-disable-line max-depth\n options.push(\n '<option value=\"' + (expectedDays - needed) + '\">' + (expectedDays - needed) + '</option>'\n );\n }\n $(options.join('')).insertAfter(daysNodes.last());\n }\n }\n }\n\n $.widget('mage.priceOptionDate', {\n options: globalOptions,\n\n /**\n * Function-initializer of priceOptionDate widget\n * @private\n */\n _create: function initOptionDate() {\n var field = this.element,\n form = field.closest(this.options.fromSelector),\n dropdowns = $(this.options.dropdownsSelector, field),\n dateOptionId;\n\n if (dropdowns.length) {\n dateOptionId = this.options.dropdownsSelector + dropdowns.attr('name');\n\n optionHandler.optionHandlers[dateOptionId] = onCalendarDropdownChange(dropdowns);\n\n form.priceOptions(optionHandler);\n\n dropdowns.data('role', dateOptionId);\n dropdowns.on('change', onDateChange.bind(this, dropdowns));\n }\n }\n });\n\n return $.mage.priceOptionDate;\n});\n","Magento_Catalog/js/category-checkbox-tree.js":"/**\n * Copyright 2018 Adobe\n * All Rights Reserved.\n */\n\ndefine([\n 'jquery',\n 'jquery/jstree/jquery.jstree',\n 'mage/adminhtml/form'\n], function ($) {\n 'use strict';\n\n /**\n * Recursively adds the 'lastNode' property to the nodes in the nested object.\n *\n * @param {Array} nodes\n * @returns {Array}\n */\n function addLastNodeProperty(nodes) {\n return nodes.map(node => {\n return node.children ? {\n ...node,\n children: addLastNodeProperty(node.children)\n } : {\n ...node,\n lastNode: true\n };\n });\n }\n\n /**\n * Main function that creates the jstree\n *\n * @param {Object} config - Configuration object containing various options\n */\n return function (config) {\n\n let options = {\n dataUrl: config.dataUrl,\n divId: config.divId,\n rootVisible: config.rootVisible,\n useAjax: config.useAjax,\n currentNodeId: config.currentNodeId,\n jsFormObject: window[config.jsFormObject],\n name: config.name,\n checked: config.checked,\n allowDrop: config.allowDrop,\n rootId: config.rootId,\n expanded: config.expanded,\n categoryId: config.categoryId,\n treeJson: addLastNodeProperty(config.treeJson)\n },\n checkedNodes = [];\n\n /**\n * Get the jstree element by its ID\n */\n const treeId = $('#' + options.divId);\n\n /**\n * Function to check child nodes based on the checkedNodes array\n *\n * @param {Object} node\n */\n function getCheckedNodeIds(node) {\n if (node.children_d && node.children_d.length > 0) {\n const selectChildrenNodes = node.children_d.filter(item => checkedNodes.includes(item));\n\n if (selectChildrenNodes.length > 0) {\n treeId.jstree(false).select_node(selectChildrenNodes);\n }\n }\n }\n\n /**\n * Initialize the jstree with configuration options\n */\n treeId.jstree({\n core: {\n data: options.treeJson,\n check_callback: true\n },\n plugins: ['checkbox'],\n checkbox: {\n three_state: false\n }\n });\n\n /**\n * Event handler for 'loaded.jstree' event\n */\n treeId.on('loaded.jstree', function () {\n\n /**\n * Get each node in the tree\n */\n $(treeId.jstree().get_json('#', {\n flat: false\n })).each(function () {\n let node = treeId.jstree().get_node(this.id, false);\n\n if (node.original.expanded) {\n treeId.jstree(true).open_node(node);\n }\n\n if (options.jsFormObject.updateElement.defaultValue) {\n checkedNodes = options.jsFormObject.updateElement.defaultValue.split(',');\n }\n });\n });\n\n /**\n * Event handler for 'load_node.jstree' event\n */\n treeId.on('load_node.jstree', function (e, data) {\n getCheckedNodeIds(data.node);\n });\n\n /**\n * Add lastNode property to child who doesn't have children property\n *\n * @param {Object} treeData\n */\n function addLastNodeFlag(treeData) {\n if (treeData.children) {\n treeData.children.forEach((child) => addLastNodeFlag(child));\n } else {\n treeData.lastNode = true;\n }\n }\n\n /**\n * Function to handle the 'success' callback of the AJAX request\n *\n * @param {Array} response\n * @param {Object} childNode\n * @param {Object} data\n */\n function handleSuccessResponse(response, childNode, data) {\n if (response.length > 0) {\n response.forEach(function (newNode) {\n addLastNodeFlag(newNode);\n\n /**\n * Create the new node and execute node callback\n */\n data.instance.create_node(childNode, newNode, 'last', function (node) {\n if (checkedNodes.includes(node.id)) {\n treeId.jstree(false).select_node(node.id);\n }\n getCheckedNodeIds(node);\n });\n });\n }\n }\n\n /**\n * Event handler for 'open_node.jstree' event\n */\n treeId.on('open_node.jstree', function (e, data) {\n let parentNode = data.node;\n\n if (parentNode.children.length > 0) {\n let childNode = data.instance.get_node(parentNode.children, false);\n\n /**\n * Check if the child node has no children (is not yet loaded)\n */\n if (childNode.children && childNode.children.length === 0\n && childNode.original && !childNode.original.lastNode) {\n $.ajax({\n url: options.dataUrl,\n data: {\n id: childNode.id,\n selected: options.jsFormObject.updateElement.value\n },\n dataType: 'json',\n success: function (response) {\n handleSuccessResponse(response, childNode, data);\n },\n error: function (jqXHR, status, error) {\n console.log(status + ': ' + error + '\\nResponse text:\\n' + jqXHR.responseText);\n }\n });\n }\n }\n });\n\n /**\n * Event handler for 'changed.jstree' event\n */\n treeId.on('changed.jstree', function (e, data) {\n if (data.action === 'ready') {\n return;\n }\n const clickedNodeID = data.node.id, currentCheckedNodes = data.instance.get_checked();\n\n if (data.action === 'select_node' && !checkedNodes.includes(clickedNodeID)) {\n checkedNodes = currentCheckedNodes;\n } else if (data.action === 'deselect_node') {\n checkedNodes = currentCheckedNodes.filter((nodeID) => nodeID !== clickedNodeID);\n }\n checkedNodes.sort((a, b) => a - b);\n\n /**\n * Update the value of the corresponding form element with the checked node IDs\n */\n options.jsFormObject.updateElement.value = checkedNodes.join(', ');\n });\n };\n});\n","Magento_Catalog/js/options.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* eslint-disable no-undef */\n// jscs:disable jsDoc\n\ndefine([\n 'jquery',\n 'mage/template',\n 'uiRegistry',\n 'jquery/ui',\n 'prototype',\n 'form',\n 'validation',\n 'mage/translate'\n], function (jQuery, mageTemplate, rg) {\n 'use strict';\n\n return function (config) {\n var optionPanel = jQuery('#manage-options-panel'),\n editForm = jQuery('#edit_form'),\n attributeOption = {\n table: $('attribute-options-table'),\n itemCount: 0,\n totalItems: 0,\n rendered: 0,\n template: mageTemplate('#row-template'),\n newOptionClass: 'new-option',\n isReadOnly: config.isReadOnly,\n add: function (data, render) {\n var isNewOption = false,\n element;\n\n if (typeof data.id == 'undefined') {\n data = {\n 'id': 'option_' + this.itemCount,\n 'sort_order': this.itemCount + 1,\n 'rowClasses': this.newOptionClass\n };\n isNewOption = true;\n }\n\n if (!data.intype) {\n data.intype = this.getOptionInputType();\n }\n\n element = this.template({\n data: data\n });\n\n if (isNewOption && !this.isReadOnly) {\n this.enableNewOptionDeleteButton(data.id);\n }\n this.itemCount++;\n this.totalItems++;\n this.elements += element;\n\n if (render) {\n this.render();\n this.updateItemsCountField();\n }\n },\n remove: function (event) {\n var element = $(Event.findElement(event, 'tr')),\n elementFlags; // !!! Button already have table parent in safari\n\n // Safari workaround\n element.ancestors().each(function (parentItem) {\n if (parentItem.hasClassName('option-row')) {\n element = parentItem;\n throw $break;\n } else if (parentItem.hasClassName('box')) {\n throw $break;\n }\n });\n\n if (element) {\n elementFlags = element.getElementsByClassName('delete-flag');\n\n if (elementFlags[0]) {\n elementFlags[0].value = 1;\n }\n\n element.addClassName('no-display');\n element.addClassName('template');\n element.hide();\n this.totalItems--;\n this.updateItemsCountField();\n }\n\n if (element.hasClassName(this.newOptionClass)) {\n element.remove();\n }\n },\n updateItemsCountField: function () {\n $('option-count-check').value = this.totalItems > 0 ? '1' : '';\n },\n enableNewOptionDeleteButton: function (id) {\n $$('#delete_button_container_' + id + ' button').each(function (button) {\n button.enable();\n button.removeClassName('disabled');\n });\n },\n bindRemoveButtons: function () {\n jQuery('#swatch-visual-options-panel').on('click', '.delete-option', this.remove.bind(this));\n },\n render: function () {\n Element.insert($$('[data-role=options-container]')[0], this.elements);\n this.elements = '';\n },\n renderWithDelay: function (data, from, step, delay) {\n var arrayLength = data.length,\n len;\n\n for (len = from + step; from < len && from < arrayLength; from++) {\n this.add(data[from]);\n }\n this.render();\n\n if (from === arrayLength) {\n this.updateItemsCountField();\n this.rendered = 1;\n jQuery('body').trigger('processStop');\n\n return true;\n }\n setTimeout(this.renderWithDelay.bind(this, data, from, step, delay), delay);\n },\n ignoreValidate: function () {\n var ignore = '.ignore-validate input, ' +\n '.ignore-validate select, ' +\n '.ignore-validate textarea';\n\n jQuery('#edit_form').data('validator').settings.forceIgnore = ignore;\n },\n getOptionInputType: function () {\n var optionDefaultInputType = 'radio';\n\n if ($('frontend_input') && $('frontend_input').value === 'multiselect') {\n optionDefaultInputType = 'checkbox';\n }\n\n return optionDefaultInputType;\n }\n },\n tableBody = jQuery(),\n activePanelClass = 'selected-type-options';\n\n if ($('add_new_option_button')) {\n Event.observe('add_new_option_button', 'click', attributeOption.add.bind(attributeOption, {}, true));\n }\n $('manage-options-panel').on('click', '.delete-option', function (event) {\n attributeOption.remove(event);\n });\n\n optionPanel.on('render', function () {\n attributeOption.ignoreValidate();\n\n if (attributeOption.rendered) {\n return false;\n }\n jQuery('body').trigger('processStart');\n attributeOption.renderWithDelay(config.attributesData, 0, 100, 300);\n attributeOption.bindRemoveButtons();\n });\n\n if (config.isSortable) {\n jQuery(function ($) {\n $('[data-role=options-container]').sortable({\n distance: 8,\n tolerance: 'pointer',\n cancel: 'input, button',\n axis: 'y',\n update: function () {\n $('[data-role=options-container] [data-role=order]').each(function (index, element) {\n $(element).val(index + 1);\n });\n }\n });\n });\n }\n editForm.on('beforeSubmit', function () {\n var optionContainer = optionPanel.find('table tbody'),\n optionsValues;\n\n if (optionPanel.hasClass(activePanelClass)) {\n optionsValues = jQuery.map(\n optionContainer.find('tr'),\n function (row) {\n return jQuery(row).find('input, select, textarea').serialize();\n }\n );\n jQuery('<input>')\n .attr({\n type: 'hidden',\n name: 'serialized_options'\n })\n .val(JSON.stringify(optionsValues))\n .prependTo(editForm);\n }\n tableBody = optionContainer.detach();\n });\n editForm.on('afterValidate.error highlight.validate', function () {\n if (optionPanel.hasClass(activePanelClass)) {\n optionPanel.find('table').append(tableBody);\n jQuery('input[name=\"serialized_options\"]').remove();\n }\n });\n window.attributeOption = attributeOption;\n window.optionDefaultInputType = attributeOption.getOptionInputType();\n\n rg.set('manage-options-panel', attributeOption);\n };\n});\n","Magento_Catalog/js/new-category-dialog.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @deprecated since version 2.2.0\n */\n/*global FORM_KEY*/\ndefine([\n 'jquery',\n 'jquery/ui',\n 'Magento_Ui/js/modal/modal',\n 'mage/translate',\n 'mage/backend/tree-suggest',\n 'mage/backend/validation'\n], function ($) {\n 'use strict';\n\n /** Clear parent category. */\n var clearParentCategory = function () {\n $('#new_category_parent').find('option').each(function () {\n $('#new_category_parent-suggest').treeSuggest('removeOption', null, this);\n });\n };\n\n $.widget('mage.newCategoryDialog', {\n /** @inheritdoc */\n _create: function () {\n var widget = this,\n newCategoryForm;\n\n $('#new_category_parent').before($('<input>', {\n id: 'new_category_parent-suggest',\n placeholder: $.mage.__('start typing to search category')\n }));\n\n $('#new_category_parent-suggest').treeSuggest(this.options.suggestOptions)\n .on('suggestbeforeselect', function (event) {\n clearParentCategory();\n $(event.target).treeSuggest('close');\n });\n\n $.validator.addMethod('validate-parent-category', function () {\n return $('#new_category_parent').val() || $('#new_category_parent-suggest').val() === '';\n }, $.mage.__('Choose existing category.'));\n newCategoryForm = $('#new_category_form');\n newCategoryForm.mage('validation', {\n /**\n * @param {jQuery} error\n * @param {*} element\n */\n errorPlacement: function (error, element) {\n error.insertAfter(element.is('#new_category_parent') ?\n $('#new_category_parent-suggest').closest('.mage-suggest') :\n element);\n }\n }).on('highlight.validate', function (e) {\n var options = $(this).validation('option');\n\n if ($(e.target).is('#new_category_parent')) {\n options.highlight($('#new_category_parent-suggest').get(0),\n options.errorClass, options.validClass || '');\n }\n });\n this.element.modal({\n type: 'slide',\n modalClass: 'mage-new-category-dialog form-inline',\n title: $.mage.__('Create Category'),\n\n /** @inheritdoc */\n opened: function () {\n var enteredName = $('#category_ids-suggest').val();\n\n $('#new_category_name').val(enteredName);\n\n if (enteredName === '') {\n $('#new_category_name').trigger('focus');\n }\n $('#new_category_messages').html('');\n },\n\n /** @inheritdoc */\n closed: function () {\n var validationOptions = newCategoryForm.validation('option');\n\n $('#new_category_name, #new_category_parent-suggest').val('');\n validationOptions.unhighlight($('#new_category_parent-suggest').get(0),\n validationOptions.errorClass, validationOptions.validClass || '');\n newCategoryForm.validation('clearError');\n $('#category_ids-suggest').trigger('focus');\n },\n buttons: [{\n text: $.mage.__('Create Category'),\n class: 'action-primary',\n\n /** @inheritdoc */\n click: function (e) {\n var thisButton;\n\n if (!newCategoryForm.valid()) {\n return;\n }\n thisButton = $(e.currentTarget);\n\n thisButton.prop('disabled', true);\n $.ajax({\n type: 'POST',\n url: widget.options.saveCategoryUrl,\n data: {\n name: $('#new_category_name').val(),\n parent: $('#new_category_parent').val(),\n 'is_active': 1,\n 'include_in_menu': 1,\n 'use_config': ['available_sort_by', 'default_sort_by'],\n 'form_key': FORM_KEY,\n 'return_session_messages_only': 1\n },\n dataType: 'json',\n context: $('body')\n }).done(function (data) {\n var $suggest;\n\n if (!data.error) {\n $suggest = $('#category_ids-suggest');\n\n $suggest.trigger('selectItem', {\n id: data.category['entity_id'],\n label: data.category.name\n });\n $('#new_category_name, #new_category_parent-suggest').val('');\n $suggest.val('');\n clearParentCategory();\n $(widget.element).modal('closeModal');\n } else {\n $('#new_category_messages').html(data.messages);\n }\n }).always(\n function () {\n thisButton.prop('disabled', false);\n }\n );\n }\n }]\n });\n }\n });\n\n return $.mage.newCategoryDialog;\n});\n","Magento_Catalog/js/bundle-proxy-button.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n * @deprecated since version 2.2.0\n */\ndefine([\n 'Magento_Ui/js/form/components/button',\n 'uiRegistry',\n 'underscore'\n], function (Button, registry, _) {\n 'use strict';\n\n return Button.extend({\n defaults: {\n currentRecordNamespace: 'bundle_current_record',\n listingDataProvider: '',\n value: [],\n imports: {\n currentRecordName: '${ $.provider }:${ $.currentRecordNamespace }',\n listingData: '${ $.provider }:${ $.listingDataProvider }'\n },\n links: {\n value: '${ $.provider }:${ $.dataScope }'\n },\n listens: {\n listingData: 'setListingData'\n }\n },\n\n /**\n * Initializes component.\n *\n * @returns {Object} Chainable.\n */\n initialize: function () {\n this._super()\n .initSource();\n\n return this;\n },\n\n /**\n * Calls 'initObservable' of parent\n *\n * @returns {Object} Chainable.\n */\n initObservable: function () {\n this._super()\n .observe([\n 'value',\n 'listingData'\n ]);\n\n return this;\n },\n\n /**\n * Calls 'destroy' of parent and\n * clear listing provider source\n *\n * @returns {Object} Chainable.\n */\n destroy: function () {\n this._super();\n this.source.set(this.listingDataProvider, []);\n\n return this;\n },\n\n /**\n * Call parent \"action\" method\n * and set new data to record and listing.\n *\n * @returns {Object} Chainable.\n */\n\n action: function () {\n this._super();\n this.source.set(this.currentRecordNamespace, this.name);\n this.source.set(this.listingDataProvider, this.value());\n\n return this;\n },\n\n /**\n * Init current source.\n *\n * @returns {Object} Chainable.\n */\n initSource: function () {\n if (!_.isFunction(this.source)) {\n this.source = registry.get(this.provider);\n }\n\n return this;\n },\n\n /**\n * Set data to listing source.\n *\n * @returns {Object} Chainable.\n */\n setListingData: function (data) {\n if (this.name === this.currentRecordName) {\n this.source.set(this.dataScope, data);\n }\n\n return this;\n }\n });\n});\n","Magento_Catalog/js/custom-options-type.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'underscore',\n 'uiRegistry',\n 'Magento_Ui/js/form/element/ui-select'\n], function ($, _, registry, UiSelect) {\n 'use strict';\n\n return UiSelect.extend({\n defaults: {\n previousGroup: null,\n groupsConfig: {},\n valuesMap: {},\n indexesMap: {},\n filterPlaceholder: 'ns = ${ $.ns }, parentScope = ${ $.parentScope }'\n },\n\n /**\n * Initialize component.\n * @returns {Element}\n */\n initialize: function () {\n return this\n ._super()\n .initMapping()\n .updateComponents(this.initialValue, true);\n },\n\n /**\n * Create additional mappings.\n *\n * @returns {Element}\n */\n initMapping: function () {\n _.each(this.groupsConfig, function (groupData, group) {\n _.each(groupData.values, function (value) {\n this.valuesMap[value] = group;\n }, this);\n\n _.each(groupData.indexes, function (index) {\n if (!this.indexesMap[index]) {\n this.indexesMap[index] = [];\n }\n\n this.indexesMap[index].push(group);\n }, this);\n }, this);\n\n return this;\n },\n\n /**\n * Callback that fires when 'value' property is updated.\n *\n * @param {String} currentValue\n * @returns {*}\n */\n onUpdate: function (currentValue) {\n this.updateComponents(currentValue);\n\n return this._super();\n },\n\n /**\n * Show, hide or clear components based on the current type value.\n *\n * @param {String} currentValue\n * @param {Boolean} isInitialization\n * @returns {Element}\n */\n updateComponents: function (currentValue, isInitialization) {\n var currentGroup = this.valuesMap[currentValue];\n\n if (currentGroup !== this.previousGroup) {\n _.each(this.indexesMap, function (groups, index) {\n var template = this.filterPlaceholder + ', index = ' + index,\n visible = groups.indexOf(currentGroup) !== -1,\n component;\n\n switch (index) {\n case 'container_type_static':\n case 'values':\n template = 'ns=' + this.ns +\n ', dataScope=' + this.parentScope +\n ', index=' + index;\n break;\n }\n\n /*eslint-disable max-depth */\n if (isInitialization) {\n registry.async(template)(\n function (currentComponent) {\n currentComponent.visible(visible);\n }\n );\n } else {\n component = registry.get(template);\n\n if (component) {\n component.visible(visible);\n }\n }\n }, this);\n\n this.previousGroup = currentGroup;\n }\n\n return this;\n }\n });\n});\n","Magento_Catalog/js/category-tree.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'jquery/ui',\n 'jquery/jstree/jquery.jstree'\n], function ($) {\n 'use strict';\n\n $.widget('mage.categoryTree', {\n options: {\n url: '',\n data: [],\n tree: {\n core: {\n themes: {\n dots: false\n }\n }\n }\n },\n\n /** @inheritdoc */\n _create: function () {\n var options = this.options,\n treeOptions = $.extend(\n true,\n {},\n options.tree,\n {\n core: {\n data: this._convertData(this.options.data).children\n }\n }\n );\n\n this.element.jstree(treeOptions);\n this.element.on('select_node.jstree', $.proxy(this._selectNode, this));\n },\n\n /**\n * @param {jQuery.Event} event\n * @param {Object} data\n * @private\n */\n _selectNode: function (event, data) {\n var node = data.node;\n\n if (!node.state.disabled) {\n window.location = window.location + '/' + node.id;\n } else {\n event.preventDefault();\n }\n },\n\n /**\n * @param {Array} nodes\n * @returns {Array}\n * @private\n */\n _convertDataNodes: function (nodes) {\n var nodesData = [];\n\n nodes.children.forEach(function (node) {\n nodesData.push(this._convertData(node));\n }, this);\n\n return nodesData;\n },\n\n /**\n * @param {Object} node\n * @return {*}\n * @private\n */\n _convertData: function (node) {\n var self = this,\n result;\n\n if (!node) {\n return result;\n }\n // jscs:disable requireCamelCaseOrUpperCaseIdentifiers\n result = {\n id: node.id,\n text: node.name + ' (' + node.product_count + ')',\n li_attr: {\n class: node.cls + (!!node.disabled ? ' disabled' : '') //eslint-disable-line no-extra-boolean-cast\n },\n state: {\n disabled: node.disabled,\n opened: !!node.children_count && node.expanded\n }\n };\n // jscs:enable requireCamelCaseOrUpperCaseIdentifiers\n if (node.children) {\n result.children = [];\n $.each(node.children, function () {\n result.children.push(self._convertData(this));\n });\n }\n\n return result;\n }\n });\n\n return $.mage.categoryTree;\n});\n","Magento_Catalog/js/price-options.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'underscore',\n 'mage/template',\n 'priceUtils',\n 'priceBox',\n 'jquery-ui-modules/widget'\n], function ($, _, mageTemplate, utils) {\n 'use strict';\n\n var globalOptions = {\n productId: null,\n priceHolderSelector: '.price-box', //data-role=\"priceBox\"\n optionsSelector: '.product-custom-option',\n optionConfig: {},\n optionHandlers: {},\n optionTemplate: '<%= data.label %>' +\n '<% if (data.finalPrice.value > 0) { %>' +\n ' +<%- data.finalPrice.formatted %>' +\n '<% } else if (data.finalPrice.value < 0) { %>' +\n ' <%- data.finalPrice.formatted %>' +\n '<% } %>',\n controlContainer: 'dd'\n };\n\n /**\n * Custom option preprocessor\n * @param {jQuery} element\n * @param {Object} optionsConfig - part of config\n * @return {Object}\n */\n function defaultGetOptionValue(element, optionsConfig) {\n var changes = {},\n optionValue = element.val(),\n optionId = utils.findOptionId(element[0]),\n optionName = element.prop('name'),\n optionType = element.prop('type'),\n optionConfig = optionsConfig[optionId],\n optionHash = optionName;\n\n switch (optionType) {\n case 'text':\n case 'textarea':\n changes[optionHash] = optionValue ? optionConfig.prices : {};\n break;\n\n case 'radio':\n if (element.is(':checked')) {\n changes[optionHash] = optionConfig[optionValue] && optionConfig[optionValue].prices || {};\n }\n break;\n\n case 'select-one':\n changes[optionHash] = optionConfig[optionValue] && optionConfig[optionValue].prices || {};\n break;\n\n case 'select-multiple':\n _.each(optionConfig, function (row, optionValueCode) {\n optionHash = optionName + '##' + optionValueCode;\n changes[optionHash] = _.contains(optionValue, optionValueCode) ? row.prices : {};\n });\n break;\n\n case 'checkbox':\n optionHash = optionName + '##' + optionValue;\n changes[optionHash] = element.is(':checked') ? optionConfig[optionValue].prices : {};\n break;\n\n case 'file':\n // Checking for 'disable' property equal to checking DOMNode with id*=\"change-\"\n changes[optionHash] = optionValue || element.prop('disabled') ? optionConfig.prices : {};\n break;\n }\n\n return changes;\n }\n\n $.widget('mage.priceOptions', {\n options: globalOptions,\n\n /**\n * @private\n */\n _init: function initPriceBundle() {\n $(this.options.optionsSelector, this.element).trigger('change');\n },\n\n /**\n * Widget creating method.\n * Triggered once.\n * @private\n */\n _create: function createPriceOptions() {\n var form = this.element,\n options = $(this.options.optionsSelector, form),\n priceBox = $(this.options.priceHolderSelector, $(this.options.optionsSelector).element);\n\n if (priceBox.data('magePriceBox') &&\n priceBox.priceBox('option') &&\n priceBox.priceBox('option').priceConfig\n ) {\n if (priceBox.priceBox('option').priceConfig.optionTemplate) {\n this._setOption('optionTemplate', priceBox.priceBox('option').priceConfig.optionTemplate);\n }\n this._setOption('priceFormat', priceBox.priceBox('option').priceConfig.priceFormat);\n }\n\n this._applyOptionNodeFix(options);\n\n options.on('change', this._onOptionChanged.bind(this));\n },\n\n /**\n * Custom option change-event handler\n * @param {Event} event\n * @private\n */\n _onOptionChanged: function onOptionChanged(event) {\n var changes,\n option = $(event.target),\n handler = this.options.optionHandlers[option.data('role')];\n\n option.data('optionContainer', option.closest(this.options.controlContainer));\n\n if (handler && handler instanceof Function) {\n changes = handler(option, this.options.optionConfig, this);\n } else {\n changes = defaultGetOptionValue(option, this.options.optionConfig);\n }\n $(this.options.priceHolderSelector).trigger('updatePrice', changes);\n },\n\n /**\n * Helper to fix issue with option nodes:\n * - you can't place any html in option ->\n * so you can't style it via CSS\n * @param {jQuery} options\n * @private\n */\n _applyOptionNodeFix: function applyOptionNodeFix(options) {\n var config = this.options,\n format = config.priceFormat,\n template = config.optionTemplate;\n\n template = mageTemplate(template);\n options.filter('select').each(function (index, element) {\n var $element = $(element),\n optionId = utils.findOptionId($element),\n optionConfig = config.optionConfig && config.optionConfig[optionId];\n\n $element.find('option').each(function (idx, option) {\n var $option,\n optionValue,\n toTemplate,\n prices;\n\n $option = $(option);\n optionValue = $option.val();\n\n if (!optionValue && optionValue !== 0) {\n return;\n }\n\n toTemplate = {\n data: {\n label: optionConfig[optionValue] && optionConfig[optionValue].name\n }\n };\n prices = optionConfig[optionValue] ? optionConfig[optionValue].prices : null;\n\n if (prices) {\n _.each(prices, function (price, type) {\n var value = +price.amount;\n\n value += _.reduce(price.adjustments, function (sum, x) { //eslint-disable-line\n return sum + x;\n }, 0);\n toTemplate.data[type] = {\n value: value,\n formatted: utils.formatPriceLocale(value, format)\n };\n });\n\n $option.text(template(toTemplate));\n }\n });\n });\n },\n\n /**\n * Custom behavior on getting options:\n * now widget able to deep merge accepted configuration with instance options.\n * @param {Object} options\n * @return {$.Widget}\n * @private\n */\n _setOptions: function setOptions(options) {\n $.extend(true, this.options, options);\n this._super(options);\n\n return this;\n }\n });\n\n return $.mage.priceOptions;\n});\n","Magento_Catalog/js/edit-tree.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* eslint-disable no-undef */\n// jscs:disable jsDoc\n\nrequire([\n 'jquery',\n 'Magento_Ui/js/modal/confirm',\n 'Magento_Ui/js/modal/alert',\n 'loadingPopup',\n 'mage/backend/floating-header'\n], function (jQuery, confirm) {\n 'use strict';\n\n /**\n * Delete some category\n * This routine get categoryId explicitly, so even if currently selected tree node is out of sync\n * with this form, we surely delete same category in the tree and at backend.\n *\n * @deprecated\n * @see deleteConfirm\n */\n function categoryDelete(url) {\n confirm({\n content: 'Are you sure you want to delete this category?',\n actions: {\n confirm: function () {\n location.href = url;\n }\n }\n });\n }\n\n function displayLoadingMask() {\n jQuery('body').loadingPopup();\n }\n\n window.categoryDelete = categoryDelete;\n window.displayLoadingMask = displayLoadingMask;\n});\n","Magento_Catalog/js/price-utils.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'jquery',\n 'underscore'\n], function ($, _) {\n 'use strict';\n\n var globalPriceFormat = {\n requiredPrecision: 2,\n integerRequired: 1,\n decimalSymbol: ',',\n groupSymbol: ',',\n groupLength: ','\n };\n\n /**\n * Repeats {string} {times} times\n * @param {String} string\n * @param {Number} times\n * @return {String}\n */\n function stringPad(string, times) {\n return new Array(times + 1).join(string);\n }\n\n /**\n * Format the price with the compliance to the specified locale\n *\n * @param {Number} amount\n * @param {Object} format\n * @param {Boolean} isShowSign\n */\n function formatPriceLocale(amount, format, isShowSign)\n {\n var s = '',\n precision, pattern, locale, r;\n\n format = _.extend(globalPriceFormat, format);\n precision = isNaN(format.requiredPrecision = Math.abs(format.requiredPrecision)) ? 2 : format.requiredPrecision;\n pattern = format.pattern || '%s';\n locale = window.LOCALE || 'en-US';\n if (isShowSign === undefined || isShowSign === true) {\n s = amount < 0 ? '-' : isShowSign ? '+' : '';\n } else if (isShowSign === false) {\n s = '';\n }\n pattern = pattern.indexOf('{sign}') < 0 ? s + pattern : pattern.replace('{sign}', s);\n amount = Number(Math.round(Math.abs(+amount || 0) + 'e+' + precision) + ('e-' + precision));\n r = amount.toLocaleString(locale, {minimumFractionDigits: precision});\n\n return pattern.replace('%s', r).replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }\n\n /**\n * Formatter for price amount\n * @param {Number} amount\n * @param {Object} format\n * @param {Boolean} isShowSign\n * @return {String} Formatted value\n * @deprecated\n */\n function formatPrice(amount, format, isShowSign) {\n var s = '',\n precision, integerRequired, decimalSymbol, groupSymbol, groupLength, pattern, i, pad, j, re, r, am;\n\n format = _.extend(globalPriceFormat, format);\n\n // copied from price-option.js | Could be refactored with varien/js.js\n\n precision = isNaN(format.requiredPrecision = Math.abs(format.requiredPrecision)) ? 2 : format.requiredPrecision;\n integerRequired = isNaN(format.integerRequired = Math.abs(format.integerRequired)) ? 1 : format.integerRequired;\n decimalSymbol = format.decimalSymbol === undefined ? ',' : format.decimalSymbol;\n groupSymbol = format.groupSymbol === undefined ? '.' : format.groupSymbol;\n groupLength = format.groupLength === undefined ? 3 : format.groupLength;\n pattern = format.pattern || '%s';\n\n if (isShowSign === undefined || isShowSign === true) {\n s = amount < 0 ? '-' : isShowSign ? '+' : '';\n } else if (isShowSign === false) {\n s = '';\n }\n pattern = pattern.indexOf('{sign}') < 0 ? s + pattern : pattern.replace('{sign}', s);\n\n // we're avoiding the usage of to fixed, and using round instead with the e representation to address\n // numbers like 1.005 = 1.01. Using ToFixed to only provide trailing zeroes in case we have a whole number\n i = parseInt(\n amount = Number(Math.round(Math.abs(+amount || 0) + 'e+' + precision) + ('e-' + precision)),\n 10\n ) + '';\n pad = i.length < integerRequired ? integerRequired - i.length : 0;\n\n i = stringPad('0', pad) + i;\n\n j = i.length > groupLength ? i.length % groupLength : 0;\n re = new RegExp('(\\\\d{' + groupLength + '})(?=\\\\d)', 'g');\n\n // replace(/-/, 0) is only for fixing Safari bug which appears\n // when Math.abs(0).toFixed() executed on '0' number.\n // Result is '0.-0' :(\n\n am = Number(Math.round(Math.abs(amount - i) + 'e+' + precision) + ('e-' + precision));\n r = (j ? i.substr(0, j) + groupSymbol : '') +\n i.substr(j).replace(re, '$1' + groupSymbol) +\n (precision ? decimalSymbol + am.toFixed(precision).replace(/-/, 0).slice(2) : '');\n\n return pattern.replace('%s', r).replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }\n\n /**\n * Deep clone of Object. Doesn't support functions\n * @param {Object} obj\n * @return {Object}\n */\n function objectDeepClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n\n /**\n * Helper to find ID in name attribute\n * @param {jQuery} element\n * @returns {undefined|String}\n */\n function findOptionId(element) {\n var re, id, name;\n\n if (!element) {\n return id;\n }\n name = $(element).attr('name');\n\n if (name.indexOf('[') !== -1) {\n re = /\\[([^\\]]+)?\\]/;\n } else {\n re = /_([^\\]]+)?_/; // just to support file-type-option\n }\n id = re.exec(name) && re.exec(name)[1];\n\n if (id) {\n return id;\n }\n }\n\n return {\n formatPriceLocale: formatPriceLocale,\n formatPrice: formatPrice,\n deepClone: objectDeepClone,\n strPad: stringPad,\n findOptionId: findOptionId\n };\n});\n","Magento_Catalog/js/product/weight-handler.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'jquery'\n], function ($) {\n 'use strict';\n\n return {\n\n /**\n * Get weight\n * @returns {*|jQuery|HTMLElement}\n */\n $weight: function () {\n return $('#weight');\n },\n\n /**\n * Weight Switcher\n * @returns {*|jQuery|HTMLElement}\n */\n $weightSwitcher: function () {\n return $('[data-role=weight-switcher]');\n },\n\n /**\n * Weight Change Toggle\n * @returns {*|jQuery|HTMLElement}\n */\n $weightChangeToggle: function () {\n return $('#toggle_weight');\n },\n\n /**\n * Is locked\n * @returns {*}\n */\n isLocked: function () {\n return this.$weight().is('[data-locked]');\n },\n\n /**\n * Disabled\n */\n disabled: function () {\n this.$weight().addClass('ignore-validate').prop('disabled', true);\n },\n\n /**\n * Enabled\n */\n enabled: function () {\n this.$weight().removeClass('ignore-validate').prop('disabled', false);\n },\n\n /**\n * Disabled Switcher\n */\n disabledSwitcher: function () {\n this.$weightSwitcher().find('input[type=\"radio\"]').addClass('ignore-validate').prop('disabled', true);\n },\n\n /**\n * Enabled Switcher\n */\n enabledSwitcher: function () {\n this.$weightSwitcher().find('input[type=\"radio\"]').removeClass('ignore-validate').prop('disabled', false);\n },\n\n /**\n * Switch Weight\n * @returns {*}\n */\n switchWeight: function () {\n if (this.hasWeightChangeToggle()) {\n return;\n }\n\n return this.productHasWeightBySwitcher() ? this.enabled() : this.disabled();\n },\n\n /**\n * Toggle Switcher\n */\n toggleSwitcher: function () {\n this.isWeightChanging() ? this.enabledSwitcher() : this.disabledSwitcher();\n },\n\n /**\n * Hide weight switcher\n */\n hideWeightSwitcher: function () {\n this.$weightSwitcher().hide();\n },\n\n /**\n * Has weight switcher\n * @returns {*}\n */\n hasWeightSwitcher: function () {\n return this.$weightSwitcher().is(':visible');\n },\n\n /**\n * Has weight\n * @returns {*}\n */\n hasWeight: function () {\n return this.$weight.is(':visible');\n },\n\n /**\n * Has weight change toggle\n * @returns {*}\n */\n hasWeightChangeToggle: function () {\n return this.$weightChangeToggle().is(':visible');\n },\n\n /**\n * Product has weight\n * @returns {Bool}\n */\n productHasWeightBySwitcher: function () {\n return $('input:checked', this.$weightSwitcher()).val() === '1';\n },\n\n /**\n * Product weight toggle is checked\n * @returns {Bool}\n */\n isWeightChanging: function () {\n return this.$weightChangeToggle().is(':checked');\n },\n\n /**\n * Change\n * @param {String} data\n */\n change: function (data) {\n var value = data !== undefined ? +data : !this.productHasWeightBySwitcher();\n\n $('input[value=' + value + ']', this.$weightSwitcher()).prop('checked', true);\n this.switchWeight();\n },\n\n /**\n * Constructor component\n */\n 'Magento_Catalog/js/product/weight-handler': function () {\n this.bindAll();\n\n if (this.hasWeightSwitcher()) {\n this.switchWeight();\n }\n\n if (this.hasWeightChangeToggle()) {\n this.toggleSwitcher();\n }\n },\n\n /**\n * Bind all\n */\n bindAll: function () {\n this.$weightSwitcher().find('input').on('change', this.switchWeight.bind(this));\n }\n };\n});\n","Magento_Catalog/js/product/addtocompare-button.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/grid/columns/column',\n 'Magento_Catalog/js/product/uenc-processor',\n 'Magento_Catalog/js/product/list/column-status-validator'\n], function (Column, uencProcessor, columnStatusValidator) {\n 'use strict';\n\n return Column.extend({\n defaults: {\n label: ''\n },\n\n /**\n * Prepare Data-Post data that will be used in data-mage-init\n *\n * @param {Object} row\n * @returns {Array}\n */\n getDataPost: function (row) {\n return uencProcessor(row['add_to_compare_button'].url ||\n row['add_to_compare_button']['post_data']);\n },\n\n /**\n * Depends on this option, \"Add to compare\" button can be shown or hide. Depends on backend configuration\n *\n * @returns {Boolean}\n */\n isAllowed: function () {\n return columnStatusValidator.isValid(this.source(), 'add_to_compare', 'show_buttons');\n },\n\n /**\n * Get button label.\n *\n * @return {String}\n */\n getLabel: function () {\n return this.label;\n }\n });\n});\n","Magento_Catalog/js/product/name.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/grid/columns/column',\n 'Magento_Catalog/js/product/list/column-status-validator',\n 'escaper'\n], function (Column, columnStatusValidator, escaper) {\n 'use strict';\n\n return Column.extend({\n defaults: {\n allowedTags: ['div', 'span', 'b', 'strong', 'i', 'em', 'u', 'a']\n },\n\n /**\n * Depends on this option, product name can be shown or hide. Depends on backend configuration\n *\n * @returns {Boolean}\n */\n isAllowed: function () {\n return columnStatusValidator.isValid(this.source(), 'name', 'show_attributes');\n },\n\n /**\n * Name column.\n *\n * @param {String} label\n * @returns {String}\n */\n getNameUnsanitizedHtml: function (label) {\n return escaper.escapeHtml(label, this.allowedTags);\n }\n });\n});\n","Magento_Catalog/js/product/addtocart-button.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/grid/columns/column',\n 'Magento_Catalog/js/product/uenc-processor',\n 'Magento_Catalog/js/product/list/column-status-validator'\n], function (Element, uencProcessor, columnStatusValidator) {\n 'use strict';\n\n return Element.extend({\n defaults: {\n label: ''\n },\n\n /**\n * Prepare data, that will be inserted as data-mage-init attribute into button. With help of this attribute\n * Add To * buttons can understand post data and urls\n *\n * @param {Object} row\n * @returns {String}\n */\n getDataMageInit: function (row) {\n return '{\"redirectUrl\": { \"url\" : \"' + uencProcessor(row['add_to_cart_button'].url) + '\"}}';\n },\n\n /**\n * Prepare Data-Post data that will be used in data-mage-init\n *\n * @param {Object} row\n * @return {String}\n */\n getDataPost: function (row) {\n return uencProcessor(row['add_to_cart_button']['post_data']);\n },\n\n /**\n * Check if product has required options.\n *\n * @param {Object} row\n * @return {Boolean}\n */\n hasRequiredOptions: function (row) {\n return row['add_to_cart_button']['required_options'];\n },\n\n /**\n * Depends on this option, \"Add to cart\" button can be shown or hide\n *\n * @param {Object} row\n * @returns {Boolean}\n */\n isSalable: function (row) {\n return row['is_salable'];\n },\n\n /**\n * Depends on this option, stock status text can be \"In stock\" or \"Out Of Stock\"\n *\n * @param {Object} row\n * @returns {Boolean}\n */\n isAvailable: function (row) {\n return row['is_available'];\n },\n\n /**\n * Depends on this option, \"Add to cart\" button can be shown or hide. Depends on backend configuration\n *\n * @returns {Boolean}\n */\n isAllowed: function () {\n return columnStatusValidator.isValid(this.source(), 'add_to_cart', 'show_buttons');\n },\n\n /**\n * Get button label.\n *\n * @return {String}\n */\n getLabel: function () {\n return this.label;\n }\n });\n});\n","Magento_Catalog/js/product/learn-more.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/grid/columns/column',\n 'Magento_Catalog/js/product/list/column-status-validator'\n], function (Column, columnStatusValidator) {\n 'use strict';\n\n return Column.extend({\n /**\n * Depends on this option, \"Learn More\" link can be shown or hide. Depends on backend configuration\n *\n * @returns {Boolean}\n */\n isAllowed: function () {\n return columnStatusValidator.isValid(this.source(), 'learn_more', 'show_attributes');\n }\n });\n});\n","Magento_Catalog/js/product/list/listing.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'ko',\n 'underscore',\n 'Magento_Ui/js/grid/listing'\n], function (ko, _, Listing) {\n 'use strict';\n\n return Listing.extend({\n defaults: {\n additionalClasses: '',\n filteredRows: {},\n limit: 5,\n listens: {\n elems: 'filterRowsFromCache',\n '${ $.provider }:data.items': 'filterRowsFromServer'\n }\n },\n\n /** @inheritdoc */\n initialize: function () {\n this._super();\n this.filteredRows = ko.observable();\n this.initProductsLimit();\n this.hideLoader();\n },\n\n /**\n * Initialize product limit\n * Product limit can be configured through Ui component.\n * Product limit are present in widget form\n *\n * @returns {exports}\n */\n initProductsLimit: function () {\n if (this.source['page_size']) {\n this.limit = this.source['page_size'];\n }\n\n return this;\n },\n\n /**\n * Initializes observable properties.\n *\n * @returns {Listing} Chainable.\n */\n initObservable: function () {\n this._super()\n .track({\n rows: []\n });\n\n return this;\n },\n\n /**\n * Sort and filter rows, that are already in magento storage cache\n *\n * @return void\n */\n filterRowsFromCache: function () {\n this._filterRows(this.rows);\n },\n\n /**\n * Sort and filter rows, that are come from backend\n *\n * @param {Object} rows\n */\n filterRowsFromServer: function (rows) {\n this._filterRows(rows);\n },\n\n /**\n * Filter rows by limit and sort them\n *\n * @param {Array} rows\n * @private\n */\n _filterRows: function (rows) {\n this.filteredRows(_.sortBy(rows, 'added_at').reverse().slice(0, this.limit));\n },\n\n /**\n * Can retrieve product url\n *\n * @param {Object} row\n * @returns {String}\n */\n getUrl: function (row) {\n return row.url;\n },\n\n /**\n * Get product attribute by code.\n *\n * @param {String} code\n * @return {Object}\n */\n getComponentByCode: function (code) {\n var elems = this.elems() ? this.elems() : ko.getObservable(this, 'elems'),\n component;\n\n component = _.filter(elems, function (elem) {\n return elem.index === code;\n }, this).pop();\n\n return component;\n }\n });\n});\n","Magento_Catalog/js/product/list/column-status-validator.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'underscore'\n], function (_) {\n 'use strict';\n\n return _.extend({\n /**\n * Check whether we can show column depends on server settings or not\n *\n * @param {Object} source\n * @param {String} attributeCode\n * @param {String} type\n * @returns {Boolean}\n */\n isValid: function (source, attributeCode, type) {\n var attributes;\n\n if (!source[type]) {\n return false;\n }\n\n attributes = source[type].split(',');\n\n return _.contains(attributes, attributeCode);\n }\n });\n});\n","Magento_Catalog/js/product/list/columns/price-box.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'ko',\n 'underscore',\n 'uiRegistry',\n 'mageUtils',\n 'uiCollection',\n 'Magento_Catalog/js/product/list/column-status-validator',\n 'uiLayout'\n], function (ko, _, registry, utils, Collection, columnStatusValidator, layout) {\n 'use strict';\n\n return Collection.extend({\n defaults: {\n label: '',\n hasSpecialPrice: false,\n showMinimalPrice: false,\n useLinkForAsLowAs: false,\n visible: true,\n headerTmpl: 'ui/grid/columns/text',\n bodyTmpl: 'Magento_Catalog/product/price/price_box',\n disableAction: false,\n controlVisibility: true,\n sortable: false,\n sorting: false,\n draggable: true,\n fieldClass: {},\n renders: {\n default: {}\n },\n ignoreTmpls: {\n fieldAction: true\n },\n statefull: {\n visible: true,\n sorting: true\n },\n imports: {\n exportSorting: 'sorting'\n },\n listens: {\n elems: ''\n },\n modules: {\n source: '${ $.provider }'\n },\n pricesInit: {}\n },\n\n /**\n * Sort prices api\n *\n * @returns {exports}\n */\n sort: function () {\n return this;\n },\n\n /**\n * Check whether is allowed to render price or not\n *\n * @returns {*}\n */\n isAllowed: function () {\n return columnStatusValidator.isValid(this.source(), 'price', 'show_attributes');\n },\n\n /**\n * Retrieve array of prices, that should be rendered for specific product\n *\n * @param {Array} row\n * @return {Array}\n */\n getPrices: function (row) {\n var elems = this.elems() ? this.elems() : ko.getObservable(this, 'elems'),\n result;\n\n //we cant take type of product from row\n this.initPrices(row);\n result = _.filter(elems, function (elem) {\n return elem.productType === row.type;\n });\n\n return result;\n },\n\n /**\n * Recursive Merging of objects\n *\n * @param {Array} target\n * @param {Array} source\n * @returns {Array}\n * @private\n */\n _deepObjectExtend: function (target, source) {\n var _target = utils.copy(target);\n\n _.each(source, function (value, key) {\n if (_.keys(value).length && typeof _target[key] !== 'undefined') {\n _target[key] = this._deepObjectExtend(_target[key], value);\n } else {\n _target[key] = value;\n }\n }, this);\n\n return _target;\n },\n\n /**\n * Init price type box, in cases when product type has custom component or bodyTmpl\n *\n * @param {String} productType\n * @private\n */\n _initPriceWithCustomMetaData: function (productType) {\n var price = this._deepObjectExtend(\n this.renders.prices['default'],\n this.renders.prices[productType]\n );\n\n price.name = productType + '.default';\n price.parent = this.name;\n price.source = this.source;\n price.productType = productType;\n layout([price]);\n },\n\n /**\n * Init Prices by product type and add them to layout\n *\n * @param {Array} _priceData\n * @param {String} productType\n * @private\n */\n _initPricesForProductType: function (_priceData, productType) {\n var prices = [];\n\n this._setPriceNamesToPrices(_priceData, productType);\n _.sortBy(_priceData, this._comparePrices);\n\n _.each(_priceData, function (priceData) {\n if (!priceData.component) {\n return;\n }\n\n priceData.parent = this.name;\n priceData.provider = this.provider;\n priceData.productType = productType;\n priceData = utils.template(priceData, this);\n prices.push(priceData);\n }, this);\n\n layout(prices);\n },\n\n /**\n * Init dynamic price components\n *\n * @param {Array} row\n * @returns {void}\n */\n initPrices: function (row) {\n var _priceData = [],\n productType = row.type,\n defaultPrice = this.renders.prices['default'];\n\n if (this.pricesInit[productType]) {\n return true;\n }\n\n this.pricesInit[productType] = true;\n\n if (this.renders.prices[productType] && this._needToApplyCustomTemplate(this.renders.prices[productType])) {\n return this._initPriceWithCustomMetaData(productType);\n }\n\n if (this.renders.prices[productType] && this.renders.prices[productType].children) {\n _priceData = this._deepObjectExtend(defaultPrice.children, this.renders.prices[productType].children);\n } else {\n _priceData = defaultPrice.children;\n }\n\n return this._initPricesForProductType(_priceData, productType);\n },\n\n /**\n * Set name to all price components\n *\n * @param {Array} prices\n * @param {String} productType\n * @private\n */\n _setPriceNamesToPrices: function (prices, productType) {\n _.each(prices, function (price, name) {\n price.priceType = name;\n price.name = name + '.' + productType;\n });\n\n return prices;\n },\n\n /**\n * Sort callback to compare prices by sort order\n *\n * @param {Number} firstPrice\n * @param {Number} secondPrice\n * @returns {Number}\n * @private\n */\n _comparePrices: function (firstPrice, secondPrice) {\n if (firstPrice.sortOrder < secondPrice.sortOrder) {\n return -1;\n }\n\n if (firstPrice.sortOrder > secondPrice.sortOrder) {\n return 1;\n }\n\n return 0;\n },\n\n /**\n * Check whether metadata of product type prices was changed, and we should\n * to apply custom template or custom component\n *\n * @param {Array} productData\n * @returns {*}\n * @private\n */\n _needToApplyCustomTemplate: function (productData) {\n return productData.bodyTmpl || productData.component;\n },\n\n /**\n * Returns path to the columns' body template.\n *\n * @returns {String}\n */\n getBody: function () {\n return this.bodyTmpl;\n },\n\n /**\n * Get price label.\n *\n * @returns {String}\n */\n getLabel: function () {\n return this.label;\n }\n });\n});\n","Magento_Catalog/js/product/list/columns/final-price.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'underscore',\n 'uiRegistry',\n 'mageUtils',\n 'uiCollection'\n], function (_, registry, utils, Collection) {\n 'use strict';\n\n return Collection.extend({\n defaults: {\n label: false,\n headerTmpl: 'ui/grid/columns/text',\n showMinimalPrice: false,\n showMaximumPrice: false,\n useLinkForAsLowAs: false,\n bodyTmpl: 'Magento_Catalog/product/final_price',\n priceWrapperCssClasses: '',\n priceWrapperAttr: {}\n },\n\n /**\n * Get product final price.\n *\n * @param {Object} row\n * @return {HTMLElement} final price html\n */\n getPrice: function (row) {\n return row['price_info']['formatted_prices']['final_price'];\n },\n\n /**\n * UnsanitizedHtml version of getPrice.\n *\n * @param {Object} row\n * @return {HTMLElement} final price html\n */\n getPriceUnsanitizedHtml: function (row) {\n return this.getPrice(row);\n },\n\n /**\n * Get product regular price.\n *\n * @param {Object} row\n * @return {HTMLElement} regular price html\n */\n getRegularPrice: function (row) {\n return row['price_info']['formatted_prices']['regular_price'];\n },\n\n /**\n * UnsanitizedHtml version of getRegularPrice.\n *\n * @param {Object} row\n * @return {HTMLElement} regular price html\n */\n getRegularPriceUnsanitizedHtml: function (row) {\n return this.getRegularPrice(row);\n },\n\n /**\n * Check if product has a price range.\n *\n * @param {Object} row\n * @return {Boolean}\n */\n hasPriceRange: function (row) {\n return row['price_info']['max_regular_price'] !== row['price_info']['min_regular_price'];\n },\n\n /**\n * Check if product has special price.\n *\n * @param {Object} row\n * @return {HTMLElement} special price html\n */\n hasSpecialPrice: function (row) {\n return row['price_info']['regular_price'] > row['price_info']['final_price'];\n },\n\n /**\n * Check if product has minimal price.\n *\n * @param {Object} row\n * @return {HTMLElement} minimal price html\n */\n isMinimalPrice: function (row) {\n return row['price_info']['minimal_price'] < row['price_info']['final_price'];\n },\n\n /**\n * Get product minimal price.\n *\n * @param {Object} row\n * @return {HTMLElement} minimal price html\n */\n getMinimalPrice: function (row) {\n return row['price_info']['formatted_prices']['minimal_price'];\n },\n\n /**\n * UnsanitizedHtml version of getMinimalPrice.\n *\n * @param {Object} row\n * @return {HTMLElement} minimal price html\n */\n getMinimalPriceUnsanitizedHtml: function (row) {\n return this.getMinimalPrice(row);\n },\n\n /**\n * Check if product is salable.\n *\n * @param {Object} row\n * @return {Boolean}\n */\n isSalable: function (row) {\n return row['is_salable'];\n },\n\n /**\n * Get product maximum price.\n *\n * @param {Object} row\n * @return {HTMLElement} maximum price html\n */\n getMaxPrice: function (row) {\n return row['price_info']['formatted_prices']['max_price'];\n },\n\n /**\n * UnsanitizedHtml version of getMaxPrice.\n *\n * @param {Object} row\n * @return {HTMLElement} maximum price html\n */\n getMaxPriceUnsanitizedHtml: function (row) {\n return this.getMaxPrice(row);\n },\n\n /**\n * Get product maximum regular price in case of price range and special price.\n *\n * @param {Object} row\n * @return {HTMLElement} maximum regular price html\n */\n getMaxRegularPrice: function (row) {\n return row['price_info']['formatted_prices']['max_regular_price'];\n },\n\n /**\n * UnsanitizedHtml version of getMaxRegularPrice.\n *\n * @param {Object} row\n * @return {HTMLElement} maximum regular price html\n */\n getMaxRegularPriceUnsanitizedHtml: function (row) {\n return this.getMaxRegularPrice(row);\n },\n\n /**\n * Get product minimal regular price in case of price range and special price.\n *\n * @param {Object} row\n * @return {HTMLElement} minimal regular price html\n */\n getMinRegularPrice: function (row) {\n return row['price_info']['formatted_prices']['min_regular_price'];\n },\n\n /**\n * UnsanitizedHtml version of getMinRegularPrice.\n *\n * @param {Object} row\n * @return {HTMLElement} minimal regular price html\n */\n getMinRegularPriceUnsanitizedHtml: function (row) {\n return this.getMinRegularPrice(row);\n },\n\n /**\n * Get adjustments names and return as string.\n *\n * @return {String} adjustments classes\n */\n getAdjustmentCssClasses: function () {\n return _.pluck(this.getAdjustments(), 'index').join(' ');\n },\n\n /**\n * Get product minimal price as number.\n *\n * @param {Object} row\n * @return {Number} minimal price amount\n */\n getMinimalPriceAmount: function (row) {\n return row['price_info']['minimal_price'];\n },\n\n /**\n * UnsanitizedHtml version of getMinimalPriceAmount\n *\n * @param {Object} row\n * @return {Number} minimal price amount\n */\n getMinimalPriceAmountUnsanitizedHtml: function (row) {\n return this.getMinimalPriceAmount(row);\n },\n\n /**\n * Get product minimal regular price as number in case of special price.\n *\n * @param {Object} row\n * @return {Number} minimal regular price amount\n */\n getMinimalRegularPriceAmount: function (row) {\n return row['price_info']['min_regular_price'];\n },\n\n /**\n * Get product maximum price as number.\n *\n * @param {Object} row\n * @return {Number} maximum price amount\n */\n getMaximumPriceAmount: function (row) {\n return row['price_info']['max_price'];\n },\n\n /**\n * Get product maximum regular price as number in case of special price.\n *\n * @param {Object} row\n * @return {Number} maximum regular price amount\n */\n getMaximumRegularPriceAmount: function (row) {\n return row['price_info']['max_regular_price'];\n },\n\n /**\n * Check if minimal regular price exist for product.\n *\n * @param {Object} row\n * @return {Boolean}\n */\n showMinRegularPrice: function (row) {\n return this.getMinimalPriceAmount(row) < this.getMinimalRegularPriceAmount(row);\n },\n\n /**\n * Check if maximum regular price exist for product.\n *\n * @param {Object} row\n * @return {Boolean}\n */\n showMaxRegularPrice: function (row) {\n return this.getMaximumPriceAmount(row) < this.getMaximumRegularPriceAmount(row);\n },\n\n /**\n * Get path to the columns' body template.\n *\n * @returns {String}\n */\n getBody: function () {\n return this.bodyTmpl;\n },\n\n /**\n * Get all price adjustments.\n *\n * @returns {Object}\n */\n getAdjustments: function () {\n var adjustments = this.elems();\n\n _.each(adjustments, function (adjustment) {\n adjustment.setPriceType(this.priceType);\n adjustment.source = this.source;\n }, this);\n\n return adjustments;\n }\n });\n});\n","Magento_Catalog/js/product/list/columns/pricetype-box.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'ko',\n 'underscore',\n 'uiCollection'\n], function (ko, _, Collection) {\n 'use strict';\n\n return Collection.extend({\n /**\n * Find from all price ui components, price with specific code, init source on it and set priceType\n *\n * @param {String} code\n * @returns {*|T}\n */\n getPriceByCode: function (code) {\n var elems = this.elems() ? this.elems() : ko.getObservable(this, 'elems'),\n price;\n\n price = _.filter(elems, function (elem) {\n return elem.index.split('.').shift() === code;\n }, this).pop();\n\n price.source = this.source();\n price.priceType = code;\n\n return price;\n },\n\n /**\n * Retrieve body template\n *\n * @returns {String}\n */\n getBody: function () {\n return this.bodyTmpl;\n },\n\n /**\n * Check whether price has price range, depends on different options, that can be choose\n *\n * @param {Object} row\n * @returns {Boolean}\n */\n hasPriceRange: function (row) {\n return row['price_info']['max_regular_price'] !== row['price_info']['min_regular_price'];\n }\n });\n});\n","Magento_Catalog/js/product/list/columns/image.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'underscore',\n 'Magento_Ui/js/grid/columns/column',\n 'Magento_Catalog/js/product/list/column-status-validator'\n], function (_, Element, columnStatusValidator) {\n 'use strict';\n\n return Element.extend({\n defaults: {\n bodyTmpl: 'Magento_Catalog/product/list/columns/image',\n imageCode: 'default',\n image: {}\n },\n\n /**\n * Find image by code in scope of images\n *\n * @param {Object} images\n * @returns {*|T}\n */\n getImage: function (images) {\n return _.filter(images, function (image) {\n return this.imageCode === image.code;\n }, this).pop();\n },\n\n /**\n * Get image path.\n *\n * @param {Object} row\n * @return {String}\n */\n getImageUrl: function (row) {\n return this.getImage(row.images).url;\n },\n\n /**\n * Get image box width.\n *\n * @param {Object} row\n * @return {Number}\n */\n getWidth: function (row) {\n return this.getImage(row.images).width;\n },\n\n /**\n * Get image box height.\n *\n * @param {Object} row\n * @return {Number}\n */\n getHeight: function (row) {\n return this.getImage(row.images).height;\n },\n\n /**\n * Get resized image width.\n *\n * @param {Object} row\n * @return {Number}\n */\n getResizedImageWidth: function (row) {\n return this.getImage(row.images)['resized_width'];\n },\n\n /**\n * Get resized image height.\n *\n * @param {Object} row\n * @return {Number}\n */\n getResizedImageHeight: function (row) {\n return this.getImage(row.images)['resized_height'];\n },\n\n /**\n * Get image alt text.\n *\n * @param {Object} row\n * @return {String}\n */\n getLabel: function (row) {\n if (!this.imageExists(row)) {\n return this._super();\n }\n\n return this.getImage(row.images).label;\n },\n\n /**\n * Check if image exist.\n *\n * @param {Object} row\n * @return {Boolean}\n */\n imageExists: function (row) {\n return this.getImage(row.images) !== 'undefined';\n },\n\n /**\n * Check if component must be shown.\n *\n * @return {Boolean}\n */\n isAllowed: function () {\n return columnStatusValidator.isValid(this.source(), 'image', 'show_attributes');\n }\n });\n});\n","Magento_Catalog/js/form/element/action-delete.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'underscore',\n 'Magento_Ui/js/form/element/abstract'\n], function (_, Abstract) {\n 'use strict';\n\n return Abstract.extend({\n defaults: {\n prefixName: '',\n prefixElementName: '',\n elementName: '',\n suffixName: ''\n },\n\n /**\n * Parses options and merges the result with instance\n *\n * @param {Object} config\n * @returns {Object} Chainable.\n */\n initConfig: function (config) {\n this._super(config);\n\n this.configureDataScope();\n\n return this;\n },\n\n /**\n * Configure data scope.\n */\n configureDataScope: function () {\n var recordId,\n prefixName,\n suffixName;\n\n // Get recordId\n recordId = this.parentName.split('.').last();\n\n prefixName = this.dataScopeToHtmlArray(this.prefixName);\n this.elementName = this.prefixElementName + recordId;\n\n suffixName = '';\n\n if (!_.isEmpty(this.suffixName) || _.isNumber(this.suffixName)) {\n suffixName = '[' + this.suffixName + ']';\n }\n this.inputName = prefixName + '[' + this.elementName + ']' + suffixName;\n\n suffixName = '';\n\n if (!_.isEmpty(this.suffixName) || _.isNumber(this.suffixName)) {\n suffixName = '.' + this.suffixName;\n }\n this.dataScope = 'data.' + this.prefixName + '.' + this.elementName + suffixName;\n\n this.links.value = this.provider + ':' + this.dataScope;\n },\n\n /**\n * Get HTML array from data scope.\n *\n * @param {String} dataScopeString\n * @returns {String}\n */\n dataScopeToHtmlArray: function (dataScopeString) {\n var dataScopeArray, dataScope, reduceFunction;\n\n /**\n * Reduce\n *\n * @param {String} prev\n * @param {String} curr\n * @returns {String}\n */\n reduceFunction = function (prev, curr) {\n return prev + '[' + curr + ']';\n };\n\n dataScopeArray = dataScopeString.split('.');\n\n dataScope = dataScopeArray.shift();\n dataScope += dataScopeArray.reduce(reduceFunction, '');\n\n return dataScope;\n },\n\n /**\n * Delete record instance\n * update data provider dataScope\n *\n * @param {Object} parents\n */\n deleteRecord: function (parents) {\n this.value(1);\n parents[1].deleteRecord(parents[0].index, parents[0].recordId);\n\n return this;\n }\n });\n});\n","Magento_Catalog/js/form/element/checkbox.js":"/**\r\n * Copyright \u00a9 Magento, Inc. All rights reserved.\r\n * See COPYING.txt for license details.\r\n */\r\n\r\ndefine([\r\n 'Magento_Ui/js/form/element/single-checkbox'\r\n], function (Checkbox) {\r\n 'use strict';\r\n\r\n return Checkbox.extend({\r\n defaults: {\r\n inputCheckBoxName: '',\r\n prefixElementName: '',\r\n parentDynamicRowName: 'visual_swatch'\r\n },\r\n\r\n /**\r\n * Parses options and merges the result with instance\r\n *\r\n * @returns {Object} Chainable.\r\n */\r\n initConfig: function () {\r\n this._super();\r\n this.configureDataScope();\r\n\r\n return this;\r\n },\r\n\r\n /** @inheritdoc */\r\n initialize: function () {\r\n this._super();\r\n\r\n if (this.rows && this.rows().elems().length === 0) {\r\n this.checked(true);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Configure data scope.\r\n */\r\n configureDataScope: function () {\r\n var recordId,\r\n value;\r\n\r\n recordId = this.parentName.split('.').last();\r\n value = this.prefixElementName + recordId;\r\n\r\n this.dataScope = 'data.' + this.inputCheckBoxName;\r\n this.inputName = this.dataScopeToHtmlArray(this.inputCheckBoxName);\r\n\r\n this.initialValue = value;\r\n\r\n this.links.value = this.provider + ':' + this.dataScope;\r\n },\r\n\r\n /**\r\n * Get HTML array from data scope.\r\n *\r\n * @param {String} dataScopeString\r\n * @returns {String}\r\n */\r\n dataScopeToHtmlArray: function (dataScopeString) {\r\n var dataScopeArray, dataScope, reduceFunction;\r\n\r\n /**\r\n * Add new level of nesting.\r\n *\r\n * @param {String} prev\r\n * @param {String} curr\r\n * @returns {String}\r\n */\r\n reduceFunction = function (prev, curr) {\r\n return prev + '[' + curr + ']';\r\n };\r\n\r\n dataScopeArray = dataScopeString.split('.');\r\n\r\n dataScope = dataScopeArray.shift();\r\n dataScope += dataScopeArray.reduce(reduceFunction, '');\r\n\r\n return dataScope;\r\n }\r\n });\r\n});\r\n","Magento_Catalog/js/form/element/input.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'underscore',\n 'Magento_Ui/js/form/element/abstract'\n], function (_, Abstract) {\n 'use strict';\n\n return Abstract.extend({\n defaults: {\n prefixName: '',\n prefixElementName: '',\n elementName: '',\n suffixName: ''\n },\n\n /**\n * Parses options and merges the result with instance\n *\n * @returns {Object} Chainable.\n */\n initConfig: function () {\n this._super();\n this.configureDataScope();\n\n return this;\n },\n\n /**\n * Configure data scope.\n */\n configureDataScope: function () {\n var recordId,\n prefixName,\n suffixName;\n\n // Get recordId\n recordId = this.parentName.split('.').last();\n\n prefixName = this.dataScopeToHtmlArray(this.prefixName);\n this.elementName = this.prefixElementName + recordId;\n\n suffixName = '';\n\n if (!_.isEmpty(this.suffixName) || _.isNumber(this.suffixName)) {\n suffixName = '[' + this.suffixName + ']';\n }\n this.inputName = prefixName + '[' + this.elementName + ']' + suffixName;\n\n suffixName = '';\n\n if (!_.isEmpty(this.suffixName) || _.isNumber(this.suffixName)) {\n suffixName = '.' + this.suffixName;\n }\n\n this.exportDataLink = 'data.' + this.prefixName + '.' + this.elementName + suffixName;\n this.exports.value = this.provider + ':' + this.exportDataLink;\n },\n\n /** @inheritdoc */\n destroy: function () {\n this._super();\n\n this.source.remove(this.exportDataLink);\n },\n\n /**\n * Get HTML array from data scope.\n *\n * @param {String} dataScopeString\n * @returns {String}\n */\n dataScopeToHtmlArray: function (dataScopeString) {\n var dataScopeArray, dataScope, reduceFunction;\n\n /**\n * Add new level of nesting.\n *\n * @param {String} prev\n * @param {String} curr\n * @returns {String}\n */\n reduceFunction = function (prev, curr) {\n return prev + '[' + curr + ']';\n };\n\n dataScopeArray = dataScopeString.split('.');\n\n dataScope = dataScopeArray.shift();\n dataScope += dataScopeArray.reduce(reduceFunction, '');\n\n return dataScope;\n }\n });\n});\n","Magento_Catalog/js/components/custom-options-component.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'underscore',\n 'Magento_Ui/js/form/element/abstract'\n], function (_, Abstract) {\n 'use strict';\n\n return Abstract.extend({\n /**\n * {@inheritdoc}\n */\n setInitialValue: function () {\n this._super();\n\n this.addBefore(this.addbefore);\n\n return this;\n },\n\n /**\n * {@inheritdoc}\n */\n initObservable: function () {\n this._super();\n\n this.observe('addBefore');\n\n return this;\n }\n });\n});\n","Magento_Catalog/js/components/website-currency-symbol.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/select'\n], function (Select) {\n 'use strict';\n\n return Select.extend({\n defaults: {\n currenciesForWebsites: {},\n tracks: {\n currency: true\n }\n },\n\n /**\n * Set currency symbol per website\n *\n * @param {String} value - currency symbol\n */\n setDifferedFromDefault: function (value) {\n this.currency = this.currenciesForWebsites[value];\n\n return this._super();\n }\n });\n});\n","Magento_Catalog/js/components/disable-hide-select.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/element/select',\n 'Magento_Catalog/js/components/visible-on-option/strategy',\n 'Magento_Catalog/js/components/disable-on-option/strategy'\n], function (Element, visibleStrategy, disableStrategy) {\n 'use strict';\n\n return Element.extend(visibleStrategy).extend(disableStrategy);\n});\n","Magento_Catalog/js/components/dynamic-rows-tier-price.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'underscore',\n 'Magento_Ui/js/dynamic-rows/dynamic-rows'\n], function (_, DynamicRows) {\n 'use strict';\n\n /**\n * @deprecated Parent method contains labels sorting.\n * @see Magento_Ui/js/dynamic-rows/dynamic-rows\n */\n return DynamicRows.extend({\n\n /**\n * Init header elements\n */\n initHeader: function () {\n var labels;\n\n this._super();\n labels = _.clone(this.labels());\n labels = _.sortBy(labels, function (label) {\n return label.sortOrder;\n });\n\n this.labels(labels);\n }\n });\n});\n","Magento_Catalog/js/components/attributes-grid-paging.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/grid/paging/paging',\n 'underscore'\n], function (Paging, _) {\n 'use strict';\n\n return Paging.extend({\n defaults: {\n totalTmpl: 'Magento_Catalog/attributes/grid/paging',\n modules: {\n selectionColumn: '${ $.selectProvider }'\n },\n listens: {\n '${ $.selectProvider }:selected': 'changeLabel'\n },\n label: '',\n selectedAttrs: []\n },\n\n /**\n * Change label.\n *\n * @param {Array} selected\n */\n changeLabel: function (selected) {\n this.selectedAttrs = [];\n _.each(this.selectionColumn().rows(), function (row) {\n if (selected.indexOf(row['attribute_id']) !== -1) {\n this.selectedAttrs.push(row['attribute_code']);\n }\n }, this);\n\n this.label(this.selectedAttrs.join(', '));\n },\n\n /** @inheritdoc */\n initObservable: function () {\n this._super()\n .observe('label');\n\n return this;\n }\n });\n});\n","Magento_Catalog/js/components/url-key-handle-changes.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'Magento_Ui/js/form/element/single-checkbox'\n], function (Checkbox) {\n 'use strict';\n\n return Checkbox.extend({\n defaults: {\n imports: {\n handleUseDefault: '${ $.parentName }.use_default.url_key:checked',\n urlKey: '${ $.provider }:data.url_key'\n },\n listens: {\n urlKey: 'handleChanges'\n },\n modules: {\n useDefault: '${ $.parentName }.use_default.url_key'\n }\n },\n\n /**\n * Disable checkbox field, when 'url_key' field without changes or 'use default' field is checked\n */\n handleChanges: function (newValue) {\n this.disabled(newValue === this.valueMap['true'] || this.useDefault.checked);\n },\n\n /**\n * Disable checkbox field, when 'url_key' field without changes or 'use default' field is checked\n */\n handleUseDefault: function (checkedUseDefault) {\n this.disabled(this.urlKey === this.valueMap['true'] || checkedUseDefault);\n }\n });\n});\n","Magento_Catalog/js/components/dynamic-rows-per-page.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/dynamic-rows/dynamic-rows',\n 'underscore',\n 'mageUtils',\n 'uiLayout',\n 'rjsResolver'\n], function (DynamicRows, _, utils, layout, resolver) {\n 'use strict';\n\n return DynamicRows.extend({\n defaults: {\n sizesConfig: {\n component: 'Magento_Ui/js/grid/paging/sizes',\n name: '${ $.name }_sizes',\n options: {\n '20': {\n value: 20,\n label: 20\n },\n '30': {\n value: 30,\n label: 30\n },\n '50': {\n value: 50,\n label: 50\n },\n '100': {\n value: 100,\n label: 100\n },\n '200': {\n value: 200,\n label: 200\n }\n },\n storageConfig: {\n provider: '${ $.storageConfig.provider }',\n namespace: '${ $.storageConfig.namespace }'\n },\n enabled: false\n },\n links: {\n options: '${ $.sizesConfig.name }:options',\n pageSize: '${ $.sizesConfig.name }:value'\n },\n listens: {\n 'pageSize': 'onPageSizeChange'\n },\n modules: {\n sizes: '${ $.sizesConfig.name }'\n }\n },\n\n /**\n * Initializes paging component.\n *\n * @returns {Paging} Chainable.\n */\n initialize: function () {\n this._super()\n .initSizes();\n\n return this;\n },\n\n /**\n * Initializes sizes component.\n *\n * @returns {Paging} Chainable.\n */\n initSizes: function () {\n if (this.sizesConfig.enabled) {\n layout([this.sizesConfig]);\n }\n\n return this;\n },\n\n /**\n * Initializes observable properties.\n *\n * @returns {Paging} Chainable.\n */\n initObservable: function () {\n this._super()\n .track([\n 'pageSize'\n ]);\n\n return this;\n },\n\n /**\n * Handles changes of the page size.\n */\n onPageSizeChange: function () {\n resolver(function () {\n if (this.elems().length) {\n this.reload();\n }\n }, this);\n }\n });\n});\n","Magento_Catalog/js/components/new-category.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/ui-select'\n], function (Select) {\n 'use strict';\n\n return Select.extend({\n\n /**\n * Parse data and set it to options.\n *\n * @param {Object} data - Response data object.\n * @returns {Object}\n */\n setParsed: function (data) {\n var option = this.parseData(data);\n\n if (data.error) {\n return this;\n }\n\n this.options([]);\n this.setOption(option);\n this.set('newOption', option);\n },\n\n /**\n * Normalize option object.\n *\n * @param {Object} data - Option object.\n * @returns {Object}\n */\n parseData: function (data) {\n return {\n 'is_active': data.category['is_active'],\n level: data.category.level,\n value: data.category['entity_id'],\n label: data.category.name,\n parent: data.category.parent\n };\n }\n });\n});\n","Magento_Catalog/js/components/new-attribute-form.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/form/form',\n 'Magento_Ui/js/modal/prompt',\n 'Magento_Ui/js/modal/alert'\n], function ($, Form, prompt, alert) {\n 'use strict';\n\n return Form.extend({\n defaults: {\n newSetPromptMessage: '',\n listens: {\n responseData: 'processResponseData'\n },\n modules: {\n productForm: 'product_form.product_form'\n }\n },\n\n /**\n * Process response data\n *\n * @param {Object} data\n */\n processResponseData: function (data) {\n if (data.params['new_attribute_set_id']) {\n this.productForm().params = {\n set: data.params['new_attribute_set_id']\n };\n }\n },\n\n /**\n * Process Save In New Attribute Set prompt\n */\n saveAttributeInNewSet: function () {\n\n var self = this;\n\n this.validate();\n\n if (!this.additionalInvalid && !this.source.get('params.invalid')) {\n prompt({\n content: this.newSetPromptMessage,\n actions: {\n\n /**\n * @param {String} val\n * @this {actions}\n */\n confirm: function (val) {\n var rules = ['required-entry', 'validate-no-html-tags'],\n editForm = self,\n newAttributeSetName = val,\n i,\n params = {};\n\n if (!newAttributeSetName) {\n return;\n }\n\n for (i = 0; i < rules.length; i++) {\n if (!$.validator.methods[rules[i]](newAttributeSetName)) {\n alert({\n content: $.validator.messages[rules[i]]\n });\n\n return;\n }\n }\n\n params['new_attribute_set_name'] = newAttributeSetName;\n editForm.setAdditionalData(params);\n editForm.save();\n }\n }\n });\n } else {\n this.focusInvalid();\n }\n }\n });\n});\n","Magento_Catalog/js/components/attributes-fieldset.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/components/fieldset',\n 'Magento_Ui/js/core/app'\n], function (Fieldset, app) {\n 'use strict';\n\n return Fieldset.extend({\n defaults: {\n listens: {\n '${ $.provider }:additionalAttributes': 'onAttributeAdd'\n }\n },\n\n /**\n * On attribute add trigger\n *\n * @param {Object} listOfNewAttributes\n */\n onAttributeAdd: function (listOfNewAttributes) {\n app(listOfNewAttributes, true);\n }\n });\n});\n","Magento_Catalog/js/components/dynamic-rows-import-custom-options.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/dynamic-rows/dynamic-rows-grid',\n 'underscore',\n 'mageUtils'\n], function (DynamicRows, _, utils) {\n 'use strict';\n\n return DynamicRows.extend({\n defaults: {\n mappingSettings: {\n enabled: false,\n distinct: false\n },\n update: true,\n map: {\n 'option_id': 'option_id'\n },\n identificationProperty: 'option_id',\n identificationDRProperty: 'option_id'\n },\n\n /** @inheritdoc */\n processingInsertData: function (data) {\n var options = [],\n currentOption,\n generalContext = this;\n\n if (!data) {\n return;\n }\n _.each(data, function (item) {\n if (!item.options) {\n return;\n }\n _.each(item.options, function (option) {\n currentOption = utils.copy(option);\n\n if (currentOption.hasOwnProperty('option_id')) {\n delete currentOption['option_id'];\n }\n\n if (currentOption.values.length > 0) {\n generalContext.removeOptionsIds(currentOption.values);\n }\n options.push(currentOption);\n });\n });\n\n if (!options.length) {\n return;\n }\n this.cacheGridData = options;\n _.each(options, function (opt) {\n this.mappingValue(opt);\n }, this);\n\n this.insertData([]);\n },\n\n /**\n * Removes option_id and option_type_id from every option\n *\n * @param {Array} options\n */\n removeOptionsIds: function (options) {\n _.each(options, function (optionValue) {\n delete optionValue['option_id'];\n delete optionValue['option_type_id'];\n });\n },\n\n /** @inheritdoc */\n processingAddChild: function (ctx, index, prop) {\n if (!ctx) {\n this.showSpinner(true);\n this.addChild(ctx, index, prop);\n\n return;\n }\n\n this._super(ctx, index, prop);\n },\n\n /**\n * Set empty array to dataProvider\n */\n clearDataProvider: function () {\n this.source.set(this.dataProvider, []);\n },\n\n /**\n * Mutes parent method\n */\n updateInsertData: function () {\n return false;\n }\n });\n});\n","Magento_Catalog/js/components/attribute-set-select.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/ui-select'\n], function (Select) {\n 'use strict';\n\n return Select.extend({\n defaults: {\n listens: {\n 'value': 'changeFormSubmitUrl'\n },\n modules: {\n formProvider: '${ $.provider }'\n }\n },\n\n /**\n * Change set parameter in save and validate urls of form\n *\n * @param {String|Number} value\n */\n changeFormSubmitUrl: function (value) {\n var pattern = /(set\\/)(\\d)*?\\//,\n change = '$1' + value + '/';\n\n this.formProvider().client.urls.save = this.formProvider().client.urls.save.replace(pattern, change);\n this.formProvider().client.urls.beforeSave = this.formProvider().client.urls.beforeSave.replace(\n pattern,\n change\n );\n }\n });\n});\n","Magento_Catalog/js/components/custom-options-price-type.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'underscore',\n 'Magento_Ui/js/form/element/select',\n 'uiRegistry'\n], function (_, Select, uiRegistry) {\n 'use strict';\n\n return Select.extend({\n /**\n * {@inheritdoc}\n */\n onUpdate: function () {\n this._super();\n\n this.updateAddBeforeForPrice();\n },\n\n /**\n * {@inheritdoc}\n */\n setInitialValue: function () {\n this._super();\n\n this.updateAddBeforeForPrice();\n\n return this;\n },\n\n /**\n * Update addbefore for price field. Change it to currency or % depends of price_type value.\n */\n updateAddBeforeForPrice: function () {\n var addBefore, currentValue, priceIndex, priceName, uiPrice;\n\n priceIndex = typeof this.imports.priceIndex == 'undefined' ? 'price' : this.imports.priceIndex;\n priceName = this.parentName + '.' + priceIndex;\n\n uiPrice = uiRegistry.get(priceName);\n\n if (uiPrice && uiPrice.addbeforePool) {\n currentValue = this.value();\n\n uiPrice.addbeforePool.forEach(function (item) {\n if (item.value === currentValue) {\n addBefore = item.label;\n }\n });\n\n if (typeof addBefore != 'undefined') {\n uiPrice.addBefore(addBefore);\n }\n }\n }\n });\n});\n","Magento_Catalog/js/components/reset-dynamic-rows-grid-row-position-on-delete.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'underscore',\n 'uiRegistry',\n 'rjsResolver',\n 'Magento_Ui/js/dynamic-rows/dynamic-rows-grid'\n], function (_, registry, resolver, dynamicRowsGrid) {\n 'use strict';\n\n return dynamicRowsGrid.extend({\n\n /** @inheritdoc */\n deleteRecord: function () {\n this._super();\n this.resetPosition();\n },\n\n /**\n * Reset the position on delete of the record.\n */\n resetPosition() {\n let self = this,\n position = 0;\n\n _.filter(this.elems(), function (elem, index) {\n if (index === 0) {\n position = (self.currentPage() - 1) * self.pageSize + 1;\n }\n _.filter(elem.elems(),function (childElem) {\n if (childElem.index === 'position') {\n childElem.value(position);\n }\n });\n position++;\n });\n },\n\n /** @inheritdoc */\n nextPage: function () {\n this._super();\n resolver(function () {\n if (this.elems().length) {\n this.resetPosition();\n }\n }, this);\n }\n });\n});\n","Magento_Catalog/js/components/import-handler.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/abstract',\n 'underscore',\n 'uiRegistry'\n], function (Abstract, _, registry) {\n 'use strict';\n\n return Abstract.extend({\n defaults: {\n allowImport: true,\n autoImportIfEmpty: false,\n values: {},\n mask: '',\n queryTemplate: 'ns = ${ $.ns }, index = '\n },\n\n /** @inheritdoc */\n initialize: function () {\n this._super();\n\n if (this.allowImport) {\n this.setHandlers();\n }\n },\n\n /**\n * Split mask placeholder and attach events to placeholder fields.\n */\n setHandlers: function () {\n var str = this.mask || '',\n placeholders;\n\n placeholders = str.match(/{{(.*?)}}/g); // Get placeholders\n\n _.each(placeholders, function (placeholder) {\n placeholder = placeholder.replace(/[{{}}]/g, ''); // Remove curly braces\n\n registry.get(this.queryTemplate + placeholder, function (component) {\n this.values[placeholder] = component.getPreview();\n component.on('value', this.updateValue.bind(this, placeholder, component));\n component.valueUpdate = 'keyup';\n }.bind(this));\n }, this);\n },\n\n /**\n * Update field with mask value, if it's allowed.\n *\n * @param {Object} placeholder\n * @param {Object} component\n */\n updateValue: function (placeholder, component) {\n var string = this.mask || '',\n nonEmptyValueFlag = false;\n\n if (placeholder) {\n this.values[placeholder] = component.getPreview() || '';\n }\n\n if (!this.allowImport) {\n return;\n }\n\n _.each(this.values, function (propertyValue, propertyName) {\n string = string.replace('{{' + propertyName + '}}', propertyValue);\n nonEmptyValueFlag = nonEmptyValueFlag || !!propertyValue;\n });\n\n if (nonEmptyValueFlag) {\n string = string.replace(/<style.*?>.*?<\\/style>/gis, ''); //Remove style tags\n string = string.replace(/{{widget.*?}}/gis, ''); //Remove widgets\n string = string.replace(/(<([^>]+)>)/ig, ''); // Remove html tags\n this.value(string);\n } else {\n this.value('');\n }\n },\n\n /**\n * Disallow import when initial value isn't empty string\n *\n * @returns {*}\n */\n setInitialValue: function () {\n this._super();\n\n if (this.initialValue !== '') {\n this.allowImport = false;\n }\n\n return this;\n },\n\n /**\n * Callback when value is changed by user,\n * and disallow/allow import value\n */\n userChanges: function () {\n\n /**\n * As userChanges is called before updateValue,\n * we forced to get value from component by reference\n */\n var actualValue = arguments[1].currentTarget.value;\n\n this._super();\n\n if (actualValue === '') {\n this.allowImport = true;\n\n if (this.autoImportIfEmpty) {\n this.updateValue(null, null);\n }\n } else {\n this.allowImport = false;\n }\n }\n });\n});\n","Magento_Catalog/js/components/new-attribute-insert-form.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/components/insert-form'\n], function (InsertForm) {\n 'use strict';\n\n return InsertForm.extend({\n defaults: {\n modules: {\n productForm: 'product_form.product_form'\n },\n listens: {\n responseStatus: 'processResponseStatus'\n },\n attributeSetId: 0,\n productId: 0\n },\n\n /**\n * Process response status.\n */\n processResponseStatus: function () {\n if (this.responseStatus()) {\n\n if (this.productForm().params === undefined) {\n this.productForm().params = {\n set: this.attributeSetId\n };\n }\n\n if (this.productId) {\n this.productForm().params.id = this.productId;\n }\n this.productForm().params.type = this.productType;\n\n this.productForm().reload();\n this.resetForm();\n }\n }\n });\n});\n","Magento_Catalog/js/components/checkbox.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @deprecated since version 2.2.0\n */\ndefine([\n 'Magento_Ui/js/form/element/abstract',\n 'knockout'\n], function (Abstract, ko) {\n 'use strict';\n\n return Abstract.extend({\n\n /**\n * Initializes observable properties of instance\n *\n * @returns {Element} Chainable.\n */\n initObservable: function () {\n this._super()\n .observe('checked');\n\n this.value = ko.pureComputed({\n\n /**\n * use 'mappedValue' as value if checked\n */\n read: function () {\n return this.checked() ? this.mappedValue : '';\n },\n\n /**\n * any value made checkbox checked\n */\n write: function (val) {\n if (val) {\n this.checked(true);\n }\n },\n owner: this\n });\n\n return this;\n }\n });\n});\n","Magento_Catalog/js/components/messages.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/components/html'\n], function (Html) {\n 'use strict';\n\n return Html.extend({\n defaults: {\n form: '${ $.namespace }.${ $.namespace }',\n visible: false,\n imports: {\n responseData: '${ $.form }:responseData',\n visible: 'responseData.error',\n content: 'responseData.messages'\n },\n listens: {\n '${ $.provider }:data.reset': 'hide'\n }\n },\n\n /**\n * Show messages.\n */\n show: function () {\n this.visible(true);\n },\n\n /**\n * Hide messages.\n */\n hide: function () {\n this.visible(false);\n }\n });\n});\n","Magento_Catalog/js/components/dynamic-rows-import-custom-options-per-page.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Catalog/js/components/dynamic-rows-import-custom-options',\n 'underscore',\n 'mageUtils',\n 'uiLayout',\n 'rjsResolver'\n], function (DrCustomOptions, _, utils, layout, resolver) {\n 'use strict';\n\n return DrCustomOptions.extend({\n defaults: {\n sizesConfig: {\n component: 'Magento_Ui/js/grid/paging/sizes',\n name: '${ $.name }_sizes',\n options: {\n '20': {\n value: 20,\n label: 20\n },\n '30': {\n value: 30,\n label: 30\n },\n '50': {\n value: 50,\n label: 50\n },\n '100': {\n value: 100,\n label: 100\n },\n '200': {\n value: 200,\n label: 200\n }\n },\n storageConfig: {\n provider: '${ $.storageConfig.provider }',\n namespace: '${ $.storageConfig.namespace }'\n },\n enabled: false\n },\n links: {\n options: '${ $.sizesConfig.name }:options',\n pageSize: '${ $.sizesConfig.name }:value'\n },\n listens: {\n 'pageSize': 'onPageSizeChange'\n },\n modules: {\n sizes: '${ $.sizesConfig.name }'\n }\n },\n\n /**\n * Initializes paging component.\n *\n * @returns {Paging} Chainable.\n */\n initialize: function () {\n this._super()\n .initSizes();\n\n return this;\n },\n\n /**\n * Initializes sizes component.\n *\n * @returns {Paging} Chainable.\n */\n initSizes: function () {\n if (this.sizesConfig.enabled) {\n layout([this.sizesConfig]);\n }\n\n return this;\n },\n\n /**\n * Initializes observable properties.\n *\n * @returns {Paging} Chainable.\n */\n initObservable: function () {\n this._super()\n .track([\n 'pageSize'\n ]);\n\n return this;\n },\n\n /**\n * Handles changes of the page size.\n */\n onPageSizeChange: function () {\n resolver(function () {\n if (this.elems().length) {\n this.reload();\n }\n }, this);\n }\n });\n});\n","Magento_Catalog/js/components/product-ui-select.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @deprecated see Magento/Ui/view/base/web/js/grid/filters/elements/ui-select.js\n */\ndefine([\n 'Magento_Ui/js/form/element/ui-select',\n 'jquery',\n 'underscore'\n], function (Select, $, _) {\n 'use strict';\n\n return Select.extend({\n defaults: {\n validationUrl: false,\n loadedOption: [],\n validationLoading: true\n },\n\n /** @inheritdoc */\n initialize: function () {\n this._super();\n\n this.validateInitialValue();\n\n return this;\n },\n\n /**\n * Validate initial value actually exists\n */\n validateInitialValue: function () {\n if (!_.isEmpty(this.value())) {\n $.ajax({\n url: this.validationUrl,\n type: 'GET',\n dataType: 'json',\n context: this,\n data: {\n productId: this.value()\n },\n\n /** @param {Object} response */\n success: function (response) {\n if (!_.isEmpty(response)) {\n this.options([response]);\n this.loadedOption = response;\n }\n },\n\n /** set empty array if error occurs */\n error: function () {\n this.options([]);\n },\n\n /** stop loader */\n complete: function () {\n this.validationLoading(false);\n this.setCaption();\n }\n });\n } else {\n this.validationLoading(false);\n }\n },\n\n /** @inheritdoc */\n getSelected: function () {\n var options = this._super();\n\n if (!_.isEmpty(this.loadedOption)) {\n return this.value() === this.loadedOption.value ? [this.loadedOption] : options;\n }\n\n return options;\n }\n });\n});\n","Magento_Catalog/js/components/attributes-insert-listing.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/lib/view/utils/async',\n 'uiRegistry',\n 'underscore',\n 'Magento_Ui/js/form/components/insert-listing'\n], function ($, registry, _, InsertListing) {\n 'use strict';\n\n return InsertListing.extend({\n defaults: {\n addAttributeUrl: '',\n attributeSetId: '',\n attributeIds: '',\n groupCode: '',\n groupName: '',\n groupSortOrder: 0,\n productId: 0,\n formProvider: '',\n modules: {\n form: '${ $.formProvider }',\n modal: '${ $.parentName }'\n },\n productType: ''\n },\n\n /**\n * Render attribute\n */\n render: function () {\n this._super();\n },\n\n /**\n * Save attribute\n */\n save: function () {\n this.addSelectedAttributes();\n this._super();\n },\n\n /**\n * Add selected attributes\n */\n addSelectedAttributes: function () {\n $.ajax({\n url: this.addAttributeUrl,\n type: 'POST',\n dataType: 'json',\n data: {\n attributeIds: this.selections().getSelections(),\n templateId: this.attributeSetId,\n groupCode: this.groupCode,\n groupName: this.groupName,\n groupSortOrder: this.groupSortOrder,\n productId: this.productId,\n componentJson: 1\n },\n success: function () {\n this.form().params = {\n set: this.attributeSetId,\n id: this.productId,\n type: this.productType\n };\n this.form().reload();\n this.modal().state(false);\n this.reload();\n }.bind(this)\n });\n }\n });\n});\n","Magento_Catalog/js/components/disable-on-option/strategy.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine(function () {\n 'use strict';\n\n return {\n defaults: {\n valuesForEnable: [],\n disabled: true,\n imports: {\n toggleDisable:\n 'product_attribute_add_form.product_attribute_add_form.base_fieldset.frontend_input:value'\n }\n },\n\n /**\n * Toggle disabled state.\n *\n * @param {Number} selected\n */\n toggleDisable: function (selected) {\n this.disabled(!(selected in this.valuesForEnable));\n }\n };\n});\n","Magento_Catalog/js/components/disable-on-option/select.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/element/select',\n 'Magento_Catalog/js/components/disable-on-option/strategy'\n], function (Element, strategy) {\n 'use strict';\n\n return Element.extend(strategy);\n});\n","Magento_Catalog/js/components/disable-on-option/input.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/element/abstract',\n 'Magento_Catalog/js/components/disable-on-option/strategy'\n], function (Element, strategy) {\n 'use strict';\n\n return Element.extend(strategy);\n});\n","Magento_Catalog/js/components/disable-on-option/yesno.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/element/single-checkbox',\n 'Magento_Catalog/js/components/disable-on-option/strategy'\n], function (Element, strategy) {\n 'use strict';\n\n var comp = Element.extend(strategy).extend({\n\n defaults: {\n listens: {\n disabled: 'updateValueForDisabledField',\n visible: 'updateValueForDisabledField'\n }\n },\n\n /**\n * {@inheritdoc}\n */\n initialize: function () {\n this._super();\n this.updateValueForDisabledField();\n\n return this;\n },\n\n /**\n * Set element value to O(No) if element is invisible and disabled\n * Set element value to initialValue if element becomes visible and enable\n */\n updateValueForDisabledField: function () {\n if (!this.disabled() && this.visible()) {\n this.set('value', this.initialValue);\n } else {\n this.set('value', 0);\n }\n }\n });\n\n return comp.extend(strategy);\n});\n","Magento_Catalog/js/components/visible-on-option/fieldset.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/components/fieldset',\n 'Magento_Catalog/js/components/visible-on-option/strategy'\n], function (Fieldset, strategy) {\n 'use strict';\n\n return Fieldset.extend(strategy).extend(\n {\n defaults: {\n openOnShow: true\n },\n\n /**\n * Toggle visibility state.\n */\n toggleVisibility: function () {\n this._super();\n\n if (this.openOnShow) {\n this.opened(this.inverseVisibility ? !this.isShown : this.isShown);\n }\n }\n }\n );\n});\n","Magento_Catalog/js/components/visible-on-option/strategy.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine(function () {\n 'use strict';\n\n return {\n defaults: {\n valuesForOptions: [],\n imports: {\n toggleVisibility:\n 'product_attribute_add_form.product_attribute_add_form.base_fieldset.frontend_input:value'\n },\n isShown: false,\n inverseVisibility: false\n },\n\n /**\n * Toggle visibility state.\n *\n * @param {Number} selected\n */\n toggleVisibility: function (selected) {\n this.isShown = selected in this.valuesForOptions;\n this.visible(this.inverseVisibility ? !this.isShown : this.isShown);\n }\n };\n});\n","Magento_Catalog/js/components/visible-on-option/select.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/element/select',\n 'Magento_Catalog/js/components/visible-on-option/strategy'\n], function (Element, strategy) {\n 'use strict';\n\n return Element.extend(strategy);\n});\n","Magento_Catalog/js/components/visible-on-option/date.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/element/date',\n 'Magento_Catalog/js/components/visible-on-option/strategy'\n], function (Element, strategy) {\n 'use strict';\n\n return Element.extend(strategy);\n});\n","Magento_Catalog/js/components/visible-on-option/input.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/element/abstract',\n 'Magento_Catalog/js/components/visible-on-option/strategy'\n], function (Element, strategy) {\n 'use strict';\n\n return Element.extend(strategy);\n});\n","Magento_Catalog/js/components/visible-on-option/textarea.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/element/textarea',\n 'Magento_Catalog/js/components/visible-on-option/strategy'\n], function (Element, strategy) {\n 'use strict';\n\n return Element.extend(strategy);\n});\n","Magento_Catalog/js/components/visible-on-option/yesno.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/element/single-checkbox',\n 'Magento_Catalog/js/components/visible-on-option/strategy'\n], function (Element, strategy) {\n 'use strict';\n\n return Element.extend(strategy);\n});\n","Magento_Catalog/js/components/use-parent-settings/select.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'Magento_Ui/js/form/element/select'\n], function (Component) {\n 'use strict';\n\n return Component;\n});\n","Magento_Catalog/js/components/use-parent-settings/single-checkbox.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'Magento_Ui/js/form/element/single-checkbox'\n], function (Component) {\n 'use strict';\n\n return Component;\n});\n","Magento_Catalog/js/components/use-parent-settings/textarea.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'Magento_Ui/js/form/element/textarea'\n], function (Component) {\n 'use strict';\n\n return Component;\n});\n","Magento_Catalog/js/components/use-parent-settings/toggle-disabled-mixin.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'underscore'\n], function (_) {\n 'use strict';\n\n var mixin = {\n defaults: {\n imports: {\n toggleDisabled: '${ $.parentName }.custom_use_parent_settings:checked'\n },\n useParent: false,\n useDefaults: false\n },\n\n /**\n * Disable form input if settings for parent section is used\n * or default value is applied.\n *\n * @param {Boolean} isUseParent\n */\n toggleDisabled: function (isUseParent) {\n var disabled = this.useParent = isUseParent;\n\n if (!disabled && !_.isUndefined(this.service)) {\n disabled = !!this.isUseDefault();\n }\n\n this.saveUseDefaults();\n this.disabled(disabled);\n },\n\n /**\n * Stores original state of the field.\n */\n saveUseDefaults: function () {\n this.useDefaults = this.disabled();\n },\n\n /** @inheritdoc */\n setInitialValue: function () {\n this._super();\n this.isUseDefault(this.useDefaults);\n\n return this;\n },\n\n /** @inheritdoc */\n toggleUseDefault: function (state) {\n this._super();\n this.disabled(state || this.useParent);\n }\n };\n\n return function (target) {\n return target.extend(mixin);\n };\n});\n","Magento_Catalog/js/utils/percentage-price-calculator.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine(['Magento_Ui/js/lib/validation/utils'], function (utils) {\n 'use strict';\n\n /**\n * Calculates the price input value when entered percentage value.\n *\n * @param {String} price\n * @param {String} input\n *\n * @returns {String}\n */\n return function (price, input) {\n var result,\n lastInputSymbol = input.slice(-1),\n inputPercent = input.slice(0, -1),\n parsedPercent = utils.parseNumber(inputPercent),\n parsedPrice = utils.parseNumber(price);\n\n if (lastInputSymbol !== '%') {\n result = input;\n } else if (\n input === '%' ||\n isNaN(parsedPrice) ||\n parsedPercent != inputPercent || /* eslint eqeqeq:0 */\n isNaN(parsedPercent) ||\n input === ''\n ) {\n result = '';\n } else if (parsedPercent > 100) {\n result = '0.00';\n } else if (lastInputSymbol === '%') {\n result = parsedPrice - parsedPrice * (inputPercent / 100);\n result = result.toFixed(2);\n } else {\n result = input;\n }\n\n return result;\n };\n});\n","Magento_Catalog/js/tier-price/value-type-select.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/select',\n 'uiRegistry',\n 'underscore'\n], function (Select, uiRegistry, _) {\n 'use strict';\n\n return Select.extend({\n defaults: {\n prices: {}\n },\n\n /**\n * {@inheritdoc}\n */\n initialize: function () {\n this._super();\n delete this.prices.__disableTmpl;\n this.prepareForm();\n },\n\n /**\n * {@inheritdoc}\n */\n setInitialValue: function () {\n this.initialValue = this.getInitialValue();\n\n if (this.value.peek() !== this.initialValue) {\n this.value(this.initialValue);\n }\n\n this.isUseDefault(this.disabled());\n\n return this;\n },\n\n /**\n * {@inheritdoc}\n */\n prepareForm: function () {\n var elements = this.getElementsByPrices(),\n prices = this.prices,\n currencyType = _.keys(prices)[0],\n select = this;\n\n uiRegistry.get(elements, function () {\n _.each(arguments, function (currentValue) {\n if (parseFloat(currentValue.value()) > 0) {\n _.each(prices, function (priceValue, priceKey) {\n if (priceValue === currentValue.name) {\n currencyType = priceKey;\n }\n });\n }\n });\n select.value(currencyType);\n select.on('value', select.onUpdate.bind(select));\n select.onUpdate();\n });\n },\n\n /**\n * @returns {Array}\n */\n getElementsByPrices: function () {\n var elements = [];\n\n _.each(this.prices, function (currentValue) {\n elements.push(currentValue);\n });\n\n return elements;\n },\n\n /**\n * Callback that fires when 'value' property is updated\n */\n onUpdate: function () {\n var value = this.value(),\n prices = this.prices,\n select = this,\n parentDataScopeArr = this.dataScope.split('.'),\n parentDataScope,\n elements = this.getElementsByPrices();\n\n parentDataScopeArr.pop();\n parentDataScope = parentDataScopeArr.join('.');\n\n uiRegistry.get(elements, function () {\n var sourceData = select.source.get(parentDataScope);\n\n _.each(arguments, function (currentElement) {\n var index;\n\n _.each(prices, function (priceValue, priceKey) {\n if (priceValue === currentElement.name) {\n index = priceKey;\n }\n });\n\n if (value === index) {\n currentElement.visible(true);\n sourceData[currentElement.index] = currentElement.value();\n } else {\n currentElement.value('');\n currentElement.visible(false);\n delete sourceData[currentElement.index];\n }\n });\n select.source.set(parentDataScope, sourceData);\n });\n }\n });\n});\n","Magento_Catalog/js/tier-price/percentage-processor.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'uiElement',\n 'underscore',\n 'Magento_Ui/js/lib/view/utils/async',\n 'Magento_Catalog/js/utils/percentage-price-calculator'\n], function (Element, _, $, percentagePriceCalculator) {\n 'use strict';\n\n return Element.extend({\n defaults: {\n priceElem: '${ $.parentName }.price',\n selector: 'input',\n imports: {\n priceValue: '${ $.priceElem }:priceValue'\n },\n exports: {\n calculatedVal: '${ $.priceElem }:value'\n }\n },\n\n /**\n * {@inheritdoc}\n */\n initialize: function () {\n this._super();\n\n _.bindAll(this, 'initPriceListener', 'onInput');\n\n $.async({\n component: this.priceElem,\n selector: this.selector\n }, this.initPriceListener);\n\n return this;\n },\n\n /**\n * {@inheritdoc}\n */\n initObservable: function () {\n return this._super()\n .observe(['visible']);\n },\n\n /**\n * Handles keyup event on price input.\n *\n * {@param} HTMLElement elem\n */\n initPriceListener: function (elem) {\n $(elem).on('keyup.priceCalc', this.onInput);\n },\n\n /**\n * Delegates calculation of the price input value to percentagePriceCalculator.\n *\n * {@param} object event\n */\n onInput: function (event) {\n var value = event.currentTarget.value;\n\n if (value.slice(-1) === '%') {\n value = percentagePriceCalculator(this.priceValue, value);\n this.set('calculatedVal', value);\n }\n }\n });\n});\n","Magento_Catalog/catalog/product-attributes.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'underscore',\n 'uiRegistry',\n 'jquery/ui',\n 'mage/translate'\n], function ($, _, registry) {\n 'use strict';\n\n $.widget('mage.productAttributes', {\n /** @inheritdoc */\n _create: function () {\n this._on({\n 'click': '_showPopup'\n });\n },\n\n /**\n * @private\n */\n _initModal: function () {\n var self = this;\n\n this.modal = $('<div id=\"create_new_attribute\"></div>').modal({\n title: $.mage.__('New Attribute'),\n type: 'slide',\n buttons: [],\n\n /** @inheritdoc */\n opened: function () {\n $(this).parent().addClass('modal-content-new-attribute');\n self.iframe = $('<iframe id=\"create_new_attribute_container\"></iframe>').attr({\n src: self._prepareUrl(),\n frameborder: 0\n });\n self.modal.append(self.iframe);\n self._changeIframeSize();\n $(window).off().on('resize.modal', _.debounce(self._changeIframeSize.bind(self), 400));\n },\n\n /** @inheritdoc */\n closed: function () {\n var doc = self.iframe.get(0).document;\n\n if (doc && typeof doc.execCommand === 'function') {\n //IE9 break script loading but not execution on iframe removing\n doc.execCommand('stop');\n self.iframe.remove();\n }\n self.modal.data('mageModal').modal.remove();\n $(window).off('resize.modal');\n }\n });\n },\n\n /**\n * @return {Number}\n * @private\n */\n _getHeight: function () {\n var modal = this.modal.data('mageModal').modal,\n modalHead = modal.find('header'),\n modalHeadHeight = modalHead.outerHeight(),\n modalHeight = modal.outerHeight(),\n modalContentPadding = this.modal.parent().outerHeight() - this.modal.parent().height();\n\n return modalHeight - modalHeadHeight - modalContentPadding;\n },\n\n /**\n * @return {Number}\n * @private\n */\n _getWidth: function () {\n return this.modal.width();\n },\n\n /**\n * @private\n */\n _changeIframeSize: function () {\n this.modal.parent().outerHeight(this._getHeight());\n this.iframe.outerHeight(this._getHeight());\n this.iframe.outerWidth(this._getWidth());\n\n },\n\n /**\n * @return {String}\n * @private\n */\n _prepareUrl: function () {\n var productSource,\n attributeSetId = '';\n\n if (this.options.dataProvider) {\n try {\n productSource = registry.get(this.options.dataProvider);\n attributeSetId = productSource.data.product['attribute_set_id'];\n } catch (e) {}\n }\n\n return this.options.url +\n (/\\?/.test(this.options.url) ? '&' : '?') +\n 'set=' + attributeSetId;\n },\n\n /**\n * @private\n */\n _showPopup: function () {\n this._initModal();\n this.modal.modal('openModal');\n }\n });\n\n return $.mage.productAttributes;\n});\n","Magento_Catalog/catalog/apply-to-type-switcher.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'jquery',\n 'Magento_Catalog/catalog/type-events'\n], function ($, productType) {\n 'use strict';\n\n return {\n\n /**\n * Bind event\n */\n bindAll: function () {\n $('[data-form=edit-product] [data-role=tabs]').on(\n 'contentUpdated',\n this._switchToTypeByApplyAttr.bind(this)\n );\n\n $('#product_info_tabs').on(\n 'beforePanelsMove tabscreate tabsactivate',\n this._switchToTypeByApplyAttr.bind(this)\n );\n\n $(document).on('changeTypeProduct', this._switchToTypeByApplyAttr.bind(this));\n },\n\n /**\n * Constructor component\n */\n 'Magento_Catalog/catalog/apply-to-type-switcher': function () {\n this.bindAll();\n this._switchToTypeByApplyAttr();\n },\n\n /**\n * Show/hide elements based on type\n *\n * @private\n */\n _switchToTypeByApplyAttr: function () {\n $('[data-apply-to]:not(.removed)').each(function (index, element) {\n var attrContainer = $(element),\n applyTo = attrContainer.data('applyTo') || [],\n $inputs = attrContainer.find('select, input, textarea');\n\n if (applyTo.length === 0 || $.inArray(productType.type.current, applyTo) !== -1) {\n attrContainer.removeClass('not-applicable-attribute');\n $inputs.removeClass('ignore-validate');\n } else {\n attrContainer.addClass('not-applicable-attribute');\n $inputs.addClass('ignore-validate');\n }\n });\n }\n };\n});\n","Magento_Catalog/catalog/type-events.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'jquery'\n], function ($) {\n 'use strict';\n\n return {\n $type: $('#product_type_id'),\n\n /**\n * Init\n */\n init: function () {\n this.type = {\n init: this.$type.val(),\n current: this.$type.val()\n };\n\n this.bindAll();\n },\n\n /**\n * Bind all\n */\n bindAll: function () {\n $(document).on('setTypeProduct', function (event, type) {\n this.setType(type);\n }.bind(this));\n\n //direct change type input\n this.$type.on('change', function () {\n this.type.current = this.$type.val();\n this._notifyType();\n }.bind(this));\n },\n\n /**\n * Set type\n * @param {String} type - type product (downloadable, simple, virtual ...)\n * @returns {*}\n */\n setType: function (type) {\n return this.$type.val(type || this.type.init).trigger('change');\n },\n\n /**\n * Notify type\n * @private\n */\n _notifyType: function () {\n $(document).trigger('changeTypeProduct', this.type);\n }\n };\n});\n","Magento_Catalog/catalog/base-image-uploader.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* eslint-disable no-undef */\n\ndefine([\n 'jquery',\n 'mage/template',\n 'Magento_Ui/js/modal/alert',\n 'jquery/ui',\n 'jquery/uppy-core',\n 'mage/translate',\n 'mage/backend/notification'\n], function ($, mageTemplate, alert) {\n 'use strict';\n\n $.widget('mage.baseImage', {\n /**\n * Button creation\n * @protected\n */\n options: {\n maxImageUploadCount: 10\n },\n\n /** @inheritdoc */\n _create: function () {\n var $container = this.element,\n imageTmpl = mageTemplate(this.element.find('[data-template=image]').html()),\n $dropPlaceholder = this.element.find('.image-placeholder'),\n $galleryContainer = $('#media_gallery_content'),\n mainClass = 'base-image',\n maximumImageCount = 5,\n $fieldCheckBox = $container.closest('[data-attribute-code=image]').find(':checkbox'),\n isDefaultChecked = $fieldCheckBox.is(':checked'),\n findElement, updateVisibility;\n\n if (isDefaultChecked) {\n $fieldCheckBox.trigger('click');\n }\n\n /**\n * @param {Object} data\n * @return {HTMLElement}\n */\n findElement = function (data) {\n return $container.find('.image:not(.image-placeholder)').filter(function () {\n if (!$(this).data('image')) {\n return false;\n }\n\n return $(this).data('image').file === data.file;\n }).first();\n };\n\n /** Update image visibility. */\n updateVisibility = function () {\n var elementsList = $container.find('.image:not(.removed-item)');\n\n elementsList.each(function (index) {\n $(this)[index < maximumImageCount ? 'show' : 'hide']();\n });\n $dropPlaceholder[elementsList.length > maximumImageCount ? 'hide' : 'show']();\n };\n\n $galleryContainer.on('setImageType', function (event, data) {\n if (data.type === 'image') {\n $container.find('.' + mainClass).removeClass(mainClass);\n\n if (data.imageData) {\n findElement(data.imageData).addClass(mainClass);\n }\n }\n });\n\n $galleryContainer.on('addItem', function (event, data) {\n var tmpl = imageTmpl({\n data: data\n });\n\n $(tmpl).data('image', data).insertBefore($dropPlaceholder);\n\n updateVisibility();\n });\n\n $galleryContainer.on('removeItem', function (event, image) {\n findElement(image).addClass('removed-item').hide();\n updateVisibility();\n });\n\n $galleryContainer.on('moveElement', function (event, data) {\n var $element = findElement(data.imageData),\n $after;\n\n if (data.position === 0) {\n $container.prepend($element);\n } else {\n $after = $container.find('.image').eq(data.position);\n\n if (!$element.is($after)) {\n $element.insertAfter($after);\n }\n }\n updateVisibility();\n });\n\n $container.on('click', '[data-role=make-base-button]', function (event) {\n var data;\n\n event.preventDefault();\n data = $(event.target).closest('.image').data('image');\n $galleryContainer.productGallery('setBase', data);\n });\n\n $container.on('click', '[data-role=delete-button]', function (event) {\n event.preventDefault();\n $galleryContainer.trigger('removeItem', $(event.target).closest('.image').data('image'));\n });\n\n $container.sortable({\n axis: 'x',\n items: '.image:not(.image-placeholder)',\n distance: 8,\n tolerance: 'pointer',\n\n /**\n * @param {jQuery.Event} event\n * @param {Object} data\n */\n stop: function (event, data) {\n $galleryContainer.trigger('setPosition', {\n imageData: data.item.data('image'),\n position: $container.find('.image').index(data.item)\n });\n $galleryContainer.trigger('resort');\n }\n }).disableSelection();\n\n // uppy implemetation\n let targetElement = this.element.find('input[type=\"file\"]').parent()[0],\n url = '{$block->escapeJs($block->getJsUploadUrl())}',\n fileId = null,\n arrayFromObj = Array.from,\n fileObj = [],\n uploaderContainer = this.element.find('input[type=\"file\"]').closest('.image-placeholder'),\n options = {\n proudlyDisplayPoweredByUppy: false,\n target: targetElement,\n hideUploadButton: false,\n hideRetryButton: true,\n hideCancelButton: true,\n inline: true,\n showRemoveButtonAfterComplete: true,\n showProgressDetails: false,\n showSelectedFiles: false,\n allowMultipleUploads: false,\n hideProgressAfterFinish: true\n };\n\n const uppy = new Uppy.Uppy({\n restrictions: {\n allowedFileTypes: ['.gif', '.jpeg', '.jpg', '.png'],\n maxFileSize: this.element.data('maxFileSize')\n },\n\n onBeforeFileAdded: (currentFile) => {\n\n if (fileObj.length > this.options.maxImageUploadCount) {\n $('body').notification('clear').notification('add', {\n error: true,\n message: $.mage.__('You can\\'t upload more than ' + this.options.maxImageUploadCount +\n ' images in one time'),\n\n /**\n * @param {*} message\n */\n insertMethod: function (message) {\n $('.page-main-actions').after(message);\n }\n });\n return false;\n }\n\n fileId = Math.random().toString(36).substr(2, 9);\n // code to allow duplicate files from same folder\n const modifiedFile = {\n ...currentFile,\n id: currentFile.id + '-' + fileId,\n tempFileId: fileId\n };\n\n uploaderContainer.addClass('loading');\n fileObj.push(currentFile);\n return modifiedFile;\n },\n\n meta: {\n 'form_key': window.FORM_KEY,\n isAjax : true\n }\n });\n\n // initialize Uppy upload\n uppy.use(Uppy.Dashboard, options);\n\n // drop area for file upload\n uppy.use(Uppy.DropTarget, {\n target: $dropPlaceholder.closest('[data-attribute-code]')[0],\n onDragOver: () => {\n // override Array.from method of legacy-build.min.js file\n Array.from = null;\n },\n onDragLeave: () => {\n Array.from = arrayFromObj;\n }\n });\n\n\n // upload files on server\n uppy.use(Uppy.XHRUpload, {\n endpoint: url,\n fieldName: 'image'\n });\n\n uppy.on('upload-progress', (file, progress) => {\n let progressWidth = parseInt(progress.bytesUploaded / progress.bytesTotal * 100, 10);\n\n $dropPlaceholder.find('.progress-bar').addClass('in-progress').text(progressWidth + '%');\n });\n\n uppy.on('upload-success', (file, response) => {\n $dropPlaceholder.find('.progress-bar').text('').removeClass('in-progress');\n\n if (!response.body) {\n return;\n }\n\n if (!response.body.error) {\n $galleryContainer.trigger('addItem', response.body);\n } else {\n alert({\n content: $.mage.__('We don\\'t recognize or support this file extension type.')\n });\n }\n });\n\n uppy.on('complete', () => {\n uploaderContainer.removeClass('loading');\n Array.from = arrayFromObj;\n });\n }\n });\n\n return $.mage.baseImage;\n});\n","Magento_Catalog/catalog/product.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\nrequire([\n 'jquery'\n], function ($) {\n 'use strict';\n\n window.Product = {};\n\n /**\n * @param {String} id\n * @return {*|jQuery|HTMLElement}\n */\n function byId(id) {\n return $('#' + id);\n }\n\n /**\n * @param {String} fieldId\n */\n function disableFieldEditMode(fieldId) {\n var field = byId(fieldId);\n\n field.prop('disabled', true);\n\n if (field.next().hasClass('addafter')) {\n field.parent().addClass('_update-attributes-disabled');\n }\n\n if (byId(fieldId + '_hidden').length) {\n byId(fieldId + '_hidden').prop('disabled', true);\n }\n }\n\n /**\n * @param {String} fieldId\n */\n function enableFieldEditMode(fieldId) {\n var field = byId(fieldId);\n\n field.prop('disabled', false);\n\n if (field.parent().hasClass('_update-attributes-disabled')) {\n field.parent().removeClass('_update-attributes-disabled');\n }\n\n if (byId(fieldId + '_hidden').length) {\n byId(fieldId + '_hidden').prop('disabled', false);\n }\n }\n\n /**\n * @param {String} toogleIdentifier\n * @param {String} fieldId\n */\n function toogleFieldEditMode(toogleIdentifier, fieldId) {\n if ($(toogleIdentifier).is(':checked')) {\n enableFieldEditMode(fieldId);\n } else {\n disableFieldEditMode(fieldId);\n }\n }\n\n /**\n * On complete disable.\n */\n function onCompleteDisableInited() {\n var item;\n\n $.each($('[data-disable]'), function () {\n item = $(this).data('disable');\n disableFieldEditMode(item);\n });\n }\n\n /**\n * @param {String} urlKey\n */\n function onUrlkeyChanged(urlKey) {\n var hidden, chbx, oldValue;\n\n urlKey = byId(urlKey);\n hidden = urlKey.siblings('input[type=hidden]');\n chbx = urlKey.siblings('input[type=checkbox]');\n oldValue = chbx.val();\n\n chbx.prop('disabled', oldValue === urlKey.val());\n hidden.prop('disabled', chbx.prop('disabled'));\n }\n\n /**\n * @param {HTMLElement} element\n */\n function onCustomUseParentChanged(element) {\n var useParent, parent;\n\n element = $(element);\n useParent = element.val() == 1; //eslint-disable-line eqeqeq\n parent = element.offsetParent().parent();\n\n parent.find('input, select, textarea').each(function (i, el) {\n el = $(el);\n\n if (element.prop('id') !== el.prop('id')) {\n el.prop('disabled', useParent);\n }\n });\n\n parent.find('img').each(function (i, el) {\n if (useParent) {\n $(el).hide();\n } else {\n $(el).show();\n }\n });\n }\n\n window.onCustomUseParentChanged = onCustomUseParentChanged;\n window.onUrlkeyChanged = onUrlkeyChanged;\n window.toogleFieldEditMode = toogleFieldEditMode;\n\n $(onCompleteDisableInited);\n});\n","Magento_Catalog/catalog/product/composite/configure.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'jquery',\n 'Magento_Ui/js/lib/view/utils/async',\n 'jquery/ui',\n 'mage/translate',\n 'prototype',\n 'Magento_Ui/js/modal/modal'\n], function (jQuery) {\n\n window.ProductConfigure = Class.create();\n\n ProductConfigure.prototype = {\n\n listTypes: $H({}),\n current: $H({}),\n itemsFilter: $H({}),\n blockWindow: null,\n blockForm: null,\n blockFormFields: null,\n blockFormAdd: null,\n blockFormConfirmed: null,\n blockConfirmed: null,\n blockIFrame: null,\n blockCancelBtn: null,\n blockMask: null,\n blockMsg: null,\n blockMsgError: null,\n windowHeight: null,\n confirmedCurrentId: null,\n confirmCallback: {},\n cancelCallback: {},\n onLoadIFrameCallback: {},\n showWindowCallback: {},\n beforeSubmitCallback: {},\n iFrameJSVarname: null,\n _listTypeId: 1,\n\n /**\n * Initialize object\n */\n initialize: function () {\n var self = this,\n popupDialog = jQuery('#product_composite_configure');\n\n this._initWindowElements();\n jQuery.async('#product_composite_configure', function (el) {\n if (el !== popupDialog[0]) {\n el = popupDialog[0];\n }\n self.dialog = jQuery(el).modal({\n title: jQuery.mage.__('Configure Product'),\n type: 'slide',\n buttons: [{\n text: jQuery.mage.__('OK'),\n 'class': 'action-primary',\n click: function () {\n self.onConfirmBtn();\n }\n }],\n closed: function () {\n self.clean('window');\n },\n });\n });\n },\n\n /**\n * Initialize window elements\n */\n _initWindowElements: function () {\n this.blockWindow = $('product_composite_configure');\n this.blockForm = $('product_composite_configure_form');\n this.blockFormFields = $('product_composite_configure_form_fields');\n this.blockFormAdd = $('product_composite_configure_form_additional');\n this.blockFormConfirmed = $('product_composite_configure_form_confirmed');\n this.blockConfirmed = $('product_composite_configure_confirmed');\n this.blockIFrame = $('product_composite_configure_iframe');\n this.blockCancelBtn = $('product_composite_configure_form_cancel');\n this.blockMsg = $('product_composite_configure_messages');\n this.blockMsgError = this.blockMsg.select('.message.error div')[0];\n this.iFrameJSVarname = this.blockForm.select('input[name=\"as_js_varname\"]')[0].value;\n },\n\n /**\n * Returns next unique list type id\n */\n _generateListTypeId: function () {\n return '_internal_lt_' + this._listTypeId++;\n },\n\n /**\n * Add product list types as scope and their urls\n * example: addListType('product_to_add', {urlFetch: 'http://magento...'})\n * example: addListType('wishlist', {urlSubmit: 'http://magento...'})\n *\n * @param type types as scope\n * @param urls obj can be\n * - {urlFetch: 'http://magento...'} for fetching configuration fields through ajax\n * - {urlConfirm: 'http://magento...'} for submit configured data through iFrame when clicked confirm button\n * - {urlSubmit: 'http://magento...'} for submit configured data through iFrame\n */\n addListType: function (type, urls) {\n if ('undefined' == typeof this.listTypes[type]) {\n this.listTypes[type] = {};\n }\n Object.extend(this.listTypes[type], urls);\n\n return this;\n },\n\n /**\n * Adds complex list type - that is used to submit several list types at once\n * Only urlSubmit is possible for this list type\n * example: addComplexListType(['wishlist', 'product_list'], 'http://magento...')\n *\n * @param type types as scope\n * @param urls obj can be\n * - {urlSubmit: 'http://magento...'} for submit configured data through iFrame\n * @return type string\n */\n addComplexListType: function (types, urlSubmit) {\n var type = this._generateListTypeId();\n\n this.listTypes[type] = {};\n this.listTypes[type].complexTypes = types;\n this.listTypes[type].urlSubmit = urlSubmit;\n\n return type;\n },\n\n /**\n * Add filter of items\n *\n * @param listType scope name\n * @param itemsFilter\n */\n addItemsFilter: function (listType, itemsFilter) {\n if (!listType || !itemsFilter) {\n return false;\n }\n\n if ('undefined' == typeof this.itemsFilter[listType]) {\n this.itemsFilter[listType] = [];\n }\n this.itemsFilter[listType] = this.itemsFilter[listType].concat(itemsFilter);\n\n return this;\n },\n\n /**\n * Returns id of block where configuration for an item is stored\n *\n * @param listType scope name\n * @param itemId\n * @return string\n */\n _getConfirmedBlockId: function (listType, itemId) {\n return this.blockConfirmed.id + '[' + listType + '][' + itemId + ']';\n },\n\n /**\n * Checks whether item has some configuration fields\n *\n * @param listType scope name\n * @param itemId\n * @return bool\n */\n itemConfigured: function (listType, itemId) {\n var confirmedBlockId = this._getConfirmedBlockId(listType, itemId);\n var itemBlock = $(confirmedBlockId);\n\n return !!(itemBlock && itemBlock.innerHTML);\n },\n\n /**\n * Show configuration fields of item, if it not found then get it through ajax\n *\n * @param listType scope name\n * @param itemId\n */\n showItemConfiguration: function (listType, itemId) {\n if (!listType || !itemId) {\n return false;\n }\n\n this.initialize();\n this.current.listType = listType;\n this.current.itemId = itemId;\n this.confirmedCurrentId = this._getConfirmedBlockId(listType, itemId);\n\n if (!this.itemConfigured(listType, itemId)) {\n this._requestItemConfiguration(listType, itemId);\n } else {\n this._processFieldsData('item_restore');\n this._showWindow();\n }\n },\n\n /**\n * Get configuration fields of product through ajax and show them\n *\n * @param listType scope name\n * @param itemId\n */\n _requestItemConfiguration: function (listType, itemId) {\n if (!this.listTypes[listType].urlFetch) {\n return false;\n }\n var url = this.listTypes[listType].urlFetch;\n\n if (url) {\n new Ajax.Request(url, {\n parameters: {\n id: itemId\n },\n onSuccess: function (transport) {\n var response = transport.responseText;\n\n if (response.isJSON()) {\n response = response.evalJSON();\n\n if (response.error) {\n this.blockMsg.show();\n this.blockMsgError.innerHTML = response.message;\n if(this.blockCancelBtn) {\n this.blockCancelBtn.hide();\n }\n this.setConfirmCallback(listType, null);\n this._showWindow();\n }\n } else if (response) {\n response += '';\n this.blockFormFields.update(response);\n\n // Add special div to hold mage data, e.g. scripts to execute on every popup show\n var mageData = {};\n var scripts = response.extractScripts();\n\n mageData.scripts = scripts;\n\n var scriptHolder = new Element('div', {\n 'style': 'display:none'\n });\n\n scriptHolder.mageData = mageData;\n this.blockFormFields.insert(scriptHolder);\n\n // Show window\n this._showWindow();\n }\n }.bind(this)\n });\n }\n },\n\n /**\n * Triggered on confirm button click\n * Do submit configured data through iFrame if needed\n */\n onConfirmBtn: function () {\n if (jQuery(this.blockForm).valid()) {\n if (this.listTypes[this.current.listType].urlConfirm) {\n this.submit();\n } else {\n this._processFieldsData('item_confirm');\n this._closeWindow();\n\n if (Object.isFunction(this.confirmCallback[this.current.listType])) {\n this.confirmCallback[this.current.listType]();\n }\n }\n }\n\n return this;\n },\n\n /**\n * Triggered on cancel button click\n */\n onCancelBtn: function () {\n this._closeWindow();\n\n if (Object.isFunction(this.cancelCallback[this.current.listType])) {\n this.cancelCallback[this.current.listType]();\n }\n\n return this;\n },\n\n /**\n * Submit configured data through iFrame\n *\n * @param listType scope name\n */\n submit: function (listType) {\n // prepare data\n if (listType) {\n this.current.listType = listType;\n this.current.itemId = null;\n }\n var urlConfirm = this.listTypes[this.current.listType].urlConfirm;\n var urlSubmit = this.listTypes[this.current.listType].urlSubmit;\n\n if (!urlConfirm && !urlSubmit) {\n return false;\n }\n\n if (urlConfirm) {\n this.blockForm.action = urlConfirm;\n this.addFields([new Element('input', {\n type: 'hidden', name: 'id', value: this.current.itemId\n })]);\n } else {\n this.blockForm.action = urlSubmit;\n\n var complexTypes = this.listTypes[this.current.listType].complexTypes;\n\n if (complexTypes) {\n this.addFields([new Element('input', {\n type: 'hidden', name: 'configure_complex_list_types', value: complexTypes.join(',')\n })]);\n }\n\n this._processFieldsData('current_confirmed_to_form');\n\n // Disable item controls that duplicate added fields (e.g. sometimes qty controls can intersect)\n // so they won't be submitted\n var tagNames = ['input', 'select', 'textarea'];\n\n var names = {}; // Map of added field names\n\n for (var i = 0, len = tagNames.length; i < len; i++) {\n var tagName = tagNames[i];\n var elements = this.blockFormAdd.getElementsByTagName(tagName);\n\n for (var index = 0, elLen = elements.length; index < elLen; index++) {\n names[elements[index].name] = true;\n }\n }\n\n for (var i = 0, len = tagNames.length; i < len; i++) {\n var tagName = tagNames[i];\n var elements = this.blockFormConfirmed.getElementsByTagName(tagName);\n\n for (var index = 0, elLen = elements.length; index < elLen; index++) {\n var element = elements[index];\n\n if (names[element.name]) {\n element.setAttribute('configure_disabled', 1);\n element.setAttribute('configure_prev_disabled', element.disabled ? 1 : 0);\n element.disabled = true;\n } else {\n element.setAttribute('configure_disabled', 0);\n }\n }\n }\n }\n // do submit\n if (Object.isFunction(this.beforeSubmitCallback[this.current.listType])) {\n this.beforeSubmitCallback[this.current.listType]();\n }\n this.blockForm.submit();\n\n // Show loader\n jQuery(this.blockForm).trigger('processStart');\n\n return this;\n },\n\n /**\n * Add dynamically additional fields for form\n *\n * @param fields\n */\n addFields: function (fields) {\n fields.each(function (elm) {\n this.blockFormAdd.insert(elm);\n }.bind(this));\n\n return this;\n },\n\n /**\n * Triggered when form was submitted and iFrame was loaded. Get response from iFrame and handle it\n */\n onLoadIFrame: function () {\n this.blockFormConfirmed.select('[configure_disabled=1]').each(function (element) {\n element.disabled = element.getAttribute('configure_prev_disabled') == '1';\n });\n\n this._processFieldsData('form_confirmed_to_confirmed');\n\n var response = this.blockIFrame.contentWindow[this.iFrameJSVarname];\n\n if (response && 'object' == typeof response) {\n if (this.listTypes[this.current.listType].urlConfirm) {\n if (response.ok) {\n this._closeWindow();\n this.clean('current');\n } else if (response.error) {\n this.showItemConfiguration(this.current.listType, this.current.itemId);\n this.blockMsg.show();\n this.blockMsgError.innerHTML = response.message;\n this._showWindow();\n\n jQuery(this.blockForm).trigger('processStop');\n return false;\n }\n }\n\n if (Object.isFunction(this.onLoadIFrameCallback[this.current.listType])) {\n this.onLoadIFrameCallback[this.current.listType](response);\n }\n document.fire(this.current.listType + ':afterIFrameLoaded');\n }\n // Hide loader\n jQuery(this.blockForm).trigger('processStop');\n\n this.clean('current');\n this.initialize();\n },\n\n /**\n * Helper for fetching content from iFrame\n */\n _getIFrameContent: function () {\n var content = this.blockIFrame.contentWindow || this.blockIFrame.contentDocument;\n\n if (content.document) {\n content = content.document;\n }\n\n return content;\n },\n\n /**\n * Helper to find qty of currently confirmed item\n */\n getCurrentConfirmedQtyElement: function () {\n var elms = $(this.confirmedCurrentId).getElementsByTagName('input');\n\n for (var i = 0; i < elms.length; i++) {\n if (elms[i].name == 'qty') {\n return elms[i];\n }\n }\n },\n\n /**\n * Helper to find select element of currently confirmed item\n */\n getCurrentConfirmedSelectElement: function () {\n return $(this.confirmedCurrentId).getElementsByTagName('select');\n },\n\n /**\n * Helper to find qty of active form\n */\n getCurrentFormQtyElement: function () {\n var elms = this.blockFormFields.getElementsByTagName('input');\n\n for (var i = 0; i < elms.length; i++) {\n if (elms[i].name == 'qty') {\n return elms[i];\n }\n }\n },\n\n /**\n * Show configuration window\n */\n _showWindow: function () {\n this.dialog.modal('openModal');\n //this._toggleSelectsExceptBlock(false);\n\n if (Object.isFunction(this.showWindowCallback[this.current.listType])) {\n this.showWindowCallback[this.current.listType]();\n }\n },\n\n /**\n * Close configuration window\n */\n _closeWindow: function () {\n this.dialog.modal('closeModal');\n //this.blockWindow.style.display = 'none';\n //this.clean('window');\n },\n\n /**\n * Attach callback function triggered when confirm button was clicked\n *\n * @param confirmCallback\n */\n setConfirmCallback: function (listType, confirmCallback) {\n this.confirmCallback[listType] = confirmCallback;\n\n return this;\n },\n\n /**\n * Attach callback function triggered when cancel button was clicked\n *\n * @param cancelCallback\n */\n setCancelCallback: function (listType, cancelCallback) {\n this.cancelCallback[listType] = cancelCallback;\n\n return this;\n },\n\n /**\n * Attach callback function triggered when iFrame was loaded\n *\n * @param onLoadIFrameCallback\n */\n setOnLoadIFrameCallback: function (listType, onLoadIFrameCallback) {\n this.onLoadIFrameCallback[listType] = onLoadIFrameCallback;\n\n return this;\n },\n\n /**\n * Attach callback function triggered when iFrame was loaded\n *\n * @param showWindowCallback\n */\n setShowWindowCallback: function (listType, showWindowCallback) {\n this.showWindowCallback[listType] = showWindowCallback;\n\n return this;\n },\n\n /**\n * Attach callback function triggered before submitting form\n *\n * @param beforeSubmitCallback\n */\n setBeforeSubmitCallback: function (listType, beforeSubmitCallback) {\n this.beforeSubmitCallback[listType] = beforeSubmitCallback;\n\n return this;\n },\n\n /**\n * Clean object data\n *\n * @param method can be 'all' or 'current'\n */\n clean: function (method) {\n var listInfo = null;\n var listTypes = null;\n var removeConfirmed = function (listTypes) {\n this.blockConfirmed.childElements().each(function (elm) {\n for (var i = 0, len = listTypes.length; i < len; i++) {\n var pattern = this.blockConfirmed.id + '[' + listTypes[i] + ']';\n\n if (elm.id.indexOf(pattern) == 0) {\n elm.remove();\n break;\n }\n }\n }.bind(this));\n }.bind(this);\n\n switch (method) {\n case 'current':\n listInfo = this.listTypes[this.current.listType];\n listTypes = [this.current.listType];\n\n if (listInfo && listInfo.complexTypes) {\n listTypes = listTypes.concat(listInfo.complexTypes);\n }\n removeConfirmed(listTypes);\n break;\n\n case 'window':\n this.blockFormFields.update();\n this.blockMsg.hide();\n this.blockMsgError.update();\n if(this.blockCancelBtn) {\n this.blockCancelBtn.show();\n }\n break;\n default:\n // search in list types for its cleaning\n if (this.listTypes[method]) {\n listInfo = this.listTypes[method];\n listTypes = [method];\n\n if (listInfo.complexTypes) {\n listTypes = listTypes.concat(listInfo.complexTypes);\n }\n removeConfirmed(listTypes);\n // clean all\n } else if (!method) {\n this.current = $H({});\n this.blockConfirmed.update();\n this.blockFormFields.update();\n this.blockMsg.hide();\n this.blockMsgError.update();\n if(this.blockCancelBtn) {\n this.blockCancelBtn.show();\n }\n }\n break;\n }\n this._getIFrameContent().body.innerHTML = '';\n this.blockIFrame.contentWindow[this.iFrameJSVarname] = {};\n this.blockFormAdd.update();\n this.blockFormConfirmed.update();\n this.blockForm.action = '';\n\n return this;\n },\n\n /**\n * Process fields data: save, restore, move saved to form and back\n *\n * @param method can be 'item_confirm', 'item_restore', 'current_confirmed_to_form', 'form_confirmed_to_confirmed'\n */\n _processFieldsData: function (method) {\n var self = this;\n\n /**\n * Internal function for rename fields names of some list type\n * if listType is not specified, then it won't be added as prefix to all names\n *\n * @param method can be 'current_confirmed_to_form', 'form_confirmed_to_confirmed'\n * @param blockItem\n */\n var _renameFields = function (method, blockItem, listType) {\n var pattern = null;\n var patternFlat = null;\n var patternPrefix = RegExp('\\\\s', 'g');\n var replacement = null;\n var replacementFlat = null;\n var replacementPrefix = '_';\n var scopeArr = blockItem.id.match(/.*\\[\\w+\\]\\[([^\\]]+)\\]$/);\n var itemId = scopeArr[1];\n\n if (method == 'current_confirmed_to_form') {\n pattern = RegExp('(\\\\w+)(\\\\[?)');\n patternFlat = RegExp('(\\\\w+)');\n replacement = 'item[' + itemId + '][$1]$2';\n replacementFlat = 'item_' + itemId + '_$1';\n\n if (listType) {\n replacement = 'list[' + listType + '][item][' + itemId + '][$1]$2';\n replacementFlat = 'list_' + listType + '_' + replacementFlat;\n }\n } else if (method == 'form_confirmed_to_confirmed') {\n var stPattern = 'item\\\\[' + itemId + '\\\\]\\\\[(\\\\w+)\\\\](.*)';\n var stPatternFlat = 'item_' + itemId + '_(\\\\w+)';\n\n if (listType) {\n stPattern = 'list\\\\[' + listType + '\\\\]\\\\[item\\\\]\\\\[' + itemId + '\\\\]\\\\[(\\\\w+)\\\\](.*)';\n stPatternFlat = 'list_' + listType + '_' + stPatternFlat;\n }\n pattern = new RegExp(stPattern);\n patternFlat = new RegExp(stPatternFlat);\n replacement = '$1$2';\n replacementFlat = '$1';\n } else {\n return false;\n }\n var rename = function (elms) {\n for (var i = 0; i < elms.length; i++) {\n if (elms[i].name && elms[i].type == 'file') {\n var prefixName = 'options[files_prefix]',\n prefixValue = 'item_' + itemId + '_';\n\n self.blockFormFields.insert(new Element('input', {\n type: 'hidden',\n name: prefixName.replace(pattern, replacement),\n value: prefixValue.replace(patternPrefix, replacementPrefix)\n }));\n elms[i].name = elms[i].name.replace(patternFlat, replacementFlat);\n } else if (elms[i].name) {\n elms[i].name = elms[i].name.replace(pattern, replacement);\n }\n }\n };\n\n rename(blockItem.getElementsByTagName('input'));\n rename(blockItem.getElementsByTagName('select'));\n rename(blockItem.getElementsByTagName('textarea'));\n };\n\n switch (method) {\n case 'item_confirm':\n if (!$(this.confirmedCurrentId)) {\n this.blockConfirmed.insert(new Element('div', {\n id: this.confirmedCurrentId\n }));\n } else {\n $(this.confirmedCurrentId).update();\n }\n this.blockFormFields.childElements().each(function (elm) {\n $(this.confirmedCurrentId).insert(elm);\n }.bind(this));\n break;\n\n case 'item_restore':\n this.blockFormFields.update();\n\n // clone confirmed to form\n var mageData = null;\n\n $(this.confirmedCurrentId).childElements().each(function (elm) {\n var cloned = elm.cloneNode(true);\n\n if (elm.mageData) {\n cloned.mageData = elm.mageData;\n mageData = elm.mageData;\n }\n this.blockFormFields.insert(cloned);\n }.bind(this));\n\n // get confirmed values\n var fieldsValue = {};\n var getConfirmedValues = function (elms) {\n for (var i = 0; i < elms.length; i++) {\n if (elms[i].name) {\n if ('undefined' == typeof fieldsValue[elms[i].name]) {\n fieldsValue[elms[i].name] = {};\n }\n\n if (elms[i].type == 'checkbox') {\n fieldsValue[elms[i].name][elms[i].value] = elms[i].checked;\n } else if (elms[i].type == 'radio') {\n if (elms[i].checked) {\n fieldsValue[elms[i].name] = elms[i].value;\n }\n } else {\n fieldsValue[elms[i].name] = Form.Element.getValue(elms[i]);\n }\n }\n }\n };\n\n getConfirmedValues($(this.confirmedCurrentId).getElementsByTagName('input'));\n getConfirmedValues($(this.confirmedCurrentId).getElementsByTagName('select'));\n getConfirmedValues($(this.confirmedCurrentId).getElementsByTagName('textarea'));\n\n // restore confirmed values\n var restoreConfirmedValues = function (elms) {\n for (var i = 0; i < elms.length; i++) {\n if ('undefined' != typeof fieldsValue[elms[i].name]) {\n if (elms[i].type != 'file') {\n if (elms[i].type == 'checkbox') {\n elms[i].checked = fieldsValue[elms[i].name][elms[i].value];\n } else if (elms[i].type == 'radio') {\n if (elms[i].value == fieldsValue[elms[i].name]) {\n elms[i].checked = true;\n }\n } else {\n elms[i].setValue(fieldsValue[elms[i].name]);\n }\n }\n }\n }\n };\n\n restoreConfirmedValues(this.blockFormFields.getElementsByTagName('input'));\n restoreConfirmedValues(this.blockFormFields.getElementsByTagName('select'));\n restoreConfirmedValues(this.blockFormFields.getElementsByTagName('textarea'));\n\n // Execute scripts\n if (mageData && mageData.scripts) {\n this.restorePhase = true;\n\n try {\n mageData.scripts.map(function (script) {\n return eval(script);\n });\n } catch (e) {\n\n }\n this.restorePhase = false;\n }\n break;\n\n case 'current_confirmed_to_form':\n var allowedListTypes = {};\n\n allowedListTypes[this.current.listType] = true;\n var listInfo = this.listTypes[this.current.listType];\n\n if (listInfo.complexTypes) {\n for (var i = 0, len = listInfo.complexTypes.length; i < len; i++) {\n allowedListTypes[listInfo.complexTypes[i]] = true;\n }\n }\n\n this.blockFormConfirmed.update();\n this.blockConfirmed.childElements().each(function (blockItem) {\n var scopeArr = blockItem.id.match(/.*\\[(\\w+)\\]\\[([^\\]]+)\\]$/);\n var listType = scopeArr[1];\n var itemId = scopeArr[2];\n\n if (allowedListTypes[listType] && (!this.itemsFilter[listType] ||\n this.itemsFilter[listType].indexOf(itemId) != -1)) {\n _renameFields(method, blockItem, listInfo.complexTypes ? listType : null);\n this.blockFormConfirmed.insert(blockItem);\n }\n }.bind(this));\n break;\n\n case 'form_confirmed_to_confirmed':\n var listInfo = this.listTypes[this.current.listType];\n\n this.blockFormConfirmed.childElements().each(function (blockItem) {\n var scopeArr = blockItem.id.match(/.*\\[(\\w+)\\]\\[([^\\]]+)\\]$/);\n var listType = scopeArr[1];\n\n _renameFields(method, blockItem, listInfo.complexTypes ? listType : null);\n this.blockConfirmed.insert(blockItem);\n }.bind(this));\n break;\n }\n },\n\n /**\n * Check if qty selected correctly\n *\n * @param object element\n * @param object event\n */\n changeOptionQty: function (element, event) {\n var checkQty = true;\n\n if ('undefined' != typeof event) {\n if (event.keyCode == 8 || event.keyCode == 46) {\n checkQty = false;\n }\n }\n\n if (checkQty && (Number(element.value) <= 0 || isNaN(Number(element.value)))) {\n element.value = 1;\n }\n }\n };\n\n productConfigure = new ProductConfigure();\n jQuery(document).trigger('productConfigure:inited');\n jQuery(document).data('productConfigureInited', true);\n});\n","Magento_Catalog/catalog/product/edit/attribute.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'mage/mage',\n 'validation'\n], function ($) {\n 'use strict';\n\n return function (config, element) {\n $(element).mage('form').validation({\n validationUrl: config.validationUrl\n });\n };\n});\n","Magento_Catalog/catalog/product/attribute/unique-validate.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'mage/backend/validation'\n], function (jQuery) {\n 'use strict';\n\n return function (config) {\n var msg = '',\n _config = jQuery.extend({\n element: null,\n message: '',\n uniqueClass: 'required-unique'\n }, config),\n\n /** @inheritdoc */\n messager = function () {\n return msg;\n };\n\n if (typeof _config.element === 'string') {\n jQuery.validator.addMethod(\n _config.element,\n\n function (value, element) {\n var inputs = jQuery(element)\n .closest('table')\n .find('.' + _config.uniqueClass + ':visible'),\n valuesHash = {},\n isValid = true,\n duplicates = [];\n\n inputs.each(function (el) {\n var inputValue = inputs[el].value;\n\n if (typeof valuesHash[inputValue] !== 'undefined') {\n isValid = false;\n duplicates.push(inputValue);\n }\n valuesHash[inputValue] = el;\n });\n\n if (!isValid) {\n msg = _config.message + ' (' + duplicates.join(', ') + ')';\n }\n\n return isValid;\n },\n\n messager\n );\n }\n };\n});\n","Magento_Catalog/catalog/category/form.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/modal/alert'\n], function ($, alert) {\n 'use strict';\n\n return function (config) {\n var categoryForm = {\n options: {\n categoryIdSelector: 'input[name=\"id\"]',\n categoryPathSelector: 'input[name=\"path\"]',\n categoryParentSelector: 'input[name=\"parent\"]',\n categoryLevelSelector: 'input[name=\"level\"]',\n refreshUrl: config.refreshUrl\n },\n\n /**\n * Sending ajax to server to refresh field 'path'\n * @protected\n */\n refreshPath: function () {\n if (!$(this.options.categoryIdSelector)) {\n return false;\n }\n $.ajax({\n url: this.options.refreshUrl,\n method: 'GET',\n showLoader: true\n }).done(this._refreshPathSuccess.bind(this));\n },\n\n /**\n * Refresh field 'path' on ajax success\n * @param {Object} data\n * @private\n */\n _refreshPathSuccess: function (data) {\n if (data.error) {\n alert({\n content: data.message\n });\n } else {\n $(this.options.categoryIdSelector).val(data.id).trigger('change');\n $(this.options.categoryPathSelector).val(data.path).trigger('change');\n $(this.options.categoryParentSelector).val(data.parentId).trigger('change');\n $(this.options.categoryLevelSelector).val(data.level).trigger('change');\n }\n }\n };\n\n $('body').on('categoryMove.tree', $.proxy(categoryForm.refreshPath.bind(categoryForm), this));\n };\n});\n","Magento_Catalog/catalog/category/assign-products.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'mage/adminhtml/grid'\n], function () {\n 'use strict';\n\n return function (config) {\n var selectedProducts = config.selectedProducts,\n categoryProducts = $H(selectedProducts),\n gridJsObject = window[config.gridJsObjectName],\n tabIndex = 1000;\n\n $('in_category_products').value = Object.toJSON(categoryProducts);\n\n /**\n * Register Category Product\n *\n * @param {Object} grid\n * @param {Object} element\n * @param {Boolean} checked\n */\n function registerCategoryProduct(grid, element, checked) {\n if (checked) {\n if (element.positionElement) {\n element.positionElement.disabled = false;\n categoryProducts.set(element.value, element.positionElement.value);\n }\n } else {\n if (element.positionElement) {\n element.positionElement.disabled = true;\n }\n categoryProducts.unset(element.value);\n }\n $('in_category_products').value = Object.toJSON(categoryProducts);\n grid.reloadParams = {\n 'selected_products[]': categoryProducts.keys()\n };\n }\n\n /**\n * Click on product row\n *\n * @param {Object} grid\n * @param {String} event\n */\n function categoryProductRowClick(grid, event) {\n var trElement = Event.findElement(event, 'tr'),\n eventElement = Event.element(event),\n isInputCheckbox = eventElement.tagName === 'INPUT' && eventElement.type === 'checkbox',\n isInputPosition = grid.targetElement &&\n grid.targetElement.tagName === 'INPUT' &&\n grid.targetElement.name === 'position',\n checked = false,\n checkbox = null;\n\n if (eventElement.tagName === 'LABEL' &&\n trElement.querySelector('#' + eventElement.htmlFor) &&\n trElement.querySelector('#' + eventElement.htmlFor).type === 'checkbox'\n ) {\n event.stopPropagation();\n trElement.querySelector('#' + eventElement.htmlFor).trigger('click');\n\n return;\n }\n\n if (trElement && !isInputPosition) {\n checkbox = Element.getElementsBySelector(trElement, 'input');\n\n if (checkbox[0]) {\n checked = isInputCheckbox ? checkbox[0].checked : !checkbox[0].checked;\n gridJsObject.setCheckboxChecked(checkbox[0], checked);\n }\n }\n }\n\n /**\n * Change product position\n *\n * @param {String} event\n */\n function positionChange(event) {\n var element = Event.element(event);\n\n if (element && element.checkboxElement && element.checkboxElement.checked) {\n categoryProducts.set(element.checkboxElement.value, element.value);\n $('in_category_products').value = Object.toJSON(categoryProducts);\n }\n }\n\n /**\n * Initialize category product row\n *\n * @param {Object} grid\n * @param {String} row\n */\n function categoryProductRowInit(grid, row) {\n var checkbox = $(row).getElementsByClassName('checkbox')[0],\n position = $(row).getElementsByClassName('input-text')[0];\n\n if (checkbox && position) {\n checkbox.positionElement = position;\n position.checkboxElement = checkbox;\n position.disabled = !checkbox.checked;\n position.tabIndex = tabIndex++;\n Event.observe(position, 'keyup', positionChange);\n }\n }\n\n gridJsObject.rowClickCallback = categoryProductRowClick;\n gridJsObject.initRowCallback = categoryProductRowInit;\n gridJsObject.checkboxCheckCallback = registerCategoryProduct;\n\n if (gridJsObject.rows) {\n gridJsObject.rows.each(function (row) {\n categoryProductRowInit(gridJsObject, row);\n });\n }\n };\n});\n","Magento_Catalog/component/select-type-grid.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/dynamic-rows/dynamic-rows'\n], function ($, Abstract) {\n 'use strict';\n\n return Abstract.extend({\n\n /**\n * Checks is relevant value\n *\n * @param {String} value\n * @returns {Boolean}\n */\n isRelevant: function (value) {\n if ($.inArray(value, ['drop_down', 'radio', 'checkbox', 'multiple']) !== -1) {\n this.disabled(false);\n this.visible(true);\n\n return true;\n }\n\n this.reset();\n this.disabled(true);\n this.visible(false);\n\n return false;\n }\n });\n});\n","Magento_Catalog/component/static-type-select.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/form/element/select'\n], function ($, Abstract) {\n 'use strict';\n\n return Abstract.extend({\n\n /**\n * Checks is relevant value\n *\n * @param {String} value\n * @returns {Boolean}\n */\n isRelevant: function (value) {\n if (!value || $.inArray(value, ['drop_down', 'radio', 'checkbox', 'multiple']) !== -1) {\n this.reset();\n this.disabled(true);\n\n return false;\n }\n\n this.disabled(false);\n\n return true;\n }\n });\n});\n","Magento_Catalog/component/image-size-field.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/lib/validation/utils',\n 'Magento_Ui/js/form/element/abstract',\n 'Magento_Ui/js/lib/validation/validator',\n 'mage/translate'\n], function ($, utils, Abstract, validator) {\n 'use strict';\n\n validator.addRule(\n 'validate-image-size-range',\n function (value) {\n var dataAttrRange = /^(\\d+)x(\\d+)$/,\n m;\n\n if (utils.isEmptyNoTrim(value)) {\n return true;\n }\n\n m = dataAttrRange.exec(value);\n\n return !!(m && m[1] > 0 && m[2] > 0);\n },\n $.mage.__('This value does not follow the specified format (for example, 200X300).')\n );\n\n return Abstract.extend({\n\n /**\n * Checks for relevant value\n *\n * @returns {Boolean}\n */\n isRangeCorrect: function () {\n return validator('validate-image-size-range', this.value()).passed;\n }\n });\n});\n","Magento_Catalog/component/static-type-input.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'uiRegistry',\n 'Magento_Ui/js/form/element/abstract'\n], function (registry, Abstract) {\n 'use strict';\n\n return Abstract.extend({\n defaults: {\n parentOption: null\n },\n\n /**\n * Initialize component.\n *\n * @returns {Element}\n */\n initialize: function () {\n return this\n ._super()\n .initLinkToParent();\n },\n\n /**\n * Cache link to parent component - option holder.\n *\n * @returns {Element}\n */\n initLinkToParent: function () {\n var pathToParent = this.parentName.replace(/(\\.[^.]*){2}$/, '');\n\n this.parentOption = registry.async(pathToParent);\n this.value() && this.parentOption('label', this.value());\n\n return this;\n },\n\n /**\n * On value change handler.\n *\n * @param {String} value\n */\n onUpdate: function (value) {\n this.parentOption(function (component) {\n component.set('label', value ? value : component.get('headerLabel'));\n });\n\n return this._super();\n }\n });\n});\n","Magento_Catalog/component/file-type-field.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/abstract'\n], function (Abstract) {\n 'use strict';\n\n return Abstract.extend({\n\n /**\n * Checks is relevant value\n *\n * @param {String} value\n * @returns {Boolean}\n */\n isRelevant: function (value) {\n if (value === 'file') {\n this.disabled(false);\n this.visible(true);\n\n return true;\n }\n\n this.reset();\n this.disabled(true);\n this.visible(false);\n\n return false;\n }\n });\n});\n","Magento_Catalog/component/text-type-field.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/form/element/abstract'\n], function ($, Abstract) {\n 'use strict';\n\n return Abstract.extend({\n\n /**\n * Checks for relevant value\n *\n * @param {*} value\n * @returns {Boolean}\n */\n isRelevant: function (value) {\n if ($.inArray(value, ['field', 'area']) !== -1) {\n this.disabled(false);\n this.visible(true);\n\n return true;\n }\n\n this.reset();\n this.disabled(true);\n this.visible(false);\n\n return false;\n }\n });\n});\n","Magento_Catalog/component/static-type-container.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/form/components/group'\n], function ($, Group) {\n 'use strict';\n\n return Group.extend({\n\n /**\n * Checks is relevant value\n *\n * @param {String} value\n * @returns {Boolean}\n */\n isRelevant: function (value) {\n if ($.inArray(value, ['field', 'area', 'file', 'date', 'date_time', 'time']) !== -1) {\n this.visible(true);\n\n return true;\n }\n\n this.visible(false);\n\n return false;\n }\n });\n});\n","requirejs/domReady.js":"/**\n * @license RequireJS domReady 2.0.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/requirejs/domReady for details\n */\n/*jslint */\n/*global require: false, define: false, requirejs: false,\n window: false, clearInterval: false, document: false,\n self: false, setInterval: false */\n\n\ndefine(function () {\n 'use strict';\n\n var isTop, testDiv, scrollIntervalId,\n isBrowser = typeof window !== \"undefined\" && window.document,\n isPageLoaded = !isBrowser,\n doc = isBrowser ? document : null,\n readyCalls = [];\n\n function runCallbacks(callbacks) {\n var i;\n for (i = 0; i < callbacks.length; i += 1) {\n callbacks[i](doc);\n }\n }\n\n function callReady() {\n var callbacks = readyCalls;\n\n if (isPageLoaded) {\n //Call the DOM ready callbacks\n if (callbacks.length) {\n readyCalls = [];\n runCallbacks(callbacks);\n }\n }\n }\n\n /**\n * Sets the page as loaded.\n */\n function pageLoaded() {\n if (!isPageLoaded) {\n isPageLoaded = true;\n if (scrollIntervalId) {\n clearInterval(scrollIntervalId);\n }\n\n callReady();\n }\n }\n\n if (isBrowser) {\n if (document.addEventListener) {\n //Standards. Hooray! Assumption here that if standards based,\n //it knows about DOMContentLoaded.\n document.addEventListener(\"DOMContentLoaded\", pageLoaded, false);\n window.addEventListener(\"load\", pageLoaded, false);\n } else if (window.attachEvent) {\n window.attachEvent(\"onload\", pageLoaded);\n\n testDiv = document.createElement('div');\n try {\n isTop = window.frameElement === null;\n } catch (e) {}\n\n //DOMContentLoaded approximation that uses a doScroll, as found by\n //Diego Perini: http://javascript.nwbox.com/IEContentLoaded/,\n //but modified by other contributors, including jdalton\n if (testDiv.doScroll && isTop && window.external) {\n scrollIntervalId = setInterval(function () {\n try {\n testDiv.doScroll();\n pageLoaded();\n } catch (e) {}\n }, 30);\n }\n }\n\n //Check if document is no longer loading, and if so, just trigger page load\n //listeners. Latest webkit browsers also use \"interactive\", and\n //will fire the onDOMContentLoaded before \"interactive\" but not after\n //entering \"interactive\" or \"complete\". More details:\n //http://dev.w3.org/html5/spec/the-end.html#the-end\n //http://stackoverflow.com/questions/3665561/document-readystate-of-interactive-vs-ondomcontentloaded\n //Hmm, this is more complicated on further use, see \"firing too early\"\n //bug: https://github.com/requirejs/domReady/issues/1\n //so removing the || document.readyState === \"interactive\" test.\n //There is still a window.onload binding that should get fired if\n //DOMContentLoaded is missed.\n if (document.readyState !== \"loading\") {\n // Handle it asynchronously to allow scripts the opportunity to delay ready\n setTimeout(pageLoaded);\n }\n }\n\n /** START OF PUBLIC API **/\n\n /**\n * Registers a callback for DOM ready. If DOM is already ready, the\n * callback is called immediately.\n * @param {Function} callback\n */\n function domReady(callback) {\n if (isPageLoaded) {\n callback(doc);\n } else {\n readyCalls.push(callback);\n }\n return domReady;\n }\n\n domReady.version = '2.0.1';\n\n /**\n * Loader Plugin API method\n */\n domReady.load = function (name, req, onLoad, config) {\n if (config.isBuild) {\n onLoad(null);\n } else {\n domReady(onLoad);\n }\n };\n\n /** END OF PUBLIC API **/\n\n return domReady;\n});\n","Magento_Weee/js/fpt-group.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/components/group',\n 'uiRegistry',\n 'Magento_Ui/js/lib/validation/validator',\n 'mage/translate',\n 'underscore'\n], function (Group, uiRegistry, validation, $t, _) {\n 'use strict';\n\n return Group.extend({\n defaults: {\n visible: true,\n label: '',\n showLabel: true,\n required: false,\n template: 'ui/group/group',\n fieldTemplate: 'ui/form/field',\n breakLine: true,\n validateWholeGroup: false,\n additionalClasses: {}\n },\n\n /** @inheritdoc */\n initialize: function () {\n validation.addRule('validate-fpt-group', function (value) {\n if (value.indexOf('?') !== -1) {\n\n return false;\n }\n\n return true;\n }, $t(\n 'Set unique country-state combinations within the same fixed product tax. ' +\n 'Verify the combinations and try again.'\n ));\n\n this._super();\n },\n\n /**\n *\n * @private\n */\n _handleOptionsAvailability: function () {\n var parent,\n dup;\n\n dup = {};\n parent = uiRegistry.get(uiRegistry.get(this.parentName).parentName);\n _.each(parent.elems(), function (elem) {\n var country,\n state,\n val,\n key;\n\n country = uiRegistry.get(elem.name + '.countryState.country');\n state = uiRegistry.get(elem.name + '.countryState.state');\n val = uiRegistry.get(elem.name + '.countryState.val');\n\n key = country.value() + (state.value() > 0 ? state.value() : 0);\n dup[key]++;\n\n if (!dup[key]) {\n dup[key] = 1;\n val.value('');\n } else {\n dup[key]++;\n val.value(country.value() + '?' + country.name);\n }\n });\n },\n\n /** @inheritdoc */\n initElement: function (elem) {\n var obj;\n\n obj = this;\n this._super();\n elem.on('value', function () {\n obj._handleOptionsAvailability();\n });\n\n return this;\n }\n });\n});\n","Magento_Weee/js/fpt-attribute.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* global RegionUpdater */\ndefine([\n 'jquery',\n 'mage/template',\n 'jquery/ui',\n 'mage/adminhtml/form'\n], function ($, mageTemplate) {\n 'use strict';\n\n $.widget('mage.fptAttribute', {\n /** @inheritdoc */\n _create: function () {\n var widget = this;\n\n this.rowTmpl = mageTemplate(this.element.find('[data-role=\"row-template\"]').html());\n\n this._initOptionItem();\n\n if ($(this.options.bundlePriceType).val() === '0') {\n this.element.hide();\n }\n\n $.each(this.options.itemsData, function () {\n widget.addItem(this);\n });\n },\n\n /**\n * @private\n */\n _initOptionItem: function () {\n var widget = this,\n isOriginalRequired = $(widget.element).hasClass('required');\n\n this._on({\n /**\n * Add new tax item.\n *\n * @param {jQuery.Event} event\n */\n 'click [data-action=add-fpt-item]': function (event) {\n this.addItem(event);\n },\n\n /**\n * Delete tax item.\n *\n * @param {jQuery.Event} event\n */\n 'click [data-action=delete-fpt-item]': function (event) {\n var parent = $(event.target).closest('[data-role=\"fpt-item-row\"]');\n\n parent.find('[data-role=\"delete-fpt-item\"]').val(1);\n parent.addClass('ignore-validate').hide();\n },\n\n /**\n * Change tax item country/state.\n *\n * @param {jQuery.Event} event\n * @param {Object} data\n */\n 'change [data-role=\"select-country\"]': function (event, data) {\n var currentElement = event.target || event.srcElement || event.currentTarget,\n parentElement = $(currentElement).closest('[data-role=\"fpt-item-row\"]'),\n updater;\n\n data = data || {};\n updater = new RegionUpdater(\n parentElement.find('[data-role=\"select-country\"]').attr('id'), null,\n parentElement.find('[data-role=\"select-state\"]').attr('id'),\n widget.options.region, 'disable', true\n );\n updater.update();\n //set selected state value if set\n if (data.state) {\n parentElement.find('[data-role=\"select-state\"]').val(data.state);\n }\n\n if (!isOriginalRequired && $(widget.element).hasClass('required')) {\n $(widget.element).removeClass('required');\n }\n }\n });\n\n $(this.options.bundlePriceType).on('change', function (event) {\n var attributeItems = widget.element.find('[data-role=\"delete-fpt-item\"]');\n\n if ($(event.target).val() === '0') {\n widget.element.hide();\n attributeItems.each(function () {\n $(this).val(1);\n });\n } else {\n widget.element.show();\n attributeItems.each(function () {\n if ($(this).closest('[data-role=\"fpt-item-row\"]').is(':visible')) {\n $(this).val(0);\n }\n });\n }\n });\n },\n\n /**\n * Add custom option.\n *\n * @param {jQuery.Event} event\n */\n addItem: function (event) {\n var data = {},\n currentElement = event.target || event.srcElement || event.currentTarget,\n tmpl;\n\n if (typeof currentElement !== 'undefined') {\n data['website_id'] = 0;\n } else {\n data = event;\n }\n\n data.index = this.element.find('[data-role=\"fpt-item-row\"]').length;\n\n tmpl = this.rowTmpl({\n data: data\n });\n\n $(tmpl).appendTo(this.element.find('[data-role=\"fpt-item-container\"]'));\n\n //set selected website_id value if set\n if (data['website_id']) {\n this.element.find('[data-role=\"select-website\"][id$=\"_' + data.index + '_website\"]')\n .val(data['website_id']);\n }\n\n //set selected country value if set\n if (data.country) {\n this.element.find('[data-role=\"select-country\"][id$=\"_' + data.index + '_country\"]')\n .val(data.country).trigger('change', data);\n }\n }\n });\n\n return $.mage.fptAttribute;\n});\n","Magento_Weee/js/regions-tax-select.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/select'\n], function (Select) {\n 'use strict';\n\n return Select.extend({\n defaults: {\n filterBy: {\n field: 'country',\n target: '${ $.parentName }.country:value'\n }\n },\n\n /** @inheritdoc */\n filter: function () {\n this._super();\n this.disableSelect();\n },\n\n /**\n * Disables select if there's no regions/states\n *\n * @returns {*} instance - Chainable\n */\n disableSelect: function () {\n var empty = !this.options().length;\n\n this.disabled(empty);\n\n if (empty) {\n this.error('');\n }\n\n return this;\n }\n });\n});\n","Magento_Weee/js/price/adjustment.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/grid/columns/column'\n], function (Element) {\n 'use strict';\n\n return Element.extend({\n defaults: {\n bodyTmpl: 'Magento_Weee/price/adjustment',\n dataSource: '${ $.parentName }.provider',\n //Weee configuration constants can be configured from backend\n inclFptWithDesc: 1,//show FPT and description\n inclFpt: 0, //show FPT attribute\n exclFpt: 2, //do not show FPT\n bothFptPrices: 3 //show price without FPT and with FPT and with description\n },\n\n /**\n * Get Weee attributes.\n *\n * @param {Object} row\n * @return {HTMLElement} Weee html\n */\n getWeeeAttributes: function (row) {\n return row['price_info']['extension_attributes']['weee_attributes'];\n },\n\n /**\n * Get Weee without Tax attributes.\n *\n * @param {Object} taxAmount\n * @return {HTMLElement} Weee html\n */\n getWeeeTaxWithoutTax: function (taxAmount) {\n return taxAmount['amount_excl_tax'];\n },\n\n /**\n * UnsanitizedHtml version of getWeeeTaxWithoutTax.\n *\n * @param {Object} taxAmount\n * @return {HTMLElement} Weee html\n */\n getWeeeTaxWithoutTaxUnsanitizedHtml: function (taxAmount) {\n return this.getWeeeTaxWithoutTax(taxAmount);\n },\n\n /**\n * Get Weee with Tax attributes.\n *\n * @param {Object} taxAmount\n * @return {HTMLElement} Weee html\n */\n getWeeeTaxWithTax: function (taxAmount) {\n return taxAmount['tax_amount_incl_tax'];\n },\n\n /**\n * UnsanitizedHtml version of getWeeeTaxWithTax.\n *\n * @param {Object} taxAmount\n * @return {HTMLElement} Weee html\n */\n getWeeeTaxWithTaxUnsanitizedHtml: function (taxAmount) {\n return this.getWeeeTaxWithTax(taxAmount);\n },\n\n /**\n * Get Weee Tax name.\n *\n * @param {String} taxAmount\n * @return {String} Weee name\n */\n getWeeTaxAttributeName: function (taxAmount) {\n return taxAmount['attribute_code'];\n },\n\n /**\n * Set price type.\n *\n * @param {String} priceType\n * @return {Object}\n */\n setPriceType: function (priceType) {\n this.taxPriceType = priceType;\n\n return this;\n },\n\n /**\n * Check if Weee Tax must be shown.\n *\n * @param {Object} row\n * @return {Boolean}\n */\n isShown: function (row) {\n return row['price_info']['extension_attributes']['weee_attributes'].length;\n },\n\n /**\n * Get Weee final price.\n *\n * @param {Object} row\n * @return {HTMLElement} Weee final price html\n */\n getWeeeAdjustment: function (row) {\n return row['price_info']['extension_attributes']['weee_adjustment'];\n },\n\n /**\n * UnsanitizedHtml version of getWeeeAdjustment.\n *\n * @param {Object} row\n * @return {HTMLElement} Weee final price html\n */\n getWeeeAdjustmentUnsanitizedHtml: function (row) {\n return this.getWeeeAdjustment(row);\n },\n\n /**\n * Return whether display setting is to display price including FPT only.\n *\n * @return {Boolean}\n */\n displayPriceInclFpt: function () {\n return +this.source.data.displayWeee === this.inclFpt;\n },\n\n /**\n * Return whether display setting is to display\n * price including FPT and FPT description.\n *\n * @return {Boolean}\n */\n displayPriceInclFptDescr: function () {\n return +this.source.data.displayWeee === this.inclFptWithDesc;\n },\n\n /**\n * Return whether display setting is to display price\n * excluding FPT but including FPT description and final price.\n *\n * @return {Boolean}\n */\n displayPriceExclFptDescr: function () {\n return +this.source.data.displayWeee === this.exclFpt;\n },\n\n /**\n * Return whether display setting is to display price excluding FPT.\n *\n * @return {Boolean}\n */\n displayPriceExclFpt: function () {\n return +this.source.data.displayWeee === this.bothFptPrices;\n },\n\n /**\n * Return whether display setting is to display price excluding tax.\n *\n * @return {Boolean}\n */\n displayPriceExclTax: function () {\n return +this.source.data.displayTaxes === this.inclFptWithDesc;\n },\n\n /**\n * Return whether display setting is to display price including tax.\n *\n * @return {Boolean}\n */\n displayPriceInclTax: function () {\n return +this.source.data.displayTaxes === this.exclFpt;\n },\n\n /**\n * Return whether display setting is to display\n * both price including tax and price excluding tax.\n *\n * @return {Boolean}\n */\n displayBothPricesTax: function () {\n return +this.source.data.displayTaxes === this.bothFptPrices;\n }\n });\n});\n","Magento_InventoryLowQuantityNotificationAdminUi/js/components/notify-stock-qty.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/abstract'\n], function (AbstractField) {\n 'use strict';\n\n return AbstractField.extend({\n defaults: {\n notifyStockQtyUseDefault: '',\n manageStock: '',\n listens: {\n notifyStockQtyUseDefault: 'onChange',\n manageStock: 'onChange'\n }\n },\n\n /**\n * @inheritdoc\n */\n initObservable: function () {\n return this\n ._super()\n .observe(['notifyStockQtyUseDefault', 'manageStock']);\n },\n\n /**\n * Disable input when Manage Stock switched off or Notify Quantity Use Default\n */\n onChange: function () {\n this.disabled(\n this.notifyStockQtyUseDefault() ||\n this.manageStock()\n );\n }\n });\n});\n","Magento_InventoryLowQuantityNotificationAdminUi/js/components/use-config-settings.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/form/element/single-checkbox'\n], function (checkbox) {\n 'use strict';\n\n return checkbox.extend({\n defaults: {\n valueFromConfig: '',\n linkedValue: ''\n },\n\n /**\n * @inheritdoc\n */\n initObservable: function () {\n return this\n ._super()\n .observe(['valueFromConfig', 'linkedValue']);\n },\n\n /**\n * @inheritdoc\n */\n 'onCheckedChanged': function (newChecked) {\n if (newChecked) {\n this.linkedValue(this.valueFromConfig());\n }\n\n this._super(newChecked);\n },\n\n /**\n * @returns {String}\n */\n getInitialValue: function () {\n var values = [this.value(), this.default],\n value;\n\n values.some(function (v) {\n value = v || !!v;\n\n return value;\n });\n\n return this.normalizeData(value);\n }\n });\n});\n","Magento_InventoryInStorePickupSalesAdminUi/order/create/scripts-mixin.js":"/*\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine(\n [\n 'jquery',\n 'prototype'\n ],\n function (jQuery) {\n 'use strict';\n\n return function () {\n var STORE_PICKUP_METHOD = 'instore_pickup',\n SOURCES_FIELD_SELECTOR = '#shipping_form_pickup_location_source',\n SAME_AS_BILLING_SELECTOR = '#order-shipping_same_as_billing',\n CUSTOMER_SHIPPING_ADDRESS_ID_SELECTOR = '#order-shipping_address_customer_address_id',\n CUSTOMER_ADDRESS_SAVE_IN_ADDRESS_BOOK_SELECTOR = '#order-shipping_address_save_in_address_book',\n IN_STORE_PICKUP_CHECKBOX_SELECTOR = '#s_method_instore_pickup';\n\n /**\n * Display sources dropdown field;\n * And vice-versa\n *\n * @param {Boolean} isStorePickup\n */\n function setStorePickupMethod(isStorePickup) {\n var sourcesInput = jQuery(SOURCES_FIELD_SELECTOR),\n shippingAddressSaveInAddressBook = jQuery(CUSTOMER_ADDRESS_SAVE_IN_ADDRESS_BOOK_SELECTOR);\n\n if (isStorePickup) {\n shippingAddressSaveInAddressBook.prop('checked', false);\n sourcesInput.show();\n\n return;\n }\n window.order.disableShippingAddress(jQuery(SAME_AS_BILLING_SELECTOR).prop('checked'));\n sourcesInput.hide();\n }\n\n /**\n * Verify is store pickup delivery method is checked.\n */\n function isStorePickupSelected() {\n var storePickupCheckbox = jQuery(IN_STORE_PICKUP_CHECKBOX_SELECTOR);\n\n return storePickupCheckbox.length && storePickupCheckbox.prop('checked');\n }\n\n /**\n * Always disable unwanted shipping address fields in case store pickup is selected.\n */\n window.AdminOrder.prototype.disableShippingAddress =\n window.AdminOrder.prototype.disableShippingAddress.wrap(function (proceed, flag) {\n var shippingAddressId = jQuery(CUSTOMER_SHIPPING_ADDRESS_ID_SELECTOR),\n theSameAsBillingCheckBox = jQuery(SAME_AS_BILLING_SELECTOR),\n shippingAddressSaveInAddressBook = jQuery(CUSTOMER_ADDRESS_SAVE_IN_ADDRESS_BOOK_SELECTOR);\n\n proceed(flag);\n\n if (isStorePickupSelected()) {\n shippingAddressId.prop('disabled', true);\n theSameAsBillingCheckBox.prop('disabled', true);\n shippingAddressSaveInAddressBook.prop('disabled', true);\n }\n });\n\n /**\n * Set shipping method override\n *\n * @param {String} method\n */\n window.AdminOrder.prototype.setShippingMethod = function (method) {\n var data = {},\n areas = [\n 'shipping_method',\n 'totals',\n 'billing_method',\n 'shipping_address'\n ];\n\n data['order[shipping_method]'] = method;\n\n if (method === STORE_PICKUP_METHOD) {\n data = this.serializeData(this.shippingAddressContainer).toObject();\n data['order[shipping_method]'] = method;\n data['shipping_as_billing'] = 0;\n data['save_in_address_book'] = 0;\n this.shippingAsBilling = 0;\n this.saveInAddressBook = 0;\n }\n\n this.loadArea(areas, true, data).then(\n function () {\n setStorePickupMethod(method === STORE_PICKUP_METHOD);\n }\n );\n };\n\n /**\n * Replace shipping method area.\n * Restore store pickup shipping method if it was already selected.\n */\n window.AdminOrder.prototype.resetShippingMethod = function () {\n var storePickupCheckbox = jQuery(IN_STORE_PICKUP_CHECKBOX_SELECTOR);\n\n if (!this.isOnlyVirtualProduct) {\n /* eslint-disable no-undef */\n $(this.getAreaId('shipping_method')).update(this.shippingTemplate);\n\n if (isStorePickupSelected()) {\n window.order.setShippingMethod(storePickupCheckbox.val());\n }\n }\n };\n };\n }\n);\n","Magento_InventoryInStorePickupSalesAdminUi/order/create/trigger-shipping-method-update.js":"/*\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine(\n [\n 'jquery',\n 'Magento_Sales/order/create/form'\n ],\n function ($) {\n 'use strict';\n\n return function () {\n var storePickupCheckbox = $('#s_method_instore_pickup');\n\n if (storePickupCheckbox.length && storePickupCheckbox.prop('checked')) {\n window.order.setShippingMethod(storePickupCheckbox.val());\n }\n };\n }\n);\n","Magento_Rule/conditions-data-normalizer.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'underscore'\n], function ($, _) {\n 'use strict';\n\n /**\n * @constructor\n */\n var ConditionsDataNormalizer = function () {\n this.patterns = {\n validate: /^[a-z0-9_.-][a-z0-9_.-]*(?:\\[(?:\\d*|[a-z0-9_.-]+)\\])*$/i,\n key: /[a-z0-9_.-]+|(?=\\[\\])/gi,\n push: /^$/,\n fixed: /^\\d+$/,\n named: /^[a-z0-9_.-]+$/i\n };\n };\n\n ConditionsDataNormalizer.prototype = {\n /**\n * Will convert an object:\n * {\n * \"foo[bar][1][baz]\": 123,\n * \"foo[bar][1][blah]\": 321\n * \"foo[bar][1--1][ah]\": 456\n * }\n *\n * to\n * {\n * \"foo\": {\n * \"bar\": {\n * \"1\": {\n * \"baz\": 123,\n * \"blah\": 321\n * },\n * \"1--1\": {\n * \"ah\": 456\n * }\n * }\n * }\n * }\n */\n normalize: function normalize(value) {\n var el, _this = this;\n\n this.pushes = {};\n this.data = {};\n\n _.each(value, function (e, i) {\n el = {};\n el[i] = e;\n\n _this._addPair({\n name: i,\n value: e\n });\n });\n\n return this.data;\n },\n\n /**\n * @param {Object} base\n * @param {String} key\n * @param {String} value\n * @return {Object}\n * @private\n */\n _build: function build(base, key, value) {\n base[key] = value;\n\n return base;\n },\n\n /**\n * @param {Object} root\n * @param {String} value\n * @return {*}\n * @private\n */\n _makeObject: function makeObject(root, value) {\n var keys = root.match(this.patterns.key),\n k, idx; // nest, nest, ..., nest\n\n while ((k = keys.pop()) !== undefined) {\n // foo[]\n if (this.patterns.push.test(k)) {\n idx = this._incrementPush(root.replace(/\\[\\]$/, ''));\n value = this._build([], idx, value);\n } // foo[n]\n else if (this.patterns.fixed.test(k)) {\n value = this._build({}, k, value);\n } // foo; foo[bar]\n else if (this.patterns.named.test(k)) {\n value = this._build({}, k, value);\n }\n }\n\n return value;\n },\n\n /**\n * @param {String} key\n * @return {Number}\n * @private\n */\n _incrementPush: function incrementPush(key) {\n if (this.pushes[key] === undefined) {\n this.pushes[key] = 0;\n }\n\n return this.pushes[key]++;\n },\n\n /**\n * @param {Object} pair\n * @return {Object}\n * @private\n */\n _addPair: function addPair(pair) {\n var obj = this._makeObject(pair.name, pair.value);\n\n if (!this.patterns.validate.test(pair.name)) {\n return this;\n }\n\n this.data = $.extend(true, this.data, obj);\n\n return this;\n }\n };\n\n return ConditionsDataNormalizer;\n});\n","Magento_Rule/rules.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/modal/alert',\n 'mage/translate',\n 'prototype'\n], function (jQuery) {\n 'use strict';\n\n var VarienRulesForm = new Class.create();\n\n VarienRulesForm.prototype = {\n initialize: function (parent, newChildUrl) {\n this.parent = $(parent);\n this.newChildUrl = newChildUrl;\n this.shownElement = null;\n this.updateElement = null;\n this.chooserSelectedItems = $H({});\n this.readOnly = false;\n\n var elems = this.parent.getElementsByClassName('rule-param');\n\n for (var i = 0; i < elems.length; i++) {\n this.initParam(elems[i]);\n }\n },\n\n setReadonly: function (readonly) {\n this.readOnly = readonly;\n var elems = this.parent.getElementsByClassName('rule-param-remove');\n\n for (var i = 0; i < elems.length; i++) {\n var element = elems[i];\n\n if (this.readOnly) {\n element.hide();\n } else {\n element.show();\n }\n }\n\n var elems = this.parent.getElementsByClassName('rule-param-new-child');\n\n for (var i = 0; i < elems.length; i++) {\n var element = elems[i];\n\n if (this.readOnly) {\n element.hide();\n } else {\n element.show();\n }\n }\n\n var elems = this.parent.getElementsByClassName('rule-param');\n\n for (var i = 0; i < elems.length; i++) {\n var container = elems[i];\n var label = Element.down(container, '.label');\n\n if (label) {\n if (this.readOnly) {\n label.addClassName('label-disabled');\n } else {\n label.removeClassName('label-disabled');\n }\n }\n }\n },\n\n initParam: function (container) {\n container.rulesObject = this;\n var label = Element.down(container, '.label');\n\n if (label) {\n Event.observe(label, 'click', this.showParamInputField.bind(this, container));\n }\n\n var elem = Element.down(container, '.element');\n\n if (elem) {\n var trig = elem.down('.rule-chooser-trigger');\n\n if (trig) {\n Event.observe(trig, 'click', this.toggleChooser.bind(this, container));\n }\n\n var apply = elem.down('.rule-param-apply');\n\n if (apply) {\n Event.observe(apply, 'click', this.hideParamInputField.bind(this, container));\n } else {\n elem = elem.down('.element-value-changer');\n elem.container = container;\n\n if (!elem.multiple) {\n Event.observe(elem, 'change', this.hideParamInputField.bind(this, container));\n\n this.changeVisibilityForValueRuleParam(elem);\n\n }\n Event.observe(elem, 'blur', this.hideParamInputField.bind(this, container));\n }\n }\n\n var remove = Element.down(container, '.rule-param-remove');\n\n if (remove) {\n Event.observe(remove, 'click', this.removeRuleEntry.bind(this, container));\n }\n },\n\n showChooserElement: function (chooser) {\n this.chooserSelectedItems = $H({});\n\n if (chooser.hasClassName('no-split')) {\n this.chooserSelectedItems.set(this.updateElement.value, 1);\n } else {\n var values = this.updateElement.value.split(','),\n s = '';\n\n for (var i = 0; i < values.length; i++) {\n s = values[i].strip();\n\n if (s != '') {\n this.chooserSelectedItems.set(s, 1);\n }\n }\n }\n new Ajax.Request(chooser.getAttribute('url'), {\n evalScripts: true,\n parameters: {\n 'form_key': FORM_KEY, 'selected[]': this.chooserSelectedItems.keys()\n },\n onSuccess: function (transport) {\n if (this._processSuccess(transport)) {\n jQuery(chooser).html(transport.responseText);\n this.showChooserLoaded(chooser, transport);\n jQuery(chooser).trigger('contentUpdated');\n }\n }.bind(this),\n onFailure: this._processFailure.bind(this)\n });\n },\n\n showChooserLoaded: function (chooser, transport) {\n chooser.style.display = 'block';\n },\n\n showChooser: function (container, event) {\n var chooser = container.up('li');\n\n if (!chooser) {\n return;\n }\n chooser = chooser.down('.rule-chooser');\n\n if (!chooser) {\n return;\n }\n this.showChooserElement(chooser);\n },\n\n hideChooser: function (container, event) {\n var chooser = container.up('li');\n\n if (!chooser) {\n return;\n }\n chooser = chooser.down('.rule-chooser');\n\n if (!chooser) {\n return;\n }\n chooser.style.display = 'none';\n },\n\n toggleChooser: function (container, event) {\n if (this.readOnly) {\n return false;\n }\n\n var chooser = container.up('li').down('.rule-chooser');\n\n if (!chooser) {\n return;\n }\n\n if (chooser.style.display == 'block') {\n chooser.style.display = 'none';\n this.cleanChooser(container, event);\n } else {\n this.showChooserElement(chooser);\n }\n },\n\n cleanChooser: function (container, event) {\n var chooser = container.up('li').down('.rule-chooser');\n\n if (!chooser) {\n return;\n }\n chooser.innerHTML = '';\n },\n\n showParamInputField: function (container, event) {\n if (this.readOnly) {\n return false;\n }\n\n if (this.shownElement) {\n this.hideParamInputField(this.shownElement, event);\n }\n\n Element.addClassName(container, 'rule-param-edit');\n var elemContainer = Element.down(container, '.element');\n\n var elem = Element.down(elemContainer, 'input.input-text');\n\n jQuery(elem).trigger('contentUpdated');\n\n if (elem) {\n elem.focus();\n\n if (elem && elem.id && elem.id.match(/__value$/)) {\n this.updateElement = elem;\n }\n\n }\n\n var elem = Element.down(elemContainer, '.element-value-changer');\n\n if (elem) {\n elem.focus();\n }\n\n this.shownElement = container;\n },\n\n hideParamInputField: function (container, event) {\n Element.removeClassName(container, 'rule-param-edit');\n var label = Element.down(container, '.label'),\n elem;\n\n if (!container.hasClassName('rule-param-new-child')) {\n elem = Element.down(container, '.element-value-changer');\n\n if (elem && elem.options) {\n var selectedOptions = [];\n\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n selectedOptions.push(elem.options[i].text);\n }\n }\n\n var str = selectedOptions.join(', ');\n\n label.innerHTML = str != '' ? str : '...';\n }\n\n this.changeVisibilityForValueRuleParam(elem);\n\n elem = Element.down(container, 'input.input-text');\n\n if (elem) {\n var str = elem.value.replace(/(^\\s+|\\s+$)/g, '');\n\n elem.value = str;\n\n if (str == '') {\n str = '...';\n } else if (str.length > 30) {\n str = str.substr(0, 30) + '...';\n }\n label.innerHTML = str.escapeHTML();\n }\n } else {\n elem = container.down('.element-value-changer');\n\n if (elem.value) {\n this.addRuleNewChild(elem);\n }\n elem.value = '';\n }\n\n if (elem && elem.id && elem.id.match(/__value$/)) {\n this.hideChooser(container, event);\n this.updateElement = null;\n }\n\n this.shownElement = null;\n },\n\n changeVisibilityForValueRuleParam: function(elem) {\n var parsedElementId = elem.id.split('__');\n if (parsedElementId[2] !== 'operator') {\n return false;\n }\n\n var valueElement = jQuery('#' + parsedElementId[0] + '__' + parsedElementId[1] + '__value');\n\n if(elem.value === '<=>') {\n valueElement.closest('.rule-param').hide();\n } else {\n valueElement.closest('.rule-param').show();\n }\n\n return true;\n },\n\n addRuleNewChild: function (elem) {\n var parent_id = elem.id.replace(/^.*__(.*)__.*$/, '$1');\n var children_ul_id = elem.id.replace(/__/g, ':').replace(/[^:]*$/, 'children').replace(/:/g, '__');\n var children_ul = $(this.parent).select('#' + children_ul_id)[0];\n var max_id = 0,\n i;\n var children_inputs = Selector.findChildElements(children_ul, $A(['input.hidden']));\n\n if (children_inputs.length) {\n children_inputs.each(function (el) {\n if (el.id.match(/__type$/)) {\n i = 1 * el.id.replace(/^.*__.*?([0-9]+)__.*$/, '$1');\n max_id = i > max_id ? i : max_id;\n }\n });\n }\n var new_id = parent_id + '--' + (max_id + 1);\n var new_type = elem.value;\n var new_elem = document.createElement('LI');\n\n new_elem.className = 'rule-param-wait';\n new_elem.innerHTML = jQuery.mage.__('This won\\'t take long . . .');\n children_ul.insertBefore(new_elem, $(elem).up('li'));\n\n new Ajax.Request(this.newChildUrl, {\n evalScripts: true,\n parameters: {\n form_key: FORM_KEY, type: new_type.replace('/', '-'), id: new_id\n },\n onComplete: this.onAddNewChildComplete.bind(this, new_elem),\n onSuccess: function (transport) {\n if (this._processSuccess(transport)) {\n $(new_elem).update(transport.responseText);\n }\n }.bind(this),\n onFailure: this._processFailure.bind(this)\n });\n },\n\n _processSuccess: function (transport) {\n if (transport.responseText.isJSON()) {\n var response = transport.responseText.evalJSON();\n\n if (response.error) {\n alert(response.message);\n }\n\n if (response.ajaxExpired && response.ajaxRedirect) {\n setLocation(response.ajaxRedirect);\n }\n\n return false;\n }\n\n return true;\n },\n\n _processFailure: function (transport) {\n location.href = BASE_URL;\n },\n\n onAddNewChildComplete: function (new_elem) {\n if (this.readOnly) {\n return false;\n }\n\n $(new_elem).removeClassName('rule-param-wait');\n var elems = new_elem.getElementsByClassName('rule-param');\n\n for (var i = 0; i < elems.length; i++) {\n this.initParam(elems[i]);\n }\n },\n\n removeRuleEntry: function (container, event) {\n var li = Element.up(container, 'li');\n\n li.parentNode.removeChild(li);\n },\n\n chooserGridInit: function (grid) {\n //grid.reloadParams = {'selected[]':this.chooserSelectedItems.keys()};\n },\n\n chooserGridRowInit: function (grid, row) {\n if (!grid.reloadParams) {\n grid.reloadParams = {\n 'selected[]': this.chooserSelectedItems.keys()\n };\n }\n },\n\n chooserGridRowClick: function (grid, event) {\n var trElement = Event.findElement(event, 'tr');\n var isInput = Event.element(event).tagName == 'INPUT';\n\n if (trElement) {\n var checkbox = Element.select(trElement, 'input');\n\n if (checkbox[0]) {\n var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;\n\n grid.setCheckboxChecked(checkbox[0], checked);\n\n }\n }\n },\n\n chooserGridCheckboxCheck: function (grid, element, checked) {\n if (checked) {\n if (!element.up('th')) {\n this.chooserSelectedItems.set(element.value, 1);\n }\n } else {\n this.chooserSelectedItems.unset(element.value);\n }\n grid.reloadParams = {\n 'selected[]': this.chooserSelectedItems.keys()\n };\n this.updateElement.value = this.chooserSelectedItems.keys().join(', ');\n }\n };\n\n return VarienRulesForm;\n});\n","Magento_InventoryInStorePickupAdminUi/js/form/components/fieldset.js":"/*\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/components/fieldset',\n 'ko'\n], function (Fieldset, ko) {\n 'use strict';\n\n /**\n * TODO Remove when issue is resolved in core.\n * @see Please check issue in core for more details: https://github.com/magento/magento2/issues/22067.\n */\n return Fieldset.extend(ko).extend(\n {\n /**\n * Convert `visible` value from string ('1', '0') to bool (true, false)\n */\n initialize: function () {\n this._super();\n\n // eslint-disable-next-line vars-on-top\n var visible = this.visible;\n\n this.visible = ko.computed({\n /**\n * @returns {Boolean}\n */\n read: function () {\n return visible();\n },\n\n /**\n * @param {String} value\n */\n write: function (value) {\n value = Boolean(value) === value ? value : Boolean(parseInt(value, 10));\n visible(value);\n },\n owner: this\n });\n this.visible(visible());\n }\n }\n );\n});\n","Magento_InventoryInStorePickupAdminUi/js/form/element/conditional-required.js":"/*\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'Magento_Ui/js/form/element/abstract',\n 'ko',\n 'underscore',\n 'mageUtils'\n], function (uiElement, ko, _, utils) {\n 'use strict';\n\n /**\n * Provide possibility to make field required by dependency on other field value.\n */\n return uiElement.extend(\n {\n /**\n * Convert `required` value from string ('1', '0') to bool (true, false)\n */\n initialize: function () {\n this._super();\n\n // eslint-disable-next-line vars-on-top\n var required = this.required;\n\n this.required = ko.computed({\n /**\n * @returns {Boolean}\n */\n read: function () {\n return required();\n },\n\n /**\n * @param {String|Boolean} value\n */\n write: function (value) {\n value = Boolean(value) === value ? value : Boolean(parseInt(value, 10));\n\n if (required() !== value) {\n required(value);\n this.setValidation('required-entry', required());\n }\n },\n owner: this\n });\n this.required(required());\n },\n\n /**\n * @param {(String|Object)} rule\n * @param {(Object|Boolean)} [options]\n * @returns {Abstract} Chainable.\n */\n setValidation: function (rule, options) {\n var rules = utils.copy(this.validation),\n changed;\n\n if (_.isObject(rule)) {\n _.extend(this.validation, rule);\n } else {\n this.validation[rule] = options;\n }\n\n changed = !utils.compare(rules, this.validation).equal;\n\n if (changed) {\n this.required(!!this.validation['required-entry']);\n this.validate();\n }\n\n return this;\n }\n }\n );\n});\n","jquery/jquery.metadata.js":"/*\n * Metadata - jQuery plugin for parsing metadata from elements\n *\n * Copyright (c) 2006 John Resig, Yehuda Katz, J\u00ef\u00bf\u00bd\u00c3\u00b6rn Zaefferer, Paul McLanahan\n *\n * Dual licensed under the MIT and GPL licenses:\n * http://www.opensource.org/licenses/mit-license.php\n * http://www.gnu.org/licenses/gpl.html\n *\n * Revision: $Id: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan $\n *\n */\n\n/**\n * Sets the type of metadata to use. Metadata is encoded in JSON, and each property\n * in the JSON will become a property of the element itself.\n *\n * There are four supported types of metadata storage:\n *\n * attr: Inside an attribute. The name parameter indicates *which* attribute.\n *\n * class: Inside the class attribute, wrapped in curly braces: { }\n *\n * elem: Inside a child element (e.g. a script tag). The\n * name parameter indicates *which* element.\n * html5: Values are stored in data-* attributes.\n *\n * The metadata for an element is loaded the first time the element is accessed via jQuery.\n *\n * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements\n * matched by expr, then redefine the metadata type and run another $(expr) for other elements.\n *\n * @name $.metadata.setType\n *\n * @example <p id=\"one\" class=\"some_class {item_id: 1, item_label: 'Label'}\">This is a p</p>\n * @before $.metadata.setType(\"class\")\n * @after $(\"#one\").metadata().item_id == 1; $(\"#one\").metadata().item_label == \"Label\"\n * @desc Reads metadata from the class attribute\n *\n * @example <p id=\"one\" class=\"some_class\" data=\"{item_id: 1, item_label: 'Label'}\">This is a p</p>\n * @before $.metadata.setType(\"attr\", \"data\")\n * @after $(\"#one\").metadata().item_id == 1; $(\"#one\").metadata().item_label == \"Label\"\n * @desc Reads metadata from a \"data\" attribute\n *\n * @example <p id=\"one\" class=\"some_class\"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>\n * @before $.metadata.setType(\"elem\", \"script\")\n * @after $(\"#one\").metadata().item_id == 1; $(\"#one\").metadata().item_label == \"Label\"\n * @desc Reads metadata from a nested script element\n *\n * @example <p id=\"one\" class=\"some_class\" data-item_id=\"1\" data-item_label=\"Label\">This is a p</p>\n * @before $.metadata.setType(\"html5\")\n * @after $(\"#one\").metadata().item_id == 1; $(\"#one\").metadata().item_label == \"Label\"\n * @desc Reads metadata from a series of data-* attributes\n *\n * @param String type The encoding type\n * @param String name The name of the attribute to be used to get metadata (optional)\n * @cat Plugins/Metadata\n * @descr Sets the type of encoding to be used when loading metadata for the first time\n * @type undefined\n * @see metadata()\n */\n(function (factory) {\n if (typeof define === 'function' && define.amd) {\n define([\"jquery\"], factory);\n } else {\n factory(jQuery);\n }\n}(function ($) {\n\n\n $.extend({\n metadata : {\n defaults : {\n type: 'class',\n name: 'metadata',\n cre: /({.*})/,\n single: 'metadata',\n meta:'validate'\n },\n setType: function( type, name ){\n this.defaults.type = type;\n this.defaults.name = name;\n },\n get: function( elem, opts ){\n var settings = $.extend({},this.defaults,opts);\n // check for empty string in single property\n if (!settings.single.length) {\n settings.single = 'metadata';\n }\n if (!settings.meta.length) {\n settings.meta = 'validate';\n }\n\n var data = $.data(elem, settings.single);\n // returned cached data if it already exists\n if ( data ) return data;\n\n data = \"{}\";\n\n var getData = function(data) {\n if(typeof data != \"string\") return data;\n\n if( data.indexOf('{') < 0 ) {\n data = eval(\"(\" + data + \")\");\n }\n }\n\n var getObject = function(data) {\n if(typeof data != \"string\") return data;\n\n data = eval(\"(\" + data + \")\");\n return data;\n }\n\n if ( settings.type == \"html5\" ) {\n var object = {};\n $( elem.attributes ).each(function() {\n var name = this.nodeName;\n if (name.indexOf('data-' + settings.meta) === 0) {\n name = name.replace(/^data-/, '');\n }\n else {\n return true;\n }\n object[name] = getObject(this.value);\n });\n } else {\n if ( settings.type == \"class\" ) {\n var m = settings.cre.exec( elem.className );\n if ( m )\n data = m[1];\n } else if ( settings.type == \"elem\" ) {\n if( !elem.getElementsByTagName ) return;\n var e = elem.getElementsByTagName(settings.name);\n if ( e.length )\n data = $.trim(e[0].innerHTML);\n } else if ( elem.getAttribute != undefined ) {\n var attr = elem.getAttribute( settings.name );\n if ( attr )\n data = attr;\n }\n object = getObject(data.indexOf(\"{\") < 0 ? \"{\" + data + \"}\" : data);\n }\n\n $.data( elem, settings.single, object );\n return object;\n }\n }\n });\n\n /**\n * Returns the metadata object for the first member of the jQuery object.\n *\n * @name metadata\n * @descr Returns element's metadata object\n * @param Object opts An object contianing settings to override the defaults\n * @type jQuery\n * @cat Plugins/Metadata\n */\n $.fn.metadata = function( opts ){\n return $.metadata.get( this[0], opts );\n };\n\n}));","jquery/jquery-ui-timepicker-addon.js":"/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20\n* http://trentrichardson.com/examples/timepicker\n* Copyright (c) 2016 Trent Richardson; Licensed MIT */\n(function (factory) {\n if (typeof define === 'function' && define.amd) {\n define(['jquery', 'jquery/ui'], factory);\n } else {\n factory(jQuery);\n }\n}(function ($) {\n\n /*\n * Lets not redefine timepicker, Prevent \"Uncaught RangeError: Maximum call stack size exceeded\"\n */\n $.ui.timepicker = $.ui.timepicker || {};\n if ($.ui.timepicker.version) {\n return;\n }\n\n /*\n * Extend jQueryUI, get it started with our version number\n */\n $.extend($.ui, {\n timepicker: {\n version: \"1.6.3\"\n }\n });\n\n /*\n * Timepicker manager.\n * Use the singleton instance of this class, $.timepicker, to interact with the time picker.\n * Settings for (groups of) time pickers are maintained in an instance object,\n * allowing multiple different settings on the same page.\n */\n var Timepicker = function () {\n this.regional = []; // Available regional settings, indexed by language code\n this.regional[''] = { // Default regional settings\n currentText: 'Now',\n closeText: 'Done',\n amNames: ['AM', 'A'],\n pmNames: ['PM', 'P'],\n timeFormat: 'HH:mm',\n timeSuffix: '',\n timeOnlyTitle: 'Choose Time',\n timeText: 'Time',\n hourText: 'Hour',\n minuteText: 'Minute',\n secondText: 'Second',\n millisecText: 'Millisecond',\n microsecText: 'Microsecond',\n timezoneText: 'Time Zone',\n isRTL: false\n };\n this._defaults = { // Global defaults for all the datetime picker instances\n showButtonPanel: true,\n timeOnly: false,\n timeOnlyShowDate: false,\n showHour: null,\n showMinute: null,\n showSecond: null,\n showMillisec: null,\n showMicrosec: null,\n showTimezone: null,\n showTime: true,\n stepHour: 1,\n stepMinute: 1,\n stepSecond: 1,\n stepMillisec: 1,\n stepMicrosec: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisec: 0,\n microsec: 0,\n timezone: null,\n hourMin: 0,\n minuteMin: 0,\n secondMin: 0,\n millisecMin: 0,\n microsecMin: 0,\n hourMax: 23,\n minuteMax: 59,\n secondMax: 59,\n millisecMax: 999,\n microsecMax: 999,\n minDateTime: null,\n maxDateTime: null,\n maxTime: null,\n minTime: null,\n onSelect: null,\n hourGrid: 0,\n minuteGrid: 0,\n secondGrid: 0,\n millisecGrid: 0,\n microsecGrid: 0,\n alwaysSetTime: true,\n separator: ' ',\n altFieldTimeOnly: true,\n altTimeFormat: null,\n altSeparator: null,\n altTimeSuffix: null,\n altRedirectFocus: true,\n pickerTimeFormat: null,\n pickerTimeSuffix: null,\n showTimepicker: true,\n timezoneList: null,\n addSliderAccess: false,\n sliderAccessArgs: null,\n controlType: 'slider',\n oneLine: false,\n defaultValue: null,\n parse: 'strict',\n afterInject: null\n };\n $.extend(this._defaults, this.regional['']);\n };\n\n $.extend(Timepicker.prototype, {\n $input: null,\n $altInput: null,\n $timeObj: null,\n inst: null,\n hour_slider: null,\n minute_slider: null,\n second_slider: null,\n millisec_slider: null,\n microsec_slider: null,\n timezone_select: null,\n maxTime: null,\n minTime: null,\n hour: 0,\n minute: 0,\n second: 0,\n millisec: 0,\n microsec: 0,\n timezone: null,\n hourMinOriginal: null,\n minuteMinOriginal: null,\n secondMinOriginal: null,\n millisecMinOriginal: null,\n microsecMinOriginal: null,\n hourMaxOriginal: null,\n minuteMaxOriginal: null,\n secondMaxOriginal: null,\n millisecMaxOriginal: null,\n microsecMaxOriginal: null,\n ampm: '',\n formattedDate: '',\n formattedTime: '',\n formattedDateTime: '',\n timezoneList: null,\n units: ['hour', 'minute', 'second', 'millisec', 'microsec'],\n support: {},\n control: null,\n\n /*\n * Override the default settings for all instances of the time picker.\n * @param {Object} settings object - the new settings to use as defaults (anonymous object)\n * @return {Object} the manager object\n */\n setDefaults: function (settings) {\n extendRemove(this._defaults, settings || {});\n return this;\n },\n\n /*\n * Create a new Timepicker instance\n */\n _newInst: function ($input, opts) {\n var tp_inst = new Timepicker(),\n inlineSettings = {},\n fns = {},\n overrides, i;\n\n for (var attrName in this._defaults) {\n if (this._defaults.hasOwnProperty(attrName)) {\n var attrValue = $input.attr('time:' + attrName);\n if (attrValue) {\n try {\n inlineSettings[attrName] = eval(attrValue);\n } catch (err) {\n inlineSettings[attrName] = attrValue;\n }\n }\n }\n }\n\n overrides = {\n beforeShow: function (input, dp_inst) {\n if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {\n return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);\n }\n },\n onChangeMonthYear: function (year, month, dp_inst) {\n // Update the time as well : this prevents the time from disappearing from the $input field.\n // tp_inst._updateDateTime(dp_inst);\n if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {\n tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);\n }\n },\n onClose: function (dateText, dp_inst) {\n if (tp_inst.timeDefined === true && $input.val() !== '') {\n tp_inst._updateDateTime(dp_inst);\n }\n if ($.isFunction(tp_inst._defaults.evnts.onClose)) {\n tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);\n }\n }\n };\n for (i in overrides) {\n if (overrides.hasOwnProperty(i)) {\n fns[i] = opts[i] || this._defaults[i] || null;\n }\n }\n\n tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, {\n evnts: fns,\n timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');\n });\n tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) {\n return val.toUpperCase();\n });\n tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) {\n return val.toUpperCase();\n });\n\n // detect which units are supported\n tp_inst.support = detectSupport(\n tp_inst._defaults.timeFormat +\n (tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +\n (tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));\n\n // controlType is string - key to our this._controls\n if (typeof(tp_inst._defaults.controlType) === 'string') {\n if (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') {\n tp_inst._defaults.controlType = 'select';\n }\n tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];\n }\n // controlType is an object and must implement create, options, value methods\n else {\n tp_inst.control = tp_inst._defaults.controlType;\n }\n\n // prep the timezone options\n var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60,\n 0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];\n if (tp_inst._defaults.timezoneList !== null) {\n timezoneList = tp_inst._defaults.timezoneList;\n }\n var tzl = timezoneList.length, tzi = 0, tzv = null;\n if (tzl > 0 && typeof timezoneList[0] !== 'object') {\n for (; tzi < tzl; tzi++) {\n tzv = timezoneList[tzi];\n timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) };\n }\n }\n tp_inst._defaults.timezoneList = timezoneList;\n\n // set the default units\n tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) :\n ((new Date()).getTimezoneOffset() * -1);\n tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin :\n tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;\n tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin :\n tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;\n tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin :\n tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;\n tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin :\n tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;\n tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin :\n tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;\n tp_inst.ampm = '';\n tp_inst.$input = $input;\n\n if (tp_inst._defaults.altField) {\n tp_inst.$altInput = $(tp_inst._defaults.altField);\n if (tp_inst._defaults.altRedirectFocus === true) {\n tp_inst.$altInput.css({\n cursor: 'pointer'\n }).focus(function () {\n $input.trigger(\"focus\");\n });\n }\n }\n\n if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {\n tp_inst._defaults.minDate = new Date();\n }\n if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {\n tp_inst._defaults.maxDate = new Date();\n }\n\n // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..\n if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {\n tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());\n }\n if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {\n tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());\n }\n if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {\n tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());\n }\n if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {\n tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());\n }\n tp_inst.$input.bind('focus', function () {\n tp_inst._onFocus();\n });\n\n return tp_inst;\n },\n\n /*\n * add our sliders to the calendar\n */\n _addTimePicker: function (dp_inst) {\n var currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val());\n\n this.timeDefined = this._parseTime(currDT);\n this._limitMinMaxDateTime(dp_inst, false);\n this._injectTimePicker();\n this._afterInject();\n },\n\n /*\n * parse the time string from input value or _setTime\n */\n _parseTime: function (timeString, withDate) {\n if (!this.inst) {\n this.inst = $.datepicker._getInst(this.$input[0]);\n }\n\n if (withDate || !this._defaults.timeOnly) {\n var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');\n try {\n var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);\n if (!parseRes.timeObj) {\n return false;\n }\n $.extend(this, parseRes.timeObj);\n } catch (err) {\n $.timepicker.log(\"Error parsing the date/time string: \" + err +\n \"\\ndate/time string = \" + timeString +\n \"\\ntimeFormat = \" + this._defaults.timeFormat +\n \"\\ndateFormat = \" + dp_dateFormat);\n return false;\n }\n return true;\n } else {\n var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);\n if (!timeObj) {\n return false;\n }\n $.extend(this, timeObj);\n return true;\n }\n },\n\n /*\n * Handle callback option after injecting timepicker\n */\n _afterInject: function() {\n var o = this.inst.settings;\n if ($.isFunction(o.afterInject)) {\n o.afterInject.call(this);\n }\n },\n\n /*\n * generate and inject html for timepicker into ui datepicker\n */\n _injectTimePicker: function () {\n var $dp = this.inst.dpDiv,\n o = this.inst.settings,\n tp_inst = this,\n litem = '',\n uitem = '',\n show = null,\n max = {},\n gridSize = {},\n size = null,\n i = 0,\n l = 0;\n\n // Prevent displaying twice\n if ($dp.find(\"div.ui-timepicker-div\").length === 0 && o.showTimepicker) {\n var noDisplay = ' ui_tpicker_unit_hide',\n html = '<div class=\"ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + (o.oneLine && o.controlType === 'select' ? ' ui-timepicker-oneLine' : '') + '\"><dl>' + '<dt class=\"ui_tpicker_time_label' + ((o.showTime) ? '' : noDisplay) + '\">' + o.timeText + '</dt>' +\n '<dd class=\"ui_tpicker_time '+ ((o.showTime) ? '' : noDisplay) + '\"><input class=\"ui_tpicker_time_input\" ' + (o.timeInput ? '' : 'disabled') + '/></dd>';\n\n // Create the markup\n for (i = 0, l = this.units.length; i < l; i++) {\n litem = this.units[i];\n uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);\n show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];\n\n // Added by Peter Medeiros:\n // - Figure out what the hour/minute/second max should be based on the step values.\n // - Example: if stepMinute is 15, then minMax is 45.\n max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);\n gridSize[litem] = 0;\n\n html += '<dt class=\"ui_tpicker_' + litem + '_label' + (show ? '' : noDisplay) + '\">' + o[litem + 'Text'] + '</dt>' +\n '<dd class=\"ui_tpicker_' + litem + (show ? '' : noDisplay) + '\"><div class=\"ui_tpicker_' + litem + '_slider' + (show ? '' : noDisplay) + '\"></div>';\n\n if (show && o[litem + 'Grid'] > 0) {\n html += '<div style=\"padding-left: 1px\"><table class=\"ui-tpicker-grid-label\"><tr>';\n\n if (litem === 'hour') {\n for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) {\n gridSize[litem]++;\n var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o);\n html += '<td data-for=\"' + litem + '\">' + tmph + '</td>';\n }\n }\n else {\n for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) {\n gridSize[litem]++;\n html += '<td data-for=\"' + litem + '\">' + ((m < 10) ? '0' : '') + m + '</td>';\n }\n }\n\n html += '</tr></table></div>';\n }\n html += '</dd>';\n }\n\n // Timezone\n var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;\n html += '<dt class=\"ui_tpicker_timezone_label' + (showTz ? '' : noDisplay) + '\">' + o.timezoneText + '</dt>';\n html += '<dd class=\"ui_tpicker_timezone' + (showTz ? '' : noDisplay) + '\"></dd>';\n\n // Create the elements from string\n html += '</dl></div>';\n var $tp = $(html);\n\n // if we only want time picker...\n if (o.timeOnly === true) {\n $tp.prepend('<div class=\"ui-widget-header ui-helper-clearfix ui-corner-all\">' + '<div class=\"ui-datepicker-title\">' + o.timeOnlyTitle + '</div>' + '</div>');\n $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();\n }\n\n // add sliders, adjust grids, add events\n for (i = 0, l = tp_inst.units.length; i < l; i++) {\n litem = tp_inst.units[i];\n uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);\n show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];\n\n // add the slider\n tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]);\n\n // adjust the grid and add click event\n if (show && o[litem + 'Grid'] > 0) {\n size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']);\n $tp.find('.ui_tpicker_' + litem + ' table').css({\n width: size + \"%\",\n marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + \"%\"),\n marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + \"%\") : '0',\n borderCollapse: 'collapse'\n }).find(\"td\").click(function (e) {\n var $t = $(this),\n h = $t.html(),\n n = parseInt(h.replace(/[^0-9]/g), 10),\n ap = h.replace(/[^apm]/ig),\n f = $t.data('for'); // loses scope, so we use data-for\n\n if (f === 'hour') {\n if (ap.indexOf('p') !== -1 && n < 12) {\n n += 12;\n }\n else {\n if (ap.indexOf('a') !== -1 && n === 12) {\n n = 0;\n }\n }\n }\n\n tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);\n\n tp_inst._onTimeChange();\n tp_inst._onSelectHandler();\n }).css({\n cursor: 'pointer',\n width: (100 / gridSize[litem]) + '%',\n textAlign: 'center',\n overflow: 'hidden'\n });\n } // end if grid > 0\n } // end for loop\n\n // Add timezone options\n this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find(\"select\");\n $.fn.append.apply(this.timezone_select,\n $.map(o.timezoneList, function (val, idx) {\n return $(\"<option />\").val(typeof val === \"object\" ? val.value : val).text(typeof val === \"object\" ? val.label : val);\n }));\n if (typeof(this.timezone) !== \"undefined\" && this.timezone !== null && this.timezone !== \"\") {\n var local_timezone = (new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12)).getTimezoneOffset() * -1;\n if (local_timezone === this.timezone) {\n selectLocalTimezone(tp_inst);\n } else {\n this.timezone_select.val(this.timezone);\n }\n } else {\n if (typeof(this.hour) !== \"undefined\" && this.hour !== null && this.hour !== \"\") {\n this.timezone_select.val(o.timezone);\n } else {\n selectLocalTimezone(tp_inst);\n }\n }\n this.timezone_select.change(function () {\n tp_inst._onTimeChange();\n tp_inst._onSelectHandler();\n tp_inst._afterInject();\n });\n // End timezone options\n\n // inject timepicker into datepicker\n var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');\n if ($buttonPanel.length) {\n $buttonPanel.before($tp);\n } else {\n $dp.append($tp);\n }\n\n this.$timeObj = $tp.find('.ui_tpicker_time_input');\n this.$timeObj.change(function () {\n var timeFormat = tp_inst.inst.settings.timeFormat;\n var parsedTime = $.datepicker.parseTime(timeFormat, this.value);\n var update = new Date();\n if (parsedTime) {\n update.setHours(parsedTime.hour);\n update.setMinutes(parsedTime.minute);\n update.setSeconds(parsedTime.second);\n $.datepicker._setTime(tp_inst.inst, update);\n } else {\n this.value = tp_inst.formattedTime;\n this.blur();\n }\n });\n\n if (this.inst !== null) {\n var timeDefined = this.timeDefined;\n this._onTimeChange();\n this.timeDefined = timeDefined;\n }\n\n // slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/\n if (this._defaults.addSliderAccess) {\n var sliderAccessArgs = this._defaults.sliderAccessArgs,\n rtl = this._defaults.isRTL;\n sliderAccessArgs.isRTL = rtl;\n\n setTimeout(function () { // fix for inline mode\n if ($tp.find('.ui-slider-access').length === 0) {\n $tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);\n\n // fix any grids since sliders are shorter\n var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);\n if (sliderAccessWidth) {\n $tp.find('table:visible').each(function () {\n var $g = $(this),\n oldWidth = $g.outerWidth(),\n oldMarginLeft = $g.css(rtl ? 'marginRight' : 'marginLeft').toString().replace('%', ''),\n newWidth = oldWidth - sliderAccessWidth,\n newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%',\n css = { width: newWidth, marginRight: 0, marginLeft: 0 };\n css[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft;\n $g.css(css);\n });\n }\n }\n }, 10);\n }\n // end slideAccess integration\n\n tp_inst._limitMinMaxDateTime(this.inst, true);\n }\n },\n\n /*\n * This function tries to limit the ability to go outside the\n * min/max date range\n */\n _limitMinMaxDateTime: function (dp_inst, adjustSliders) {\n var o = this._defaults,\n dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);\n\n if (!this._defaults.showTimepicker) {\n return;\n } // No time so nothing to check here\n\n if ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) {\n var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),\n minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);\n\n if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) {\n this.hourMinOriginal = o.hourMin;\n this.minuteMinOriginal = o.minuteMin;\n this.secondMinOriginal = o.secondMin;\n this.millisecMinOriginal = o.millisecMin;\n this.microsecMinOriginal = o.microsecMin;\n }\n\n if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) {\n this._defaults.hourMin = minDateTime.getHours();\n if (this.hour <= this._defaults.hourMin) {\n this.hour = this._defaults.hourMin;\n this._defaults.minuteMin = minDateTime.getMinutes();\n if (this.minute <= this._defaults.minuteMin) {\n this.minute = this._defaults.minuteMin;\n this._defaults.secondMin = minDateTime.getSeconds();\n if (this.second <= this._defaults.secondMin) {\n this.second = this._defaults.secondMin;\n this._defaults.millisecMin = minDateTime.getMilliseconds();\n if (this.millisec <= this._defaults.millisecMin) {\n this.millisec = this._defaults.millisecMin;\n this._defaults.microsecMin = minDateTime.getMicroseconds();\n } else {\n if (this.microsec < this._defaults.microsecMin) {\n this.microsec = this._defaults.microsecMin;\n }\n this._defaults.microsecMin = this.microsecMinOriginal;\n }\n } else {\n this._defaults.millisecMin = this.millisecMinOriginal;\n this._defaults.microsecMin = this.microsecMinOriginal;\n }\n } else {\n this._defaults.secondMin = this.secondMinOriginal;\n this._defaults.millisecMin = this.millisecMinOriginal;\n this._defaults.microsecMin = this.microsecMinOriginal;\n }\n } else {\n this._defaults.minuteMin = this.minuteMinOriginal;\n this._defaults.secondMin = this.secondMinOriginal;\n this._defaults.millisecMin = this.millisecMinOriginal;\n this._defaults.microsecMin = this.microsecMinOriginal;\n }\n } else {\n this._defaults.hourMin = this.hourMinOriginal;\n this._defaults.minuteMin = this.minuteMinOriginal;\n this._defaults.secondMin = this.secondMinOriginal;\n this._defaults.millisecMin = this.millisecMinOriginal;\n this._defaults.microsecMin = this.microsecMinOriginal;\n }\n }\n\n if ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) {\n var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),\n maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);\n\n if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) {\n this.hourMaxOriginal = o.hourMax;\n this.minuteMaxOriginal = o.minuteMax;\n this.secondMaxOriginal = o.secondMax;\n this.millisecMaxOriginal = o.millisecMax;\n this.microsecMaxOriginal = o.microsecMax;\n }\n\n if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) {\n this._defaults.hourMax = maxDateTime.getHours();\n if (this.hour >= this._defaults.hourMax) {\n this.hour = this._defaults.hourMax;\n this._defaults.minuteMax = maxDateTime.getMinutes();\n if (this.minute >= this._defaults.minuteMax) {\n this.minute = this._defaults.minuteMax;\n this._defaults.secondMax = maxDateTime.getSeconds();\n if (this.second >= this._defaults.secondMax) {\n this.second = this._defaults.secondMax;\n this._defaults.millisecMax = maxDateTime.getMilliseconds();\n if (this.millisec >= this._defaults.millisecMax) {\n this.millisec = this._defaults.millisecMax;\n this._defaults.microsecMax = maxDateTime.getMicroseconds();\n } else {\n if (this.microsec > this._defaults.microsecMax) {\n this.microsec = this._defaults.microsecMax;\n }\n this._defaults.microsecMax = this.microsecMaxOriginal;\n }\n } else {\n this._defaults.millisecMax = this.millisecMaxOriginal;\n this._defaults.microsecMax = this.microsecMaxOriginal;\n }\n } else {\n this._defaults.secondMax = this.secondMaxOriginal;\n this._defaults.millisecMax = this.millisecMaxOriginal;\n this._defaults.microsecMax = this.microsecMaxOriginal;\n }\n } else {\n this._defaults.minuteMax = this.minuteMaxOriginal;\n this._defaults.secondMax = this.secondMaxOriginal;\n this._defaults.millisecMax = this.millisecMaxOriginal;\n this._defaults.microsecMax = this.microsecMaxOriginal;\n }\n } else {\n this._defaults.hourMax = this.hourMaxOriginal;\n this._defaults.minuteMax = this.minuteMaxOriginal;\n this._defaults.secondMax = this.secondMaxOriginal;\n this._defaults.millisecMax = this.millisecMaxOriginal;\n this._defaults.microsecMax = this.microsecMaxOriginal;\n }\n }\n\n if (dp_inst.settings.minTime!==null) {\n var tempMinTime=new Date(\"01/01/1970 \" + dp_inst.settings.minTime);\n if (this.hour<tempMinTime.getHours()) {\n this.hour=this._defaults.hourMin=tempMinTime.getHours();\n this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();\n } else if (this.hour===tempMinTime.getHours() && this.minute<tempMinTime.getMinutes()) {\n this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();\n } else {\n if (this._defaults.hourMin<tempMinTime.getHours()) {\n this._defaults.hourMin=tempMinTime.getHours();\n this._defaults.minuteMin=tempMinTime.getMinutes();\n } else if (this._defaults.hourMin===tempMinTime.getHours()===this.hour && this._defaults.minuteMin<tempMinTime.getMinutes()) {\n this._defaults.minuteMin=tempMinTime.getMinutes();\n } else {\n this._defaults.minuteMin=0;\n }\n }\n }\n\n if (dp_inst.settings.maxTime!==null) {\n var tempMaxTime=new Date(\"01/01/1970 \" + dp_inst.settings.maxTime);\n if (this.hour>tempMaxTime.getHours()) {\n this.hour=this._defaults.hourMax=tempMaxTime.getHours();\n this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();\n } else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) {\n this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();\n } else {\n if (this._defaults.hourMax>tempMaxTime.getHours()) {\n this._defaults.hourMax=tempMaxTime.getHours();\n this._defaults.minuteMax=tempMaxTime.getMinutes();\n } else if (this._defaults.hourMax===tempMaxTime.getHours()===this.hour && this._defaults.minuteMax>tempMaxTime.getMinutes()) {\n this._defaults.minuteMax=tempMaxTime.getMinutes();\n } else {\n this._defaults.minuteMax=59;\n }\n }\n }\n\n if (adjustSliders !== undefined && adjustSliders === true) {\n var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),\n minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),\n secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10),\n millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10),\n microsecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10);\n\n if (this.hour_slider) {\n this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax, step: this._defaults.stepHour });\n this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));\n }\n if (this.minute_slider) {\n this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax, step: this._defaults.stepMinute });\n this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));\n }\n if (this.second_slider) {\n this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax, step: this._defaults.stepSecond });\n this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));\n }\n if (this.millisec_slider) {\n this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax, step: this._defaults.stepMillisec });\n this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));\n }\n if (this.microsec_slider) {\n this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax, step: this._defaults.stepMicrosec });\n this.control.value(this, this.microsec_slider, 'microsec', this.microsec - (this.microsec % this._defaults.stepMicrosec));\n }\n }\n\n },\n\n /*\n * when a slider moves, set the internal time...\n * on time change is also called when the time is updated in the text field\n */\n _onTimeChange: function () {\n if (!this._defaults.showTimepicker) {\n return;\n }\n var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,\n minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,\n second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,\n millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,\n microsec = (this.microsec_slider) ? this.control.value(this, this.microsec_slider, 'microsec') : false,\n timezone = (this.timezone_select) ? this.timezone_select.val() : false,\n o = this._defaults,\n pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,\n pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;\n\n if (typeof(hour) === 'object') {\n hour = false;\n }\n if (typeof(minute) === 'object') {\n minute = false;\n }\n if (typeof(second) === 'object') {\n second = false;\n }\n if (typeof(millisec) === 'object') {\n millisec = false;\n }\n if (typeof(microsec) === 'object') {\n microsec = false;\n }\n if (typeof(timezone) === 'object') {\n timezone = false;\n }\n\n if (hour !== false) {\n hour = parseInt(hour, 10);\n }\n if (minute !== false) {\n minute = parseInt(minute, 10);\n }\n if (second !== false) {\n second = parseInt(second, 10);\n }\n if (millisec !== false) {\n millisec = parseInt(millisec, 10);\n }\n if (microsec !== false) {\n microsec = parseInt(microsec, 10);\n }\n if (timezone !== false) {\n timezone = timezone.toString();\n }\n\n var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];\n\n // If the update was done in the input field, the input field should not be updated.\n // If the update was done using the sliders, update the input field.\n var hasChanged = (\n hour !== parseInt(this.hour,10) || // sliders should all be numeric\n minute !== parseInt(this.minute,10) ||\n second !== parseInt(this.second,10) ||\n millisec !== parseInt(this.millisec,10) ||\n microsec !== parseInt(this.microsec,10) ||\n (this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||\n (this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or \"EST\" format, so use toString()\n );\n\n if (hasChanged) {\n\n if (hour !== false) {\n this.hour = hour;\n }\n if (minute !== false) {\n this.minute = minute;\n }\n if (second !== false) {\n this.second = second;\n }\n if (millisec !== false) {\n this.millisec = millisec;\n }\n if (microsec !== false) {\n this.microsec = microsec;\n }\n if (timezone !== false) {\n this.timezone = timezone;\n }\n\n if (!this.inst) {\n this.inst = $.datepicker._getInst(this.$input[0]);\n }\n\n this._limitMinMaxDateTime(this.inst, true);\n }\n if (this.support.ampm) {\n this.ampm = ampm;\n }\n\n // Updates the time within the timepicker\n this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);\n if (this.$timeObj) {\n if (pickerTimeFormat === o.timeFormat) {\n this.$timeObj.val(this.formattedTime + pickerTimeSuffix);\n }\n else {\n this.$timeObj.val($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);\n }\n if (this.$timeObj[0].setSelectionRange) {\n var sPos = this.$timeObj[0].selectionStart;\n var ePos = this.$timeObj[0].selectionEnd;\n this.$timeObj[0].setSelectionRange(sPos, ePos);\n }\n }\n\n this.timeDefined = true;\n if (hasChanged) {\n this._updateDateTime();\n //this.$input.focus(); // may automatically open the picker on setDate\n }\n },\n\n /*\n * call custom onSelect.\n * bind to sliders slidestop, and grid click.\n */\n _onSelectHandler: function () {\n var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;\n var inputEl = this.$input ? this.$input[0] : null;\n if (onSelect && inputEl) {\n onSelect.apply(inputEl, [this.formattedDateTime, this]);\n }\n },\n\n /*\n * update our input with the new date time..\n */\n _updateDateTime: function (dp_inst) {\n dp_inst = this.inst || dp_inst;\n var dtTmp = (dp_inst.currentYear > 0?\n new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :\n new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),\n dt = $.datepicker._daylightSavingAdjust(dtTmp),\n //dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),\n //dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay)),\n dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),\n formatCfg = $.datepicker._getFormatConfig(dp_inst),\n timeAvailable = dt !== null && this.timeDefined;\n this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);\n var formattedDateTime = this.formattedDate;\n\n // if a slider was changed but datepicker doesn't have a value yet, set it\n if (dp_inst.lastVal === \"\") {\n dp_inst.currentYear = dp_inst.selectedYear;\n dp_inst.currentMonth = dp_inst.selectedMonth;\n dp_inst.currentDay = dp_inst.selectedDay;\n }\n\n /*\n * remove following lines to force every changes in date picker to change the input value\n * Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.\n * If the user manually empty the value in the input field, the date picker will never change selected value.\n */\n //if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {\n //\treturn;\n //}\n\n if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) {\n formattedDateTime = this.formattedTime;\n } else if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) {\n formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;\n }\n\n this.formattedDateTime = formattedDateTime;\n\n if (!this._defaults.showTimepicker) {\n this.$input.val(this.formattedDate);\n } else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {\n this.$altInput.val(this.formattedTime);\n this.$input.val(this.formattedDate);\n } else if (this.$altInput) {\n this.$input.val(formattedDateTime);\n var altFormattedDateTime = '',\n altSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator,\n altTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;\n\n if (!this._defaults.timeOnly) {\n if (this._defaults.altFormat) {\n altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);\n }\n else {\n altFormattedDateTime = this.formattedDate;\n }\n\n if (altFormattedDateTime) {\n altFormattedDateTime += altSeparator;\n }\n }\n\n if (this._defaults.altTimeFormat !== null) {\n altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;\n }\n else {\n altFormattedDateTime += this.formattedTime + altTimeSuffix;\n }\n this.$altInput.val(altFormattedDateTime);\n } else {\n this.$input.val(formattedDateTime);\n }\n\n this.$input.trigger(\"change\");\n },\n\n _onFocus: function () {\n if (!this.$input.val() && this._defaults.defaultValue) {\n this.$input.val(this._defaults.defaultValue);\n var inst = $.datepicker._getInst(this.$input.get(0)),\n tp_inst = $.datepicker._get(inst, 'timepicker');\n if (tp_inst) {\n if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {\n try {\n $.datepicker._updateDatepicker(inst);\n } catch (err) {\n $.timepicker.log(err);\n }\n }\n }\n }\n },\n\n /*\n * Small abstraction to control types\n * We can add more, just be sure to follow the pattern: create, options, value\n */\n _controls: {\n // slider methods\n slider: {\n create: function (tp_inst, obj, unit, val, min, max, step) {\n var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60\n return obj.prop('slide', null).slider({\n orientation: \"horizontal\",\n value: rtl ? val * -1 : val,\n min: rtl ? max * -1 : min,\n max: rtl ? min * -1 : max,\n step: step,\n slide: function (event, ui) {\n tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value);\n tp_inst._onTimeChange();\n },\n stop: function (event, ui) {\n tp_inst._onSelectHandler();\n }\n });\n },\n options: function (tp_inst, obj, unit, opts, val) {\n if (tp_inst._defaults.isRTL) {\n if (typeof(opts) === 'string') {\n if (opts === 'min' || opts === 'max') {\n if (val !== undefined) {\n return obj.slider(opts, val * -1);\n }\n return Math.abs(obj.slider(opts));\n }\n return obj.slider(opts);\n }\n var min = opts.min,\n max = opts.max;\n opts.min = opts.max = null;\n if (min !== undefined) {\n opts.max = min * -1;\n }\n if (max !== undefined) {\n opts.min = max * -1;\n }\n return obj.slider(opts);\n }\n if (typeof(opts) === 'string' && val !== undefined) {\n return obj.slider(opts, val);\n }\n return obj.slider(opts);\n },\n value: function (tp_inst, obj, unit, val) {\n if (tp_inst._defaults.isRTL) {\n if (val !== undefined) {\n return obj.slider('value', val * -1);\n }\n return Math.abs(obj.slider('value'));\n }\n if (val !== undefined) {\n return obj.slider('value', val);\n }\n return obj.slider('value');\n }\n },\n // select methods\n select: {\n create: function (tp_inst, obj, unit, val, min, max, step) {\n var sel = '<select class=\"ui-timepicker-select ui-state-default ui-corner-all\" data-unit=\"' + unit + '\" data-min=\"' + min + '\" data-max=\"' + max + '\" data-step=\"' + step + '\">',\n format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;\n\n for (var i = min; i <= max; i += step) {\n sel += '<option value=\"' + i + '\"' + (i === val ? ' selected' : '') + '>';\n if (unit === 'hour') {\n sel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/ig, '')), {hour: i}, tp_inst._defaults);\n }\n else if (unit === 'millisec' || unit === 'microsec' || i >= 10) { sel += i; }\n else {sel += '0' + i.toString(); }\n sel += '</option>';\n }\n sel += '</select>';\n\n obj.children('select').remove();\n\n $(sel).appendTo(obj).change(function (e) {\n tp_inst._onTimeChange();\n tp_inst._onSelectHandler();\n tp_inst._afterInject();\n });\n\n return obj;\n },\n options: function (tp_inst, obj, unit, opts, val) {\n var o = {},\n $t = obj.children('select');\n if (typeof(opts) === 'string') {\n if (val === undefined) {\n return $t.data(opts);\n }\n o[opts] = val;\n }\n else { o = opts; }\n return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min>=0 ? o.min : $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));\n },\n value: function (tp_inst, obj, unit, val) {\n var $t = obj.children('select');\n if (val !== undefined) {\n return $t.val(val);\n }\n return $t.val();\n }\n }\n } // end _controls\n\n });\n\n $.fn.extend({\n /*\n * shorthand just to use timepicker.\n */\n timepicker: function (o) {\n o = o || {};\n var tmp_args = Array.prototype.slice.call(arguments);\n\n if (typeof o === 'object') {\n tmp_args[0] = $.extend(o, {\n timeOnly: true\n });\n }\n\n return $(this).each(function () {\n $.fn.datetimepicker.apply($(this), tmp_args);\n });\n },\n\n /*\n * extend timepicker to datepicker\n */\n datetimepicker: function (o) {\n o = o || {};\n var tmp_args = arguments;\n\n if (typeof(o) === 'string') {\n if (o === 'getDate' || (o === 'option' && tmp_args.length === 2 && typeof (tmp_args[1]) === 'string')) {\n return $.fn.datepicker.apply($(this[0]), tmp_args);\n } else {\n return this.each(function () {\n var $t = $(this);\n $t.datepicker.apply($t, tmp_args);\n });\n }\n } else {\n return this.each(function () {\n var $t = $(this);\n $t.datepicker($.timepicker._newInst($t, o)._defaults);\n });\n }\n }\n });\n\n /*\n * Public Utility to parse date and time\n */\n $.datepicker.parseDateTime = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {\n var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);\n if (parseRes.timeObj) {\n var t = parseRes.timeObj;\n parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);\n parseRes.date.setMicroseconds(t.microsec);\n }\n\n return parseRes.date;\n };\n\n /*\n * Public utility to parse time\n */\n $.datepicker.parseTime = function (timeFormat, timeString, options) {\n var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}),\n iso8601 = (timeFormat.replace(/\\'.*?\\'/g, '').indexOf('Z') !== -1);\n\n // Strict parse requires the timeString to match the timeFormat exactly\n var strictParse = function (f, s, o) {\n\n // pattern for standard and localized AM/PM markers\n var getPatternAmpm = function (amNames, pmNames) {\n var markers = [];\n if (amNames) {\n $.merge(markers, amNames);\n }\n if (pmNames) {\n $.merge(markers, pmNames);\n }\n markers = $.map(markers, function (val) {\n return val.replace(/[.*+?|()\\[\\]{}\\\\]/g, '\\\\$&');\n });\n return '(' + markers.join('|') + ')?';\n };\n\n // figure out position of time elements.. cause js cant do named captures\n var getFormatPositions = function (timeFormat) {\n var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),\n orders = {\n h: -1,\n m: -1,\n s: -1,\n l: -1,\n c: -1,\n t: -1,\n z: -1\n };\n\n if (finds) {\n for (var i = 0; i < finds.length; i++) {\n if (orders[finds[i].toString().charAt(0)] === -1) {\n orders[finds[i].toString().charAt(0)] = i + 1;\n }\n }\n }\n return orders;\n };\n\n var regstr = '^' + f.toString()\n .replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {\n var ml = match.length;\n switch (match.charAt(0).toLowerCase()) {\n case 'h':\n return ml === 1 ? '(\\\\d?\\\\d)' : '(\\\\d{' + ml + '})';\n case 'm':\n return ml === 1 ? '(\\\\d?\\\\d)' : '(\\\\d{' + ml + '})';\n case 's':\n return ml === 1 ? '(\\\\d?\\\\d)' : '(\\\\d{' + ml + '})';\n case 'l':\n return '(\\\\d?\\\\d?\\\\d)';\n case 'c':\n return '(\\\\d?\\\\d?\\\\d)';\n case 'z':\n return '(z|[-+]\\\\d\\\\d:?\\\\d\\\\d|\\\\S+)?';\n case 't':\n return getPatternAmpm(o.amNames, o.pmNames);\n default: // literal escaped in quotes\n return '(' + match.replace(/\\'/g, \"\").replace(/(\\.|\\$|\\^|\\\\|\\/|\\(|\\)|\\[|\\]|\\?|\\+|\\*)/g, function (m) { return \"\\\\\" + m; }) + ')?';\n }\n })\n .replace(/\\s/g, '\\\\s?') +\n o.timeSuffix + '$',\n order = getFormatPositions(f),\n ampm = '',\n treg;\n\n treg = s.match(new RegExp(regstr, 'i'));\n\n var resTime = {\n hour: 0,\n minute: 0,\n second: 0,\n millisec: 0,\n microsec: 0\n };\n\n if (treg) {\n if (order.t !== -1) {\n if (treg[order.t] === undefined || treg[order.t].length === 0) {\n ampm = '';\n resTime.ampm = '';\n } else {\n ampm = $.inArray(treg[order.t].toUpperCase(), $.map(o.amNames, function (x,i) { return x.toUpperCase(); })) !== -1 ? 'AM' : 'PM';\n resTime.ampm = o[ampm === 'AM' ? 'amNames' : 'pmNames'][0];\n }\n }\n\n if (order.h !== -1) {\n if (ampm === 'AM' && treg[order.h] === '12') {\n resTime.hour = 0; // 12am = 0 hour\n } else {\n if (ampm === 'PM' && treg[order.h] !== '12') {\n resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12\n } else {\n resTime.hour = Number(treg[order.h]);\n }\n }\n }\n\n if (order.m !== -1) {\n resTime.minute = Number(treg[order.m]);\n }\n if (order.s !== -1) {\n resTime.second = Number(treg[order.s]);\n }\n if (order.l !== -1) {\n resTime.millisec = Number(treg[order.l]);\n }\n if (order.c !== -1) {\n resTime.microsec = Number(treg[order.c]);\n }\n if (order.z !== -1 && treg[order.z] !== undefined) {\n resTime.timezone = $.timepicker.timezoneOffsetNumber(treg[order.z]);\n }\n\n\n return resTime;\n }\n return false;\n };// end strictParse\n\n // First try JS Date, if that fails, use strictParse\n var looseParse = function (f, s, o) {\n try {\n var d = new Date('2012-01-01 ' + s);\n if (isNaN(d.getTime())) {\n d = new Date('2012-01-01T' + s);\n if (isNaN(d.getTime())) {\n d = new Date('01/01/2012 ' + s);\n if (isNaN(d.getTime())) {\n throw \"Unable to parse time with native Date: \" + s;\n }\n }\n }\n\n return {\n hour: d.getHours(),\n minute: d.getMinutes(),\n second: d.getSeconds(),\n millisec: d.getMilliseconds(),\n microsec: d.getMicroseconds(),\n timezone: d.getTimezoneOffset() * -1\n };\n }\n catch (err) {\n try {\n return strictParse(f, s, o);\n }\n catch (err2) {\n $.timepicker.log(\"Unable to parse \\ntimeString: \" + s + \"\\ntimeFormat: \" + f);\n }\n }\n return false;\n }; // end looseParse\n\n if (typeof o.parse === \"function\") {\n return o.parse(timeFormat, timeString, o);\n }\n if (o.parse === 'loose') {\n return looseParse(timeFormat, timeString, o);\n }\n return strictParse(timeFormat, timeString, o);\n };\n\n /**\n * Public utility to format the time\n * @param {string} format format of the time\n * @param {Object} time Object not a Date for timezones\n * @param {Object} [options] essentially the regional[].. amNames, pmNames, ampm\n * @returns {string} the formatted time\n */\n $.datepicker.formatTime = function (format, time, options) {\n options = options || {};\n options = $.extend({}, $.timepicker._defaults, options);\n time = $.extend({\n hour: 0,\n minute: 0,\n second: 0,\n millisec: 0,\n microsec: 0,\n timezone: null\n }, time);\n\n var tmptime = format,\n ampmName = options.amNames[0],\n hour = parseInt(time.hour, 10);\n\n if (hour > 11) {\n ampmName = options.pmNames[0];\n }\n\n tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {\n switch (match) {\n case 'HH':\n return ('0' + hour).slice(-2);\n case 'H':\n return hour;\n case 'hh':\n return ('0' + convert24to12(hour)).slice(-2);\n case 'h':\n return convert24to12(hour);\n case 'mm':\n return ('0' + time.minute).slice(-2);\n case 'm':\n return time.minute;\n case 'ss':\n return ('0' + time.second).slice(-2);\n case 's':\n return time.second;\n case 'l':\n return ('00' + time.millisec).slice(-3);\n case 'c':\n return ('00' + time.microsec).slice(-3);\n case 'z':\n return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false);\n case 'Z':\n return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true);\n case 'T':\n return ampmName.charAt(0).toUpperCase();\n case 'TT':\n return ampmName.toUpperCase();\n case 't':\n return ampmName.charAt(0).toLowerCase();\n case 'tt':\n return ampmName.toLowerCase();\n default:\n return match.replace(/'/g, \"\");\n }\n });\n\n return tmptime;\n };\n\n /*\n * the bad hack :/ override datepicker so it doesn't close on select\n // inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378\n */\n $.datepicker._base_selectDate = $.datepicker._selectDate;\n $.datepicker._selectDate = function (id, dateStr) {\n var inst = this._getInst($(id)[0]),\n tp_inst = this._get(inst, 'timepicker'),\n was_inline;\n\n if (tp_inst && inst.settings.showTimepicker) {\n tp_inst._limitMinMaxDateTime(inst, true);\n was_inline = inst.inline;\n inst.inline = inst.stay_open = true;\n //This way the onSelect handler called from calendarpicker get the full dateTime\n this._base_selectDate(id, dateStr);\n inst.inline = was_inline;\n inst.stay_open = false;\n this._notifyChange(inst);\n this._updateDatepicker(inst);\n } else {\n this._base_selectDate(id, dateStr);\n }\n };\n\n /*\n * second bad hack :/ override datepicker so it triggers an event when changing the input field\n * and does not redraw the datepicker on every selectDate event\n */\n $.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;\n $.datepicker._updateDatepicker = function (inst) {\n\n // don't popup the datepicker if there is another instance already opened\n var input = inst.input[0];\n if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) {\n return;\n }\n\n if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {\n\n this._base_updateDatepicker(inst);\n\n // Reload the time control when changing something in the input text field.\n var tp_inst = this._get(inst, 'timepicker');\n if (tp_inst) {\n tp_inst._addTimePicker(inst);\n }\n }\n };\n\n /*\n * third bad hack :/ override datepicker so it allows spaces and colon in the input field\n */\n $.datepicker._base_doKeyPress = $.datepicker._doKeyPress;\n $.datepicker._doKeyPress = function (event) {\n var inst = $.datepicker._getInst(event.target),\n tp_inst = $.datepicker._get(inst, 'timepicker');\n\n if (tp_inst) {\n if ($.datepicker._get(inst, 'constrainInput')) {\n var ampm = tp_inst.support.ampm,\n tz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone,\n dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),\n datetimeChars = tp_inst._defaults.timeFormat.toString()\n .replace(/[hms]/g, '')\n .replace(/TT/g, ampm ? 'APM' : '')\n .replace(/Tt/g, ampm ? 'AaPpMm' : '')\n .replace(/tT/g, ampm ? 'AaPpMm' : '')\n .replace(/T/g, ampm ? 'AP' : '')\n .replace(/tt/g, ampm ? 'apm' : '')\n .replace(/t/g, ampm ? 'ap' : '') +\n \" \" + tp_inst._defaults.separator +\n tp_inst._defaults.timeSuffix +\n (tz ? tp_inst._defaults.timezoneList.join('') : '') +\n (tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +\n dateChars,\n chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);\n return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);\n }\n }\n\n return $.datepicker._base_doKeyPress(event);\n };\n\n /*\n * Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField\n * Update any alternate field to synchronise with the main field.\n */\n $.datepicker._base_updateAlternate = $.datepicker._updateAlternate;\n $.datepicker._updateAlternate = function (inst) {\n var tp_inst = this._get(inst, 'timepicker');\n if (tp_inst) {\n var altField = tp_inst._defaults.altField;\n if (altField) { // update alternate field too\n var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,\n date = this._getDate(inst),\n formatCfg = $.datepicker._getFormatConfig(inst),\n altFormattedDateTime = '',\n altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,\n altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,\n altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;\n\n altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;\n if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {\n if (tp_inst._defaults.altFormat) {\n altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime;\n }\n else {\n altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime;\n }\n }\n $(altField).val( inst.input.val() ? altFormattedDateTime : \"\");\n }\n }\n else {\n $.datepicker._base_updateAlternate(inst);\n }\n };\n\n /*\n * Override key up event to sync manual input changes.\n */\n $.datepicker._base_doKeyUp = $.datepicker._doKeyUp;\n $.datepicker._doKeyUp = function (event) {\n var inst = $.datepicker._getInst(event.target),\n tp_inst = $.datepicker._get(inst, 'timepicker');\n\n if (tp_inst) {\n if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {\n try {\n $.datepicker._updateDatepicker(inst);\n } catch (err) {\n $.timepicker.log(err);\n }\n }\n }\n\n return $.datepicker._base_doKeyUp(event);\n };\n\n /*\n * override \"Today\" button to also grab the time and set it to input field.\n */\n $.datepicker._base_gotoToday = $.datepicker._gotoToday;\n $.datepicker._gotoToday = function (id) {\n var inst = this._getInst($(id)[0]);\n this._base_gotoToday(id);\n var tp_inst = this._get(inst, 'timepicker');\n if (!tp_inst) {\n return;\n }\n\n var tzoffset = $.timepicker.timezoneOffsetNumber(tp_inst.timezone);\n var now = new Date();\n now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + parseInt(tzoffset, 10));\n this._setTime(inst, now);\n this._setDate(inst, now);\n tp_inst._onSelectHandler();\n };\n\n /*\n * Disable & enable the Time in the datetimepicker\n */\n $.datepicker._disableTimepickerDatepicker = function (target) {\n var inst = this._getInst(target);\n if (!inst) {\n return;\n }\n\n var tp_inst = this._get(inst, 'timepicker');\n $(target).datepicker('getDate'); // Init selected[Year|Month|Day]\n if (tp_inst) {\n inst.settings.showTimepicker = false;\n tp_inst._defaults.showTimepicker = false;\n tp_inst._updateDateTime(inst);\n }\n };\n\n $.datepicker._enableTimepickerDatepicker = function (target) {\n var inst = this._getInst(target);\n if (!inst) {\n return;\n }\n\n var tp_inst = this._get(inst, 'timepicker');\n $(target).datepicker('getDate'); // Init selected[Year|Month|Day]\n if (tp_inst) {\n inst.settings.showTimepicker = true;\n tp_inst._defaults.showTimepicker = true;\n tp_inst._addTimePicker(inst); // Could be disabled on page load\n tp_inst._updateDateTime(inst);\n }\n };\n\n /*\n * Create our own set time function\n */\n $.datepicker._setTime = function (inst, date) {\n var tp_inst = this._get(inst, 'timepicker');\n if (tp_inst) {\n var defaults = tp_inst._defaults;\n\n // calling _setTime with no date sets time to defaults\n tp_inst.hour = date ? date.getHours() : defaults.hour;\n tp_inst.minute = date ? date.getMinutes() : defaults.minute;\n tp_inst.second = date ? date.getSeconds() : defaults.second;\n tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;\n tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;\n\n //check if within min/max times..\n tp_inst._limitMinMaxDateTime(inst, true);\n\n tp_inst._onTimeChange();\n tp_inst._updateDateTime(inst);\n }\n };\n\n /*\n * Create new public method to set only time, callable as $().datepicker('setTime', date)\n */\n $.datepicker._setTimeDatepicker = function (target, date, withDate) {\n var inst = this._getInst(target);\n if (!inst) {\n return;\n }\n\n var tp_inst = this._get(inst, 'timepicker');\n\n if (tp_inst) {\n this._setDateFromField(inst);\n var tp_date;\n if (date) {\n if (typeof date === \"string\") {\n tp_inst._parseTime(date, withDate);\n tp_date = new Date();\n tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);\n tp_date.setMicroseconds(tp_inst.microsec);\n } else {\n tp_date = new Date(date.getTime());\n tp_date.setMicroseconds(date.getMicroseconds());\n }\n if (tp_date.toString() === 'Invalid Date') {\n tp_date = undefined;\n }\n this._setTime(inst, tp_date);\n }\n }\n\n };\n\n /*\n * override setDate() to allow setting time too within Date object\n */\n $.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;\n $.datepicker._setDateDatepicker = function (target, _date) {\n var inst = this._getInst(target);\n var date = _date;\n if (!inst) {\n return;\n }\n\n if (typeof(_date) === 'string') {\n date = new Date(_date);\n if (!date.getTime()) {\n this._base_setDateDatepicker.apply(this, arguments);\n date = $(target).datepicker('getDate');\n }\n }\n\n var tp_inst = this._get(inst, 'timepicker');\n var tp_date;\n if (date instanceof Date) {\n tp_date = new Date(date.getTime());\n tp_date.setMicroseconds(date.getMicroseconds());\n } else {\n tp_date = date;\n }\n\n // This is important if you are using the timezone option, javascript's Date\n // object will only return the timezone offset for the current locale, so we\n // adjust it accordingly. If not using timezone option this won't matter..\n // If a timezone is different in tp, keep the timezone as is\n if (tp_inst && tp_date) {\n // look out for DST if tz wasn't specified\n if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {\n tp_inst.timezone = tp_date.getTimezoneOffset() * -1;\n }\n date = $.timepicker.timezoneAdjust(date, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()), tp_inst.timezone);\n tp_date = $.timepicker.timezoneAdjust(tp_date, $.timepicker.timezoneOffsetString(-tp_date.getTimezoneOffset()), tp_inst.timezone);\n }\n\n this._updateDatepicker(inst);\n this._base_setDateDatepicker.apply(this, arguments);\n this._setTimeDatepicker(target, tp_date, true);\n };\n\n /*\n * override getDate() to allow getting time too within Date object\n */\n $.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;\n $.datepicker._getDateDatepicker = function (target, noDefault) {\n var inst = this._getInst(target);\n if (!inst) {\n return;\n }\n\n var tp_inst = this._get(inst, 'timepicker');\n\n if (tp_inst) {\n // if it hasn't yet been defined, grab from field\n if (inst.lastVal === undefined) {\n this._setDateFromField(inst, noDefault);\n }\n\n var date = this._getDate(inst);\n\n var currDT = null;\n\n if (tp_inst.$altInput && tp_inst._defaults.altFieldTimeOnly) {\n currDT = tp_inst.$input.val() + ' ' + tp_inst.$altInput.val();\n }\n else if (tp_inst.$input.get(0).tagName !== 'INPUT' && tp_inst.$altInput) {\n /**\n * in case the datetimepicker has been applied to a non-input tag for inline UI,\n * and the user has not configured the plugin to display only time in altInput,\n * pick current date time from the altInput (and hope for the best, for now, until \"ER1\" is applied)\n *\n * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from \"altFormat\" and \"altTimeFormat\" option values\n */\n currDT = tp_inst.$altInput.val();\n }\n else {\n currDT = tp_inst.$input.val();\n }\n\n if (date && tp_inst._parseTime(currDT, !inst.settings.timeOnly)) {\n date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);\n date.setMicroseconds(tp_inst.microsec);\n\n // This is important if you are using the timezone option, javascript's Date\n // object will only return the timezone offset for the current locale, so we\n // adjust it accordingly. If not using timezone option this won't matter..\n if (tp_inst.timezone != null) {\n // look out for DST if tz wasn't specified\n if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {\n tp_inst.timezone = date.getTimezoneOffset() * -1;\n }\n date = $.timepicker.timezoneAdjust(date, tp_inst.timezone, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()));\n }\n }\n return date;\n }\n return this._base_getDateDatepicker(target, noDefault);\n };\n\n /*\n * override parseDate() because UI 1.8.14 throws an error about \"Extra characters\"\n * An option in datapicker to ignore extra format characters would be nicer.\n */\n $.datepicker._base_parseDate = $.datepicker.parseDate;\n $.datepicker.parseDate = function (format, value, settings) {\n var date;\n try {\n date = this._base_parseDate(format, value, settings);\n } catch (err) {\n // Hack! The error message ends with a colon, a space, and\n // the \"extra\" characters. We rely on that instead of\n // attempting to perfectly reproduce the parsing algorithm.\n if (err.indexOf(\":\") >= 0) {\n date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(':') - 2)), settings);\n $.timepicker.log(\"Error parsing the date string: \" + err + \"\\ndate string = \" + value + \"\\ndate format = \" + format);\n } else {\n throw err;\n }\n }\n return date;\n };\n\n /*\n * override formatDate to set date with time to the input\n */\n $.datepicker._base_formatDate = $.datepicker._formatDate;\n $.datepicker._formatDate = function (inst, day, month, year) {\n var tp_inst = this._get(inst, 'timepicker');\n if (tp_inst) {\n tp_inst._updateDateTime(inst);\n return tp_inst.$input.val();\n }\n return this._base_formatDate(inst);\n };\n\n /*\n * override options setter to add time to maxDate(Time) and minDate(Time). MaxDate\n */\n $.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;\n $.datepicker._optionDatepicker = function (target, name, value) {\n var inst = this._getInst(target),\n name_clone;\n if (!inst) {\n return null;\n }\n\n var tp_inst = this._get(inst, 'timepicker');\n if (tp_inst) {\n var min = null,\n max = null,\n onselect = null,\n overrides = tp_inst._defaults.evnts,\n fns = {},\n prop,\n ret,\n oldVal,\n $target;\n if (typeof name === 'string') { // if min/max was set with the string\n if (name === 'minDate' || name === 'minDateTime') {\n min = value;\n } else if (name === 'maxDate' || name === 'maxDateTime') {\n max = value;\n } else if (name === 'onSelect') {\n onselect = value;\n } else if (overrides.hasOwnProperty(name)) {\n if (typeof (value) === 'undefined') {\n return overrides[name];\n }\n fns[name] = value;\n name_clone = {}; //empty results in exiting function after overrides updated\n }\n } else if (typeof name === 'object') { //if min/max was set with the JSON\n if (name.minDate) {\n min = name.minDate;\n } else if (name.minDateTime) {\n min = name.minDateTime;\n } else if (name.maxDate) {\n max = name.maxDate;\n } else if (name.maxDateTime) {\n max = name.maxDateTime;\n }\n for (prop in overrides) {\n if (overrides.hasOwnProperty(prop) && name[prop]) {\n fns[prop] = name[prop];\n }\n }\n }\n for (prop in fns) {\n if (fns.hasOwnProperty(prop)) {\n overrides[prop] = fns[prop];\n if (!name_clone) { name_clone = $.extend({}, name); }\n delete name_clone[prop];\n }\n }\n if (name_clone && isEmptyObject(name_clone)) { return; }\n if (min) { //if min was set\n if (min === 0) {\n min = new Date();\n } else {\n min = new Date(min);\n }\n tp_inst._defaults.minDate = min;\n tp_inst._defaults.minDateTime = min;\n } else if (max) { //if max was set\n if (max === 0) {\n max = new Date();\n } else {\n max = new Date(max);\n }\n tp_inst._defaults.maxDate = max;\n tp_inst._defaults.maxDateTime = max;\n } else if (onselect) {\n tp_inst._defaults.onSelect = onselect;\n }\n\n // Datepicker will override our date when we call _base_optionDatepicker when\n // calling minDate/maxDate, so we will first grab the value, call\n // _base_optionDatepicker, then set our value back.\n if(min || max){\n $target = $(target);\n oldVal = $target.datetimepicker('getDate');\n ret = this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);\n $target.datetimepicker('setDate', oldVal);\n return ret;\n }\n }\n if (value === undefined) {\n return this._base_optionDatepicker.call($.datepicker, target, name);\n }\n return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);\n };\n\n /*\n * jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,\n * it will return false for all objects\n */\n var isEmptyObject = function (obj) {\n var prop;\n for (prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n return true;\n };\n\n /*\n * jQuery extend now ignores nulls!\n */\n var extendRemove = function (target, props) {\n $.extend(target, props);\n for (var name in props) {\n if (props[name] === null || props[name] === undefined) {\n target[name] = props[name];\n }\n }\n return target;\n };\n\n /*\n * Determine by the time format which units are supported\n * Returns an object of booleans for each unit\n */\n var detectSupport = function (timeFormat) {\n var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals\n isIn = function (f, t) { // does the format contain the token?\n return f.indexOf(t) !== -1 ? true : false;\n };\n return {\n hour: isIn(tf, 'h'),\n minute: isIn(tf, 'm'),\n second: isIn(tf, 's'),\n millisec: isIn(tf, 'l'),\n microsec: isIn(tf, 'c'),\n timezone: isIn(tf, 'z'),\n ampm: isIn(tf, 't') && isIn(timeFormat, 'h'),\n iso8601: isIn(timeFormat, 'Z')\n };\n };\n\n /*\n * Converts 24 hour format into 12 hour\n * Returns 12 hour without leading 0\n */\n var convert24to12 = function (hour) {\n hour %= 12;\n\n if (hour === 0) {\n hour = 12;\n }\n\n return String(hour);\n };\n\n var computeEffectiveSetting = function (settings, property) {\n return settings && settings[property] ? settings[property] : $.timepicker._defaults[property];\n };\n\n /*\n * Splits datetime string into date and time substrings.\n * Throws exception when date can't be parsed\n * Returns {dateString: dateString, timeString: timeString}\n */\n var splitDateTime = function (dateTimeString, timeSettings) {\n // The idea is to get the number separator occurrences in datetime and the time format requested (since time has\n // fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.\n var separator = computeEffectiveSetting(timeSettings, 'separator'),\n format = computeEffectiveSetting(timeSettings, 'timeFormat'),\n timeParts = format.split(separator), // how many occurrences of separator may be in our format?\n timePartsLen = timeParts.length,\n allParts = dateTimeString.split(separator),\n allPartsLen = allParts.length;\n\n if (allPartsLen > 1) {\n return {\n dateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator),\n timeString: allParts.splice(0, timePartsLen).join(separator)\n };\n }\n\n return {\n dateString: dateTimeString,\n timeString: ''\n };\n };\n\n /*\n * Internal function to parse datetime interval\n * Returns: {date: Date, timeObj: Object}, where\n * date - parsed date without time (type Date)\n * timeObj = {hour: , minute: , second: , millisec: , microsec: } - parsed time. Optional\n */\n var parseDateTimeInternal = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {\n var date,\n parts,\n parsedTime;\n\n parts = splitDateTime(dateTimeString, timeSettings);\n date = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings);\n\n if (parts.timeString === '') {\n return {\n date: date\n };\n }\n\n parsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings);\n\n if (!parsedTime) {\n throw 'Wrong time format';\n }\n\n return {\n date: date,\n timeObj: parsedTime\n };\n };\n\n /*\n * Internal function to set timezone_select to the local timezone\n */\n var selectLocalTimezone = function (tp_inst, date) {\n if (tp_inst && tp_inst.timezone_select) {\n var now = date || new Date();\n tp_inst.timezone_select.val(-now.getTimezoneOffset());\n }\n };\n\n /*\n * Create a Singleton Instance\n */\n $.timepicker = new Timepicker();\n\n /**\n * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5)\n * @param {number} tzMinutes if not a number, less than -720 (-1200), or greater than 840 (+1400) this value is returned\n * @param {boolean} iso8601 if true formats in accordance to iso8601 \"+12:45\"\n * @return {string}\n */\n $.timepicker.timezoneOffsetString = function (tzMinutes, iso8601) {\n if (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) {\n return tzMinutes;\n }\n\n var off = tzMinutes,\n minutes = off % 60,\n hours = (off - minutes) / 60,\n iso = iso8601 ? ':' : '',\n tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2);\n\n if (tz === '+00:00') {\n return 'Z';\n }\n return tz;\n };\n\n /**\n * Get the number in minutes that represents a timezone string\n * @param {string} tzString formatted like \"+0500\", \"-1245\", \"Z\"\n * @return {number} the offset minutes or the original string if it doesn't match expectations\n */\n $.timepicker.timezoneOffsetNumber = function (tzString) {\n var normalized = tzString.toString().replace(':', ''); // excuse any iso8601, end up with \"+1245\"\n\n if (normalized.toUpperCase() === 'Z') { // if iso8601 with Z, its 0 minute offset\n return 0;\n }\n\n if (!/^(\\-|\\+)\\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back\n return parseInt(tzString, 10);\n }\n\n return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus\n ((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes)\n parseInt(normalized.substr(3, 2), 10))); // minutes\n };\n\n /**\n * No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)\n * @param {Date} date\n * @param {string} fromTimezone formatted like \"+0500\", \"-1245\"\n * @param {string} toTimezone formatted like \"+0500\", \"-1245\"\n * @return {Date}\n */\n $.timepicker.timezoneAdjust = function (date, fromTimezone, toTimezone) {\n var fromTz = $.timepicker.timezoneOffsetNumber(fromTimezone);\n var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);\n if (!isNaN(toTz)) {\n date.setMinutes(date.getMinutes() + (-fromTz) - (-toTz));\n }\n return date;\n };\n\n /**\n * Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to\n * enforce date range limits.\n * n.b. The input value must be correctly formatted (reformatting is not supported)\n * @param {Element} startTime\n * @param {Element} endTime\n * @param {Object} options Options for the timepicker() call\n * @return {jQuery}\n */\n $.timepicker.timeRange = function (startTime, endTime, options) {\n return $.timepicker.handleRange('timepicker', startTime, endTime, options);\n };\n\n /**\n * Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to\n * enforce date range limits.\n * @param {Element} startTime\n * @param {Element} endTime\n * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,\n * a boolean value that can be used to reformat the input values to the `dateFormat`.\n * @param {string} method Can be used to specify the type of picker to be added\n * @return {jQuery}\n */\n $.timepicker.datetimeRange = function (startTime, endTime, options) {\n $.timepicker.handleRange('datetimepicker', startTime, endTime, options);\n };\n\n /**\n * Calls `datepicker` on the `startTime` and `endTime` elements, and configures them to\n * enforce date range limits.\n * @param {Element} startTime\n * @param {Element} endTime\n * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,\n * a boolean value that can be used to reformat the input values to the `dateFormat`.\n * @return {jQuery}\n */\n $.timepicker.dateRange = function (startTime, endTime, options) {\n $.timepicker.handleRange('datepicker', startTime, endTime, options);\n };\n\n /**\n * Calls `method` on the `startTime` and `endTime` elements, and configures them to\n * enforce date range limits.\n * @param {string} method Can be used to specify the type of picker to be added\n * @param {Element} startTime\n * @param {Element} endTime\n * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,\n * a boolean value that can be used to reformat the input values to the `dateFormat`.\n * @return {jQuery}\n */\n $.timepicker.handleRange = function (method, startTime, endTime, options) {\n options = $.extend({}, {\n minInterval: 0, // min allowed interval in milliseconds\n maxInterval: 0, // max allowed interval in milliseconds\n start: {}, // options for start picker\n end: {} // options for end picker\n }, options);\n\n // for the mean time this fixes an issue with calling getDate with timepicker()\n var timeOnly = false;\n if(method === 'timepicker'){\n timeOnly = true;\n method = 'datetimepicker';\n }\n\n function checkDates(changed, other) {\n var startdt = startTime[method]('getDate'),\n enddt = endTime[method]('getDate'),\n changeddt = changed[method]('getDate');\n\n if (startdt !== null) {\n var minDate = new Date(startdt.getTime()),\n maxDate = new Date(startdt.getTime());\n\n minDate.setMilliseconds(minDate.getMilliseconds() + options.minInterval);\n maxDate.setMilliseconds(maxDate.getMilliseconds() + options.maxInterval);\n\n if (options.minInterval > 0 && minDate > enddt) { // minInterval check\n endTime[method]('setDate', minDate);\n }\n else if (options.maxInterval > 0 && maxDate < enddt) { // max interval check\n endTime[method]('setDate', maxDate);\n }\n else if (startdt > enddt) {\n other[method]('setDate', changeddt);\n }\n }\n }\n\n function selected(changed, other, option) {\n if (!changed.val()) {\n return;\n }\n var date = changed[method].call(changed, 'getDate');\n if (date !== null && options.minInterval > 0) {\n if (option === 'minDate') {\n date.setMilliseconds(date.getMilliseconds() + options.minInterval);\n }\n if (option === 'maxDate') {\n date.setMilliseconds(date.getMilliseconds() - options.minInterval);\n }\n }\n\n if (date.getTime) {\n other[method].call(other, 'option', option, date);\n }\n }\n\n $.fn[method].call(startTime, $.extend({\n timeOnly: timeOnly,\n onClose: function (dateText, inst) {\n checkDates($(this), endTime);\n },\n onSelect: function (selectedDateTime) {\n selected($(this), endTime, 'minDate');\n }\n }, options, options.start));\n $.fn[method].call(endTime, $.extend({\n timeOnly: timeOnly,\n onClose: function (dateText, inst) {\n checkDates($(this), startTime);\n },\n onSelect: function (selectedDateTime) {\n selected($(this), startTime, 'maxDate');\n }\n }, options, options.end));\n\n checkDates(startTime, endTime);\n\n selected(startTime, endTime, 'minDate');\n selected(endTime, startTime, 'maxDate');\n\n return $([startTime.get(0), endTime.get(0)]);\n };\n\n /**\n * Log error or data to the console during error or debugging\n * @param {Object} err pass any type object to log to the console during error or debugging\n * @return {void}\n */\n $.timepicker.log = function () {\n // Older IE (9, maybe 10) throw error on accessing `window.console.log.apply`, so check first.\n if (window.console && window.console.log && window.console.log.apply) {\n window.console.log.apply(window.console, Array.prototype.slice.call(arguments));\n }\n };\n\n /*\n * Add util object to allow access to private methods for testability.\n */\n $.timepicker._util = {\n _extendRemove: extendRemove,\n _isEmptyObject: isEmptyObject,\n _convert24to12: convert24to12,\n _detectSupport: detectSupport,\n _selectLocalTimezone: selectLocalTimezone,\n _computeEffectiveSetting: computeEffectiveSetting,\n _splitDateTime: splitDateTime,\n _parseDateTimeInternal: parseDateTimeInternal\n };\n\n /*\n * Microsecond support\n */\n if (!Date.prototype.getMicroseconds) {\n Date.prototype.microseconds = 0;\n Date.prototype.getMicroseconds = function () { return this.microseconds; };\n Date.prototype.setMicroseconds = function (m) {\n this.setMilliseconds(this.getMilliseconds() + Math.floor(m / 1000));\n this.microseconds = m % 1000;\n return this;\n };\n }\n\n /*\n * Keep up with the version\n */\n $.timepicker.version = \"1.6.3\";\n\n}));\n","jquery/z-index.js":"/*!\n * zIndex plugin from jQuery UI Core - v1.10.4\n * http://jqueryui.com\n *\n * Copyright 2014 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/category/ui-core/\n */\ndefine([\n 'jquery'\n], function ($, undefined) {\n\n// plugins\n $.fn.extend({\n zIndex: function (zIndex) {\n if (zIndex !== undefined) {\n return this.css(\"zIndex\", zIndex);\n }\n\n if (this.length) {\n var elem = $(this[0]), position, value;\n while (elem.length && elem[0] !== document) {\n // Ignore z-index if position is set to a value where z-index is ignored by the browser\n // This makes behavior of this function consistent across browsers\n // WebKit always returns auto if the element is positioned\n position = elem.css(\"position\");\n if (position === \"absolute\" || position === \"relative\" || position === \"fixed\") {\n // IE returns 0 when zIndex is not specified\n // other browsers return a string\n // we ignore the case of nested elements with an explicit value of 0\n // <div style=\"z-index: -10;\"><div style=\"z-index: 0;\"></div></div>\n value = parseInt(elem.css(\"zIndex\"), 10);\n if (!isNaN(value) && value !== 0) {\n return value;\n }\n }\n elem = elem.parent();\n }\n }\n\n return 0;\n }\n });\n});\n","jquery/jquery.tabs.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n \"jquery\",\n \"jquery/bootstrap/tab\",\n \"jquery/bootstrap/collapse\",\n], function () {\n\n});\n","jquery/jquery.cookie.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'js-cookie/cookie-wrapper'\n], function () {\n\n});\n","jquery/jquery.validate.js":"/*!\n * jQuery Validation Plugin v1.19.5\n *\n * https://jqueryvalidation.org/\n *\n * Copyright (c) 2022 J\u00f6rn Zaefferer\n * Released under the MIT license\n */\n(function( factory ) {\n if ( typeof define === \"function\" && define.amd ) {\n define( [\"jquery\", \"jquery/jquery.metadata\"], factory );\n } else if (typeof module === \"object\" && module.exports) {\n module.exports = factory( require( \"jquery\" ) );\n } else {\n factory( jQuery );\n }\n}(function( $ ) {\n\n $.extend( $.fn, {\n\n // https://jqueryvalidation.org/validate/\n validate: function( options ) {\n\n // If nothing is selected, return nothing; can't chain anyway\n if ( !this.length ) {\n if ( options && options.debug && window.console ) {\n console.warn( \"Nothing selected, can't validate, returning nothing.\" );\n }\n return;\n }\n\n // Check if a validator for this form was already created\n var validator = $.data( this[ 0 ], \"validator\" );\n if ( validator ) {\n return validator;\n }\n\n // Add novalidate tag if HTML5.\n this.attr( \"novalidate\", \"novalidate\" );\n\n validator = new $.validator( options, this[ 0 ] );\n $.data( this[ 0 ], \"validator\", validator );\n\n if ( validator.settings.onsubmit ) {\n\n this.on( \"click.validate\", \":submit\", function( event ) {\n\n // Track the used submit button to properly handle scripted\n // submits later.\n validator.submitButton = event.currentTarget;\n\n // Allow suppressing validation by adding a cancel class to the submit button\n if ( $( this ).hasClass( \"cancel\" ) ) {\n validator.cancelSubmit = true;\n }\n\n // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button\n if ( $( this ).attr( \"formnovalidate\" ) !== undefined ) {\n validator.cancelSubmit = true;\n }\n } );\n\n // Validate the form on submit\n this.on( \"submit.validate\", function( event ) {\n if ( validator.settings.debug ) {\n\n // Prevent form submit to be able to see console output\n event.preventDefault();\n }\n\n function handle() {\n var hidden, result;\n\n // Insert a hidden input as a replacement for the missing submit button\n // The hidden input is inserted in two cases:\n // - A user defined a `submitHandler`\n // - There was a pending request due to `remote` method and `stopRequest()`\n // was called to submit the form in case it's valid\n if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) {\n hidden = $( \"<input type='hidden'/>\" )\n .attr( \"name\", validator.submitButton.name )\n .val( $( validator.submitButton ).val() )\n .appendTo( validator.currentForm );\n }\n\n if ( validator.settings.submitHandler && !validator.settings.debug ) {\n result = validator.settings.submitHandler.call( validator, validator.currentForm, event );\n if ( hidden ) {\n\n // And clean up afterwards; thanks to no-block-scope, hidden can be referenced\n hidden.remove();\n }\n if ( result !== undefined ) {\n return result;\n }\n return false;\n }\n return true;\n }\n\n // Prevent submit for invalid forms or custom submit handlers\n if ( validator.cancelSubmit ) {\n validator.cancelSubmit = false;\n return handle();\n }\n if ( validator.form() ) {\n if ( validator.pendingRequest ) {\n validator.formSubmitted = true;\n return false;\n }\n return handle();\n } else {\n validator.focusInvalid();\n return false;\n }\n } );\n }\n\n return validator;\n },\n\n // https://jqueryvalidation.org/valid/\n valid: function() {\n var valid, validator, errorList;\n\n if ( $( this[ 0 ] ).is( \"form\" ) ) {\n valid = this.validate().form();\n } else {\n errorList = [];\n valid = true;\n validator = $( this[ 0 ].form ).validate();\n this.each( function() {\n valid = validator.element( this ) && valid;\n if ( !valid ) {\n errorList = errorList.concat( validator.errorList );\n }\n } );\n validator.errorList = errorList;\n }\n return valid;\n },\n\n // https://jqueryvalidation.org/rules/\n rules: function( command, argument ) {\n var element = this[ 0 ],\n isContentEditable = typeof this.attr( \"contenteditable\" ) !== \"undefined\" && this.attr( \"contenteditable\" ) !== \"false\",\n settings, staticRules, existingRules, data, param, filtered;\n\n // If nothing is selected, return empty object; can't chain anyway\n if ( element == null ) {\n return;\n }\n\n if ( !element.form && isContentEditable ) {\n element.form = this.closest( \"form\" )[ 0 ];\n element.name = this.attr( \"name\" );\n }\n\n if ( element.form == null ) {\n return;\n }\n\n if ( command ) {\n settings = $.data( element.form, \"validator\" ).settings;\n staticRules = settings.rules;\n existingRules = $.validator.staticRules( element );\n switch ( command ) {\n case \"add\":\n $.extend( existingRules, $.validator.normalizeRule( argument ) );\n\n // Remove messages from rules, but allow them to be set separately\n delete existingRules.messages;\n staticRules[ element.name ] = existingRules;\n if ( argument.messages ) {\n settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages );\n }\n break;\n case \"remove\":\n if ( !argument ) {\n delete staticRules[ element.name ];\n return existingRules;\n }\n filtered = {};\n $.each( argument.split( /\\s/ ), function( index, method ) {\n filtered[ method ] = existingRules[ method ];\n delete existingRules[ method ];\n } );\n return filtered;\n }\n }\n\n data = $.validator.normalizeRules(\n $.extend(\n {},\n $.validator.metadataRules(element),\n $.validator.classRules( element ),\n $.validator.attributeRules( element ),\n $.validator.dataRules( element ),\n $.validator.staticRules( element )\n ), element );\n\n // Make sure required is at front\n if ( data.required ) {\n param = data.required;\n delete data.required;\n data = $.extend( { required: param }, data );\n }\n\n // Make sure remote is at back\n if ( data.remote ) {\n param = data.remote;\n delete data.remote;\n data = $.extend( data, { remote: param } );\n }\n\n return data;\n }\n } );\n\n// JQuery trim is deprecated, provide a trim method based on String.prototype.trim\n var trim = function( str ) {\n\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim#Polyfill\n return str.replace( /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, \"\" );\n };\n\n// Custom selectors\n $.extend( $.expr.pseudos || $.expr[ \":\" ], {\t\t// '|| $.expr[ \":\" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support\n\n // https://jqueryvalidation.org/blank-selector/\n blank: function( a ) {\n return !trim( \"\" + $( a ).val() );\n },\n\n // https://jqueryvalidation.org/filled-selector/\n filled: function( a ) {\n var val = $( a ).val();\n return val !== null && !!trim( \"\" + val );\n },\n\n // https://jqueryvalidation.org/unchecked-selector/\n unchecked: function( a ) {\n return !$( a ).prop( \"checked\" );\n }\n } );\n\n// Constructor for validator\n $.validator = function( options, form ) {\n this.settings = $.extend( true, {}, $.validator.defaults, options );\n this.currentForm = form;\n this.init();\n };\n\n// https://jqueryvalidation.org/jQuery.validator.format/\n $.validator.format = function( source, params ) {\n if ( arguments.length === 1 ) {\n return function() {\n var args = $.makeArray( arguments );\n args.unshift( source );\n return $.validator.format.apply( this, args );\n };\n }\n if ( params === undefined ) {\n return source;\n }\n if ( arguments.length > 2 && params.constructor !== Array ) {\n params = $.makeArray( arguments ).slice( 1 );\n }\n if ( params.constructor !== Array ) {\n params = [ params ];\n }\n $.each( params, function( i, n ) {\n source = source.replace( new RegExp( \"\\\\{\" + i + \"\\\\}\", \"g\" ), function() {\n return n;\n } );\n } );\n return source;\n };\n\n $.extend( $.validator, {\n\n defaults: {\n messages: {},\n groups: {},\n rules: {},\n errorClass: \"error\",\n pendingClass: \"pending\",\n validClass: \"valid\",\n errorElement: \"label\",\n focusCleanup: false,\n focusInvalid: true,\n errorContainer: $( [] ),\n errorLabelContainer: $( [] ),\n onsubmit: true,\n ignore: \":hidden\",\n ignoreTitle: false,\n onfocusin: function( element ) {\n this.lastActive = element;\n\n // Hide error label and remove error class on focus if enabled\n if ( this.settings.focusCleanup ) {\n if ( this.settings.unhighlight ) {\n this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );\n }\n this.hideThese( this.errorsFor( element ) );\n }\n },\n onfocusout: function( element ) {\n if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) {\n this.element( element );\n }\n },\n onkeyup: function( element, event ) {\n\n // Avoid revalidate the field when pressing one of the following keys\n // Shift => 16\n // Ctrl => 17\n // Alt => 18\n // Caps lock => 20\n // End => 35\n // Home => 36\n // Left arrow => 37\n // Up arrow => 38\n // Right arrow => 39\n // Down arrow => 40\n // Insert => 45\n // Num lock => 144\n // AltGr key => 225\n var excludedKeys = [\n 16, 17, 18, 20, 35, 36, 37,\n 38, 39, 40, 45, 144, 225\n ];\n\n if ( event.which === 9 && this.elementValue( element ) === \"\" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) {\n return;\n } else if ( element.name in this.submitted || element.name in this.invalid ) {\n this.element( element );\n }\n },\n onclick: function( element ) {\n\n // Click on selects, radiobuttons and checkboxes\n if ( element.name in this.submitted ) {\n this.element( element );\n\n // Or option elements, check parent select in that case\n } else if ( element.parentNode.name in this.submitted ) {\n this.element( element.parentNode );\n }\n },\n highlight: function( element, errorClass, validClass ) {\n if ( element.type === \"radio\" ) {\n this.findByName( element.name ).addClass( errorClass ).removeClass( validClass );\n } else {\n $( element ).addClass( errorClass ).removeClass( validClass );\n }\n },\n unhighlight: function( element, errorClass, validClass ) {\n if ( element.type === \"radio\" ) {\n this.findByName( element.name ).removeClass( errorClass ).addClass( validClass );\n } else {\n $( element ).removeClass( errorClass ).addClass( validClass );\n }\n }\n },\n\n // https://jqueryvalidation.org/jQuery.validator.setDefaults/\n setDefaults: function( settings ) {\n $.extend( $.validator.defaults, settings );\n },\n\n messages: {\n required: \"This field is required.\",\n remote: \"Please fix this field.\",\n email: \"Please enter a valid email address.\",\n url: \"Please enter a valid URL.\",\n date: \"Please enter a valid date.\",\n dateISO: \"Please enter a valid date (ISO).\",\n number: \"Please enter a valid number.\",\n digits: \"Please enter only digits.\",\n equalTo: \"Please enter the same value again.\",\n maxlength: $.validator.format( \"Please enter no more than {0} characters.\" ),\n minlength: $.validator.format( \"Please enter at least {0} characters.\" ),\n rangelength: $.validator.format( \"Please enter a value between {0} and {1} characters long.\" ),\n range: $.validator.format( \"Please enter a value between {0} and {1}.\" ),\n max: $.validator.format( \"Please enter a value less than or equal to {0}.\" ),\n min: $.validator.format( \"Please enter a value greater than or equal to {0}.\" ),\n step: $.validator.format( \"Please enter a multiple of {0}.\" )\n },\n\n autoCreateRanges: false,\n\n prototype: {\n\n init: function() {\n this.labelContainer = $( this.settings.errorLabelContainer );\n this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm );\n this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer );\n this.submitted = {};\n this.valueCache = {};\n this.pendingRequest = 0;\n this.pending = {};\n this.invalid = {};\n this.reset();\n\n var currentForm = this.currentForm,\n groups = ( this.groups = {} ),\n rules;\n $.each( this.settings.groups, function( key, value ) {\n if ( typeof value === \"string\" ) {\n value = value.split( /\\s/ );\n }\n $.each( value, function( index, name ) {\n groups[ name ] = key;\n } );\n } );\n rules = this.settings.rules;\n $.each( rules, function( key, value ) {\n rules[ key ] = $.validator.normalizeRule( value );\n } );\n\n function delegate( event ) {\n var isContentEditable = typeof $( this ).attr( \"contenteditable\" ) !== \"undefined\" && $( this ).attr( \"contenteditable\" ) !== \"false\";\n\n // Set form expando on contenteditable\n if ( !this.form && isContentEditable ) {\n this.form = $( this ).closest( \"form\" )[ 0 ];\n this.name = $( this ).attr( \"name\" );\n }\n\n // Ignore the element if it belongs to another form. This will happen mainly\n // when setting the `form` attribute of an input to the id of another form.\n if ( currentForm !== this.form ) {\n return;\n }\n\n var validator = $.data( this.form, \"validator\" ),\n eventType = \"on\" + event.type.replace( /^validate/, \"\" ),\n settings = validator.settings;\n if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) {\n settings[ eventType ].call( validator, this, event );\n }\n }\n\n $( this.currentForm )\n .on( \"focusin.validate focusout.validate keyup.validate\",\n \":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], \" +\n \"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], \" +\n \"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], \" +\n \"[type='radio'], [type='checkbox'], [contenteditable], [type='button']\", delegate )\n\n // Support: Chrome, oldIE\n // \"select\" is provided as event.target when clicking a option\n .on( \"click.validate\", \"select, option, [type='radio'], [type='checkbox']\", delegate );\n\n if ( this.settings.invalidHandler ) {\n $( this.currentForm ).on( \"invalid-form.validate\", this.settings.invalidHandler );\n }\n },\n\n // https://jqueryvalidation.org/Validator.form/\n form: function() {\n this.checkForm();\n $.extend( this.submitted, this.errorMap );\n this.invalid = $.extend( {}, this.errorMap );\n if ( !this.valid() ) {\n $( this.currentForm ).triggerHandler( \"invalid-form\", [ this ] );\n }\n this.showErrors();\n return this.valid();\n },\n\n checkForm: function() {\n this.prepareForm();\n for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) {\n this.check( elements[ i ] );\n }\n return this.valid();\n },\n\n // https://jqueryvalidation.org/Validator.element/\n element: function( element ) {\n var cleanElement = this.clean( element ),\n checkElement = this.validationTargetFor( cleanElement ),\n v = this,\n result = true,\n rs, group;\n\n if ( checkElement === undefined ) {\n delete this.invalid[ cleanElement.name ];\n } else {\n this.prepareElement( checkElement );\n this.currentElements = $( checkElement );\n\n // If this element is grouped, then validate all group elements already\n // containing a value\n group = this.groups[ checkElement.name ];\n if ( group ) {\n $.each( this.groups, function( name, testgroup ) {\n if ( testgroup === group && name !== checkElement.name ) {\n cleanElement = v.validationTargetFor( v.clean( v.findByName( name ) ) );\n if ( cleanElement && cleanElement.name in v.invalid ) {\n v.currentElements.push( cleanElement );\n result = v.check( cleanElement ) && result;\n }\n }\n } );\n }\n\n rs = this.check( checkElement ) !== false;\n result = result && rs;\n if ( rs ) {\n this.invalid[ checkElement.name ] = false;\n } else {\n this.invalid[ checkElement.name ] = true;\n }\n\n if ( !this.numberOfInvalids() ) {\n\n // Hide error containers on last error\n this.toHide = this.toHide.add( this.containers );\n }\n this.showErrors();\n\n // Add aria-invalid status for screen readers\n $( element ).attr( \"aria-invalid\", !rs );\n }\n\n return result;\n },\n\n // https://jqueryvalidation.org/Validator.showErrors/\n showErrors: function( errors ) {\n if ( errors ) {\n var validator = this;\n\n // Add items to error list and map\n $.extend( this.errorMap, errors );\n this.errorList = $.map( this.errorMap, function( message, name ) {\n return {\n message: message,\n element: validator.findByName( name )[ 0 ]\n };\n } );\n\n // Remove items from success list\n this.successList = $.grep( this.successList, function( element ) {\n return !( element.name in errors );\n } );\n }\n if ( this.settings.showErrors ) {\n this.settings.showErrors.call( this, this.errorMap, this.errorList );\n } else {\n this.defaultShowErrors();\n }\n },\n\n // https://jqueryvalidation.org/Validator.resetForm/\n resetForm: function() {\n if ( $.fn.resetForm ) {\n $( this.currentForm ).resetForm();\n }\n this.invalid = {};\n this.submitted = {};\n this.prepareForm();\n this.hideErrors();\n var elements = this.elements()\n .removeData( \"previousValue\" )\n .removeAttr( \"aria-invalid\" );\n\n this.resetElements( elements );\n },\n\n resetElements: function( elements ) {\n var i;\n\n if ( this.settings.unhighlight ) {\n for ( i = 0; elements[ i ]; i++ ) {\n this.settings.unhighlight.call( this, elements[ i ],\n this.settings.errorClass, \"\" );\n this.findByName( elements[ i ].name ).removeClass( this.settings.validClass );\n }\n } else {\n elements\n .removeClass( this.settings.errorClass )\n .removeClass( this.settings.validClass );\n }\n },\n\n numberOfInvalids: function() {\n return this.objectLength( this.invalid );\n },\n\n objectLength: function( obj ) {\n /* jshint unused: false */\n var count = 0,\n i;\n for ( i in obj ) {\n\n // This check allows counting elements with empty error\n // message as invalid elements\n if ( obj[ i ] !== undefined && obj[ i ] !== null && obj[ i ] !== false ) {\n count++;\n }\n }\n return count;\n },\n\n hideErrors: function() {\n this.hideThese( this.toHide );\n },\n\n hideThese: function( errors ) {\n errors.not( this.containers ).text( \"\" );\n this.addWrapper( errors ).hide();\n },\n\n valid: function() {\n return this.size() === 0;\n },\n\n size: function() {\n return this.errorList.length;\n },\n\n focusInvalid: function() {\n if ( this.settings.focusInvalid ) {\n try {\n $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] )\n .filter( \":visible\" )\n .trigger( \"focus\" )\n\n // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find\n .trigger( \"focusin\" );\n } catch ( e ) {\n\n // Ignore IE throwing errors when focusing hidden elements\n }\n }\n },\n\n findLastActive: function() {\n var lastActive = this.lastActive;\n return lastActive && $.grep( this.errorList, function( n ) {\n return n.element.name === lastActive.name;\n } ).length === 1 && lastActive;\n },\n\n elements: function() {\n var validator = this,\n rulesCache = {};\n\n // Select all valid inputs inside the form (no submit or reset buttons)\n return $( this.currentForm )\n .find( \"input, select, textarea, [contenteditable]\" )\n .not( \":submit, :reset, :image, :disabled\" )\n .not( this.settings.ignore )\n .filter( function() {\n var name = this.name || $( this ).attr( \"name\" ); // For contenteditable\n var isContentEditable = typeof $( this ).attr( \"contenteditable\" ) !== \"undefined\" && $( this ).attr( \"contenteditable\" ) !== \"false\";\n\n if ( !name && validator.settings.debug && window.console ) {\n console.error( \"%o has no name assigned\", this );\n }\n\n // Set form expando on contenteditable\n if ( isContentEditable ) {\n this.form = $( this ).closest( \"form\" )[ 0 ];\n this.name = name;\n }\n\n // Ignore elements that belong to other/nested forms\n if ( this.form !== validator.currentForm ) {\n return false;\n }\n\n // Select only the first element for each name, and only those with rules specified\n if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) {\n return false;\n }\n\n rulesCache[ name ] = true;\n return true;\n } );\n },\n\n clean: function( selector ) {\n return $( selector )[ 0 ];\n },\n\n errors: function() {\n var errorClass = this.settings.errorClass.split( \" \" ).join( \".\" );\n return $( this.settings.errorElement + \".\" + errorClass, this.errorContext );\n },\n\n resetInternals: function() {\n this.successList = [];\n this.errorList = [];\n this.errorMap = {};\n this.toShow = $( [] );\n this.toHide = $( [] );\n },\n\n reset: function() {\n this.resetInternals();\n this.currentElements = $( [] );\n },\n\n prepareForm: function() {\n this.reset();\n this.toHide = this.errors().add( this.containers );\n },\n\n prepareElement: function( element ) {\n this.reset();\n this.toHide = this.errorsFor( element );\n },\n\n elementValue: function( element ) {\n var $element = $( element ),\n type = element.type,\n isContentEditable = typeof $element.attr( \"contenteditable\" ) !== \"undefined\" && $element.attr( \"contenteditable\" ) !== \"false\",\n val, idx;\n\n if ( type === \"radio\" || type === \"checkbox\" ) {\n return this.findByName( element.name ).filter( \":checked\" ).val();\n } else if ( type === \"number\" && typeof element.validity !== \"undefined\" ) {\n return element.validity.badInput ? \"NaN\" : $element.val();\n }\n\n if ( isContentEditable ) {\n val = $element.text();\n } else {\n val = $element.val();\n }\n\n if ( type === \"file\" ) {\n\n // Modern browser (chrome & safari)\n if ( val.substr( 0, 12 ) === \"C:\\\\fakepath\\\\\" ) {\n return val.substr( 12 );\n }\n\n // Legacy browsers\n // Unix-based path\n idx = val.lastIndexOf( \"/\" );\n if ( idx >= 0 ) {\n return val.substr( idx + 1 );\n }\n\n // Windows-based path\n idx = val.lastIndexOf( \"\\\\\" );\n if ( idx >= 0 ) {\n return val.substr( idx + 1 );\n }\n\n // Just the file name\n return val;\n }\n\n if ( typeof val === \"string\" ) {\n return val.replace( /\\r/g, \"\" );\n }\n return val;\n },\n\n check: function( element ) {\n element = this.validationTargetFor( this.clean( element ) );\n\n var rules = $( element ).rules(),\n rulesCount = $.map( rules, function( n, i ) {\n return i;\n } ).length,\n dependencyMismatch = false,\n val = this.elementValue( element ),\n result, method, rule, normalizer;\n\n // Prioritize the local normalizer defined for this element over the global one\n // if the former exists, otherwise user the global one in case it exists.\n if ( typeof rules.normalizer === \"function\" ) {\n normalizer = rules.normalizer;\n } else if (\ttypeof this.settings.normalizer === \"function\" ) {\n normalizer = this.settings.normalizer;\n }\n\n // If normalizer is defined, then call it to the changed value instead\n // of using the real one.\n // Note that `this` in the normalizer is `element`.\n if ( normalizer ) {\n val = normalizer.call( element, val );\n\n // Delete the normalizer from rules to avoid treating it as a pre-defined method.\n delete rules.normalizer;\n }\n\n for ( method in rules ) {\n rule = { method: method, parameters: rules[ method ] };\n try {\n result = $.validator.methods[ method ].call( this, val, element, rule.parameters );\n\n // If a method indicates that the field is optional and therefore valid,\n // don't mark it as valid when there are no other rules\n if ( result === \"dependency-mismatch\" && rulesCount === 1 ) {\n dependencyMismatch = true;\n continue;\n }\n dependencyMismatch = false;\n\n if ( result === \"pending\" ) {\n this.toHide = this.toHide.not( this.errorsFor( element ) );\n return;\n }\n\n if ( !result ) {\n this.formatAndAdd( element, rule );\n return false;\n }\n } catch ( e ) {\n if ( this.settings.debug && window.console ) {\n console.log( \"Exception occurred when checking element \" + element.id + \", check the '\" + rule.method + \"' method.\", e );\n }\n if ( e instanceof TypeError ) {\n e.message += \". Exception occurred when checking element \" + element.id + \", check the '\" + rule.method + \"' method.\";\n }\n\n throw e;\n }\n }\n if ( dependencyMismatch ) {\n return;\n }\n if ( this.objectLength( rules ) ) {\n this.successList.push( element );\n }\n return true;\n },\n\n // Return the custom message for the given element and validation method\n // specified in the element's HTML5 data attribute\n // return the generic message if present and no method specific message is present\n customDataMessage: function( element, method ) {\n return $( element ).data( \"msg\" + method.charAt( 0 ).toUpperCase() +\n method.substring( 1 ).toLowerCase() ) || $( element ).data( \"msg\" );\n },\n\n // Return the custom message for the given element name and validation method\n customMessage: function( name, method ) {\n var m = this.settings.messages[ name ];\n return m && ( m.constructor === String ? m : m[ method ] );\n },\n\n // Return the first defined argument, allowing empty strings\n findDefined: function() {\n for ( var i = 0; i < arguments.length; i++ ) {\n if ( arguments[ i ] !== undefined ) {\n return arguments[ i ];\n }\n }\n return undefined;\n },\n\n // The second parameter 'rule' used to be a string, and extended to an object literal\n // of the following form:\n // rule = {\n // method: \"method name\",\n // parameters: \"the given method parameters\"\n // }\n //\n // The old behavior still supported, kept to maintain backward compatibility with\n // old code, and will be removed in the next major release.\n defaultMessage: function( element, rule ) {\n if ( typeof rule === \"string\" ) {\n rule = { method: rule };\n }\n\n var message = this.findDefined(\n this.customMessage( element.name, rule.method ),\n this.customDataMessage( element, rule.method ),\n\n // 'title' is never undefined, so handle empty string as undefined\n !this.settings.ignoreTitle && element.title || undefined,\n $.validator.messages[ rule.method ],\n \"<strong>Warning: No message defined for \" + element.name + \"</strong>\"\n ),\n theregex = /\\$?\\{(\\d+)\\}/g;\n if ( typeof message === \"function\" ) {\n message = message.call( this, rule.parameters, element );\n } else if ( theregex.test( message ) ) {\n message = $.validator.format( message.replace( theregex, \"{$1}\" ), rule.parameters );\n }\n\n return message;\n },\n\n formatAndAdd: function( element, rule ) {\n var message = this.defaultMessage( element, rule );\n\n this.errorList.push( {\n message: message,\n element: element,\n method: rule.method\n } );\n\n this.errorMap[ element.name ] = message;\n this.submitted[ element.name ] = message;\n },\n\n addWrapper: function( toToggle ) {\n if ( this.settings.wrapper ) {\n toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) );\n }\n return toToggle;\n },\n\n defaultShowErrors: function() {\n var i, elements, error;\n for ( i = 0; this.errorList[ i ]; i++ ) {\n error = this.errorList[ i ];\n if ( this.settings.highlight ) {\n this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass );\n }\n this.showLabel( error.element, error.message );\n }\n if ( this.errorList.length ) {\n this.toShow = this.toShow.add( this.containers );\n }\n if ( this.settings.success ) {\n for ( i = 0; this.successList[ i ]; i++ ) {\n this.showLabel( this.successList[ i ] );\n }\n }\n if ( this.settings.unhighlight ) {\n for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) {\n this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass );\n }\n }\n this.toHide = this.toHide.not( this.toShow );\n this.hideErrors();\n this.addWrapper( this.toShow ).show();\n },\n\n validElements: function() {\n return this.currentElements.not( this.invalidElements() );\n },\n\n invalidElements: function() {\n return $( this.errorList ).map( function() {\n return this.element;\n } );\n },\n\n showLabel: function( element, message ) {\n var place, group, errorID, v,\n error = this.errorsFor( element ),\n elementID = this.idOrName( element ),\n describedBy = $( element ).attr( \"aria-describedby\" );\n\n if ( error.length ) {\n\n // Refresh error/success class\n error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );\n\n // Replace message on existing label\n error.html( message );\n } else {\n\n // Create error element\n error = $( \"<\" + this.settings.errorElement + \">\" )\n .attr( \"id\", elementID + \"-error\" )\n .addClass( this.settings.errorClass )\n .html( message || \"\" );\n\n // Maintain reference to the element to be placed into the DOM\n place = error;\n if ( this.settings.wrapper ) {\n\n // Make sure the element is visible, even in IE\n // actually showing the wrapped element is handled elsewhere\n place = error.hide().show().wrap( \"<\" + this.settings.wrapper + \"/>\" ).parent();\n }\n if ( this.labelContainer.length ) {\n this.labelContainer.append( place );\n } else if ( this.settings.errorPlacement ) {\n this.settings.errorPlacement.call( this, place, $( element ) );\n } else {\n place.insertAfter( element );\n }\n\n // Link error back to the element\n if ( error.is( \"label\" ) ) {\n\n // If the error is a label, then associate using 'for'\n error.attr( \"for\", elementID );\n\n // If the element is not a child of an associated label, then it's necessary\n // to explicitly apply aria-describedby\n } else if ( error.parents( \"label[for='\" + this.escapeCssMeta( elementID ) + \"']\" ).length === 0 ) {\n errorID = error.attr( \"id\" );\n\n // Respect existing non-error aria-describedby\n if ( !describedBy ) {\n describedBy = errorID;\n } else if ( !describedBy.match( new RegExp( \"\\\\b\" + this.escapeCssMeta( errorID ) + \"\\\\b\" ) ) ) {\n\n // Add to end of list if not already present\n describedBy += \" \" + errorID;\n }\n $( element ).attr( \"aria-describedby\", describedBy );\n\n // If this element is grouped, then assign to all elements in the same group\n group = this.groups[ element.name ];\n if ( group ) {\n v = this;\n $.each( v.groups, function( name, testgroup ) {\n if ( testgroup === group ) {\n $( \"[name='\" + v.escapeCssMeta( name ) + \"']\", v.currentForm )\n .attr( \"aria-describedby\", error.attr( \"id\" ) );\n }\n } );\n }\n }\n }\n if ( !message && this.settings.success ) {\n error.text( \"\" );\n if ( typeof this.settings.success === \"string\" ) {\n error.addClass( this.settings.success );\n } else {\n this.settings.success( error, element );\n }\n }\n this.toShow = this.toShow.add( error );\n },\n\n errorsFor: function( element ) {\n var name = this.escapeCssMeta( this.idOrName( element ) ),\n describer = $( element ).attr( \"aria-describedby\" ),\n selector = \"label[for='\" + name + \"'], label[for='\" + name + \"'] *\";\n\n // 'aria-describedby' should directly reference the error element\n if ( describer ) {\n selector = selector + \", #\" + this.escapeCssMeta( describer )\n .replace( /\\s+/g, \", #\" ) + \":visible\";\n }\n\n return this\n .errors()\n .filter( selector );\n },\n\n // See https://api.jquery.com/category/selectors/, for CSS\n // meta-characters that should be escaped in order to be used with JQuery\n // as a literal part of a name/id or any selector.\n escapeCssMeta: function( string ) {\n if ( string === undefined ) {\n return \"\";\n }\n\n return string.replace( /([\\\\!\"#$%&'()*+,./:;<=>?@\\[\\]^`{|}~])/g, \"\\\\$1\" );\n },\n\n idOrName: function( element ) {\n return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name );\n },\n\n validationTargetFor: function( element ) {\n\n // If radio/checkbox, validate first element in group instead\n if ( this.checkable( element ) ) {\n element = this.findByName( element.name );\n }\n\n // Always apply ignore filter\n return $( element ).not( this.settings.ignore )[ 0 ];\n },\n\n checkable: function( element ) {\n return ( /radio|checkbox/i ).test( element.type );\n },\n\n findByName: function( name ) {\n return $( this.currentForm ).find( \"[name='\" + this.escapeCssMeta( name ) + \"']\" );\n },\n\n getLength: function( value, element ) {\n switch ( element.nodeName.toLowerCase() ) {\n case \"select\":\n return $( \"option:selected\", element ).length;\n case \"input\":\n if ( this.checkable( element ) ) {\n return this.findByName( element.name ).filter( \":checked\" ).length;\n }\n }\n return value.length;\n },\n\n depend: function( param, element ) {\n return this.dependTypes[ typeof param ] ? this.dependTypes[ typeof param ]( param, element ) : true;\n },\n\n dependTypes: {\n \"boolean\": function( param ) {\n return param;\n },\n \"string\": function( param, element ) {\n return !!$( param, element.form ).length;\n },\n \"function\": function( param, element ) {\n return param( element );\n }\n },\n\n optional: function( element ) {\n var val = this.elementValue( element );\n return !$.validator.methods.required.call( this, val, element ) && \"dependency-mismatch\";\n },\n\n startRequest: function( element ) {\n if ( !this.pending[ element.name ] ) {\n this.pendingRequest++;\n $( element ).addClass( this.settings.pendingClass );\n this.pending[ element.name ] = true;\n }\n },\n\n stopRequest: function( element, valid ) {\n this.pendingRequest--;\n\n // Sometimes synchronization fails, make sure pendingRequest is never < 0\n if ( this.pendingRequest < 0 ) {\n this.pendingRequest = 0;\n }\n delete this.pending[ element.name ];\n $( element ).removeClass( this.settings.pendingClass );\n if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() && this.pendingRequest === 0 ) {\n $( this.currentForm ).trigger( \"submit\" );\n\n // Remove the hidden input that was used as a replacement for the\n // missing submit button. The hidden input is added by `handle()`\n // to ensure that the value of the used submit button is passed on\n // for scripted submits triggered by this method\n if ( this.submitButton ) {\n $( \"input:hidden[name='\" + this.submitButton.name + \"']\", this.currentForm ).remove();\n }\n\n this.formSubmitted = false;\n } else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) {\n $( this.currentForm ).triggerHandler( \"invalid-form\", [ this ] );\n this.formSubmitted = false;\n }\n },\n\n previousValue: function( element, method ) {\n method = typeof method === \"string\" && method || \"remote\";\n\n return $.data( element, \"previousValue\" ) || $.data( element, \"previousValue\", {\n old: null,\n valid: true,\n message: this.defaultMessage( element, { method: method } )\n } );\n },\n\n // Cleans up all forms and elements, removes validator-specific events\n destroy: function() {\n this.resetForm();\n\n $( this.currentForm )\n .off( \".validate\" )\n .removeData( \"validator\" )\n .find( \".validate-equalTo-blur\" )\n .off( \".validate-equalTo\" )\n .removeClass( \"validate-equalTo-blur\" )\n .find( \".validate-lessThan-blur\" )\n .off( \".validate-lessThan\" )\n .removeClass( \"validate-lessThan-blur\" )\n .find( \".validate-lessThanEqual-blur\" )\n .off( \".validate-lessThanEqual\" )\n .removeClass( \"validate-lessThanEqual-blur\" )\n .find( \".validate-greaterThanEqual-blur\" )\n .off( \".validate-greaterThanEqual\" )\n .removeClass( \"validate-greaterThanEqual-blur\" )\n .find( \".validate-greaterThan-blur\" )\n .off( \".validate-greaterThan\" )\n .removeClass( \"validate-greaterThan-blur\" );\n }\n\n },\n\n classRuleSettings: {\n required: { required: true },\n email: { email: true },\n url: { url: true },\n date: { date: true },\n dateISO: { dateISO: true },\n number: { number: true },\n digits: { digits: true },\n creditcard: { creditcard: true }\n },\n\n addClassRules: function( className, rules ) {\n if ( className.constructor === String ) {\n this.classRuleSettings[ className ] = rules;\n } else {\n $.extend( this.classRuleSettings, className );\n }\n },\n\n classRules: function( element ) {\n var rules = {},\n classes = $( element ).attr( \"class\" );\n\n if ( classes ) {\n $.each( classes.split( \" \" ), function() {\n if ( this in $.validator.classRuleSettings ) {\n $.extend( rules, $.validator.classRuleSettings[ this ] );\n }\n } );\n }\n return rules;\n },\n\n normalizeAttributeRule: function( rules, type, method, value ) {\n\n // Convert the value to a number for number inputs, and for text for backwards compability\n // allows type=\"date\" and others to be compared as strings\n if ( /min|max|step/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) {\n value = Number( value );\n\n // Support Opera Mini, which returns NaN for undefined minlength\n if ( isNaN( value ) ) {\n value = undefined;\n }\n }\n\n if ( value || value === 0 ) {\n rules[ method ] = value;\n } else if ( type === method && type !== \"range\" ) {\n\n // Exception: the jquery validate 'range' method\n // does not test for the html5 'range' type\n rules[ type === \"date\" ? \"dateISO\" : method ] = true;\n }\n },\n\n attributeRules: function( element ) {\n var rules = {},\n $element = $( element ),\n type = element.getAttribute( \"type\" ),\n method, value;\n\n for ( method in $.validator.methods ) {\n\n // Support for <input required> in both html5 and older browsers\n if ( method === \"required\" ) {\n value = element.getAttribute( method );\n\n // Some browsers return an empty string for the required attribute\n // and non-HTML5 browsers might have required=\"\" markup\n if ( value === \"\" ) {\n value = true;\n }\n\n // Force non-HTML5 browsers to return bool\n value = !!value;\n } else {\n value = $element.attr( method );\n }\n\n this.normalizeAttributeRule( rules, type, method, value );\n }\n\n // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs\n if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) {\n delete rules.maxlength;\n }\n\n return rules;\n },\n\n metadataRules: function (element) {\n if (!$.metadata) {\n return {};\n }\n\n var meta = $.data(element.form, 'validator').settings.meta;\n return meta ?\n $(element).metadata()[meta] :\n $(element).metadata();\n },\n \n dataRules: function( element ) {\n var rules = {},\n $element = $( element ),\n type = element.getAttribute( \"type\" ),\n method, value;\n\n for ( method in $.validator.methods ) {\n value = $element.data( \"rule\" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );\n\n // Cast empty attributes like `data-rule-required` to `true`\n if ( value === \"\" ) {\n value = true;\n }\n\n this.normalizeAttributeRule( rules, type, method, value );\n }\n return rules;\n },\n\n staticRules: function( element ) {\n var rules = {},\n validator = $.data( element.form, \"validator\" );\n\n if ( validator.settings.rules ) {\n rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {};\n }\n return rules;\n },\n\n normalizeRules: function( rules, element ) {\n\n // Handle dependency check\n $.each( rules, function( prop, val ) {\n\n // Ignore rule when param is explicitly false, eg. required:false\n if ( val === false ) {\n delete rules[ prop ];\n return;\n }\n if ( val.param || val.depends ) {\n var keepRule = true;\n switch ( typeof val.depends ) {\n case \"string\":\n keepRule = !!$( val.depends, element.form ).length;\n break;\n case \"function\":\n keepRule = val.depends.call( element, element );\n break;\n }\n if ( keepRule ) {\n rules[ prop ] = val.param !== undefined ? val.param : true;\n } else {\n $.data( element.form, \"validator\" ).resetElements( $( element ) );\n delete rules[ prop ];\n }\n }\n } );\n\n // Evaluate parameters\n $.each( rules, function( rule, parameter ) {\n rules[ rule ] = typeof parameter === \"function\" && rule !== \"normalizer\" ? parameter( element ) : parameter;\n } );\n\n // Clean number parameters\n $.each( [ \"minlength\", \"maxlength\" ], function() {\n if ( rules[ this ] ) {\n rules[ this ] = Number( rules[ this ] );\n }\n } );\n $.each( [ \"rangelength\", \"range\" ], function() {\n var parts;\n if ( rules[ this ] ) {\n if ( Array.isArray( rules[ this ] ) ) {\n rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ];\n } else if ( typeof rules[ this ] === \"string\" ) {\n parts = rules[ this ].replace( /[\\[\\]]/g, \"\" ).split( /[\\s,]+/ );\n rules[ this ] = [ Number( parts[ 0 ] ), Number( parts[ 1 ] ) ];\n }\n }\n } );\n\n if ( $.validator.autoCreateRanges ) {\n\n // Auto-create ranges\n if ( rules.min != null && rules.max != null ) {\n rules.range = [ rules.min, rules.max ];\n delete rules.min;\n delete rules.max;\n }\n if ( rules.minlength != null && rules.maxlength != null ) {\n rules.rangelength = [ rules.minlength, rules.maxlength ];\n delete rules.minlength;\n delete rules.maxlength;\n }\n }\n\n return rules;\n },\n\n // Converts a simple string to a {string: true} rule, e.g., \"required\" to {required:true}\n normalizeRule: function( data ) {\n if ( typeof data === \"string\" ) {\n var transformed = {};\n $.each( data.split( /\\s/ ), function() {\n transformed[ this ] = true;\n } );\n data = transformed;\n }\n return data;\n },\n\n // https://jqueryvalidation.org/jQuery.validator.addMethod/\n addMethod: function( name, method, message ) {\n $.validator.methods[ name ] = method;\n $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ];\n if ( method.length < 3 ) {\n $.validator.addClassRules( name, $.validator.normalizeRule( name ) );\n }\n },\n\n // https://jqueryvalidation.org/jQuery.validator.methods/\n methods: {\n\n // https://jqueryvalidation.org/required-method/\n required: function( value, element, param ) {\n\n // Check if dependency is met\n if ( !this.depend( param, element ) ) {\n return \"dependency-mismatch\";\n }\n if ( element.nodeName.toLowerCase() === \"select\" ) {\n\n // Could be an array for select-multiple or a string, both are fine this way\n var val = $( element ).val();\n return val && val.length > 0;\n }\n if ( this.checkable( element ) ) {\n return this.getLength( value, element ) > 0;\n }\n return value !== undefined && value !== null && value.length > 0;\n },\n\n // https://jqueryvalidation.org/email-method/\n email: function( value, element ) {\n\n // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address\n // Retrieved 2014-01-14\n // If you have a problem with this implementation, report a bug against the above spec\n // Or use custom methods to implement your own email validation\n return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value );\n },\n\n // https://jqueryvalidation.org/url-method/\n url: function( value, element ) {\n\n // Copyright (c) 2010-2013 Diego Perini, MIT licensed\n // https://gist.github.com/dperini/729294\n // see also https://mathiasbynens.be/demo/url-regex\n // modified to allow protocol-relative URLs\n return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\\/\\/)(?:(?:[^\\]\\[?\\/<~#`!@$^&*()+=}|:\";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\\]\\[?\\/<~#`!@$^&*()+=}|:\";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$/i.test( value );\n },\n\n // https://jqueryvalidation.org/date-method/\n date: ( function() {\n var called = false;\n\n return function( value, element ) {\n if ( !called ) {\n called = true;\n if ( this.settings.debug && window.console ) {\n console.warn(\n \"The `date` method is deprecated and will be removed in version '2.0.0'.\\n\" +\n \"Please don't use it, since it relies on the Date constructor, which\\n\" +\n \"behaves very differently across browsers and locales. Use `dateISO`\\n\" +\n \"instead or one of the locale specific methods in `localizations/`\\n\" +\n \"and `additional-methods.js`.\"\n );\n }\n }\n\n return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );\n };\n }() ),\n\n // https://jqueryvalidation.org/dateISO-method/\n dateISO: function( value, element ) {\n return this.optional( element ) || /^\\d{4}[\\/\\-](0?[1-9]|1[012])[\\/\\-](0?[1-9]|[12][0-9]|3[01])$/.test( value );\n },\n\n // https://jqueryvalidation.org/number-method/\n number: function( value, element ) {\n return this.optional( element ) || /^(?:-?\\d+|-?\\d{1,3}(?:,\\d{3})+)?(?:\\.\\d+)?$/.test( value );\n },\n\n // https://jqueryvalidation.org/digits-method/\n digits: function( value, element ) {\n return this.optional( element ) || /^\\d+$/.test( value );\n },\n\n // https://jqueryvalidation.org/minlength-method/\n minlength: function( value, element, param ) {\n var length = Array.isArray( value ) ? value.length : this.getLength( value, element );\n return this.optional( element ) || length >= param;\n },\n\n // https://jqueryvalidation.org/maxlength-method/\n maxlength: function( value, element, param ) {\n var length = Array.isArray( value ) ? value.length : this.getLength( value, element );\n return this.optional( element ) || length <= param;\n },\n\n // https://jqueryvalidation.org/rangelength-method/\n rangelength: function( value, element, param ) {\n var length = Array.isArray( value ) ? value.length : this.getLength( value, element );\n return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );\n },\n\n // https://jqueryvalidation.org/min-method/\n min: function( value, element, param ) {\n return this.optional( element ) || value >= param;\n },\n\n // https://jqueryvalidation.org/max-method/\n max: function( value, element, param ) {\n return this.optional( element ) || value <= param;\n },\n\n // https://jqueryvalidation.org/range-method/\n range: function( value, element, param ) {\n return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] );\n },\n\n // https://jqueryvalidation.org/step-method/\n step: function( value, element, param ) {\n var type = $( element ).attr( \"type\" ),\n errorMessage = \"Step attribute on input type \" + type + \" is not supported.\",\n supportedTypes = [ \"text\", \"number\", \"range\" ],\n re = new RegExp( \"\\\\b\" + type + \"\\\\b\" ),\n notSupported = type && !re.test( supportedTypes.join() ),\n decimalPlaces = function( num ) {\n var match = ( \"\" + num ).match( /(?:\\.(\\d+))?$/ );\n if ( !match ) {\n return 0;\n }\n\n // Number of digits right of decimal point.\n return match[ 1 ] ? match[ 1 ].length : 0;\n },\n toInt = function( num ) {\n return Math.round( num * Math.pow( 10, decimals ) );\n },\n valid = true,\n decimals;\n\n // Works only for text, number and range input types\n // TODO find a way to support input types date, datetime, datetime-local, month, time and week\n if ( notSupported ) {\n throw new Error( errorMessage );\n }\n\n decimals = decimalPlaces( param );\n\n // Value can't have too many decimals\n if ( decimalPlaces( value ) > decimals || toInt( value ) % toInt( param ) !== 0 ) {\n valid = false;\n }\n\n return this.optional( element ) || valid;\n },\n\n // https://jqueryvalidation.org/equalTo-method/\n equalTo: function( value, element, param ) {\n\n // Bind to the blur event of the target in order to revalidate whenever the target field is updated\n var target = $( param );\n if ( this.settings.onfocusout && target.not( \".validate-equalTo-blur\" ).length ) {\n target.addClass( \"validate-equalTo-blur\" ).on( \"blur.validate-equalTo\", function() {\n $( element ).valid();\n } );\n }\n return value === target.val();\n },\n\n // https://jqueryvalidation.org/remote-method/\n remote: function( value, element, param, method ) {\n if ( this.optional( element ) ) {\n return \"dependency-mismatch\";\n }\n\n method = typeof method === \"string\" && method || \"remote\";\n\n var previous = this.previousValue( element, method ),\n validator, data, optionDataString;\n\n if ( !this.settings.messages[ element.name ] ) {\n this.settings.messages[ element.name ] = {};\n }\n previous.originalMessage = previous.originalMessage || this.settings.messages[ element.name ][ method ];\n this.settings.messages[ element.name ][ method ] = previous.message;\n\n param = typeof param === \"string\" && { url: param } || param;\n optionDataString = $.param( $.extend( { data: value }, param.data ) );\n if ( previous.old === optionDataString ) {\n return previous.valid;\n }\n\n previous.old = optionDataString;\n validator = this;\n this.startRequest( element );\n data = {};\n data[ element.name ] = value;\n $.ajax( $.extend( true, {\n mode: \"abort\",\n port: \"validate\" + element.name,\n dataType: \"json\",\n data: data,\n context: validator.currentForm,\n success: function( response ) {\n var valid = response === true || response === \"true\",\n errors, message, submitted;\n\n validator.settings.messages[ element.name ][ method ] = previous.originalMessage;\n if ( valid ) {\n submitted = validator.formSubmitted;\n validator.resetInternals();\n validator.toHide = validator.errorsFor( element );\n validator.formSubmitted = submitted;\n validator.successList.push( element );\n validator.invalid[ element.name ] = false;\n validator.showErrors();\n } else {\n errors = {};\n message = response || validator.defaultMessage( element, { method: method, parameters: value } );\n errors[ element.name ] = previous.message = message;\n validator.invalid[ element.name ] = true;\n validator.showErrors( errors );\n }\n previous.valid = valid;\n validator.stopRequest( element, valid );\n }\n }, param ) );\n return \"pending\";\n }\n }\n\n } );\n\n// Ajax mode: abort\n// usage: $.ajax({ mode: \"abort\"[, port: \"uniqueport\"]});\n// if mode:\"abort\" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()\n\n var pendingRequests = {},\n ajax;\n\n// Use a prefilter if available (1.5+)\n if ( $.ajaxPrefilter ) {\n $.ajaxPrefilter( function( settings, _, xhr ) {\n var port = settings.port;\n if ( settings.mode === \"abort\" ) {\n if ( pendingRequests[ port ] ) {\n pendingRequests[ port ].abort();\n }\n pendingRequests[ port ] = xhr;\n }\n } );\n } else {\n\n // Proxy ajax\n ajax = $.ajax;\n $.ajax = function( settings ) {\n var mode = ( \"mode\" in settings ? settings : $.ajaxSettings ).mode,\n port = ( \"port\" in settings ? settings : $.ajaxSettings ).port;\n if ( mode === \"abort\" ) {\n if ( pendingRequests[ port ] ) {\n pendingRequests[ port ].abort();\n }\n pendingRequests[ port ] = ajax.apply( this, arguments );\n return pendingRequests[ port ];\n }\n return ajax.apply( this, arguments );\n };\n }\n return $;\n}));\n","jquery/compat.js":"// Import every plugin under the sun. Bad for performance,\n// but prevents the store from breaking in situations\n// where a dependency was missed during the migration from\n// a monolith build of jQueryUI to a modular one\n\ndefine([\n 'jquery-ui-modules/core',\n 'jquery-ui-modules/accordion',\n 'jquery-ui-modules/autocomplete',\n 'jquery-ui-modules/button',\n 'jquery-ui-modules/datepicker',\n 'jquery-ui-modules/dialog',\n 'jquery-ui-modules/draggable',\n 'jquery-ui-modules/droppable',\n 'jquery-ui-modules/effect-blind',\n 'jquery-ui-modules/effect-bounce',\n 'jquery-ui-modules/effect-clip',\n 'jquery-ui-modules/effect-drop',\n 'jquery-ui-modules/effect-explode',\n 'jquery-ui-modules/effect-fade',\n 'jquery-ui-modules/effect-fold',\n 'jquery-ui-modules/effect-highlight',\n 'jquery-ui-modules/effect-scale',\n 'jquery-ui-modules/effect-pulsate',\n 'jquery-ui-modules/effect-shake',\n 'jquery-ui-modules/effect-slide',\n 'jquery-ui-modules/effect-transfer',\n 'jquery-ui-modules/effect',\n 'jquery-ui-modules/menu',\n 'jquery-ui-modules/mouse',\n 'jquery-ui-modules/position',\n 'jquery-ui-modules/progressbar',\n 'jquery-ui-modules/resizable',\n 'jquery-ui-modules/selectable',\n 'jquery-ui-modules/slider',\n 'jquery-ui-modules/sortable',\n 'jquery-ui-modules/spinner',\n 'jquery-ui-modules/tabs',\n 'jquery-ui-modules/timepicker',\n 'jquery-ui-modules/tooltip',\n 'jquery-ui-modules/widget'\n], function() {\n console.warn(\n 'Fallback to JQueryUI Compat activated. ' +\n 'Your store is missing a dependency for a ' +\n 'jQueryUI widget. Identifying and addressing the dependency ' +\n 'will drastically improve the performance of your site.'\n );\n});\n"}
}});