![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/pub/static/frontend/Smartwave/porto/en_US/js/bundle/ |
require.config({"config": { "jsbuild":{"Magento_PageBuilder/js/resource/jarallax/jarallax-video.js":"/*!\n * Video Extension for Jarallax v2.0.3 (https://github.com/nk-o/jarallax)\n * Copyright 2022 nK <https://nkdev.info>\n * Licensed under MIT (https://github.com/nk-o/jarallax/blob/master/LICENSE)\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.jarallaxVideo = factory());\n})(this, (function () { 'use strict';\n\n /*!\n * Name : Video Worker\n * Version : 2.0.0\n * Author : nK <https://nkdev.info>\n * GitHub : https://github.com/nk-o/video-worker\n */\n\n /* eslint-disable import/no-mutable-exports */\n\n /* eslint-disable no-restricted-globals */\n let win$1;\n\n if (typeof window !== 'undefined') {\n win$1 = window;\n } else if (typeof global !== 'undefined') {\n win$1 = global;\n } else if (typeof self !== 'undefined') {\n win$1 = self;\n } else {\n win$1 = {};\n }\n\n var global$1$1 = win$1; // Deferred\n // thanks http://stackoverflow.com/questions/18096715/implement-deferred-object-without-using-jquery\n\n function Deferred() {\n this.doneCallbacks = [];\n this.failCallbacks = [];\n }\n\n Deferred.prototype = {\n execute(list, args) {\n let i = list.length; // eslint-disable-next-line no-param-reassign\n\n args = Array.prototype.slice.call(args);\n\n while (i) {\n i -= 1;\n list[i].apply(null, args);\n }\n },\n\n resolve(...args) {\n this.execute(this.doneCallbacks, args);\n },\n\n reject(...args) {\n this.execute(this.failCallbacks, args);\n },\n\n done(callback) {\n this.doneCallbacks.push(callback);\n },\n\n fail(callback) {\n this.failCallbacks.push(callback);\n }\n\n };\n let ID = 0;\n let YoutubeAPIadded = 0;\n let VimeoAPIadded = 0;\n let loadingYoutubePlayer = 0;\n let loadingVimeoPlayer = 0;\n const loadingYoutubeDefer = /*#__PURE__*/new Deferred();\n const loadingVimeoDefer = /*#__PURE__*/new Deferred();\n\n class VideoWorker {\n constructor(url, options) {\n const self = this;\n self.url = url;\n self.options_default = {\n autoplay: false,\n loop: false,\n mute: false,\n volume: 100,\n showControls: true,\n accessibilityHidden: false,\n // start / end video time in seconds\n startTime: 0,\n endTime: 0\n };\n self.options = self.extend({}, self.options_default, options); // Fix wrong option name.\n // Thanks to https://github.com/nk-o/video-worker/issues/13.\n\n if (typeof self.options.showContols !== 'undefined') {\n self.options.showControls = self.options.showContols;\n delete self.options.showContols;\n } // check URL\n\n\n self.videoID = self.parseURL(url); // init\n\n if (self.videoID) {\n self.ID = ID;\n ID += 1;\n self.loadAPI();\n self.init();\n }\n } // Extend like jQuery.extend\n // eslint-disable-next-line class-methods-use-this\n\n\n extend(...args) {\n const out = args[0] || {};\n Object.keys(args).forEach(i => {\n if (!args[i]) {\n return;\n }\n\n Object.keys(args[i]).forEach(key => {\n out[key] = args[i][key];\n });\n });\n return out;\n }\n\n parseURL(url) {\n // parse youtube ID\n function getYoutubeID(ytUrl) {\n // eslint-disable-next-line no-useless-escape\n const regExp = /.*(?:youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=)([^#\\&\\?]*).*/;\n const match = ytUrl.match(regExp);\n return match && match[1].length === 11 ? match[1] : false;\n } // parse vimeo ID\n\n\n function getVimeoID(vmUrl) {\n // eslint-disable-next-line no-useless-escape\n const regExp = /https?:\\/\\/(?:www\\.|player\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|video\\/|)(\\d+)(?:$|\\/|\\?)/;\n const match = vmUrl.match(regExp);\n return match && match[3] ? match[3] : false;\n } // parse local string\n\n\n function getLocalVideos(locUrl) {\n // eslint-disable-next-line no-useless-escape\n const videoFormats = locUrl.split(/,(?=mp4\\:|webm\\:|ogv\\:|ogg\\:)/);\n const result = {};\n let ready = 0;\n videoFormats.forEach(val => {\n // eslint-disable-next-line no-useless-escape\n const match = val.match(/^(mp4|webm|ogv|ogg)\\:(.*)/);\n\n if (match && match[1] && match[2]) {\n // eslint-disable-next-line prefer-destructuring\n result[match[1] === 'ogv' ? 'ogg' : match[1]] = match[2];\n ready = 1;\n }\n });\n return ready ? result : false;\n }\n\n const Youtube = getYoutubeID(url);\n const Vimeo = getVimeoID(url);\n const Local = getLocalVideos(url);\n\n if (Youtube) {\n this.type = 'youtube';\n return Youtube;\n }\n\n if (Vimeo) {\n this.type = 'vimeo';\n return Vimeo;\n }\n\n if (Local) {\n this.type = 'local';\n return Local;\n }\n\n return false;\n }\n\n isValid() {\n return !!this.videoID;\n } // events\n\n\n on(name, callback) {\n this.userEventsList = this.userEventsList || []; // add new callback in events list\n\n (this.userEventsList[name] || (this.userEventsList[name] = [])).push(callback);\n }\n\n off(name, callback) {\n if (!this.userEventsList || !this.userEventsList[name]) {\n return;\n }\n\n if (!callback) {\n delete this.userEventsList[name];\n } else {\n this.userEventsList[name].forEach((val, key) => {\n if (val === callback) {\n this.userEventsList[name][key] = false;\n }\n });\n }\n }\n\n fire(name, ...args) {\n if (this.userEventsList && typeof this.userEventsList[name] !== 'undefined') {\n this.userEventsList[name].forEach(val => {\n // call with all arguments\n if (val) {\n val.apply(this, args);\n }\n });\n }\n }\n\n play(start) {\n const self = this;\n\n if (!self.player) {\n return;\n }\n\n if (self.type === 'youtube' && self.player.playVideo) {\n if (typeof start !== 'undefined') {\n self.player.seekTo(start || 0);\n }\n\n if (global$1$1.YT.PlayerState.PLAYING !== self.player.getPlayerState()) {\n self.player.playVideo();\n }\n }\n\n if (self.type === 'vimeo') {\n if (typeof start !== 'undefined') {\n self.player.setCurrentTime(start);\n }\n\n self.player.getPaused().then(paused => {\n if (paused) {\n self.player.play();\n }\n });\n }\n\n if (self.type === 'local') {\n if (typeof start !== 'undefined') {\n self.player.currentTime = start;\n }\n\n if (self.player.paused) {\n self.player.play();\n }\n }\n }\n\n pause() {\n const self = this;\n\n if (!self.player) {\n return;\n }\n\n if (self.type === 'youtube' && self.player.pauseVideo) {\n if (global$1$1.YT.PlayerState.PLAYING === self.player.getPlayerState()) {\n self.player.pauseVideo();\n }\n }\n\n if (self.type === 'vimeo') {\n self.player.getPaused().then(paused => {\n if (!paused) {\n self.player.pause();\n }\n });\n }\n\n if (self.type === 'local') {\n if (!self.player.paused) {\n self.player.pause();\n }\n }\n }\n\n mute() {\n const self = this;\n\n if (!self.player) {\n return;\n }\n\n if (self.type === 'youtube' && self.player.mute) {\n self.player.mute();\n }\n\n if (self.type === 'vimeo' && self.player.setVolume) {\n self.player.setVolume(0);\n }\n\n if (self.type === 'local') {\n self.$video.muted = true;\n }\n }\n\n unmute() {\n const self = this;\n\n if (!self.player) {\n return;\n }\n\n if (self.type === 'youtube' && self.player.mute) {\n self.player.unMute();\n }\n\n if (self.type === 'vimeo' && self.player.setVolume) {\n self.player.setVolume(self.options.volume);\n }\n\n if (self.type === 'local') {\n self.$video.muted = false;\n }\n }\n\n setVolume(volume = false) {\n const self = this;\n\n if (!self.player || !volume) {\n return;\n }\n\n if (self.type === 'youtube' && self.player.setVolume) {\n self.player.setVolume(volume);\n }\n\n if (self.type === 'vimeo' && self.player.setVolume) {\n self.player.setVolume(volume);\n }\n\n if (self.type === 'local') {\n self.$video.volume = volume / 100;\n }\n }\n\n getVolume(callback) {\n const self = this;\n\n if (!self.player) {\n callback(false);\n return;\n }\n\n if (self.type === 'youtube' && self.player.getVolume) {\n callback(self.player.getVolume());\n }\n\n if (self.type === 'vimeo' && self.player.getVolume) {\n self.player.getVolume().then(volume => {\n callback(volume);\n });\n }\n\n if (self.type === 'local') {\n callback(self.$video.volume * 100);\n }\n }\n\n getMuted(callback) {\n const self = this;\n\n if (!self.player) {\n callback(null);\n return;\n }\n\n if (self.type === 'youtube' && self.player.isMuted) {\n callback(self.player.isMuted());\n }\n\n if (self.type === 'vimeo' && self.player.getVolume) {\n self.player.getVolume().then(volume => {\n callback(!!volume);\n });\n }\n\n if (self.type === 'local') {\n callback(self.$video.muted);\n }\n }\n\n getImageURL(callback) {\n const self = this;\n\n if (self.videoImage) {\n callback(self.videoImage);\n return;\n }\n\n if (self.type === 'youtube') {\n const availableSizes = ['maxresdefault', 'sddefault', 'hqdefault', '0'];\n let step = 0;\n const tempImg = new Image();\n\n tempImg.onload = function () {\n // if no thumbnail, youtube add their own image with width = 120px\n if ((this.naturalWidth || this.width) !== 120 || step === availableSizes.length - 1) {\n // ok\n self.videoImage = `https://img.youtube.com/vi/${self.videoID}/${availableSizes[step]}.jpg`;\n callback(self.videoImage);\n } else {\n // try another size\n step += 1;\n this.src = `https://img.youtube.com/vi/${self.videoID}/${availableSizes[step]}.jpg`;\n }\n };\n\n tempImg.src = `https://img.youtube.com/vi/${self.videoID}/${availableSizes[step]}.jpg`;\n }\n\n if (self.type === 'vimeo') {\n let request = new XMLHttpRequest(); // https://vimeo.com/api/oembed.json?url=https://vimeo.com/235212527\n\n request.open('GET', `https://vimeo.com/api/oembed.json?url=${self.url}`, true);\n\n request.onreadystatechange = function () {\n if (this.readyState === 4) {\n if (this.status >= 200 && this.status < 400) {\n // Success!\n const response = JSON.parse(this.responseText);\n\n if (response.thumbnail_url) {\n self.videoImage = response.thumbnail_url;\n callback(self.videoImage);\n }\n }\n }\n };\n\n request.send();\n request = null;\n }\n } // fallback to the old version.\n\n\n getIframe(callback) {\n this.getVideo(callback);\n }\n\n getVideo(callback) {\n const self = this; // return generated video block\n\n if (self.$video) {\n callback(self.$video);\n return;\n } // generate new video block\n\n\n self.onAPIready(() => {\n let hiddenDiv;\n\n if (!self.$video) {\n hiddenDiv = document.createElement('div');\n hiddenDiv.style.display = 'none';\n } // Youtube\n\n\n if (self.type === 'youtube') {\n self.playerOptions = {\n // GDPR Compliance.\n host: 'https://www.youtube-nocookie.com',\n videoId: self.videoID,\n playerVars: {\n autohide: 1,\n rel: 0,\n autoplay: 0,\n // autoplay enable on mobile devices\n playsinline: 1\n }\n }; // hide controls\n\n if (!self.options.showControls) {\n self.playerOptions.playerVars.iv_load_policy = 3;\n self.playerOptions.playerVars.modestbranding = 1;\n self.playerOptions.playerVars.controls = 0;\n self.playerOptions.playerVars.showinfo = 0;\n self.playerOptions.playerVars.disablekb = 1;\n } // events\n\n\n let ytStarted;\n let ytProgressInterval;\n self.playerOptions.events = {\n onReady(e) {\n // mute\n if (self.options.mute) {\n e.target.mute();\n } else if (self.options.volume) {\n e.target.setVolume(self.options.volume);\n } // autoplay\n\n\n if (self.options.autoplay) {\n self.play(self.options.startTime);\n }\n\n self.fire('ready', e); // For seamless loops, set the endTime to 0.1 seconds less than the video's duration\n // https://github.com/nk-o/video-worker/issues/2\n\n if (self.options.loop && !self.options.endTime) {\n const secondsOffset = 0.1;\n self.options.endTime = self.player.getDuration() - secondsOffset;\n } // volumechange\n\n\n setInterval(() => {\n self.getVolume(volume => {\n if (self.options.volume !== volume) {\n self.options.volume = volume;\n self.fire('volumechange', e);\n }\n });\n }, 150);\n },\n\n onStateChange(e) {\n // loop\n if (self.options.loop && e.data === global$1$1.YT.PlayerState.ENDED) {\n self.play(self.options.startTime);\n }\n\n if (!ytStarted && e.data === global$1$1.YT.PlayerState.PLAYING) {\n ytStarted = 1;\n self.fire('started', e);\n }\n\n if (e.data === global$1$1.YT.PlayerState.PLAYING) {\n self.fire('play', e);\n }\n\n if (e.data === global$1$1.YT.PlayerState.PAUSED) {\n self.fire('pause', e);\n }\n\n if (e.data === global$1$1.YT.PlayerState.ENDED) {\n self.fire('ended', e);\n } // progress check\n\n\n if (e.data === global$1$1.YT.PlayerState.PLAYING) {\n ytProgressInterval = setInterval(() => {\n self.fire('timeupdate', e); // check for end of video and play again or stop\n\n if (self.options.endTime && self.player.getCurrentTime() >= self.options.endTime) {\n if (self.options.loop) {\n self.play(self.options.startTime);\n } else {\n self.pause();\n }\n }\n }, 150);\n } else {\n clearInterval(ytProgressInterval);\n }\n },\n\n onError(e) {\n self.fire('error', e);\n }\n\n };\n const firstInit = !self.$video;\n\n if (firstInit) {\n const div = document.createElement('div');\n div.setAttribute('id', self.playerID);\n hiddenDiv.appendChild(div);\n document.body.appendChild(hiddenDiv);\n }\n\n self.player = self.player || new global$1$1.YT.Player(self.playerID, self.playerOptions);\n\n if (firstInit) {\n self.$video = document.getElementById(self.playerID); // add accessibility attributes\n\n if (self.options.accessibilityHidden) {\n self.$video.setAttribute('tabindex', '-1');\n self.$video.setAttribute('aria-hidden', 'true');\n } // get video width and height\n\n\n self.videoWidth = parseInt(self.$video.getAttribute('width'), 10) || 1280;\n self.videoHeight = parseInt(self.$video.getAttribute('height'), 10) || 720;\n }\n } // Vimeo\n\n\n if (self.type === 'vimeo') {\n self.playerOptions = {\n // GDPR Compliance.\n dnt: 1,\n id: self.videoID,\n autopause: 0,\n transparent: 0,\n autoplay: self.options.autoplay ? 1 : 0,\n loop: self.options.loop ? 1 : 0,\n muted: self.options.mute ? 1 : 0\n };\n\n if (self.options.volume) {\n self.playerOptions.volume = self.options.volume;\n } // hide controls\n\n\n if (!self.options.showControls) {\n self.playerOptions.badge = 0;\n self.playerOptions.byline = 0;\n self.playerOptions.portrait = 0;\n self.playerOptions.title = 0;\n self.playerOptions.background = 1;\n }\n\n if (!self.$video) {\n let playerOptionsString = '';\n Object.keys(self.playerOptions).forEach(key => {\n if (playerOptionsString !== '') {\n playerOptionsString += '&';\n }\n\n playerOptionsString += `${key}=${encodeURIComponent(self.playerOptions[key])}`;\n }); // we need to create iframe manually because when we create it using API\n // js events won't triggers after iframe moved to another place\n\n self.$video = document.createElement('iframe');\n self.$video.setAttribute('id', self.playerID);\n self.$video.setAttribute('src', `https://player.vimeo.com/video/${self.videoID}?${playerOptionsString}`);\n self.$video.setAttribute('frameborder', '0');\n self.$video.setAttribute('mozallowfullscreen', '');\n self.$video.setAttribute('allowfullscreen', '');\n self.$video.setAttribute('title', 'Vimeo video player'); // add accessibility attributes\n\n if (self.options.accessibilityHidden) {\n self.$video.setAttribute('tabindex', '-1');\n self.$video.setAttribute('aria-hidden', 'true');\n }\n\n hiddenDiv.appendChild(self.$video);\n document.body.appendChild(hiddenDiv);\n }\n\n self.player = self.player || new global$1$1.Vimeo.Player(self.$video, self.playerOptions); // set current time for autoplay\n\n if (self.options.startTime && self.options.autoplay) {\n self.player.setCurrentTime(self.options.startTime);\n } // get video width and height\n\n\n self.player.getVideoWidth().then(width => {\n self.videoWidth = width || 1280;\n });\n self.player.getVideoHeight().then(height => {\n self.videoHeight = height || 720;\n }); // events\n\n let vmStarted;\n self.player.on('timeupdate', e => {\n if (!vmStarted) {\n self.fire('started', e);\n vmStarted = 1;\n }\n\n self.fire('timeupdate', e); // check for end of video and play again or stop\n\n if (self.options.endTime) {\n if (self.options.endTime && e.seconds >= self.options.endTime) {\n if (self.options.loop) {\n self.play(self.options.startTime);\n } else {\n self.pause();\n }\n }\n }\n });\n self.player.on('play', e => {\n self.fire('play', e); // check for the start time and start with it\n\n if (self.options.startTime && e.seconds === 0) {\n self.play(self.options.startTime);\n }\n });\n self.player.on('pause', e => {\n self.fire('pause', e);\n });\n self.player.on('ended', e => {\n self.fire('ended', e);\n });\n self.player.on('loaded', e => {\n self.fire('ready', e);\n });\n self.player.on('volumechange', e => {\n self.fire('volumechange', e);\n });\n self.player.on('error', e => {\n self.fire('error', e);\n });\n } // Local\n\n\n function addSourceToLocal(element, src, type) {\n const source = document.createElement('source');\n source.src = src;\n source.type = type;\n element.appendChild(source);\n }\n\n if (self.type === 'local') {\n if (!self.$video) {\n self.$video = document.createElement('video'); // show controls\n\n if (self.options.showControls) {\n self.$video.controls = true;\n } // mute\n\n\n if (self.options.mute) {\n self.$video.muted = true;\n } else if (self.$video.volume) {\n self.$video.volume = self.options.volume / 100;\n } // loop\n\n\n if (self.options.loop) {\n self.$video.loop = true;\n } // autoplay enable on mobile devices\n\n\n self.$video.setAttribute('playsinline', '');\n self.$video.setAttribute('webkit-playsinline', ''); // add accessibility attributes\n\n if (self.options.accessibilityHidden) {\n self.$video.setAttribute('tabindex', '-1');\n self.$video.setAttribute('aria-hidden', 'true');\n }\n\n self.$video.setAttribute('id', self.playerID);\n hiddenDiv.appendChild(self.$video);\n document.body.appendChild(hiddenDiv);\n Object.keys(self.videoID).forEach(key => {\n addSourceToLocal(self.$video, self.videoID[key], `video/${key}`);\n });\n }\n\n self.player = self.player || self.$video;\n let locStarted;\n self.player.addEventListener('playing', e => {\n if (!locStarted) {\n self.fire('started', e);\n }\n\n locStarted = 1;\n });\n self.player.addEventListener('timeupdate', function (e) {\n self.fire('timeupdate', e); // check for end of video and play again or stop\n\n if (self.options.endTime) {\n if (self.options.endTime && this.currentTime >= self.options.endTime) {\n if (self.options.loop) {\n self.play(self.options.startTime);\n } else {\n self.pause();\n }\n }\n }\n });\n self.player.addEventListener('play', e => {\n self.fire('play', e);\n });\n self.player.addEventListener('pause', e => {\n self.fire('pause', e);\n });\n self.player.addEventListener('ended', e => {\n self.fire('ended', e);\n });\n self.player.addEventListener('loadedmetadata', function () {\n // get video width and height\n self.videoWidth = this.videoWidth || 1280;\n self.videoHeight = this.videoHeight || 720;\n self.fire('ready'); // autoplay\n\n if (self.options.autoplay) {\n self.play(self.options.startTime);\n }\n });\n self.player.addEventListener('volumechange', e => {\n self.getVolume(volume => {\n self.options.volume = volume;\n });\n self.fire('volumechange', e);\n });\n self.player.addEventListener('error', e => {\n self.fire('error', e);\n });\n }\n\n callback(self.$video);\n });\n }\n\n init() {\n const self = this;\n self.playerID = `VideoWorker-${self.ID}`;\n }\n\n loadAPI() {\n const self = this;\n\n if (YoutubeAPIadded && VimeoAPIadded) {\n return;\n }\n\n let src = ''; // load Youtube API\n\n if (self.type === 'youtube' && !YoutubeAPIadded) {\n YoutubeAPIadded = 1;\n src = 'https://www.youtube.com/iframe_api';\n } // load Vimeo API\n\n\n if (self.type === 'vimeo' && !VimeoAPIadded) {\n VimeoAPIadded = 1; // Useful when Vimeo API added using RequireJS https://github.com/nk-o/video-worker/pull/7\n\n if (typeof global$1$1.Vimeo !== 'undefined') {\n return;\n }\n\n src = 'https://player.vimeo.com/api/player.js';\n }\n\n if (!src) {\n return;\n } // add script in head section\n\n\n let tag = document.createElement('script');\n let head = document.getElementsByTagName('head')[0];\n tag.src = src;\n head.appendChild(tag);\n head = null;\n tag = null;\n }\n\n onAPIready(callback) {\n const self = this; // Youtube\n\n if (self.type === 'youtube') {\n // Listen for global YT player callback\n if ((typeof global$1$1.YT === 'undefined' || global$1$1.YT.loaded === 0) && !loadingYoutubePlayer) {\n // Prevents Ready event from being called twice\n loadingYoutubePlayer = 1; // Creates deferred so, other players know when to wait.\n\n global$1$1.onYouTubeIframeAPIReady = function () {\n global$1$1.onYouTubeIframeAPIReady = null;\n loadingYoutubeDefer.resolve('done');\n callback();\n };\n } else if (typeof global$1$1.YT === 'object' && global$1$1.YT.loaded === 1) {\n callback();\n } else {\n loadingYoutubeDefer.done(() => {\n callback();\n });\n }\n } // Vimeo\n\n\n if (self.type === 'vimeo') {\n if (typeof global$1$1.Vimeo === 'undefined' && !loadingVimeoPlayer) {\n loadingVimeoPlayer = 1;\n const vimeoInterval = setInterval(() => {\n if (typeof global$1$1.Vimeo !== 'undefined') {\n clearInterval(vimeoInterval);\n loadingVimeoDefer.resolve('done');\n callback();\n }\n }, 20);\n } else if (typeof global$1$1.Vimeo !== 'undefined') {\n callback();\n } else {\n loadingVimeoDefer.done(() => {\n callback();\n });\n }\n } // Local\n\n\n if (self.type === 'local') {\n callback();\n }\n }\n\n }\n\n function ready(callback) {\n if ('complete' === document.readyState || 'interactive' === document.readyState) {\n // Already ready or interactive, execute callback\n callback();\n } else {\n document.addEventListener('DOMContentLoaded', callback, {\n capture: true,\n once: true,\n passive: true\n });\n }\n }\n\n /* eslint-disable import/no-mutable-exports */\n\n /* eslint-disable no-restricted-globals */\n let win;\n\n if ('undefined' !== typeof window) {\n win = window;\n } else if ('undefined' !== typeof global) {\n win = global;\n } else if ('undefined' !== typeof self) {\n win = self;\n } else {\n win = {};\n }\n\n var global$1 = win;\n\n function jarallaxVideo(jarallax = global$1.jarallax) {\n if ('undefined' === typeof jarallax) {\n return;\n }\n\n const Jarallax = jarallax.constructor; // append video after when block will be visible.\n\n const defOnScroll = Jarallax.prototype.onScroll;\n\n Jarallax.prototype.onScroll = function () {\n const self = this;\n defOnScroll.apply(self);\n const isReady = !self.isVideoInserted && self.video && (!self.options.videoLazyLoading || self.isElementInViewport) && !self.options.disableVideo();\n\n if (isReady) {\n self.isVideoInserted = true;\n self.video.getVideo(video => {\n const $parent = video.parentNode;\n self.css(video, {\n position: self.image.position,\n top: '0px',\n left: '0px',\n right: '0px',\n bottom: '0px',\n width: '100%',\n height: '100%',\n maxWidth: 'none',\n maxHeight: 'none',\n pointerEvents: 'none',\n transformStyle: 'preserve-3d',\n backfaceVisibility: 'hidden',\n willChange: 'transform,opacity',\n margin: 0,\n zIndex: -1\n });\n self.$video = video; // add Poster attribute to self-hosted video\n\n if ('local' === self.video.type) {\n if (self.image.src) {\n self.$video.setAttribute('poster', self.image.src);\n } else if (self.image.$item && 'IMG' === self.image.$item.tagName && self.image.$item.src) {\n self.$video.setAttribute('poster', self.image.$item.src);\n }\n } // insert video tag\n\n\n self.image.$container.appendChild(video); // remove parent video element (created by VideoWorker)\n\n $parent.parentNode.removeChild($parent); // call onVideoInsert event\n\n if (self.options.onVideoInsert) {\n self.options.onVideoInsert.call(self);\n }\n });\n }\n }; // cover video\n\n\n const defCoverImage = Jarallax.prototype.coverImage;\n\n Jarallax.prototype.coverImage = function () {\n const self = this;\n const imageData = defCoverImage.apply(self);\n const node = self.image.$item ? self.image.$item.nodeName : false;\n\n if (imageData && self.video && node && ('IFRAME' === node || 'VIDEO' === node)) {\n let h = imageData.image.height;\n let w = h * self.image.width / self.image.height;\n let ml = (imageData.container.width - w) / 2;\n let mt = imageData.image.marginTop;\n\n if (imageData.container.width > w) {\n w = imageData.container.width;\n h = w * self.image.height / self.image.width;\n ml = 0;\n mt += (imageData.image.height - h) / 2;\n } // add video height over than need to hide controls\n\n\n if ('IFRAME' === node) {\n h += 400;\n mt -= 200;\n }\n\n self.css(self.$video, {\n width: `${w}px`,\n marginLeft: `${ml}px`,\n height: `${h}px`,\n marginTop: `${mt}px`\n });\n }\n\n return imageData;\n }; // init video\n\n\n const defInitImg = Jarallax.prototype.initImg;\n\n Jarallax.prototype.initImg = function () {\n const self = this;\n const defaultResult = defInitImg.apply(self);\n\n if (!self.options.videoSrc) {\n self.options.videoSrc = self.$item.getAttribute('data-jarallax-video') || null;\n }\n\n if (self.options.videoSrc) {\n self.defaultInitImgResult = defaultResult;\n return true;\n }\n\n return defaultResult;\n };\n\n const defCanInitParallax = Jarallax.prototype.canInitParallax;\n\n Jarallax.prototype.canInitParallax = function () {\n const self = this;\n let defaultResult = defCanInitParallax.apply(self);\n\n if (!self.options.videoSrc) {\n return defaultResult;\n } // Init video api\n\n\n const video = new VideoWorker(self.options.videoSrc, {\n autoplay: true,\n loop: self.options.videoLoop,\n showControls: false,\n accessibilityHidden: true,\n startTime: self.options.videoStartTime || 0,\n endTime: self.options.videoEndTime || 0,\n mute: self.options.videoVolume ? 0 : 1,\n volume: self.options.videoVolume || 0\n }); // call onVideoWorkerInit event\n\n if (self.options.onVideoWorkerInit) {\n self.options.onVideoWorkerInit.call(self, video);\n }\n\n function resetDefaultImage() {\n if (self.image.$default_item) {\n self.image.$item = self.image.$default_item;\n self.image.$item.style.display = 'block'; // set image width and height\n\n self.coverImage();\n self.onScroll();\n }\n }\n\n if (video.isValid()) {\n // Force enable parallax.\n // When the parallax disabled on mobile devices, we still need to display videos.\n // https://github.com/nk-o/jarallax/issues/159\n if (this.options.disableParallax()) {\n defaultResult = true;\n self.image.position = 'absolute';\n self.options.type = 'scroll';\n self.options.speed = 1;\n } // if parallax will not be inited, we can add thumbnail on background.\n\n\n if (!defaultResult) {\n if (!self.defaultInitImgResult) {\n video.getImageURL(url => {\n // save default user styles\n const curStyle = self.$item.getAttribute('style');\n\n if (curStyle) {\n self.$item.setAttribute('data-jarallax-original-styles', curStyle);\n } // set new background\n\n\n self.css(self.$item, {\n 'background-image': `url(\"${url}\")`,\n 'background-position': 'center',\n 'background-size': 'cover'\n });\n });\n } // init video\n\n } else {\n video.on('ready', () => {\n if (self.options.videoPlayOnlyVisible) {\n const oldOnScroll = self.onScroll;\n\n self.onScroll = function () {\n oldOnScroll.apply(self);\n\n if (!self.videoError && (self.options.videoLoop || !self.options.videoLoop && !self.videoEnded)) {\n if (self.isVisible()) {\n video.play();\n } else {\n video.pause();\n }\n }\n };\n } else {\n video.play();\n }\n });\n video.on('started', () => {\n self.image.$default_item = self.image.$item;\n self.image.$item = self.$video; // set video width and height\n\n self.image.width = self.video.videoWidth || 1280;\n self.image.height = self.video.videoHeight || 720;\n self.coverImage();\n self.onScroll(); // hide image\n\n if (self.image.$default_item) {\n self.image.$default_item.style.display = 'none';\n }\n });\n video.on('ended', () => {\n self.videoEnded = true;\n\n if (!self.options.videoLoop) {\n // show default image if Loop disabled.\n resetDefaultImage();\n }\n });\n video.on('error', () => {\n self.videoError = true; // show default image if video loading error.\n\n resetDefaultImage();\n });\n self.video = video; // set image if not exists\n\n if (!self.defaultInitImgResult) {\n // set empty image on self-hosted video if not defined\n self.image.src = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\n\n if ('local' !== video.type) {\n video.getImageURL(url => {\n self.image.bgImage = `url(\"${url}\")`;\n self.init();\n });\n return false;\n }\n }\n }\n }\n\n return defaultResult;\n }; // Destroy video parallax\n\n\n const defDestroy = Jarallax.prototype.destroy;\n\n Jarallax.prototype.destroy = function () {\n const self = this;\n\n if (self.image.$default_item) {\n self.image.$item = self.image.$default_item;\n delete self.image.$default_item;\n }\n\n defDestroy.apply(self);\n };\n }\n\n jarallaxVideo(); // data-jarallax-video initialization\n\n ready(() => {\n if ('undefined' !== typeof global$1.jarallax) {\n global$1.jarallax(document.querySelectorAll('[data-jarallax-video]'));\n }\n }); // We should add VideoWorker globally, since some project uses it.\n\n if (!global$1.VideoWorker) {\n global$1.VideoWorker = VideoWorker;\n }\n\n return jarallaxVideo;\n\n}));\n//# sourceMappingURL=jarallax-video.js.map\n","Magento_PageBuilder/js/resource/jarallax/jarallax-wrapper.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_PageBuilder/js/resource/jarallax/jarallax'\n], function(jarallax){\n 'use strict';\n\n window.jarallax = window.jarallax || jarallax;\n});\n","Magento_PageBuilder/js/resource/slick/slick.min.js":"/*\n _ _ _ _\n ___| (_) ___| | __ (_)___\n/ __| | |/ __| |/ / | / __|\n\\__ \\ | | (__| < _ | \\__ \\\n|___/_|_|\\___|_|\\_(_)/ |___/\n |__/\n\n Version: 1.9.0\n Author: Ken Wheeler\n Website: http://kenwheeler.github.io\n Docs: http://kenwheeler.github.io/slick\n Repo: http://github.com/kenwheeler/slick\n Issues: http://github.com/kenwheeler/slick/issues\n\n */\n(function(i){\"use strict\";\"function\"==typeof define&&define.amd?define([\"jquery\"],i):\"undefined\"!=typeof exports?module.exports=i(require(\"jquery\")):i(jQuery)})(function(i){\"use strict\";var e=window.Slick||{};e=function(){function e(e,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(e),appendDots:i(e),arrows:!0,asNavFor:null,prevArrow:'<button class=\"slick-prev\" aria-label=\"Previous\" type=\"button\">Previous</button>',nextArrow:'<button class=\"slick-next\" aria-label=\"Next\" type=\"button\">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:\"50px\",cssEase:\"ease\",customPaging:function(e,t){return i('<button type=\"button\" />').text(t+1)},dots:!1,dotsClass:\"slick-dots\",draggable:!0,easing:\"linear\",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:\"ondemand\",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:\"window\",responsive:null,rows:1,rtl:!1,slide:\"\",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden=\"hidden\",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(e),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange=\"visibilitychange\",n.windowWidth=0,n.windowTimer=null,s=i(e).data(\"slick\")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,\"undefined\"!=typeof document.mozHidden?(n.hidden=\"mozHidden\",n.visibilityChange=\"mozvisibilitychange\"):\"undefined\"!=typeof document.webkitHidden&&(n.hidden=\"webkitHidden\",n.visibilityChange=\"webkitvisibilitychange\"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=t++,n.htmlExpr=/^(?:\\s*(<[\\w\\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}var t=0;return e}(),e.prototype.activateADA=function(){var i=this;i.$slideTrack.find(\".slick-active\").attr({\"aria-hidden\":\"false\"}).find(\"a, input, button, select\").attr({tabindex:\"0\"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if(\"boolean\"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),\"number\"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):o===!0?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr(\"data-slick-index\",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),s.options.rtl===!0&&s.options.vertical===!1&&(e=-e),s.transformsEnabled===!1?s.options.vertical===!1?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):s.cssTransitions===!1?(s.options.rtl===!0&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),s.options.vertical===!1?(o[s.animType]=\"translate(\"+i+\"px, 0px)\",s.$slideTrack.css(o)):(o[s.animType]=\"translate(0px,\"+i+\"px)\",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),s.options.vertical===!1?o[s.animType]=\"translate3d(\"+e+\"px, 0px, 0px)\":o[s.animType]=\"translate3d(0px,\"+e+\"px, 0px)\",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this,o=t.getNavTarget();null!==o&&\"object\"==typeof o&&o.each(function(){var t=i(this).slick(\"getSlick\");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};e.options.fade===!1?t[e.transitionType]=e.transformType+\" \"+e.options.speed+\"ms \"+e.options.cssEase:t[e.transitionType]=\"opacity \"+e.options.speed+\"ms \"+e.options.cssEase,e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(i.options.infinite===!1&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1===0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;e.options.arrows===!0&&(e.$prevArrow=i(e.options.prevArrow).addClass(\"slick-arrow\"),e.$nextArrow=i(e.options.nextArrow).addClass(\"slick-arrow\"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass(\"slick-hidden\").removeAttr(\"aria-hidden tabindex\"),e.$nextArrow.removeClass(\"slick-hidden\").removeAttr(\"aria-hidden tabindex\"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),e.options.infinite!==!0&&e.$prevArrow.addClass(\"slick-disabled\").attr(\"aria-disabled\",\"true\")):e.$prevArrow.add(e.$nextArrow).addClass(\"slick-hidden\").attr({\"aria-disabled\":\"true\",tabindex:\"-1\"}))},e.prototype.buildDots=function(){var e,t,o=this;if(o.options.dots===!0&&o.slideCount>o.options.slidesToShow){for(o.$slider.addClass(\"slick-dotted\"),t=i(\"<ul />\").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i(\"<li />\").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find(\"li\").first().addClass(\"slick-active\")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+\":not(.slick-cloned)\").addClass(\"slick-slide\"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr(\"data-slick-index\",e).data(\"originalStyling\",i(t).attr(\"style\")||\"\")}),e.$slider.addClass(\"slick-slider\"),e.$slideTrack=0===e.slideCount?i('<div class=\"slick-track\"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class=\"slick-track\"/>').parent(),e.$list=e.$slideTrack.wrap('<div class=\"slick-list\"/>').parent(),e.$slideTrack.css(\"opacity\",0),e.options.centerMode!==!0&&e.options.swipeToSlide!==!0||(e.options.slidesToScroll=1),i(\"img[data-lazy]\",e.$slider).not(\"[src]\").addClass(\"slick-loading\"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses(\"number\"==typeof e.currentSlide?e.currentSlide:0),e.options.draggable===!0&&e.$list.addClass(\"draggable\")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.options.rows>0){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement(\"div\");for(e=0;e<l.options.rows;e++){var a=document.createElement(\"div\");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+\"%\",display:\"inline-block\"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if(\"window\"===r.respondTo?n=a:\"slider\"===r.respondTo?n=d:\"min\"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(r.originalSettings.mobileFirst===!1?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,\"unslick\"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,\"unslick\"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||l===!1||r.$slider.trigger(\"breakpoint\",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is(\"a\")&&e.preventDefault(),l.is(\"li\")||(l=l.closest(\"li\")),n=r.slideCount%r.options.slidesToScroll!==0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case\"previous\":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case\"next\":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case\"index\":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger(\"focus\");break;default:return}},e.prototype.checkNavigable=function(i){var e,t,o=this;if(e=o.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var s in e){if(i<e[s]){i=t;break}t=e[s]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i(\"li\",e.$dots).off(\"click.slick\",e.changeSlide).off(\"mouseenter.slick\",i.proxy(e.interrupt,e,!0)).off(\"mouseleave.slick\",i.proxy(e.interrupt,e,!1)),e.options.accessibility===!0&&e.$dots.off(\"keydown.slick\",e.keyHandler)),e.$slider.off(\"focus.slick blur.slick\"),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off(\"click.slick\",e.changeSlide),e.$nextArrow&&e.$nextArrow.off(\"click.slick\",e.changeSlide),e.options.accessibility===!0&&(e.$prevArrow&&e.$prevArrow.off(\"keydown.slick\",e.keyHandler),e.$nextArrow&&e.$nextArrow.off(\"keydown.slick\",e.keyHandler))),e.$list.off(\"touchstart.slick mousedown.slick\",e.swipeHandler),e.$list.off(\"touchmove.slick mousemove.slick\",e.swipeHandler),e.$list.off(\"touchend.slick mouseup.slick\",e.swipeHandler),e.$list.off(\"touchcancel.slick mouseleave.slick\",e.swipeHandler),e.$list.off(\"click.slick\",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),e.options.accessibility===!0&&e.$list.off(\"keydown.slick\",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().off(\"click.slick\",e.selectHandler),i(window).off(\"orientationchange.slick.slick-\"+e.instanceUid,e.orientationChange),i(window).off(\"resize.slick.slick-\"+e.instanceUid,e.resize),i(\"[draggable!=true]\",e.$slideTrack).off(\"dragstart\",e.preventDefault),i(window).off(\"load.slick.slick-\"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off(\"mouseenter.slick\",i.proxy(e.interrupt,e,!0)),e.$list.off(\"mouseleave.slick\",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>0&&(i=e.$slides.children().children(),i.removeAttr(\"style\"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){var e=this;e.shouldClick===!1&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(\".slick-cloned\",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass(\"slick-disabled slick-arrow slick-hidden\").removeAttr(\"aria-hidden aria-disabled tabindex\").css(\"display\",\"\"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass(\"slick-disabled slick-arrow slick-hidden\").removeAttr(\"aria-hidden aria-disabled tabindex\").css(\"display\",\"\"),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass(\"slick-slide slick-active slick-center slick-visible slick-current\").removeAttr(\"aria-hidden\").removeAttr(\"data-slick-index\").each(function(){i(this).attr(\"style\",i(this).data(\"originalStyling\"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass(\"slick-slider\"),t.$slider.removeClass(\"slick-initialized\"),t.$slider.removeClass(\"slick-dotted\"),t.unslicked=!0,e||t.$slider.trigger(\"destroy\",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]=\"\",e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;t.cssTransitions===!1?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;e.cssTransitions===!1?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off(\"focus.slick blur.slick\").on(\"focus.slick\",\"*\",function(t){var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&o.is(\":focus\")&&(e.focussed=!0,e.autoPlay())},0)}).on(\"blur.slick\",\"*\",function(t){i(this);e.options.pauseOnFocus&&(e.focussed=!1,e.autoPlay())})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){var i=this;return i.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(i.options.infinite===!0)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(i.options.centerMode===!0)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),n.options.infinite===!0?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,n.options.vertical===!0&&n.options.centerMode===!0&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!==0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),n.options.centerMode===!0&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:n.options.centerMode===!0&&n.options.infinite===!0?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:n.options.centerMode===!0&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=n.options.vertical===!1?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,n.options.variableWidth===!0&&(o=n.slideCount<=n.options.slidesToShow||n.options.infinite===!1?n.$slideTrack.children(\".slick-slide\").eq(i):n.$slideTrack.children(\".slick-slide\").eq(i+n.options.slidesToShow),e=n.options.rtl===!0?o[0]?(n.$slideTrack.width()-o[0].offsetLeft-o.width())*-1:0:o[0]?o[0].offsetLeft*-1:0,n.options.centerMode===!0&&(o=n.slideCount<=n.options.slidesToShow||n.options.infinite===!1?n.$slideTrack.children(\".slick-slide\").eq(i):n.$slideTrack.children(\".slick-slide\").eq(i+n.options.slidesToShow+1),e=n.options.rtl===!0?o[0]?(n.$slideTrack.width()-o[0].offsetLeft-o.width())*-1:0:o[0]?o[0].offsetLeft*-1:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){var e=this;return e.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(e.options.infinite===!1?i=e.slideCount:(t=e.options.slidesToScroll*-1,o=e.options.slidesToScroll*-1,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o,s,n=this;return s=n.options.centerMode===!0?Math.floor(n.$list.width()/2):0,o=n.swipeLeft*-1+s,n.options.swipeToSlide===!0?(n.$slideTrack.find(\".slick-slide\").each(function(e,s){var r,l,d;if(r=i(s).outerWidth(),l=s.offsetLeft,n.options.centerMode!==!0&&(l+=r/2),d=l+r,o<d)return t=s,!1}),e=Math.abs(i(t).attr(\"data-slick-index\")-n.currentSlide)||1):n.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){var t=this;t.changeSlide({data:{message:\"index\",index:parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass(\"slick-initialized\")||(i(t.$slider).addClass(\"slick-initialized\"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger(\"init\",[t]),t.options.accessibility===!0&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(\".slick-cloned\")).attr({\"aria-hidden\":\"true\",tabindex:\"-1\"}).find(\"a, input, button, select\").attr({tabindex:\"-1\"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(\".slick-cloned\")).each(function(t){var s=o.indexOf(t);if(i(this).attr({role:\"tabpanel\",id:\"slick-slide\"+e.instanceUid+t,tabindex:-1}),s!==-1){var n=\"slick-slide-control\"+e.instanceUid+s;i(\"#\"+n).length&&i(this).attr({\"aria-describedby\":n})}}),e.$dots.attr(\"role\",\"tablist\").find(\"li\").each(function(s){var n=o[s];i(this).attr({role:\"presentation\"}),i(this).find(\"button\").first().attr({role:\"tab\",id:\"slick-slide-control\"+e.instanceUid+s,\"aria-controls\":\"slick-slide\"+e.instanceUid+n,\"aria-label\":s+1+\" of \"+t,\"aria-selected\":null,tabindex:\"-1\"})}).eq(e.currentSlide).find(\"button\").attr({\"aria-selected\":\"true\",tabindex:\"0\"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.options.focusOnChange?e.$slides.eq(s).attr({tabindex:\"0\"}):e.$slides.eq(s).removeAttr(\"tabindex\");e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off(\"click.slick\").on(\"click.slick\",{message:\"previous\"},i.changeSlide),i.$nextArrow.off(\"click.slick\").on(\"click.slick\",{message:\"next\"},i.changeSlide),i.options.accessibility===!0&&(i.$prevArrow.on(\"keydown.slick\",i.keyHandler),i.$nextArrow.on(\"keydown.slick\",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;e.options.dots===!0&&e.slideCount>e.options.slidesToShow&&(i(\"li\",e.$dots).on(\"click.slick\",{message:\"index\"},e.changeSlide),e.options.accessibility===!0&&e.$dots.on(\"keydown.slick\",e.keyHandler)),e.options.dots===!0&&e.options.pauseOnDotsHover===!0&&e.slideCount>e.options.slidesToShow&&i(\"li\",e.$dots).on(\"mouseenter.slick\",i.proxy(e.interrupt,e,!0)).on(\"mouseleave.slick\",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on(\"mouseenter.slick\",i.proxy(e.interrupt,e,!0)),e.$list.on(\"mouseleave.slick\",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on(\"touchstart.slick mousedown.slick\",{action:\"start\"},e.swipeHandler),e.$list.on(\"touchmove.slick mousemove.slick\",{action:\"move\"},e.swipeHandler),e.$list.on(\"touchend.slick mouseup.slick\",{action:\"end\"},e.swipeHandler),e.$list.on(\"touchcancel.slick mouseleave.slick\",{action:\"end\"},e.swipeHandler),e.$list.on(\"click.slick\",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),e.options.accessibility===!0&&e.$list.on(\"keydown.slick\",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on(\"click.slick\",e.selectHandler),i(window).on(\"orientationchange.slick.slick-\"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on(\"resize.slick.slick-\"+e.instanceUid,i.proxy(e.resize,e)),i(\"[draggable!=true]\",e.$slideTrack).on(\"dragstart\",e.preventDefault),i(window).on(\"load.slick.slick-\"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match(\"TEXTAREA|INPUT|SELECT\")||(37===i.keyCode&&e.options.accessibility===!0?e.changeSlide({data:{message:e.options.rtl===!0?\"next\":\"previous\"}}):39===i.keyCode&&e.options.accessibility===!0&&e.changeSlide({data:{message:e.options.rtl===!0?\"previous\":\"next\"}}))},e.prototype.lazyLoad=function(){function e(e){i(\"img[data-lazy]\",e).each(function(){var e=i(this),t=i(this).attr(\"data-lazy\"),o=i(this).attr(\"data-srcset\"),s=i(this).attr(\"data-sizes\")||r.$slider.attr(\"data-sizes\"),n=document.createElement(\"img\");n.onload=function(){e.animate({opacity:0},100,function(){o&&(e.attr(\"srcset\",o),s&&e.attr(\"sizes\",s)),e.attr(\"src\",t).animate({opacity:1},200,function(){e.removeAttr(\"data-lazy data-srcset data-sizes\").removeClass(\"slick-loading\")}),r.$slider.trigger(\"lazyLoaded\",[r,e,t])})},n.onerror=function(){e.removeAttr(\"data-lazy\").removeClass(\"slick-loading\").addClass(\"slick-lazyload-error\"),r.$slider.trigger(\"lazyLoadError\",[r,e,t])},n.src=t})}var t,o,s,n,r=this;if(r.options.centerMode===!0?r.options.infinite===!0?(s=r.currentSlide+(r.options.slidesToShow/2+1),n=s+r.options.slidesToShow+2):(s=Math.max(0,r.currentSlide-(r.options.slidesToShow/2+1)),n=2+(r.options.slidesToShow/2+1)+r.currentSlide):(s=r.options.infinite?r.options.slidesToShow+r.currentSlide:r.currentSlide,n=Math.ceil(s+r.options.slidesToShow),r.options.fade===!0&&(s>0&&s--,n<=r.slideCount&&n++)),t=r.$slider.find(\".slick-slide\").slice(s,n),\"anticipated\"===r.options.lazyLoad)for(var l=s-1,d=n,a=r.$slider.find(\".slick-slide\"),c=0;c<r.options.slidesToScroll;c++)l<0&&(l=r.slideCount-1),t=t.add(a.eq(l)),t=t.add(a.eq(d)),l--,d++;e(t),r.slideCount<=r.options.slidesToShow?(o=r.$slider.find(\".slick-slide\"),e(o)):r.currentSlide>=r.slideCount-r.options.slidesToShow?(o=r.$slider.find(\".slick-cloned\").slice(0,r.options.slidesToShow),e(o)):0===r.currentSlide&&(o=r.$slider.find(\".slick-cloned\").slice(r.options.slidesToShow*-1),e(o))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass(\"slick-loading\"),i.initUI(),\"progressive\"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){var i=this;i.changeSlide({data:{message:\"next\"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;if(!t.unslicked&&(t.$slider.trigger(\"afterChange\",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),t.options.accessibility===!0&&(t.initADA(),t.options.focusOnChange))){var o=i(t.$slides.get(t.currentSlide));o.attr(\"tabindex\",0).focus()}},e.prototype.prev=e.prototype.slickPrev=function(){var i=this;i.changeSlide({data:{message:\"previous\"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i(\"img[data-lazy]\",l.$slider);d.length?(t=d.first(),o=t.attr(\"data-lazy\"),s=t.attr(\"data-srcset\"),n=t.attr(\"data-sizes\")||l.$slider.attr(\"data-sizes\"),r=document.createElement(\"img\"),r.onload=function(){s&&(t.attr(\"srcset\",s),n&&t.attr(\"sizes\",n)),t.attr(\"src\",o).removeAttr(\"data-lazy data-srcset data-sizes\").removeClass(\"slick-loading\"),l.options.adaptiveHeight===!0&&l.setPosition(),l.$slider.trigger(\"lazyLoaded\",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr(\"data-lazy\").removeClass(\"slick-loading\").addClass(\"slick-lazyload-error\"),l.$slider.trigger(\"lazyLoadError\",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger(\"allImagesLoaded\",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:\"index\",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if(\"array\"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||\"window\";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass(\"slick-slide\"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on(\"click.slick\",e.selectHandler),e.setSlideClasses(\"number\"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger(\"reInit\",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;return\"boolean\"==typeof i?(e=i,i=e===!0?0:o.slideCount-1):i=e===!0?--i:i,!(o.slideCount<1||i<0||i>o.slideCount-1)&&(o.unload(),t===!0?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,void o.reinit())},e.prototype.setCSS=function(i){var e,t,o=this,s={};o.options.rtl===!0&&(i=-i),e=\"left\"==o.positionProp?Math.ceil(i)+\"px\":\"0px\",t=\"top\"==o.positionProp?Math.ceil(i)+\"px\":\"0px\",s[o.positionProp]=i,o.transformsEnabled===!1?o.$slideTrack.css(s):(s={},o.cssTransitions===!1?(s[o.animType]=\"translate(\"+e+\", \"+t+\")\",o.$slideTrack.css(s)):(s[o.animType]=\"translate3d(\"+e+\", \"+t+\", 0px)\",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;i.options.vertical===!1?i.options.centerMode===!0&&i.$list.css({padding:\"0px \"+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),i.options.centerMode===!0&&i.$list.css({padding:i.options.centerPadding+\" 0px\"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),i.options.vertical===!1&&i.options.variableWidth===!1?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(\".slick-slide\").length))):i.options.variableWidth===!0?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(\".slick-slide\").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();i.options.variableWidth===!1&&i.$slideTrack.children(\".slick-slide\").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,t.options.rtl===!0?i(s).css({position:\"relative\",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}):i(s).css({position:\"relative\",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css(\"height\",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if(\"object\"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n=\"multiple\"):\"string\"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],\"responsive\"===arguments[0]&&\"array\"===i.type(arguments[1])?n=\"responsive\":\"undefined\"!=typeof arguments[1]&&(n=\"single\")),\"single\"===n)r.options[o]=s;else if(\"multiple\"===n)i.each(o,function(i,e){r.options[i]=e});else if(\"responsive\"===n)for(t in s)if(\"array\"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),i.options.fade===!1?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger(\"setPosition\",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=i.options.vertical===!0?\"top\":\"left\",\n\"top\"===i.positionProp?i.$slider.addClass(\"slick-vertical\"):i.$slider.removeClass(\"slick-vertical\"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||i.options.useCSS===!0&&(i.cssTransitions=!0),i.options.fade&&(\"number\"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType=\"OTransform\",i.transformType=\"-o-transform\",i.transitionType=\"OTransition\",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType=\"MozTransform\",i.transformType=\"-moz-transform\",i.transitionType=\"MozTransition\",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType=\"webkitTransform\",i.transformType=\"-webkit-transform\",i.transitionType=\"webkitTransition\",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType=\"msTransform\",i.transformType=\"-ms-transform\",i.transitionType=\"msTransition\",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&i.animType!==!1&&(i.animType=\"transform\",i.transformType=\"transform\",i.transitionType=\"transition\"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&i.animType!==!1},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(\".slick-slide\").removeClass(\"slick-active slick-center slick-current\").attr(\"aria-hidden\",\"true\"),n.$slides.eq(i).addClass(\"slick-current\"),n.options.centerMode===!0){var r=n.options.slidesToShow%2===0?1:0;e=Math.floor(n.options.slidesToShow/2),n.options.infinite===!0&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass(\"slick-active\").attr(\"aria-hidden\",\"false\"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass(\"slick-active\").attr(\"aria-hidden\",\"false\")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass(\"slick-center\"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass(\"slick-center\")),n.$slides.eq(i).addClass(\"slick-center\")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass(\"slick-active\").attr(\"aria-hidden\",\"false\"):t.length<=n.options.slidesToShow?t.addClass(\"slick-active\").attr(\"aria-hidden\",\"false\"):(s=n.slideCount%n.options.slidesToShow,o=n.options.infinite===!0?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass(\"slick-active\").attr(\"aria-hidden\",\"false\"):t.slice(o,o+n.options.slidesToShow).addClass(\"slick-active\").attr(\"aria-hidden\",\"false\"));\"ondemand\"!==n.options.lazyLoad&&\"anticipated\"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(s.options.fade===!0&&(s.options.centerMode=!1),s.options.infinite===!0&&s.options.fade===!1&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=s.options.centerMode===!0?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr(\"id\",\"\").attr(\"data-slick-index\",t-s.slideCount).prependTo(s.$slideTrack).addClass(\"slick-cloned\");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr(\"id\",\"\").attr(\"data-slick-index\",t+s.slideCount).appendTo(s.$slideTrack).addClass(\"slick-cloned\");s.$slideTrack.find(\".slick-cloned\").find(\"[id]\").each(function(){i(this).attr(\"id\",\"\")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(\".slick-slide\")?i(e.target):i(e.target).parents(\".slick-slide\"),s=parseInt(o.attr(\"data-slick-index\"));return s||(s=0),t.slideCount<=t.options.slidesToShow?void t.slideHandler(s,!1,!0):void t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(a.animating===!0&&a.options.waitForAnimate===!0||a.options.fade===!0&&a.currentSlide===i))return e===!1&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,a.options.infinite===!1&&a.options.centerMode===!1&&(i<0||i>a.getDotCount()*a.options.slidesToScroll)?void(a.options.fade===!1&&(o=a.currentSlide,t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o))):a.options.infinite===!1&&a.options.centerMode===!0&&(i<0||i>a.slideCount-a.options.slidesToScroll)?void(a.options.fade===!1&&(o=a.currentSlide,t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o))):(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!==0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!==0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger(\"beforeChange\",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=a.getNavTarget(),l=l.slick(\"getSlick\"),l.slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide)),a.updateDots(),a.updateArrows(),a.options.fade===!0?(t!==!0?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight()):void(t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)))},e.prototype.startLoad=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass(\"slick-loading\")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),o=Math.round(180*t/Math.PI),o<0&&(o=360-Math.abs(o)),o<=45&&o>=0?s.options.rtl===!1?\"left\":\"right\":o<=360&&o>=315?s.options.rtl===!1?\"left\":\"right\":o>=135&&o<=225?s.options.rtl===!1?\"right\":\"left\":s.options.verticalSwiping===!0?o>=35&&o<=135?\"down\":\"up\":\"vertical\"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(o.touchObject.edgeHit===!0&&o.$slider.trigger(\"edge\",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case\"left\":case\"down\":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case\"right\":case\"up\":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}\"vertical\"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger(\"swipe\",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(e.options.swipe===!1||\"ontouchend\"in document&&e.options.swipe===!1||e.options.draggable===!1&&i.type.indexOf(\"mouse\")!==-1))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,e.options.verticalSwiping===!0&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case\"start\":e.swipeStart(i);break;case\"move\":e.swipeMove(i);break;case\"end\":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(l.options.verticalSwiping===!0&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(l.options.rtl===!1?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),l.options.verticalSwiping===!0&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,l.options.infinite===!1&&(0===l.currentSlide&&\"right\"===t||l.currentSlide>=l.getDotCount()&&\"left\"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),l.options.vertical===!1?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,l.options.verticalSwiping===!0&&(l.swipeLeft=e+o*s),l.options.fade!==!0&&l.options.touchMove!==!1&&(l.animating===!0?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;return t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow?(t.touchObject={},!1):(void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,void(t.dragging=!0))},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(\".slick-cloned\",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass(\"slick-slide slick-active slick-visible slick-current\").attr(\"aria-hidden\",\"true\").css(\"width\",\"\")},e.prototype.unslick=function(i){var e=this;e.$slider.trigger(\"unslick\",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i,e=this;i=Math.floor(e.options.slidesToShow/2),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&!e.options.infinite&&(e.$prevArrow.removeClass(\"slick-disabled\").attr(\"aria-disabled\",\"false\"),e.$nextArrow.removeClass(\"slick-disabled\").attr(\"aria-disabled\",\"false\"),0===e.currentSlide?(e.$prevArrow.addClass(\"slick-disabled\").attr(\"aria-disabled\",\"true\"),e.$nextArrow.removeClass(\"slick-disabled\").attr(\"aria-disabled\",\"false\")):e.currentSlide>=e.slideCount-e.options.slidesToShow&&e.options.centerMode===!1?(e.$nextArrow.addClass(\"slick-disabled\").attr(\"aria-disabled\",\"true\"),e.$prevArrow.removeClass(\"slick-disabled\").attr(\"aria-disabled\",\"false\")):e.currentSlide>=e.slideCount-1&&e.options.centerMode===!0&&(e.$nextArrow.addClass(\"slick-disabled\").attr(\"aria-disabled\",\"true\"),e.$prevArrow.removeClass(\"slick-disabled\").attr(\"aria-disabled\",\"false\")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find(\"li\").removeClass(\"slick-active\").end(),i.$dots.find(\"li\").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass(\"slick-active\"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if(\"object\"==typeof s||\"undefined\"==typeof s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),\"undefined\"!=typeof t)return t;return o}});\n","Magento_PageBuilder/js/utils/breakpoints.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 return {\n /**\n * Build media query.\n *\n * @param {Object} conditions\n * @returns {String}\n */\n buildMedia: function (conditions) {\n var result = _.map(_.pairs(conditions), function (condition) {\n return '(' + condition.join(': ') + ')';\n });\n\n return result.join(' and ');\n }\n };\n});\n","Magento_PageBuilder/js/utils/map.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * googleMaps dependency is added within googlemaps.phtml through shim based on API key being set\n *\n * @api\n */\ndefine([\n 'underscore',\n 'module',\n 'Magento_PageBuilder/js/events'\n], function (_, module, events) {\n 'use strict';\n\n var google = window.google || {},\n\n /**\n * Generates a google map usable latitude and longitude object\n *\n * @param {Object} position\n * @return {google.maps.LatLng}\n */\n getGoogleLatitudeLongitude = function (position) {\n return new google.maps.LatLng(position.latitude, position.longitude);\n },\n gmAuthFailure = false;\n\n // jscs:disable requireCamelCaseOrUpperCaseIdentifiers\n /**\n * Google's error listener for map loader failures\n */\n window.gm_authFailure = function () {\n events.trigger('googleMaps:authFailure');\n gmAuthFailure = true;\n };\n // jscs:enable requireCamelCaseOrUpperCaseIdentifiers\n\n return function (element, markers, additionalOptions) {\n var options,\n style;\n\n // If we've previously had an API key error, throw the error even again\n if (gmAuthFailure) {\n events.trigger('googleMaps:authFailure');\n\n return;\n }\n\n // If Google Maps isn't loaded don't try init the map, it won't work\n if (typeof google.maps === 'undefined') {\n return;\n }\n\n /**\n * Just in case of a bad JSON that bypassed validation\n */\n try {\n style = module.config().style ? JSON.parse(module.config().style) : [];\n }\n catch (error) {\n style = [];\n }\n options = _.extend({\n zoom: 8,\n center: getGoogleLatitudeLongitude({\n latitude: 30.2672,\n longitude: -97.7431\n }),\n scrollwheel: false,\n disableDoubleClickZoom: false,\n disableDefaultUI: false,\n mapTypeControl: true,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.DEFAULT\n },\n styles: style\n }, additionalOptions);\n\n /* Create the map */\n this.map = new google.maps.Map(element, options);\n this.markers = [];\n\n /**\n * Callback function on map config update\n * @param {Array} newMarkers\n * @param {Object} updateOptions\n */\n this.onUpdate = function (newMarkers, updateOptions) {\n this.map.setOptions(updateOptions);\n this.setMarkers(newMarkers);\n };\n\n /**\n * Sets the markers to selected map\n * @param {Object} newMarkers\n */\n this.setMarkers = function (newMarkers) {\n var activeInfoWindow,\n latitudeLongitudeBounds = new google.maps.LatLngBounds();\n\n this.markers.forEach(function (marker) {\n marker.setMap(null);\n }, this);\n\n this.markers = [];\n this.bounds = [];\n\n /**\n * Creates and set listener for markers\n */\n if (newMarkers && newMarkers.length) {\n newMarkers.forEach(function (newMarker) {\n var location = _.escape(newMarker['location_name']) || '',\n comment = newMarker.comment ?\n '<p>' + _.escape(newMarker.comment).replace(/(?:\\r\\n|\\r|\\n)/g, '<br/>') + '</p>'\n : '',\n phone = newMarker.phone ? '<p>Phone: ' + _.escape(newMarker.phone) + '</p>' : '',\n address = newMarker.address ? _.escape(newMarker.address) + '<br/>' : '',\n city = _.escape(newMarker.city) || '',\n country = newMarker.country ? _.escape(newMarker.country) : '',\n state = newMarker.state ? _.escape(newMarker.state) + ' ' : '',\n zipCode = newMarker.zipcode ? _.escape(newMarker.zipcode) : '',\n cityComma = city !== '' && (zipCode !== '' || state !== '') ? ', ' : '',\n lineBreak = city !== '' || zipCode !== '' ? '<br/>' : '',\n contentString =\n '<div>' +\n '<h3><b>' + location + '</b></h3>' +\n comment +\n phone +\n '<p><span>' + address +\n city + cityComma + state + zipCode + lineBreak +\n country + '</span></p>' +\n '</div>',\n infowindow = new google.maps.InfoWindow({\n content: contentString,\n maxWidth: 350\n }),\n newCreatedMarker = new google.maps.Marker({\n map: this.map,\n position: getGoogleLatitudeLongitude(newMarker.position),\n title: location\n });\n\n if (location) {\n newCreatedMarker.addListener('click', function () {\n if (activeInfoWindow) {\n activeInfoWindow.close();\n }\n\n infowindow.open(this.map, newCreatedMarker);\n activeInfoWindow = infowindow;\n }, this);\n }\n\n this.markers.push(newCreatedMarker);\n this.bounds.push(getGoogleLatitudeLongitude(newMarker.position));\n }, this);\n }\n\n /**\n * This sets the bounds of the map for multiple locations\n */\n if (this.bounds.length > 1) {\n this.bounds.forEach(function (bound) {\n latitudeLongitudeBounds.extend(bound);\n });\n this.map.fitBounds(latitudeLongitudeBounds);\n }\n\n /**\n * Zoom to 8 if there is only a single location\n */\n if (this.bounds.length === 1) {\n this.map.setCenter(this.bounds[0]);\n this.map.setZoom(8);\n }\n };\n\n this.setMarkers(markers);\n };\n});\n","Magento_SalesRule/js/form/element/manage-coupon-codes.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'underscore',\n 'uiRegistry',\n 'Magento_Ui/js/form/components/fieldset',\n 'Magento_Ui/js/lib/view/utils/async'\n], function (_, uiRegistry, fieldset, async) {\n 'use strict';\n\n return fieldset.extend({\n\n /*eslint-disable no-unused-vars*/\n /**\n * Initialize element\n *\n * @returns {Abstract} Chainable\n */\n initialize: function (elems, position) {\n var obj = this;\n\n this._super();\n\n async.async('#sales-rule-form-tab-coupons', document.getElementById('container'), function (node) {\n var useAutoGeneration = uiRegistry.get(\n 'sales_rule_form.sales_rule_form.rule_information.use_auto_generation'\n );\n\n useAutoGeneration.on('checked', function () {\n obj.enableDisableFields();\n });\n obj.enableDisableFields();\n });\n\n return this;\n },\n\n /*eslint-enable no-unused-vars*/\n /*eslint-disable lines-around-comment*/\n\n /**\n * Enable/disable fields on Coupons tab\n */\n enableDisableFields: function () {\n var selector,\n isUseAutoGenerationChecked,\n couponType,\n disableAuto;\n\n selector = '[id=sales-rule-form-tab-coupons] input, [id=sales-rule-form-tab-coupons] select, ' +\n '[id=sales-rule-form-tab-coupons] button';\n isUseAutoGenerationChecked = uiRegistry\n .get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation')\n .checked();\n couponType = uiRegistry\n .get('sales_rule_form.sales_rule_form.rule_information.coupon_type')\n .value();\n /**\n * \\Magento\\Rule\\Model\\AbstractModel::COUPON_TYPE_AUTO\n */\n disableAuto = couponType === 3 || isUseAutoGenerationChecked;\n _.each(\n document.querySelectorAll(selector),\n function (element) {\n element.disabled = !disableAuto;\n }\n );\n }\n });\n});\n","Magento_SalesRule/js/form/element/coupon-type.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'underscore',\n 'uiRegistry',\n 'Magento_Ui/js/form/element/select'\n], function (_, uiRegistry, select) {\n 'use strict';\n\n return select.extend({\n\n /**\n * Hide fields on coupon tab\n */\n onUpdate: function () {\n\n /* eslint-disable eqeqeq */\n if (this.value() != this.displayOnlyForCouponType) {\n uiRegistry.get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation').checked(false);\n }\n\n this.enableDisableFields();\n },\n\n /**\n * Enable/disable fields on Coupons tab\n */\n enableDisableFields: function () {\n var selector,\n isUseAutoGenerationChecked,\n couponType,\n disableAuto;\n\n selector = '[id=sales-rule-form-tab-coupons] input, [id=sales-rule-form-tab-coupons] select, ' +\n '[id=sales-rule-form-tab-coupons] button';\n isUseAutoGenerationChecked = uiRegistry\n .get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation')\n .checked();\n couponType = uiRegistry\n .get('sales_rule_form.sales_rule_form.rule_information.coupon_type')\n .value();\n disableAuto = couponType === 3 || isUseAutoGenerationChecked;\n _.each(\n document.querySelectorAll(selector),\n function (element) {\n element.disabled = !disableAuto;\n }\n );\n }\n });\n});\n","Magento_SalesRule/js/view/cart/totals/discount.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_SalesRule/js/view/summary/discount'\n], function (Component) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Magento_SalesRule/cart/totals/discount'\n },\n\n /**\n * @override\n *\n * @returns {Boolean}\n */\n isDisplayed: function () {\n return this.getPureValue() != 0; //eslint-disable-line eqeqeq\n }\n });\n});\n","Magento_SalesRule/js/view/payment/discount-messages.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/view/messages',\n '../../model/payment/discount-messages'\n], function (Component, messageContainer) {\n 'use strict';\n\n return Component.extend({\n /** @inheritdoc */\n initialize: function (config) {\n return this._super(config, messageContainer);\n }\n });\n});\n","Magento_SalesRule/js/view/payment/captcha.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Captcha/js/view/checkout/defaultCaptcha',\n 'Magento_Captcha/js/model/captchaList',\n 'Magento_SalesRule/js/action/set-coupon-code',\n 'Magento_SalesRule/js/action/cancel-coupon',\n 'Magento_Checkout/js/model/quote',\n 'ko'\n ],\n function (defaultCaptcha, captchaList, setCouponCodeAction, cancelCouponAction, quote, ko) {\n 'use strict';\n\n var totals = quote.getTotals(),\n couponCode = ko.observable(null),\n isApplied;\n\n if (totals()) {\n couponCode(totals()['coupon_code']);\n }\n //Captcha can only be required for adding a coupon so we need to know if one was added already.\n isApplied = ko.observable(couponCode() != null);\n\n return defaultCaptcha.extend({\n /** @inheritdoc */\n initialize: function () {\n var self = this,\n currentCaptcha;\n\n this._super();\n //Getting coupon captcha model.\n currentCaptcha = captchaList.getCaptchaByFormId(this.formId);\n\n if (currentCaptcha != null) {\n if (!isApplied()) {\n //Show captcha if we don't have a coupon applied.\n currentCaptcha.setIsVisible(true);\n }\n this.setCurrentCaptcha(currentCaptcha);\n //Add captcha code to coupon-apply request.\n setCouponCodeAction.registerDataModifier(function (headers) {\n if (self.isRequired()) {\n headers['X-Captcha'] = self.captchaValue()();\n }\n });\n //Refresh captcha after failed request.\n setCouponCodeAction.registerFailCallback(function () {\n if (self.isRequired()) {\n self.refresh();\n }\n });\n //Hide captcha when a coupon has been applied.\n setCouponCodeAction.registerSuccessCallback(function () {\n self.setIsVisible(false);\n });\n //Show captcha again if it was canceled.\n cancelCouponAction.registerSuccessCallback(function () {\n if (self.isRequired()) {\n self.setIsVisible(true);\n }\n });\n }\n }\n });\n });\n","Magento_SalesRule/js/view/payment/discount.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'ko',\n 'uiComponent',\n 'Magento_Checkout/js/model/quote',\n 'Magento_SalesRule/js/action/set-coupon-code',\n 'Magento_SalesRule/js/action/cancel-coupon',\n 'Magento_SalesRule/js/model/coupon'\n], function ($, ko, Component, quote, setCouponCodeAction, cancelCouponAction, coupon) {\n 'use strict';\n\n var totals = quote.getTotals(),\n couponCode = coupon.getCouponCode(),\n isApplied = coupon.getIsApplied();\n\n if (totals()) {\n couponCode(totals()['coupon_code']);\n }\n isApplied(couponCode() != null);\n\n return Component.extend({\n defaults: {\n template: 'Magento_SalesRule/payment/discount'\n },\n couponCode: couponCode,\n\n /**\n * Applied flag\n */\n isApplied: isApplied,\n\n /**\n * Coupon code application procedure\n */\n apply: function () {\n if (this.validate()) {\n setCouponCodeAction(couponCode(), isApplied);\n }\n },\n\n /**\n * Cancel using coupon\n */\n cancel: function () {\n if (this.validate()) {\n couponCode('');\n cancelCouponAction(isApplied);\n }\n },\n\n /**\n * Coupon form validation\n *\n * @returns {Boolean}\n */\n validate: function () {\n var form = '#discount-form';\n\n return $(form).validation() && $(form).validation('isValid');\n }\n });\n});\n","Magento_SalesRule/js/view/summary/discount.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Checkout/js/view/summary/abstract-total',\n 'Magento_Checkout/js/model/quote'\n], function (Component, quote) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Magento_SalesRule/summary/discount'\n },\n totals: quote.getTotals(),\n\n /**\n * @return {*|Boolean}\n */\n isDisplayed: function () {\n return this.isFullMode() && this.getPureValue() != 0; //eslint-disable-line eqeqeq\n },\n\n /**\n * @return {*}\n */\n getCouponCode: function () {\n if (!this.totals()) {\n return null;\n }\n\n return this.totals()['coupon_code'];\n },\n\n /**\n * @return {*}\n */\n getCouponLabel: function () {\n if (!this.totals()) {\n return null;\n }\n\n return this.totals()['coupon_label'];\n },\n\n /**\n * Get discount title\n *\n * @returns {null|String}\n */\n getTitle: function () {\n var discountSegments;\n\n if (!this.totals()) {\n return null;\n }\n\n discountSegments = this.totals()['total_segments'].filter(function (segment) {\n return segment.code.indexOf('discount') !== -1;\n });\n\n return discountSegments.length ? discountSegments[0].title : null;\n },\n\n /**\n * @return {Number}\n */\n getPureValue: function () {\n var price = 0;\n\n if (this.totals() && this.totals()['discount_amount']) {\n price = parseFloat(this.totals()['discount_amount']);\n }\n\n return price;\n },\n\n /**\n * @return {*|String}\n */\n getValue: function () {\n return this.getFormattedPrice(this.getPureValue());\n }\n });\n});\n","Magento_SalesRule/js/action/select-payment-method-mixin.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'jquery',\n 'mage/utils/wrapper',\n 'Magento_Checkout/js/model/quote',\n 'Magento_SalesRule/js/model/payment/discount-messages',\n 'Magento_Checkout/js/action/set-payment-information-extended',\n 'Magento_Checkout/js/action/get-totals',\n 'Magento_SalesRule/js/model/coupon'\n], function ($, wrapper, quote, messageContainer, setPaymentInformationExtended, getTotalsAction, coupon) {\n 'use strict';\n\n return function (selectPaymentMethodAction) {\n\n return wrapper.wrap(selectPaymentMethodAction, function (originalSelectPaymentMethodAction, paymentMethod) {\n\n originalSelectPaymentMethodAction(paymentMethod);\n\n if (paymentMethod === null) {\n return;\n }\n\n $.when(\n setPaymentInformationExtended(\n messageContainer,\n {\n method: paymentMethod.method\n },\n true\n )\n ).done(\n function () {\n var deferred = $.Deferred(),\n\n /**\n * Update coupon form.\n */\n updateCouponCallback = function () {\n if (quote.totals() && !quote.totals()['coupon_code']) {\n coupon.setCouponCode('');\n coupon.setIsApplied(false);\n }\n };\n\n getTotalsAction([], deferred);\n $.when(deferred).done(updateCouponCallback);\n }\n );\n });\n };\n\n});\n","Magento_SalesRule/js/action/set-coupon-code.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * Customer store credit(balance) application\n */\ndefine([\n 'ko',\n 'jquery',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/model/resource-url-manager',\n 'Magento_Checkout/js/model/error-processor',\n 'Magento_SalesRule/js/model/payment/discount-messages',\n 'mage/storage',\n 'mage/translate',\n 'Magento_Checkout/js/action/get-payment-information',\n 'Magento_Checkout/js/model/totals',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/action/recollect-shipping-rates'\n], function (ko, $, quote, urlManager, errorProcessor, messageContainer, storage, $t, getPaymentInformationAction,\n totals, fullScreenLoader, recollectShippingRates\n) {\n 'use strict';\n\n var dataModifiers = [],\n successCallbacks = [],\n failCallbacks = [],\n action;\n\n /**\n * Apply provided coupon.\n *\n * @param {String} couponCode\n * @param {Boolean}isApplied\n * @returns {Deferred}\n */\n action = function (couponCode, isApplied) {\n var quoteId = quote.getQuoteId(),\n url = urlManager.getApplyCouponUrl(couponCode, quoteId),\n message = $t('Your coupon was successfully applied.'),\n data = {},\n headers = {};\n\n //Allowing to modify coupon-apply request\n dataModifiers.forEach(function (modifier) {\n modifier(headers, data);\n });\n fullScreenLoader.startLoader();\n\n return storage.put(\n url,\n data,\n false,\n null,\n headers\n ).done(function (response) {\n var deferred;\n\n if (response) {\n deferred = $.Deferred();\n\n isApplied(true);\n totals.isLoading(true);\n recollectShippingRates();\n getPaymentInformationAction(deferred);\n $.when(deferred).done(function () {\n fullScreenLoader.stopLoader();\n totals.isLoading(false);\n });\n messageContainer.addSuccessMessage({\n 'message': message\n });\n //Allowing to tap into apply-coupon process.\n successCallbacks.forEach(function (callback) {\n callback(response);\n });\n }\n }).fail(function (response) {\n fullScreenLoader.stopLoader();\n totals.isLoading(false);\n errorProcessor.process(response, messageContainer);\n //Allowing to tap into apply-coupon process.\n failCallbacks.forEach(function (callback) {\n callback(response);\n });\n });\n };\n\n /**\n * Modifying data to be sent.\n *\n * @param {Function} modifier\n */\n action.registerDataModifier = function (modifier) {\n dataModifiers.push(modifier);\n };\n\n /**\n * When successfully added a coupon.\n *\n * @param {Function} callback\n */\n action.registerSuccessCallback = function (callback) {\n successCallbacks.push(callback);\n };\n\n /**\n * When failed to add a coupon.\n *\n * @param {Function} callback\n */\n action.registerFailCallback = function (callback) {\n failCallbacks.push(callback);\n };\n\n return action;\n});\n","Magento_SalesRule/js/action/cancel-coupon.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * Customer store credit(balance) application\n */\ndefine([\n 'jquery',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/model/resource-url-manager',\n 'Magento_Checkout/js/model/error-processor',\n 'Magento_SalesRule/js/model/payment/discount-messages',\n 'mage/storage',\n 'Magento_Checkout/js/action/get-payment-information',\n 'Magento_Checkout/js/model/totals',\n 'mage/translate',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/action/recollect-shipping-rates'\n], function ($, quote, urlManager, errorProcessor, messageContainer, storage, getPaymentInformationAction, totals, $t,\n fullScreenLoader, recollectShippingRates\n) {\n 'use strict';\n\n var successCallbacks = [],\n action,\n callSuccessCallbacks;\n\n /**\n * Execute callbacks when a coupon is successfully canceled.\n */\n callSuccessCallbacks = function () {\n successCallbacks.forEach(function (callback) {\n callback();\n });\n };\n\n /**\n * Cancel applied coupon.\n *\n * @param {Boolean} isApplied\n * @returns {Deferred}\n */\n action = function (isApplied) {\n var quoteId = quote.getQuoteId(),\n url = urlManager.getCancelCouponUrl(quoteId),\n message = $t('Your coupon was successfully removed.');\n\n messageContainer.clear();\n fullScreenLoader.startLoader();\n\n return storage.delete(\n url,\n false\n ).done(function () {\n var deferred = $.Deferred();\n\n totals.isLoading(true);\n recollectShippingRates();\n getPaymentInformationAction(deferred);\n $.when(deferred).done(function () {\n isApplied(false);\n totals.isLoading(false);\n fullScreenLoader.stopLoader();\n //Allowing to tap into coupon-cancel process.\n callSuccessCallbacks();\n });\n messageContainer.addSuccessMessage({\n 'message': message\n });\n }).fail(function (response) {\n totals.isLoading(false);\n fullScreenLoader.stopLoader();\n errorProcessor.process(response, messageContainer);\n });\n };\n\n /**\n * Callback for when the cancel-coupon process is finished.\n *\n * @param {Function} callback\n */\n action.registerSuccessCallback = function (callback) {\n successCallbacks.push(callback);\n };\n\n return action;\n});\n","Magento_SalesRule/js/model/shipping-save-processor-mixin.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'mage/utils/wrapper',\n 'Magento_Checkout/js/model/quote',\n 'Magento_SalesRule/js/model/coupon'\n], function (wrapper, quote, coupon) {\n 'use strict';\n\n return function (shippingSaveProcessor) {\n shippingSaveProcessor.saveShippingInformation = wrapper.wrapSuper(\n shippingSaveProcessor.saveShippingInformation,\n function (type) {\n var updateCouponCallback;\n\n /**\n * Update coupon form\n */\n updateCouponCallback = function () {\n if (quote.totals() && !quote.totals()['coupon_code']) {\n coupon.setCouponCode('');\n coupon.setIsApplied(false);\n }\n };\n\n return this._super(type).done(updateCouponCallback);\n }\n );\n\n return shippingSaveProcessor;\n };\n});\n","Magento_SalesRule/js/model/place-order-mixin.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'jquery',\n 'mage/utils/wrapper',\n 'Magento_Checkout/js/model/quote',\n 'Magento_SalesRule/js/model/coupon',\n 'Magento_Checkout/js/action/get-totals'\n], function ($, wrapper, quote, coupon, getTotalsAction) {\n 'use strict';\n\n return function (placeOrderAction) {\n return wrapper.wrap(placeOrderAction, function (originalAction, paymentData, messageContainer) {\n var result;\n\n $.when(\n result = originalAction(paymentData, messageContainer)\n ).fail(\n function () {\n var deferred = $.Deferred(),\n\n /**\n * Update coupon form\n */\n updateCouponCallback = function () {\n if (quote.totals() && !quote.totals()['coupon_code']) {\n coupon.setCouponCode('');\n coupon.setIsApplied(false);\n }\n };\n\n getTotalsAction([], deferred);\n $.when(deferred).done(updateCouponCallback);\n }\n );\n\n return result;\n });\n };\n});\n","Magento_SalesRule/js/model/coupon.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/**\n * Coupon model.\n */\ndefine([\n 'ko',\n 'domReady!'\n], function (ko) {\n 'use strict';\n\n var couponCode = ko.observable(null),\n isApplied = ko.observable(null);\n\n return {\n couponCode: couponCode,\n isApplied: isApplied,\n\n /**\n * @return {*}\n */\n getCouponCode: function () {\n return couponCode;\n },\n\n /**\n * @return {Boolean}\n */\n getIsApplied: function () {\n return isApplied;\n },\n\n /**\n * @param {*} couponCodeValue\n */\n setCouponCode: function (couponCodeValue) {\n couponCode(couponCodeValue);\n },\n\n /**\n * @param {Boolean} isAppliedValue\n */\n setIsApplied: function (isAppliedValue) {\n isApplied(isAppliedValue);\n }\n };\n});\n","Magento_SalesRule/js/model/payment/discount-messages.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Ui/js/model/messages'\n], function (Messages) {\n 'use strict';\n\n return new Messages();\n});\n","PayPal_Braintree/js/form-builder.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine(\n [\n 'jquery',\n 'underscore',\n 'mage/template'\n ],\n function ($, _, mageTemplate) {\n 'use strict';\n\n return {\n\n /**\n * @param {Object} formData\n * @returns {*|jQuery}\n */\n build: function (formData) {\n var formTmpl = mageTemplate('<form action=\"<%= data.action %>\"' +\n ' method=\"POST\" hidden enctype=\"application/x-www-form-urlencoded\">' +\n '<% _.each(data.fields, function(val, key){ %>' +\n '<input value=\\'<%= val %>\\' name=\"<%= key %>\" type=\"hidden\">' +\n '<% }); %>' +\n '</form>');\n\n return $(formTmpl({\n data: {\n action: formData.action,\n fields: formData.fields\n }\n })).appendTo($('[data-container=\"body\"]'));\n }\n };\n }\n);\n","PayPal_Braintree/js/validator.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'underscore'\n], function (_) {\n 'use strict';\n\n return {\n config: {},\n\n /**\n * Set configuration\n * @param {Object} config\n */\n setConfig: function (config) {\n this.config = config;\n },\n\n /**\n * Get List of available card types\n * @returns {*|exports.defaults.availableCardTypes|{}}\n */\n getAvailableCardTypes: function () {\n return this.config.availableCardTypes;\n },\n\n /**\n * Get list of card types\n * @returns {Object}\n */\n getCcTypesMapper: function () {\n return this.config.ccTypesMapper;\n },\n\n /**\n * Find mage card type by Braintree type\n * @param {String} type\n * @param {Object} availableTypes\n * @returns {*}\n */\n getMageCardType: function (type, availableTypes) {\n var storedCardType = null,\n mapper = this.getCcTypesMapper();\n\n if (type && typeof mapper[type] !== 'undefined') {\n storedCardType = mapper[type];\n\n if (_.indexOf(availableTypes, storedCardType) !== -1) {\n return storedCardType;\n }\n }\n\n return null;\n },\n\n /**\n * Filter list of available card types\n * @param {Object} availableTypes\n * @param {Object} countrySpecificCardTypes\n * @returns {Object}\n */\n collectTypes: function (availableTypes, countrySpecificCardTypes) {\n var key,\n filteredTypes = [];\n\n for (key in availableTypes) {\n if (_.indexOf(countrySpecificCardTypes, availableTypes[key]) !== -1) {\n filteredTypes.push(availableTypes[key]);\n }\n }\n\n return filteredTypes;\n },\n\n /**\n * Get list of card types for country\n * @param {String} countryId\n * @returns {*}\n */\n getCountrySpecificCardTypes: function (countryId) {\n if (typeof this.config.countrySpecificCardTypes[countryId] !== 'undefined') {\n return this.config.countrySpecificCardTypes[countryId];\n }\n\n return false;\n }\n };\n});\n","PayPal_Braintree/js/view/product-page.js":"define(\n ['uiComponent'],\n function (Component) {\n 'use strict';\n\n return Component.extend({\n\n });\n }\n);","PayPal_Braintree/js/view/payment/venmo.js":"define(\n [\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n ],\n function (\n Component,\n rendererList\n ) {\n 'use strict';\n\n rendererList.push(\n {\n type: 'braintree_venmo',\n component: 'PayPal_Braintree/js/view/payment/method-renderer/venmo'\n }\n );\n\n return Component.extend({});\n }\n);\n","PayPal_Braintree/js/view/payment/braintree.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n], function (Component, rendererList) {\n 'use strict';\n\n let config = window.checkoutConfig.payment,\n braintreeType = 'braintree',\n payPalType = 'braintree_paypal',\n braintreeAchDirectDebit = 'braintree_ach_direct_debit',\n braintreeVenmo = 'braintree_venmo',\n braintreeLocalPayment = 'braintree_local_payment';\n\n if (config[braintreeType] && config[braintreeType].isActive && config[braintreeType].clientToken) {\n rendererList.push({\n type: braintreeType,\n component: 'PayPal_Braintree/js/view/payment/method-renderer/hosted-fields'\n });\n }\n\n if (config[payPalType] && config[payPalType].isActive) {\n rendererList.push({\n type: payPalType,\n component: 'PayPal_Braintree/js/view/payment/method-renderer/paypal'\n });\n }\n\n if (config[braintreeVenmo] && config[braintreeVenmo].isAllowed && config[braintreeVenmo].clientToken) {\n rendererList.push({\n type: braintreeVenmo,\n component: 'PayPal_Braintree/js/view/payment/method-renderer/venmo'\n });\n }\n\n if (config[braintreeAchDirectDebit] && config[braintreeAchDirectDebit].isActive && config[braintreeAchDirectDebit].clientToken) {\n rendererList.push({\n type: braintreeAchDirectDebit,\n component: 'PayPal_Braintree/js/view/payment/method-renderer/ach'\n });\n }\n\n if (config[braintreeLocalPayment] && config[braintreeLocalPayment].clientToken) {\n rendererList.push({\n type: braintreeLocalPayment,\n component: 'PayPal_Braintree/js/view/payment/method-renderer/lpm'\n });\n }\n\n /** Add view logic here if needed */\n return Component.extend({});\n});\n","PayPal_Braintree/js/view/payment/validator-handler.js":"/**\n * Copyright 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/model/messageList',\n 'PayPal_Braintree/js/view/payment/3d-secure',\n 'Magento_Checkout/js/model/full-screen-loader'\n], function ($, globalMessageList, verify3DSecure, fullScreenLoader) {\n 'use strict';\n\n return {\n validators: [],\n\n /**\n * Get payment config\n * @returns {Object}\n */\n getConfig: function () {\n return window.checkoutConfig.payment;\n },\n\n /**\n * Init list of validators\n */\n initialize: function () {\n var config = this.getConfig();\n\n if (config[verify3DSecure.getCode()].enabled) {\n verify3DSecure.setConfig(config[verify3DSecure.getCode()]);\n this.add(verify3DSecure);\n }\n },\n\n /**\n * Add new validator\n * @param {Object} validator\n */\n add: function (validator) {\n this.validators.push(validator);\n },\n\n /**\n * Run pull of validators\n * @param {Object} context\n * @param {Function} callback\n */\n validate: function (context, callback, errorCallback) {\n var self = this,\n deferred;\n\n // no available validators\n if (!self.validators.length) {\n callback();\n\n return;\n }\n\n // get list of deferred validators\n deferred = $.map(self.validators, function (current) {\n return current.validate(context);\n });\n\n $.when.apply($, deferred)\n .done(function () {\n callback();\n }).fail(function (error) {\n errorCallback();\n self.showError(error);\n });\n },\n\n /**\n * Show error message\n * @param {String} errorMessage\n */\n showError: function (errorMessage) {\n globalMessageList.addErrorMessage({\n message: errorMessage\n });\n fullScreenLoader.stopLoader(true);\n }\n };\n});\n","PayPal_Braintree/js/view/payment/ach.js":"define(\n [\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n ],\n function (\n Component,\n rendererList\n ) {\n 'use strict';\n\n rendererList.push(\n {\n type: 'braintree_ach_direct_debit',\n component: 'PayPal_Braintree/js/view/payment/method-renderer/ach'\n }\n );\n\n return Component.extend({});\n }\n);\n","PayPal_Braintree/js/view/payment/3d-secure.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\n\ndefine([\n 'jquery',\n 'PayPal_Braintree/js/view/payment/adapter',\n 'Magento_Checkout/js/model/quote',\n 'mage/translate',\n 'braintreeThreeDSecure',\n 'Magento_Checkout/js/model/full-screen-loader'\n], function ($, braintree, quote, $t, threeDSecure, fullScreenLoader) {\n 'use strict';\n\n return {\n config: null,\n\n /**\n * Set 3d secure config\n * @param {Object} config\n */\n setConfig: function (config) {\n this.config = config;\n this.config.thresholdAmount = parseFloat(config.thresholdAmount);\n },\n\n /**\n * Get code\n * @returns {String}\n */\n getCode: function () {\n return 'three_d_secure';\n },\n\n /**\n * convert Non-ASCII characters into unicode\n * @param str\n * @returns {string}\n */\n escapeNonAsciiCharacters: function (str) {\n return str.split(\"\").map(function (c) { return /[^\\x00-\\x7F]$/.test(c) ? c : c.split(\"\").map(function (a) { return \"\\\\u00\" + a.charCodeAt().toString(16)}).join(\"\")}).join(\"\");\n },\n\n /**\n * Validate Braintree payment nonce\n * @param {Object} context\n * @returns {Object}\n */\n validate: function (context) {\n let clientInstance = braintree.getApiClient(),\n state = $.Deferred(),\n totalAmount = parseFloat(quote.totals()['base_grand_total']).toFixed(2),\n billingAddress = quote.billingAddress();\n\n if (billingAddress.regionCode == null) {\n billingAddress.regionCode = undefined;\n }\n\n if (billingAddress.regionCode !== undefined && billingAddress.regionCode.length > 2) {\n billingAddress.regionCode = undefined;\n }\n\n // No 3d secure if using CVV verification on vaulted cards\n if (quote.paymentMethod().method.indexOf('braintree_cc_vault_') !== -1) {\n if (this.config.useCvvVault === true) {\n state.resolve();\n return state.promise();\n }\n }\n\n if (!this.isAmountAvailable(totalAmount) || !this.isCountryAvailable(billingAddress.countryId)) {\n state.resolve();\n return state.promise();\n }\n\n let firstName = this.escapeNonAsciiCharacters(billingAddress.firstname);\n let lastName = this.escapeNonAsciiCharacters(billingAddress.lastname);\n\n let challengeRequested = this.getChallengeRequested();\n\n fullScreenLoader.startLoader();\n\n let setup3d = function(clientInstance) {\n threeDSecure.create({\n version: 2,\n client: clientInstance\n }, function (threeDSecureErr, threeDSecureInstance) {\n if (threeDSecureErr) {\n fullScreenLoader.stopLoader();\n return state.reject($t('Please try again with another form of payment.'));\n }\n\n let threeDSContainer = document.createElement('div'),\n tdMask = document.createElement('div'),\n tdFrame = document.createElement('div'),\n tdBody = document.createElement('div');\n\n threeDSContainer.id = 'braintree-three-d-modal';\n tdMask.className =\"bt-mask\";\n tdFrame.className =\"bt-modal-frame\";\n tdBody.className =\"bt-modal-body\";\n\n tdFrame.appendChild(tdBody);\n threeDSContainer.appendChild(tdMask);\n threeDSContainer.appendChild(tdFrame);\n\n threeDSecureInstance.verifyCard({\n amount: totalAmount,\n nonce: context.paymentMethodNonce,\n bin: context.creditCardBin,\n challengeRequested: challengeRequested,\n billingAddress: {\n givenName: firstName,\n surname: lastName,\n phoneNumber: billingAddress.telephone,\n streetAddress: billingAddress.street[0],\n extendedAddress: billingAddress.street[1],\n locality: billingAddress.city,\n region: billingAddress.regionCode,\n postalCode: billingAddress.postcode,\n countryCodeAlpha2: billingAddress.countryId\n },\n onLookupComplete: function (data, next) {\n next();\n },\n addFrame: function (err, iframe) {\n fullScreenLoader.stopLoader();\n\n if (err) {\n console.log(\"Unable to verify card over 3D Secure\", err);\n return state.reject($t('Please try again with another form of payment.'));\n }\n\n tdBody.appendChild(iframe);\n document.body.appendChild(threeDSContainer);\n },\n removeFrame: function () {\n fullScreenLoader.startLoader();\n document.body.removeChild(threeDSContainer);\n }\n }, function (err, response) {\n fullScreenLoader.stopLoader();\n\n if (err) {\n console.error(\"3DSecure validation failed\", err);\n if (err.code === 'THREEDS_LOOKUP_VALIDATION_ERROR') {\n let errorMessage = err.details.originalError.details.originalError.error.message;\n if (errorMessage === 'Billing line1 format is invalid.' && billingAddress.street[0].length > 50) {\n return state.reject(\n $t('Billing line1 must be string and less than 50 characters. Please update the address and try again.')\n );\n\n } else if (errorMessage === 'Billing line2 format is invalid.' && billingAddress.street[1].length > 50) {\n return state.reject(\n $t('Billing line2 must be string and less than 50 characters. Please update the address and try again.')\n );\n }\n return state.reject($t(errorMessage));\n } else {\n return state.reject($t('Please try again with another form of payment.'));\n }\n }\n\n let liability = {\n shifted: response.liabilityShifted,\n shiftPossible: response.liabilityShiftPossible\n };\n\n if (liability.shifted || !liability.shifted && !liability.shiftPossible) {\n context.paymentMethodNonce = response.nonce;\n state.resolve();\n } else {\n state.reject($t('Please try again with another form of payment.'));\n }\n });\n });\n };\n\n if (!clientInstance) {\n require(['PayPal_Braintree/js/view/payment/method-renderer/cc-form'], function(c) {\n let config = c.extend({\n defaults: {\n clientConfig: {\n onReady: function() {}\n }\n }\n });\n braintree.setConfig(config.defaults.clientConfig);\n braintree.setup(setup3d);\n });\n } else {\n setup3d(clientInstance);\n }\n\n return state.promise();\n },\n\n /**\n * Check minimal amount for 3d secure activation\n * @param {Number} amount\n * @returns {Boolean}\n */\n isAmountAvailable: function (amount) {\n amount = parseFloat(amount.toString());\n\n return amount >= this.config.thresholdAmount;\n },\n\n /**\n * Check if current country is available for 3d secure\n * @param {String} countryId\n * @returns {Boolean}\n */\n isCountryAvailable: function (countryId) {\n let key,\n specificCountries = this.config.specificCountries;\n\n // all countries are available\n if (!specificCountries.length) {\n return true;\n }\n\n for (key in specificCountries) {\n if (countryId === specificCountries[key]) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * @returns {Boolean}\n */\n getChallengeRequested: function () {\n return this.config.challengeRequested;\n }\n };\n});\n","PayPal_Braintree/js/view/payment/adapter.js":"/**\n * Copyright 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'jquery',\n 'braintree',\n 'braintreeDataCollector',\n 'braintreeHostedFields',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Ui/js/model/messageList',\n 'mage/translate'\n], function ($, client, dataCollector, hostedFields, fullScreenLoader, globalMessageList, $t) {\n 'use strict';\n\n return {\n apiClient: null,\n config: {},\n checkout: null,\n deviceData: null,\n clientInstance: null,\n hostedFieldsInstance: null,\n paypalInstance: null,\n code: 'braintree',\n\n /**\n * {Object}\n */\n events: {\n onClick: null,\n onCancel: null,\n onError: null\n },\n\n /**\n * Get Braintree api client\n * @returns {Object}\n */\n getApiClient: function () {\n return this.clientInstance;\n },\n\n /**\n * Set configuration\n * @param {Object} config\n */\n setConfig: function (config) {\n this.config = config;\n },\n\n /**\n * Get payment name\n * @returns {String}\n */\n getCode: function () {\n if (window.checkoutConfig.payment[this.code]) {\n return this.code;\n } else {\n return 'braintree_paypal';\n }\n },\n\n /**\n * Get client token\n * @returns {String|*}\n */\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n },\n\n /**\n * @returns {String}\n */\n getEnvironment: function () {\n return window.checkoutConfig.payment[this.getCode()].environment;\n },\n\n getCurrentCode: function (paypalType = null) {\n var code = 'braintree_paypal';\n if (paypalType !== 'paypal') {\n code = code + '_' + paypalType;\n }\n return code;\n },\n\n /**\n * @returns {String}\n */\n getColor: function (paypalType = null) {\n return window.checkoutConfig.payment[this.getCurrentCode(paypalType)].style.color;\n },\n\n /**\n * @returns {String}\n */\n getShape: function (paypalType = null) {\n return window.checkoutConfig.payment[this.getCurrentCode(paypalType)].style.shape;\n },\n\n /**\n * @returns {String}\n */\n getSize: function (paypalType = null) {\n return window.checkoutConfig.payment[this.getCurrentCode(paypalType)].style.size;\n },\n\n /**\n * @returns {String}\n */\n getLabel: function (paypalType = null) {\n return window.checkoutConfig.payment[this.getCurrentCode(paypalType)].style.label;\n },\n\n /**\n * @returns {String}\n */\n getBranding: function () {\n return null;\n },\n\n /**\n * @returns {String}\n */\n getFundingIcons: function () {\n return null;\n },\n\n /**\n * @returns {String}\n */\n getDisabledFunding: function () {\n return window.checkoutConfig.payment[this.getCode()].disabledFunding;\n },\n\n /**\n * Show error message\n *\n * @param {String} errorMessage\n */\n showError: function (errorMessage) {\n globalMessageList.addErrorMessage({\n message: errorMessage\n });\n fullScreenLoader.stopLoader(true);\n },\n\n /**\n * Disable submit button\n */\n disableButton: function () {\n // stop any previous shown loaders\n fullScreenLoader.stopLoader(true);\n fullScreenLoader.startLoader();\n $('[data-button=\"place\"]').attr('disabled', 'disabled');\n },\n\n /**\n * Enable submit button\n */\n enableButton: function () {\n $('[data-button=\"place\"]').removeAttr('disabled');\n fullScreenLoader.stopLoader();\n },\n\n /**\n * Has PayPal been init'd already\n */\n getPayPalInstance: function() {\n if (typeof this.config.paypalInstance !== 'undefined' && this.config.paypalInstance) {\n return this.config.paypalInstance;\n }\n\n return null;\n },\n\n setPayPalInstance: function(val) {\n this.config.paypalInstance = val;\n },\n\n /**\n * Setup Braintree SDK\n */\n setup: function (callback) {\n if (!this.getClientToken()) {\n this.showError($t('Sorry, but something went wrong.'));\n return;\n }\n\n if (this.clientInstance) {\n if (typeof this.config.onReady === 'function') {\n this.config.onReady(this);\n }\n\n if (typeof callback === \"function\") {\n callback(this.clientInstance);\n }\n return;\n }\n\n client.create({\n authorization: this.getClientToken()\n }, function (clientErr, clientInstance) {\n if (clientErr) {\n console.error('Braintree Setup Error', clientErr);\n return this.showError(\"Sorry, but something went wrong. Please contact the store owner.\");\n }\n\n var options = {\n client: clientInstance\n };\n\n if (typeof this.config.dataCollector === 'object' && typeof this.config.dataCollector.paypal === 'boolean') {\n options.paypal = true;\n }\n\n dataCollector.create(options, function (err, dataCollectorInstance) {\n if (err) {\n return console.log(err);\n }\n\n this.deviceData = dataCollectorInstance.deviceData;\n this.config.onDeviceDataReceived(this.deviceData);\n }.bind(this));\n\n this.clientInstance = clientInstance;\n\n if (typeof this.config.onReady === 'function') {\n this.config.onReady(this);\n }\n\n if (typeof callback === \"function\") {\n callback(this.clientInstance);\n }\n }.bind(this));\n },\n\n /**\n * Setup hosted fields instance\n */\n setupHostedFields: function () {\n var self = this;\n\n if (this.hostedFieldsInstance) {\n this.hostedFieldsInstance.teardown(function () {\n this.hostedFieldsInstance = null;\n this.setupHostedFields();\n }.bind(this));\n return;\n }\n\n hostedFields.create({\n client: this.clientInstance,\n fields: this.config.hostedFields,\n styles: {\n \"input\": {\n \"font-size\": \"14pt\",\n \"color\": \"#3A3A3A\"\n },\n \":focus\": {\n \"color\": \"black\"\n },\n \".valid\": {\n \"color\": \"green\"\n },\n \".invalid\": {\n \"color\": \"red\"\n }\n }\n }, function (createErr, hostedFieldsInstance) {\n if (createErr) {\n self.showError($t(\"Braintree hosted fields could not be initialized. Please contact the store owner.\"));\n console.error('Braintree hosted fields error', createErr);\n return;\n }\n\n this.config.onInstanceReady(hostedFieldsInstance);\n this.hostedFieldsInstance = hostedFieldsInstance;\n }.bind(this));\n },\n\n tokenizeHostedFields: function () {\n this.hostedFieldsInstance.tokenize({}, function (tokenizeErr, payload) {\n if (tokenizeErr) {\n switch (tokenizeErr.code) {\n case 'HOSTED_FIELDS_FIELDS_EMPTY':\n // occurs when none of the fields are filled in\n console.error('All fields are empty! Please fill out the form.');\n break;\n case 'HOSTED_FIELDS_FIELDS_INVALID':\n // occurs when certain fields do not pass client side validation\n console.error('Some fields are invalid:', tokenizeErr.details.invalidFieldKeys);\n break;\n case 'HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE':\n // occurs when:\n // * the client token used for client authorization was generated\n // with a customer ID and the fail on duplicate payment method\n // option is set to true\n // * the card being tokenized has previously been vaulted (with any customer)\n // See: https://developers.braintreepayments.com/reference/request/client-token/generate/#options.fail_on_duplicate_payment_method\n console.error('This payment method already exists in your vault.');\n break;\n case 'HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED':\n // occurs when:\n // * the client token used for client authorization was generated\n // with a customer ID and the verify card option is set to true\n // and you have credit card verification turned on in the Braintree\n // control panel\n // * the cvv does not pass verfication (https://developers.braintreepayments.com/reference/general/testing/#avs-and-cvv/cid-responses)\n // See: https://developers.braintreepayments.com/reference/request/client-token/generate/#options.verify_card\n console.error('CVV did not pass verification');\n break;\n case 'HOSTED_FIELDS_FAILED_TOKENIZATION':\n // occurs for any other tokenization error on the server\n console.error('Tokenization failed server side. Is the card valid?');\n break;\n case 'HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR':\n // occurs when the Braintree gateway cannot be contacted\n console.error('Network error occurred when tokenizing.');\n break;\n default:\n console.error('Something bad happened!', tokenizeErr);\n }\n } else {\n this.config.onPaymentMethodReceived(payload);\n }\n }.bind(this));\n }\n };\n});\n\n","PayPal_Braintree/js/view/payment/lpm.js":"define(\n [\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n ],\n function (\n Component,\n rendererList\n ) {\n 'use strict';\n\n rendererList.push(\n {\n type: 'braintree_local_payment',\n component: 'PayPal_Braintree/js/view/payment/method-renderer/lpm'\n }\n );\n\n return Component.extend({});\n }\n);\n","PayPal_Braintree/js/view/payment/method-renderer/vault.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'ko',\n 'jquery',\n 'Magento_Vault/js/view/payment/method-renderer/vault',\n 'PayPal_Braintree/js/view/payment/adapter',\n 'Magento_Ui/js/model/messageList',\n 'PayPal_Braintree/js/view/payment/validator-handler',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'braintree',\n 'braintreeHostedFields',\n 'mage/url'\n], function (\n ko,\n $,\n VaultComponent,\n Braintree,\n globalMessageList,\n validatorManager,\n additionalValidators,\n fullScreenLoader,\n client,\n hostedFields,\n url\n) {\n 'use strict';\n\n return VaultComponent.extend({\n defaults: {\n active: false,\n hostedFieldsInstance: null,\n imports: {\n onActiveChange: 'active'\n },\n modules: {\n hostedFields: '${ $.parentName }.braintree'\n },\n template: 'PayPal_Braintree/payment/cc/vault',\n updatePaymentUrl: url.build('braintree/payment/updatepaymentmethod'),\n vaultedCVV: ko.observable(\"\"),\n validatorManager: validatorManager,\n isValidCvv: false,\n onInstanceReady: function (instance) {\n instance.on('validityChange', this.onValidityChange.bind(this));\n }\n },\n\n /**\n * Event fired by Braintree SDK whenever input value length matches the validation length.\n * In the case of a CVV, this is 3, or 4 for AMEX.\n * @param event\n */\n onValidityChange: function (event) {\n if (event.emittedBy === 'cvv') {\n this.isValidCvv = event.fields.cvv.isValid;\n }\n },\n\n /**\n * @returns {exports}\n */\n initObservable: function () {\n this._super().observe(['active']);\n this.validatorManager.initialize();\n return this;\n },\n\n /**\n * Is payment option active?\n * @returns {boolean}\n */\n isActive: function () {\n let active = this.getId() === this.isChecked();\n this.active(active);\n return active;\n },\n\n /**\n * Fired whenever a payment option is changed.\n * @param isActive\n */\n onActiveChange: function (isActive) {\n let self = this;\n\n if (!isActive) {\n return;\n }\n\n if (self.showCvvVerify()) {\n if (self.hostedFieldsInstance) {\n self.hostedFieldsInstance.teardown(function (teardownError) {\n if (teardownError) {\n globalMessageList.addErrorMessage({\n message: teardownError.message\n });\n }\n self.hostedFieldsInstance = null;\n self.initHostedCvvField();\n });\n return;\n }\n self.initHostedCvvField();\n }\n },\n\n /**\n * Initialize the CVV input field with the Braintree Hosted Fields SDK.\n */\n initHostedCvvField: function () {\n let self = this;\n client.create({\n authorization: Braintree.getClientToken()\n }, function (clientError, clientInstance) {\n if (clientError) {\n globalMessageList.addErrorMessage({\n message: clientError.message\n });\n }\n hostedFields.create({\n client: clientInstance,\n fields: {\n cvv: {\n selector: '#' + self.getId() + '_cid',\n placeholder: '123'\n }\n }\n }, function (hostedError, hostedFieldsInstance) {\n if (hostedError) {\n globalMessageList.addErrorMessage({\n message: hostedError.message\n });\n return;\n }\n\n self.hostedFieldsInstance = hostedFieldsInstance;\n self.onInstanceReady(self.hostedFieldsInstance);\n });\n });\n },\n\n /**\n * Return the payment method code.\n * @returns {string}\n */\n getCode: function () {\n return 'braintree_cc_vault';\n },\n\n /**\n * Get last 4 digits of card\n * @returns {String}\n */\n getMaskedCard: function () {\n return this.details.maskedCC;\n },\n\n /**\n * Get expiration date\n * @returns {String}\n */\n getExpirationDate: function () {\n return this.details.expirationDate;\n },\n\n /**\n * Get card type\n * @returns {String}\n */\n getCardType: function () {\n return this.details.type;\n },\n\n /**\n * Get show CVV Field\n * @returns {Boolean}\n */\n showCvvVerify: function () {\n return window.checkoutConfig.payment[this.code].cvvVerify;\n },\n\n /**\n * Show or hide the error message.\n * @param selector\n * @param state\n * @returns {boolean}\n */\n validateCvv: function (selector, state) {\n let $selector = $(selector),\n invalidClass = 'braintree-hosted-fields-invalid';\n\n if (state === true) {\n $selector.removeClass(invalidClass);\n return true;\n }\n\n $selector.addClass(invalidClass);\n return false;\n },\n\n /**\n * Place order\n */\n placeOrder: function () {\n let self = this;\n\n if (self.showCvvVerify()) {\n if (!self.validateCvv('#' + self.getId() + '_cid', self.isValidCvv) || !additionalValidators.validate()) {\n return;\n }\n } else {\n if (!additionalValidators.validate()) {\n return;\n }\n }\n\n fullScreenLoader.startLoader();\n\n if (self.showCvvVerify() && typeof self.hostedFieldsInstance !== 'undefined') {\n self.hostedFieldsInstance.tokenize({}, function (error, payload) {\n if (error) {\n fullScreenLoader.stopLoader();\n globalMessageList.addErrorMessage({\n message: error.message\n });\n return;\n }\n $.getJSON(self.updatePaymentUrl, {\n 'nonce': payload.nonce,\n 'public_hash': self.publicHash\n }).done(function (response) {\n if (response.success === false) {\n fullScreenLoader.stopLoader();\n globalMessageList.addErrorMessage({\n message: 'CVV verification failed.'\n });\n return;\n }\n self.getPaymentMethodNonce();\n })\n });\n } else {\n self.getPaymentMethodNonce();\n }\n },\n\n /**\n * Send request to get payment method nonce\n */\n getPaymentMethodNonce: function () {\n let self = this;\n\n fullScreenLoader.startLoader();\n $.getJSON(self.nonceUrl, {\n 'public_hash': self.publicHash,\n 'cvv': self.vaultedCVV()\n }).done(function (response) {\n fullScreenLoader.stopLoader();\n self.hostedFields(function (formComponent) {\n formComponent.setPaymentMethodNonce(response.paymentMethodNonce);\n formComponent.setCreditCardBin(response.details.bin);\n formComponent.additionalData['public_hash'] = self.publicHash;\n formComponent.code = self.code;\n if (self.vaultedCVV()) {\n formComponent.additionalData['cvv'] = self.vaultedCVV();\n }\n\n self.validatorManager.validate(formComponent, function () {\n fullScreenLoader.stopLoader();\n return formComponent.placeOrder('parent');\n }, function() {\n // No teardown actions required.\n fullScreenLoader.stopLoader();\n formComponent.setPaymentMethodNonce(null);\n formComponent.setCreditCardBin(null);\n });\n\n });\n }).fail(function (response) {\n let error = JSON.parse(response.responseText);\n\n fullScreenLoader.stopLoader();\n globalMessageList.addErrorMessage({\n message: error.message\n });\n });\n }\n });\n});\n","PayPal_Braintree/js/view/payment/method-renderer/venmo.js":"define(\n [\n 'Magento_Checkout/js/view/payment/default',\n 'braintree',\n 'braintreeDataCollector',\n 'braintreeVenmo',\n 'PayPal_Braintree/js/form-builder',\n 'Magento_Ui/js/model/messageList',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'mage/translate'\n ],\n function (\n Component,\n braintree,\n dataCollector,\n venmo,\n formBuilder,\n messageList,\n fullScreenLoader,\n additionalValidators,\n $t\n ) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n deviceData: null,\n paymentMethodNonce: null,\n template: 'PayPal_Braintree/payment/venmo',\n venmoInstance: null\n },\n\n clickVenmoBtn: function () {\n let self = this;\n\n if (!additionalValidators.validate()) {\n return false;\n }\n\n if (!this.venmoInstance) {\n this.setErrorMsg($t('Venmo not initialized, please try reloading.'));\n return;\n }\n\n this.venmoInstance.tokenize(function (tokenizeErr, payload) {\n if (tokenizeErr) {\n if (tokenizeErr.code === 'VENMO_CANCELED') {\n self.setErrorMsg($t('Venmo app is not available or the payment flow was cancelled.'));\n } else if (tokenizeErr.code === 'VENMO_APP_CANCELED') {\n self.setErrorMsg($t('Venmo payment flow cancelled.'));\n } else {\n self.setErrorMsg(tokenizeErr.message);\n }\n } else {\n self.handleVenmoSuccess(payload);\n }\n });\n },\n\n collectDeviceData: function (clientInstance, callback) {\n let self = this;\n dataCollector.create({\n client: clientInstance,\n paypal: true\n }, function (dataCollectorErr, dataCollectorInstance) {\n if (dataCollectorErr) {\n return;\n }\n self.deviceData = dataCollectorInstance.deviceData;\n callback();\n });\n },\n\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n },\n\n getCode: function() {\n return 'braintree_venmo';\n },\n\n getData: function () {\n let data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce,\n 'device_data': this.deviceData\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n return data;\n },\n\n getPaymentMarkSrc: function () {\n return window.checkoutConfig.payment[this.getCode()].paymentMarkSrc;\n },\n\n getTitle: function() {\n return 'Venmo';\n },\n\n handleVenmoSuccess: function (payload) {\n this.setPaymentMethodNonce(payload.nonce);\n this.placeOrder();\n },\n\n initialize: function () {\n this._super();\n\n let self = this;\n\n braintree.create({\n authorization: self.getClientToken()\n }, function (clientError, clientInstance) {\n if (clientError) {\n this.setErrorMsg($t('Unable to initialize Braintree Client.'));\n return;\n }\n\n // Collect device data\n self.collectDeviceData(clientInstance, function () {\n // callback from collectDeviceData\n venmo.create({\n client: clientInstance,\n allowDesktop: true,\n allowDesktopWebLogin: true,\n mobileWebFallBack: true,\n paymentMethodUsage: 'single_use',\n allowNewBrowserTab: false\n }, function (venmoErr, venmoInstance) {\n if (venmoErr) {\n self.setErrorMsg($t('Error initializing Venmo: %1').replace('%1', venmoErr));\n return;\n }\n\n if (!venmoInstance.isBrowserSupported()) {\n console.log('Browser does not support Venmo');\n return;\n }\n\n self.setVenmoInstance(venmoInstance);\n });\n });\n });\n\n return this;\n },\n\n isAllowed: function () {\n return window.checkoutConfig.payment[this.getCode()].isAllowed;\n },\n\n setErrorMsg: function (message) {\n messageList.addErrorMessage({\n message: message\n });\n },\n\n setPaymentMethodNonce: function (nonce) {\n this.paymentMethodNonce = nonce;\n },\n\n setVenmoInstance: function (instance) {\n this.venmoInstance = instance;\n }\n });\n }\n);\n","PayPal_Braintree/js/view/payment/method-renderer/paypal.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'jquery',\n 'underscore',\n 'Magento_Checkout/js/view/payment/default',\n 'braintree',\n 'braintreeCheckoutPayPalAdapter',\n 'braintreePayPalCheckout',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Magento_Checkout/js/model/step-navigator',\n 'Magento_Vault/js/view/payment/vault-enabler',\n 'Magento_Checkout/js/action/create-billing-address',\n 'Magento_Checkout/js/action/select-billing-address',\n 'Magento_CheckoutAgreements/js/view/checkout-agreements',\n 'mage/translate'\n], function (\n $,\n _,\n Component,\n braintree,\n Braintree,\n paypalCheckout,\n quote,\n fullScreenLoader,\n additionalValidators,\n stepNavigator,\n VaultEnabler,\n createBillingAddress,\n selectBillingAddress,\n checkoutAgreements,\n $t\n) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'PayPal_Braintree/payment/paypal',\n code: 'braintree_paypal',\n active: false,\n paypalInstance: null,\n paymentMethodNonce: null,\n grandTotalAmount: null,\n isReviewRequired: false,\n customerEmail: null,\n\n /**\n * Additional payment data\n *\n * {Object}\n */\n additionalData: {},\n\n /**\n * {Array}\n */\n lineItemsArray: [\n 'name',\n 'kind',\n 'quantity',\n 'unitAmount',\n 'unitTaxAmount',\n 'productCode',\n 'description'\n ],\n\n /**\n * PayPal client configuration\n * {Object}\n */\n clientConfig: {\n offerCredit: false,\n offerCreditOnly: false,\n dataCollector: {\n paypal: true\n },\n\n buttonPayPalId: 'braintree_paypal_placeholder',\n buttonCreditId: 'braintree_paypal_credit_placeholder',\n buttonPaylaterId: 'braintree_paypal_paylater_placeholder',\n\n onDeviceDataReceived: function (deviceData) {\n this.additionalData['device_data'] = deviceData;\n },\n\n /**\n * Triggers when widget is loaded\n * @param {Object} context\n */\n onReady: function (context) {\n this.setupPayPal();\n },\n\n /**\n * Triggers on payment nonce receive\n * @param {Object} response\n */\n onPaymentMethodReceived: function (response) {\n this.beforePlaceOrder(response);\n }\n },\n imports: {\n onActiveChange: 'active'\n }\n },\n\n /**\n * Set list of observable attributes\n * @returns {exports.initObservable}\n */\n initObservable: function () {\n var self = this;\n\n this._super()\n .observe(['active', 'isReviewRequired', 'customerEmail']);\n\n window.addEventListener('hashchange', function (e) {\n var methodCode = quote.paymentMethod();\n\n if (methodCode === 'braintree_paypal' || methodCode === 'braintree_paypal_vault') {\n if (e.newURL.indexOf('payment') > 0 && self.grandTotalAmount !== null) {\n self.reInitPayPal();\n }\n }\n });\n\n quote.paymentMethod.subscribe(function (value) {\n var methodCode = value;\n\n if (methodCode === 'braintree_paypal' || methodCode === 'braintree_paypal_vault') {\n self.reInitPayPal();\n }\n });\n\n this.vaultEnabler = new VaultEnabler();\n this.vaultEnabler.setPaymentCode(this.getVaultCode());\n this.vaultEnabler.isActivePaymentTokenEnabler.subscribe(function () {\n self.onVaultPaymentTokenEnablerChange();\n });\n\n this.grandTotalAmount = quote.totals()['base_grand_total'];\n\n quote.totals.subscribe(function () {\n if (self.grandTotalAmount !== quote.totals()['base_grand_total']) {\n self.grandTotalAmount = quote.totals()['base_grand_total'];\n var methodCode = quote.paymentMethod();\n\n if (methodCode && (methodCode.method === 'braintree_paypal' || methodCode.method === 'braintree_paypal_vault')) {\n self.reInitPayPal();\n }\n }\n });\n\n // for each component initialization need update property\n this.isReviewRequired(false);\n this.initClientConfig();\n\n return this;\n },\n\n /**\n * Get payment name\n *\n * @returns {String}\n */\n getCode: function () {\n return this.code;\n },\n\n /**\n * Get payment title\n *\n * @returns {String}\n */\n getTitle: function () {\n return window.checkoutConfig.payment[this.getCode()].title;\n },\n\n /**\n * Check if payment is active\n *\n * @returns {Boolean}\n */\n isActive: function () {\n var active = this.getCode() === this.isChecked();\n\n this.active(active);\n\n return active;\n },\n\n /**\n * Triggers when payment method change\n * @param {Boolean} isActive\n */\n onActiveChange: function (isActive) {\n if (!isActive) {\n return;\n }\n\n // need always re-init Braintree with PayPal configuration\n this.reInitPayPal();\n },\n\n /**\n * Init config\n */\n initClientConfig: function () {\n this.clientConfig = _.extend(this.clientConfig, this.getPayPalConfig());\n\n _.each(this.clientConfig, function (fn, name) {\n if (typeof fn === 'function') {\n this.clientConfig[name] = fn.bind(this);\n }\n }, this);\n },\n\n /**\n * Set payment nonce\n * @param {String} paymentMethodNonce\n */\n setPaymentMethodNonce: function (paymentMethodNonce) {\n this.paymentMethodNonce = paymentMethodNonce;\n },\n\n /**\n * Update quote billing address\n * @param {Object}customer\n * @param {Object}address\n */\n setBillingAddress: function (customer, address) {\n var billingAddress = {\n street: [address.line1],\n city: address.city,\n postcode: address.postalCode,\n countryId: address.countryCode,\n email: customer.email,\n firstname: customer.firstName,\n lastname: customer.lastName,\n telephone: typeof customer.phone !== 'undefined' ? customer.phone : '00000000000'\n };\n\n billingAddress['region_code'] = typeof address.state === 'string' ? address.state : '';\n billingAddress = createBillingAddress(billingAddress);\n quote.billingAddress(billingAddress);\n },\n\n /**\n * Prepare data to place order\n * @param {Object} data\n */\n beforePlaceOrder: function (data) {\n this.setPaymentMethodNonce(data.nonce);\n this.customerEmail(data.details.email);\n if (quote.isVirtual()) {\n this.isReviewRequired(true);\n } else {\n if (this.isRequiredBillingAddress() === '1' || quote.billingAddress() === null) {\n if (typeof data.details.billingAddress !== 'undefined') {\n this.setBillingAddress(data.details, data.details.billingAddress);\n } else {\n this.setBillingAddress(data.details, data.details.shippingAddress);\n }\n } else {\n if (quote.shippingAddress() === quote.billingAddress()) {\n selectBillingAddress(quote.shippingAddress());\n } else {\n selectBillingAddress(quote.billingAddress());\n }\n }\n }\n this.placeOrder();\n },\n\n /**\n * Re-init PayPal Auth Flow\n */\n reInitPayPal: function () {\n this.disableButton();\n this.clientConfig.paypal.amount = parseFloat(this.grandTotalAmount).toFixed(2);\n\n if (!quote.isVirtual()) {\n this.clientConfig.paypal.enableShippingAddress = true;\n this.clientConfig.paypal.shippingAddressEditable = false;\n this.clientConfig.paypal.shippingAddressOverride = this.getShippingAddress();\n }\n // Send Line Items\n this.clientConfig.paypal.lineItems = this.getLineItems();\n\n Braintree.setConfig(this.clientConfig);\n\n if (Braintree.getPayPalInstance()) {\n Braintree.getPayPalInstance().teardown(function () {\n Braintree.setup();\n }.bind(this));\n Braintree.setPayPalInstance(null);\n } else {\n Braintree.setup();\n this.enableButton();\n }\n },\n\n /**\n * Setup PayPal instance\n */\n setupPayPal: function () {\n var self = this;\n\n if (Braintree.config.paypalInstance) {\n fullScreenLoader.stopLoader(true);\n return;\n }\n\n paypalCheckout.create({\n client: Braintree.clientInstance\n }, function (createErr, paypalCheckoutInstance) {\n if (createErr) {\n Braintree.showError($t(\"PayPal Checkout could not be initialized. Please contact the store owner.\"));\n console.error('paypalCheckout error', createErr);\n return;\n }\n let quoteObj = quote.totals();\n\n var configSDK = {\n components: 'buttons,messages,funding-eligibility',\n \"enable-funding\": \"paylater\",\n currency: quoteObj['base_currency_code']\n };\n var merchantCountry = window.checkoutConfig.payment['braintree_paypal'].merchantCountry;\n if (Braintree.getEnvironment() == 'sandbox' && merchantCountry != null) {\n configSDK[\"buyer-country\"] = merchantCountry;\n }\n paypalCheckoutInstance.loadPayPalSDK(configSDK, function () {\n this.loadPayPalButton(paypalCheckoutInstance, 'paypal');\n if (this.isCreditEnabled()) {\n this.loadPayPalButton(paypalCheckoutInstance, 'credit');\n }\n if (this.isPaylaterEnabled()) {\n this.loadPayPalButton(paypalCheckoutInstance, 'paylater');\n }\n\n }.bind(this));\n }.bind(this));\n },\n\n loadPayPalButton: function (paypalCheckoutInstance, funding) {\n var paypalPayment = Braintree.config.paypal,\n onPaymentMethodReceived = Braintree.config.onPaymentMethodReceived;\n var style = {\n color: Braintree.getColor(funding),\n shape: Braintree.getShape(funding),\n size: Braintree.getSize(funding),\n label: Braintree.getLabel(funding)\n };\n\n if (Braintree.getBranding()) {\n style.branding = Braintree.getBranding();\n }\n if (Braintree.getFundingIcons()) {\n style.fundingicons = Braintree.getFundingIcons();\n }\n\n if (funding === 'credit') {\n Braintree.config.buttonId = this.clientConfig.buttonCreditId;\n } else if (funding === 'paylater') {\n Braintree.config.buttonId = this.clientConfig.buttonPaylaterId;\n } else {\n Braintree.config.buttonId = this.clientConfig.buttonPayPalId;\n }\n // Render\n Braintree.config.paypalInstance = paypalCheckoutInstance;\n var events = Braintree.events;\n $('#' + Braintree.config.buttonId).html('');\n\n var button = paypal.Buttons({\n fundingSource: funding,\n env: Braintree.getEnvironment(),\n style: style,\n commit: true,\n locale: Braintree.config.paypal.locale,\n\n onInit: function (data, actions) {\n var agreements = checkoutAgreements().agreements,\n shouldDisableActions = false;\n\n actions.disable();\n\n _.each(agreements, function (item, index) {\n if (checkoutAgreements().isAgreementRequired(item)) {\n var paymentMethodCode = quote.paymentMethod().method,\n inputId = '#agreement_' + paymentMethodCode + '_' + item.agreementId,\n inputEl = document.querySelector(inputId);\n\n\n if (!inputEl.checked) {\n shouldDisableActions = true;\n }\n\n inputEl.addEventListener('change', function (event) {\n if (additionalValidators.validate()) {\n actions.enable();\n } else {\n actions.disable();\n }\n });\n }\n });\n\n if (!shouldDisableActions) {\n actions.enable();\n }\n },\n\n createOrder: function () {\n return paypalCheckoutInstance.createPayment(paypalPayment).catch(function (err) {\n throw err.details.originalError.details.originalError.paymentResource;\n });\n },\n\n onCancel: function (data) {\n console.log('checkout.js payment cancelled', JSON.stringify(data, 0, 2));\n\n if (typeof events.onCancel === 'function') {\n events.onCancel();\n }\n },\n\n onError: function (err) {\n if (err.errorName === 'VALIDATION_ERROR' && err.errorMessage.indexOf('Value is invalid') !== -1) {\n Braintree.showError($t('Address failed validation. Please check and confirm your City, State, and Postal Code'));\n } else {\n Braintree.showError($t(\"PayPal Checkout could not be initialized. Please contact the store owner.\"));\n }\n Braintree.config.paypalInstance = null;\n console.error('Paypal checkout.js error', err);\n\n if (typeof events.onError === 'function') {\n events.onError(err);\n }\n }.bind(this),\n\n onClick: function (data) {\n if (!quote.isVirtual()) {\n this.clientConfig.paypal.enableShippingAddress = true;\n this.clientConfig.paypal.shippingAddressEditable = false;\n this.clientConfig.paypal.shippingAddressOverride = this.getShippingAddress();\n }\n\n // To check term & conditions input checked - validate additional validators.\n if (!additionalValidators.validate()) {\n return false;\n }\n\n if (typeof events.onClick === 'function') {\n events.onClick(data);\n }\n }.bind(this),\n\n onApprove: function (data, actions) {\n return paypalCheckoutInstance.tokenizePayment(data)\n .then(function (payload) {\n onPaymentMethodReceived(payload);\n });\n }\n\n });\n if (button.isEligible() && $('#' + Braintree.config.buttonId).length) {\n button.render('#' + Braintree.config.buttonId).then(function () {\n Braintree.enableButton();\n if (typeof Braintree.config.onPaymentMethodError === 'function') {\n Braintree.config.onPaymentMethodError();\n }\n }.bind(this)).then(function (data) {\n if (typeof events.onRender === 'function') {\n events.onRender(data);\n }\n });\n }\n },\n\n /**\n * Get locale\n * @returns {String}\n */\n getLocale: function () {\n return window.checkoutConfig.payment[this.getCode()].locale;\n },\n\n /**\n * Is Billing Address required from PayPal side\n * @returns {exports.isRequiredBillingAddress|(function())|boolean}\n */\n isRequiredBillingAddress: function () {\n return window.checkoutConfig.payment[this.getCode()].isRequiredBillingAddress;\n },\n\n /**\n * Get configuration for PayPal\n * @returns {Object}\n */\n getPayPalConfig: function () {\n var totals = quote.totals(),\n config = {},\n isActiveVaultEnabler = this.isActiveVault();\n\n config.paypal = {\n flow: 'checkout',\n amount: parseFloat(this.grandTotalAmount).toFixed(2),\n currency: totals['base_currency_code'],\n locale: this.getLocale(),\n\n /**\n * Triggers on any Braintree error\n */\n onError: function () {\n this.paymentMethodNonce = null;\n },\n\n /**\n * Triggers if browser doesn't support PayPal Checkout\n */\n onUnsupported: function () {\n this.paymentMethodNonce = null;\n }\n };\n\n if (isActiveVaultEnabler) {\n config.paypal.requestBillingAgreement = true;\n }\n\n if (!quote.isVirtual()) {\n config.paypal.enableShippingAddress = true;\n config.paypal.shippingAddressEditable = false;\n config.paypal.shippingAddressOverride = this.getShippingAddress();\n }\n\n if (this.getMerchantName()) {\n config.paypal.displayName = this.getMerchantName();\n }\n\n return config;\n },\n\n /**\n * Get shipping address\n * @returns {Object}\n */\n getShippingAddress: function () {\n var address = quote.shippingAddress();\n\n return {\n recipientName: address.firstname + ' ' + address.lastname,\n line1: address.street[0],\n line2: typeof address.street[2] === 'undefined' ? address.street[1] : address.street[1] + ' ' + address.street[2],\n city: address.city,\n countryCode: address.countryId,\n postalCode: address.postcode,\n state: address.regionCode\n };\n },\n\n /**\n * Get merchant name\n * @returns {String}\n */\n getMerchantName: function () {\n return window.checkoutConfig.payment[this.getCode()].merchantName;\n },\n\n /**\n * Get data\n * @returns {Object}\n */\n getData: function () {\n var data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n this.vaultEnabler.visitAdditionalData(data);\n\n return data;\n },\n\n /**\n * Returns payment acceptance mark image path\n * @returns {String}\n */\n getPaymentAcceptanceMarkSrc: function () {\n return window.checkoutConfig.payment[this.getCode()].paymentAcceptanceMarkSrc;\n },\n\n /**\n * @returns {String}\n */\n getVaultCode: function () {\n return window.checkoutConfig.payment[this.getCode()].vaultCode;\n },\n\n /**\n * Check if need to skip order review\n * @returns {Boolean}\n */\n isSkipOrderReview: function () {\n return window.checkoutConfig.payment[this.getCode()].skipOrderReview;\n },\n\n /**\n * Checks if vault is active\n * @returns {Boolean}\n */\n isActiveVault: function () {\n return this.vaultEnabler.isVaultEnabled() && this.vaultEnabler.isActivePaymentTokenEnabler();\n },\n\n /**\n * Re-init PayPal Auth flow to use Vault\n */\n onVaultPaymentTokenEnablerChange: function () {\n this.clientConfig.paypal.singleUse = !this.isActiveVault();\n this.reInitPayPal();\n },\n\n /**\n * Disable submit button\n */\n disableButton: function () {\n // stop any previous shown loaders\n fullScreenLoader.stopLoader(true);\n fullScreenLoader.startLoader();\n $('[data-button=\"place\"]').attr('disabled', 'disabled');\n },\n\n /**\n * Enable submit button\n */\n enableButton: function () {\n $('[data-button=\"place\"]').removeAttr('disabled');\n fullScreenLoader.stopLoader(true);\n },\n\n /**\n * Triggers when customer click \"Continue to PayPal\" button\n */\n payWithPayPal: function () {\n if (additionalValidators.validate()) {\n Braintree.checkout.paypal.initAuthFlow();\n }\n },\n\n /**\n * Get button id\n * @returns {String}\n */\n getPayPalButtonId: function () {\n return this.clientConfig.buttonPayPalId;\n },\n\n /**\n * Get button id\n * @returns {String}\n */\n getCreditButtonId: function () {\n return this.clientConfig.buttonCreditId;\n },\n\n /**\n * Get button id\n * @returns {String}\n */\n getPaylaterButtonId: function () {\n return this.clientConfig.buttonPaylaterId;\n },\n\n isPaylaterEnabled: function () {\n return window.checkoutConfig.payment['braintree_paypal_paylater']['isActive'];\n },\n\n isPaylaterMessageEnabled: function () {\n return window.checkoutConfig.payment['braintree_paypal_paylater']['isMessageActive'];\n },\n\n getGrandTotalAmount: function () {\n return parseFloat(this.grandTotalAmount).toFixed(2);\n },\n\n isCreditEnabled: function () {\n return window.checkoutConfig.payment['braintree_paypal_credit']['isActive'];\n },\n\n /**\n * Get Message Layout\n * @returns {*}\n */\n getMessagingLayout: function () {\n return window.checkoutConfig.payment['braintree_paypal_paylater']['message']['layout'];\n },\n\n /**\n * Get Message Logo\n * @returns {*}\n */\n getMessagingLogo: function () {\n return window.checkoutConfig.payment['braintree_paypal_paylater']['message']['logo'];\n },\n\n /**\n * Get Message Logo position\n * @returns {*}\n */\n getMessagingLogoPosition: function () {\n return window.checkoutConfig.payment['braintree_paypal_paylater']['message']['logo_position'];\n },\n\n /**\n * Get Message Text Color\n * @returns {*}\n */\n getMessagingTextColor: function () {\n return window.checkoutConfig.payment['braintree_paypal_paylater']['message']['text_color'];\n },\n\n /**\n * Get line items\n * @returns {Array}\n */\n getLineItems: function () {\n let self = this;\n let lineItems = [], storeCredit = 0, giftCardAccount = 0;\n let giftWrappingItems = 0, giftWrappingOrder = 0;\n $.each(quote.totals()['total_segments'], function(segmentsKey, segmentsItem) {\n if (segmentsItem['code'] === 'customerbalance') {\n storeCredit = parseFloat(Math.abs(segmentsItem['value']).toString()).toFixed(2);\n }\n if (segmentsItem['code'] === 'giftcardaccount') {\n giftCardAccount = parseFloat(Math.abs(segmentsItem['value']).toString()).toFixed(2);\n }\n if (segmentsItem['code'] === 'giftwrapping') {\n let extensionAttributes = segmentsItem['extension_attributes'];\n giftWrappingOrder = extensionAttributes['gw_base_price'];\n giftWrappingItems = extensionAttributes['gw_items_base_price'];\n }\n });\n if (this.canSendLineItems()) {\n $.each(quote.getItems(), function(quoteItemKey, quoteItem) {\n if (quoteItem.parent_item_id !== null || 0.0 === quoteItem.price) {\n return true;\n }\n\n let itemName = self.replaceUnsupportedCharacters(quoteItem.name);\n let itemSku = self.replaceUnsupportedCharacters(quoteItem.sku);\n\n let description = '';\n let itemQty = parseFloat(quoteItem.qty);\n let itemUnitAmount = parseFloat(quoteItem.price);\n if (itemQty > Math.floor(itemQty) && itemQty < Math.ceil(itemQty)) {\n description = 'Item quantity is ' + itemQty.toFixed(2) + ' and per unit amount is ' + itemUnitAmount.toFixed(2);\n itemUnitAmount = parseFloat(itemQty * itemUnitAmount);\n itemQty = parseFloat('1');\n }\n\n let lineItemValues = [\n itemName,\n 'debit',\n itemQty.toFixed(2),\n itemUnitAmount.toFixed(2),\n parseFloat(quoteItem.base_tax_amount).toFixed(2),\n itemSku,\n description\n ];\n\n let mappedLineItems = $.map(self.lineItemsArray, function(itemElement, itemIndex) {\n return [[\n self.lineItemsArray[itemIndex],\n lineItemValues[itemIndex]\n ]]\n });\n\n lineItems[quoteItemKey] = Object.fromEntries(mappedLineItems);\n });\n\n /**\n * Adds credit (refund or discount) kind as LineItems for the\n * PayPal transaction if discount amount is greater than 0(Zero)\n * as discountAmount lineItem field is not being used by PayPal.\n *\n * https://developer.paypal.com/braintree/docs/reference/response/transaction-line-item/php#discount_amount\n */\n let baseDiscountAmount = parseFloat(Math.abs(quote.totals()['base_discount_amount']).toString()).toFixed(2);\n if (baseDiscountAmount > 0) {\n let discountLineItem = {\n 'name': 'Discount',\n 'kind': 'credit',\n 'quantity': 1.00,\n 'unitAmount': baseDiscountAmount\n };\n\n lineItems = $.merge(lineItems, [discountLineItem]);\n }\n\n /**\n * Adds shipping as LineItems for the PayPal transaction\n * if shipping amount is greater than 0(Zero) to manage\n * the totals with client-side implementation as there is\n * no any field exist in the client-side implementation\n * to send the shipping amount to the Braintree.\n */\n if (quote.totals()['base_shipping_amount'] > 0) {\n let shippingLineItem = {\n 'name': 'Shipping',\n 'kind': 'debit',\n 'quantity': 1.00,\n 'unitAmount': quote.totals()['base_shipping_amount']\n };\n\n lineItems = $.merge(lineItems, [shippingLineItem]);\n }\n\n /**\n * Adds credit (Store Credit) kind as LineItems for the\n * PayPal transaction if store credit is greater than 0(Zero)\n * to manage the totals with client-side implementation\n */\n if (storeCredit > 0) {\n let storeCreditItem = {\n 'name': 'Store Credit',\n 'kind': 'credit',\n 'quantity': 1.00,\n 'unitAmount': storeCredit\n };\n\n lineItems = $.merge(lineItems, [storeCreditItem]);\n }\n\n /**\n * Adds Gift Wrapping for items as LineItems for the PayPal\n * transaction if it is greater than 0(Zero) to manage\n * the totals with client-side implementation\n */\n if (giftWrappingItems > 0) {\n let gwItems = {\n 'name': 'Gift Wrapping for Items',\n 'kind': 'debit',\n 'quantity': 1.00,\n 'unitAmount': giftWrappingItems\n };\n\n lineItems = $.merge(lineItems, [gwItems]);\n }\n\n /**\n * Adds Gift Wrapping for order as LineItems for the PayPal\n * transaction if it is greater than 0(Zero) to manage\n * the totals with client-side implementation\n */\n if (giftWrappingOrder > 0) {\n let gwOrderItem = {\n 'name': 'Gift Wrapping for Order',\n 'kind': 'debit',\n 'quantity': 1.00,\n 'unitAmount': giftWrappingOrder\n };\n\n lineItems = $.merge(lineItems, [gwOrderItem]);\n }\n\n /**\n * Adds Gift Cards as credit LineItems for the PayPal\n * transaction if it is greater than 0(Zero) to manage\n * the totals with client-side implementation\n */\n if (giftCardAccount > 0) {\n let giftCardItem = {\n 'name': 'Gift Cards',\n 'kind': 'credit',\n 'quantity': 1.00,\n 'unitAmount': giftCardAccount\n };\n\n lineItems = $.merge(lineItems, [giftCardItem]);\n }\n\n if (lineItems.length >= 250) {\n lineItems = [];\n }\n }\n return lineItems;\n },\n\n /**\n * Regex to replace all unsupported characters.\n *\n * @param str\n */\n replaceUnsupportedCharacters: function (str) {\n str.replace('/[^a-zA-Z0-9\\s\\-.\\']/', '');\n return str.substr(0, 127);\n },\n\n /**\n * Can send line items\n *\n * @returns {Boolean}\n */\n canSendLineItems: function () {\n return window.checkoutConfig.payment[this.getCode()].canSendLineItems;\n }\n });\n});\n","PayPal_Braintree/js/view/payment/method-renderer/ach.js":"define(\n [\n 'Magento_Checkout/js/view/payment/default',\n 'ko',\n 'jquery',\n 'braintree',\n 'braintreeDataCollector',\n 'braintreeAch',\n 'PayPal_Braintree/js/form-builder',\n 'Magento_Ui/js/model/messageList',\n 'Magento_Checkout/js/action/select-billing-address',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/model/quote',\n 'mage/translate'\n ],\n function (\n Component,\n ko,\n $,\n braintree,\n dataCollector,\n ach,\n formBuilder,\n messageList,\n selectBillingAddress,\n fullScreenLoader,\n quote,\n $t\n ) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n deviceData: null,\n paymentMethodNonce: null,\n template: 'PayPal_Braintree/payment/ach',\n achInstance: null,\n routingNumber: ko.observable(\"\"),\n accountNumber: ko.observable(\"\"),\n accountType: ko.observable(\"checking\"),\n ownershipType: ko.observable(\"personal\"),\n firstName: ko.observable(\"\"),\n lastName: ko.observable(\"\"),\n businessName: ko.observable(\"\"),\n hasAuthorization: ko.observable(false),\n business: ko.observable(false), // for ownership type\n personal: ko.observable(true) // for ownership type\n },\n\n clickAchBtn: function () {\n if (!this.validateForm('#' + this.getCode() + '-form')) {\n return;\n }\n\n fullScreenLoader.startLoader();\n\n var self = this;\n\n var billingAddress = quote.billingAddress();\n\n let regionCode;\n\n let bankDetails = {\n routingNumber: self.routingNumber(),\n accountNumber: self.accountNumber(),\n accountType: self.accountType(),\n ownershipType: self.ownershipType(),\n billingAddress: {\n streetAddress: billingAddress.street[0],\n extendedAddress: billingAddress.street[1],\n locality: billingAddress.city,\n region: billingAddress.regionCode,\n postalCode: billingAddress.postcode,\n }\n };\n\n if (bankDetails.ownershipType === 'personal') {\n bankDetails.firstName = self.firstName();\n bankDetails.lastName = self.lastName();\n } else {\n bankDetails.businessName = self.businessName();\n }\n\n var mandateText = document.getElementById('braintree-ach-mandate').textContent;\n\n // if no region code is available, lets find one!\n if (typeof billingAddress.regionCode === 'undefined') {\n $.get('/rest/V1/directory/countries/' + billingAddress.countryId).done(function (data) {\n if (typeof data.available_regions !== 'undefined') {\n for (var i = 0; i < data.available_regions.length; ++i) {\n if (data.available_regions[i].id === billingAddress.regionId) {\n regionCode = data.available_regions[i].code;\n bankDetails.billingAddress.region = regionCode;\n self.tokenizeAch(bankDetails, mandateText);\n }\n }\n } else {\n fullScreenLoader.stopLoader();\n self.tokenizeAch(bankDetails, mandateText);\n }\n }).fail(function() {\n fullScreenLoader.stopLoader();\n });\n } else {\n self.tokenizeAch(bankDetails, mandateText);\n }\n },\n\n tokenizeAch: function (bankDetails, mandateText) {\n var self = this;\n this.achInstance.tokenize({\n bankDetails: bankDetails,\n mandateText: mandateText\n }, function (tokenizeErr, tokenizedPayload) {\n if (tokenizeErr) {\n self.setErrorMsg($t('There was an error with the provided bank details. Please check and try again.'));\n self.hasAuthorization(false);\n } else {\n fullScreenLoader.stopLoader();\n self.handleAchSuccess(tokenizedPayload);\n }\n });\n },\n\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n },\n\n getCode: function () {\n return 'braintree_ach_direct_debit';\n },\n\n getStoreName: function () {\n return window.checkoutConfig.payment[this.getCode()].storeName;\n },\n\n getData: function () {\n let data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce,\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n return data;\n },\n\n getTitle: function() {\n return 'ACH Direct Debit';\n },\n\n handleAchSuccess: function (payload) {\n this.setPaymentMethodNonce(payload.nonce);\n this.placeOrder();\n },\n\n initialize: function () {\n this._super();\n\n var self = this;\n\n braintree.create({\n authorization: self.getClientToken()\n }, function (clientError, clientInstance) {\n if (clientError) {\n this.setErrorMsg($t('Unable to initialize Braintree Client.'));\n return;\n }\n\n ach.create({\n client: clientInstance\n }, function (achErr, achInstance) {\n if (achErr) {\n self.setErrorMsg($t('Error initializing ACH: %1').replace('%1', achErr));\n return;\n }\n\n self.setAchInstance(achInstance);\n });\n });\n\n return this;\n },\n\n isAllowed: function () {\n return window.checkoutConfig.payment[this.getCode()].isAllowed;\n },\n\n changeOwnershipType: function (data, event) {\n var self = this;\n if (event.currentTarget.value === 'business') {\n self.business(true);\n self.personal(false);\n } else {\n self.business(false);\n self.personal(true);\n }\n },\n\n isBusiness: function () {\n return this.business;\n },\n\n isPersonal: function () {\n return this.personal;\n },\n\n setErrorMsg: function (message) {\n messageList.addErrorMessage({\n message: message\n });\n },\n\n setPaymentMethodNonce: function (nonce) {\n this.paymentMethodNonce = nonce;\n },\n\n setAchInstance: function (instance) {\n this.achInstance = instance;\n },\n\n validateForm: function (form) {\n return $(form).validation() && $(form).validation('isValid');\n }\n });\n }\n);\n","PayPal_Braintree/js/view/payment/method-renderer/cc-form.js":"/**\n * Copyright 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine(\n [\n 'underscore',\n 'jquery',\n 'Magento_Payment/js/view/payment/cc-form',\n 'Magento_Checkout/js/model/quote',\n 'PayPal_Braintree/js/view/payment/adapter',\n 'mage/translate',\n 'PayPal_Braintree/js/validator',\n 'PayPal_Braintree/js/view/payment/validator-handler',\n 'Magento_Checkout/js/model/full-screen-loader'\n ],\n function (\n _,\n $,\n Component,\n quote,\n braintree,\n $t,\n validator,\n validatorManager,\n fullScreenLoader\n ) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n active: false,\n braintreeClient: null,\n braintreeDeviceData: null,\n paymentMethodNonce: null,\n lastBillingAddress: null,\n validatorManager: validatorManager,\n code: 'braintree',\n isProcessing: false,\n creditCardBin: null,\n\n /**\n * Additional payment data\n *\n * {Object}\n */\n additionalData: {},\n\n /**\n * Braintree client configuration\n *\n * {Object}\n */\n clientConfig: {\n onReady: function (context) {\n context.setupHostedFields();\n },\n\n /**\n * Triggers on payment nonce receive\n * @param {Object} response\n */\n onPaymentMethodReceived: function (response) {\n this.handleNonce(response);\n this.isProcessing = false;\n },\n\n /**\n * Allow a new nonce to be generated\n */\n onPaymentMethodError: function() {\n this.isProcessing = false;\n },\n\n /**\n * Device data initialization\n * @param {String} deviceData\n */\n onDeviceDataReceived: function (deviceData) {\n this.additionalData['device_data'] = deviceData;\n },\n\n /**\n * After Braintree instance initialization\n */\n onInstanceReady: function () {},\n\n /**\n * Triggers on any Braintree error\n * @param {Object} response\n */\n onError: function (response) {\n this.isProcessing = false;\n braintree.showError($t('Payment ' + this.getTitle() + ' can\\'t be initialized'));\n throw response.message;\n },\n\n /**\n * Triggers when customer click \"Cancel\"\n */\n onCancelled: function () {\n this.paymentMethodNonce = null;\n this.isProcessing = false;\n }\n },\n imports: {\n onActiveChange: 'active'\n }\n },\n\n /**\n * Set list of observable attributes\n *\n * @returns {exports.initObservable}\n */\n initObservable: function () {\n validator.setConfig(window.checkoutConfig.payment[this.getCode()]);\n this._super()\n .observe(['active']);\n this.validatorManager.initialize();\n this.initClientConfig();\n\n return this;\n },\n\n /**\n * Get payment name\n *\n * @returns {String}\n */\n getCode: function () {\n return this.code;\n },\n\n /**\n * Check if payment is active\n *\n * @returns {Boolean}\n */\n isActive: function () {\n let active = this.getCode() === this.isChecked();\n this.active(active);\n\n return active;\n },\n\n /**\n * Triggers when payment method change\n * @param {Boolean} isActive\n */\n onActiveChange: function (isActive) {\n if (!isActive) {\n return;\n }\n\n this.initBraintree();\n },\n\n /**\n * Init config\n */\n initClientConfig: function () {\n _.each(this.clientConfig, function (fn, name) {\n if (typeof fn === 'function') {\n this.clientConfig[name] = fn.bind(this);\n }\n }, this);\n },\n\n /**\n * Init Braintree configuration\n */\n initBraintree: function () {\n let intervalId = setInterval(function () {\n // stop loader when frame will be loaded\n if ($('#braintree-hosted-field-number').length) {\n clearInterval(intervalId);\n fullScreenLoader.stopLoader(true);\n }\n }, 500);\n\n if (braintree.checkout) {\n braintree.checkout.teardown(function () {\n braintree.checkout = null;\n });\n }\n\n fullScreenLoader.startLoader();\n braintree.setConfig(this.clientConfig);\n braintree.setup();\n },\n\n /**\n * Get full selector name\n *\n * @param {String} field\n * @returns {String}\n */\n getSelector: function (field) {\n return '#' + this.getCode() + '_' + field;\n },\n\n /**\n * Get list of available CC types\n *\n * @returns {Object}\n */\n getCcAvailableTypes: function () {\n let availableTypes = validator.getAvailableCardTypes(),\n billingAddress = quote.billingAddress(),\n billingCountryId;\n\n this.lastBillingAddress = quote.shippingAddress();\n\n if (!billingAddress) {\n billingAddress = this.lastBillingAddress;\n }\n\n billingCountryId = billingAddress.countryId;\n\n if (billingCountryId && validator.getCountrySpecificCardTypes(billingCountryId)) {\n return validator.collectTypes(\n availableTypes,\n validator.getCountrySpecificCardTypes(billingCountryId)\n );\n }\n\n return availableTypes;\n },\n\n /**\n * @returns {String}\n */\n getEnvironment: function () {\n return window.checkoutConfig.payment[this.getCode()].environment;\n },\n\n /**\n * Get data\n *\n * @returns {Object}\n */\n getData: function () {\n let data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce,\n 'g-recaptcha-response' : $(\"#token-grecaptcha-braintree\").val()\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n return data;\n },\n\n /**\n * Set payment nonce\n * @param {String} paymentMethodNonce\n */\n setPaymentMethodNonce: function (paymentMethodNonce) {\n this.paymentMethodNonce = paymentMethodNonce;\n },\n\n /**\n * Set credit card bin\n * @param creditCardBin\n */\n setCreditCardBin: function (creditCardBin) {\n this.creditCardBin = creditCardBin;\n },\n\n /**\n * Prepare payload to place order\n * @param {Object} payload\n */\n handleNonce: function (payload) {\n let self = this;\n\n this.setPaymentMethodNonce(payload.nonce);\n this.setCreditCardBin(payload.details.bin);\n\n // place order on success validation\n self.validatorManager.validate(self, function () {\n return self.placeOrder('parent');\n }, function() {\n self.isProcessing = false;\n self.paymentMethodNonce = null;\n self.creditCardBin = null;\n });\n },\n\n /**\n * Action to place order\n * @param {String} key\n */\n placeOrder: function (key) {\n if (key) {\n return this._super();\n }\n\n if (this.isProcessing) {\n return false;\n } else {\n this.isProcessing = true;\n }\n\n braintree.tokenizeHostedFields();\n return false;\n },\n\n /**\n * Get payment icons\n * @param {String} type\n * @returns {Boolean}\n */\n getIcons: function (type) {\n return window.checkoutConfig.payment.braintree.icons.hasOwnProperty(type) ?\n window.checkoutConfig.payment.braintree.icons[type]\n : false;\n },\n });\n }\n);\n","PayPal_Braintree/js/view/payment/method-renderer/paypal-vault.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'jquery',\n 'underscore',\n 'Magento_Vault/js/view/payment/method-renderer/vault',\n 'Magento_Ui/js/model/messageList',\n 'Magento_Checkout/js/model/full-screen-loader'\n], function ($, _, VaultComponent, globalMessageList, fullScreenLoader) {\n 'use strict';\n\n return VaultComponent.extend({\n defaults: {\n template: 'PayPal_Braintree/payment/paypal/vault',\n additionalData: {}\n },\n\n /**\n * Get PayPal payer email\n * @returns {String}\n */\n getPayerEmail: function () {\n return this.details.payerEmail;\n },\n\n /**\n * Get type of payment\n * @returns {String}\n */\n getPaymentIcon: function () {\n return window.checkoutConfig.payment['braintree_paypal'].paymentIcon;\n },\n\n /**\n * Place order\n */\n beforePlaceOrder: function () {\n this.getPaymentMethodNonce();\n },\n\n /**\n * Send request to get payment method nonce\n */\n getPaymentMethodNonce: function () {\n var self = this;\n\n fullScreenLoader.startLoader();\n $.getJSON(self.nonceUrl, {\n 'public_hash': self.publicHash\n })\n .done(function (response) {\n fullScreenLoader.stopLoader();\n self.additionalData['payment_method_nonce'] = response.paymentMethodNonce;\n self.placeOrder();\n })\n .fail(function (response) {\n var error = JSON.parse(response.responseText);\n\n fullScreenLoader.stopLoader();\n globalMessageList.addErrorMessage({\n message: error.message\n });\n });\n },\n\n /**\n * Get payment method data\n * @returns {Object}\n */\n getData: function () {\n var data = {\n 'method': this.code,\n 'additional_data': {\n 'public_hash': this.publicHash\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n return data;\n }\n });\n});\n","PayPal_Braintree/js/view/payment/method-renderer/hosted-fields.js":"/**\n * Copyright 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\n\ndefine([\n 'jquery',\n 'PayPal_Braintree/js/view/payment/method-renderer/cc-form',\n 'PayPal_Braintree/js/validator',\n 'Magento_Vault/js/view/payment/vault-enabler',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'mage/translate'\n], function ($, Component, validator, VaultEnabler, additionalValidators, $t) {\n 'use strict';\n\n return Component.extend({\n\n defaults: {\n template: 'PayPal_Braintree/payment/form',\n clientConfig: {\n\n /**\n * {String}\n */\n id: 'co-transparent-form-braintree'\n },\n isValidCardNumber: false,\n isValidExpirationDate: false,\n isValidCvvNumber: false,\n\n onInstanceReady: function (instance) {\n instance.on('validityChange', this.onValidityChange.bind(this));\n instance.on('cardTypeChange', this.onCardTypeChange.bind(this));\n }\n },\n\n /**\n * @returns {exports.initialize}\n */\n initialize: function () {\n this._super();\n this.vaultEnabler = new VaultEnabler();\n this.vaultEnabler.setPaymentCode(this.getVaultCode());\n\n return this;\n },\n\n /**\n * Init config\n */\n initClientConfig: function () {\n this._super();\n\n this.clientConfig.hostedFields = this.getHostedFields();\n this.clientConfig.onInstanceReady = this.onInstanceReady.bind(this);\n },\n\n /**\n * @returns {Object}\n */\n getData: function () {\n var data = this._super();\n\n this.vaultEnabler.visitAdditionalData(data);\n\n return data;\n },\n\n /**\n * @returns {Bool}\n */\n isVaultEnabled: function () {\n return this.vaultEnabler.isVaultEnabled();\n },\n\n /**\n * Get Braintree Hosted Fields\n * @returns {Object}\n */\n getHostedFields: function () {\n var self = this,\n fields = {\n number: {\n selector: self.getSelector('cc_number'),\n placeholder: $t('4111 1111 1111 1111')\n },\n expirationDate: {\n selector: self.getSelector('expirationDate'),\n placeholder: $t('MM/YYYY')\n }\n };\n\n if (self.hasVerification()) {\n fields.cvv = {\n selector: self.getSelector('cc_cid'),\n placeholder: $t('123')\n };\n }\n\n return fields;\n },\n\n /**\n * Triggers on Hosted Field changes\n * @param {Object} event\n * @returns {Boolean}\n */\n onValidityChange: function (event) {\n // Handle a change in validation or card type\n if (event.emittedBy === 'number') {\n this.selectedCardType(null);\n\n if (event.cards.length === 1) {\n this.isValidCardNumber = event.fields.number.isValid;\n this.selectedCardType(\n validator.getMageCardType(event.cards[0].type, this.getCcAvailableTypes())\n );\n this.validateCardType();\n } else {\n this.isValidCardNumber = event.fields.number.isValid;\n this.validateCardType();\n }\n }\n\n // Other field validations\n if (event.emittedBy === 'expirationDate') {\n this.isValidExpirationDate = event.fields.expirationDate.isValid;\n }\n if (event.emittedBy === 'cvv') {\n this.isValidCvvNumber = event.fields.cvv.isValid;\n }\n },\n\n /**\n * Triggers on Hosted Field card type changes\n * @param {Object} event\n * @returns {Boolean}\n */\n onCardTypeChange: function (event) {\n if (event.cards.length === 1) {\n this.selectedCardType(\n validator.getMageCardType(event.cards[0].type, this.getCcAvailableTypes())\n );\n } else {\n this.selectedCardType(null);\n }\n },\n\n /**\n * Toggle invalid class on selector\n * @param selector\n * @param state\n * @returns {boolean}\n */\n validateField: function (selector, state) {\n var $selector = $(this.getSelector(selector)),\n invalidClass = 'braintree-hosted-fields-invalid';\n\n if (state === true) {\n $selector.removeClass(invalidClass);\n return true;\n }\n\n $selector.addClass(invalidClass);\n return false;\n },\n\n /**\n * Validate current credit card type\n * @returns {Boolean}\n */\n validateCardType: function () {\n return this.validateField(\n 'cc_number',\n (this.isValidCardNumber)\n );\n },\n\n /**\n * Validate current expiry date\n * @returns {boolean}\n */\n validateExpirationDate: function () {\n return this.validateField(\n 'expirationDate',\n (this.isValidExpirationDate === true)\n );\n },\n\n /**\n * Validate current CVV field\n * @returns {boolean}\n */\n validateCvvNumber: function () {\n var self = this;\n\n if (self.hasVerification() === false) {\n return true;\n }\n\n return this.validateField(\n 'cc_cid',\n (this.isValidCvvNumber === true)\n );\n },\n\n /**\n * Validate all fields\n * @returns {boolean}\n */\n validateFormFields: function () {\n return (this.validateCardType() && this.validateExpirationDate() && this.validateCvvNumber()) === true;\n },\n\n /**\n * Trigger order placing\n */\n placeOrderClick: function () {\n if (this.validateFormFields() && additionalValidators.validate()) {\n this.placeOrder();\n }\n },\n /**\n * @returns {String}\n */\n getVaultCode: function () {\n return window.checkoutConfig.payment[this.getCode()].ccVaultCode;\n }\n });\n});\n","PayPal_Braintree/js/view/payment/method-renderer/lpm.js":"define(\n [\n 'Magento_Checkout/js/view/payment/default',\n 'ko',\n 'jquery',\n 'braintree',\n 'braintreeLpm',\n 'PayPal_Braintree/js/form-builder',\n 'Magento_Ui/js/model/messageList',\n 'Magento_Checkout/js/action/select-billing-address',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'mage/url',\n 'mage/translate'\n ],\n function (\n Component,\n ko,\n $,\n braintree,\n lpm,\n formBuilder,\n messageList,\n selectBillingAddress,\n fullScreenLoader,\n quote,\n additionalValidators,\n url,\n $t\n ) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n code: 'braintree_local_payment',\n paymentMethodsAvailable: ko.observable(false),\n paymentMethodNonce: null,\n template: 'PayPal_Braintree/payment/lpm'\n },\n\n clickPaymentBtn: function (method) {\n var self = this;\n\n if (additionalValidators.validate()) {\n fullScreenLoader.startLoader();\n\n braintree.create({\n authorization: self.getClientToken()\n }, function (clientError, clientInstance) {\n if (clientError) {\n self.setErrorMsg($t('Unable to initialize Braintree Client.'));\n fullScreenLoader.stopLoader();\n return;\n }\n\n lpm.create({\n client: clientInstance,\n merchantAccountId: self.getMerchantAccountId()\n }, function (lpmError, lpmInstance) {\n if (lpmError) {\n self.setErrorMsg(lpmError);\n fullScreenLoader.stopLoader();\n return;\n }\n\n lpmInstance.startPayment({\n amount: self.getAmount(),\n currencyCode: self.getCurrencyCode(),\n email: self.getCustomerDetails().email,\n phone: self.getCustomerDetails().phone,\n givenName: self.getCustomerDetails().firstName,\n surname: self.getCustomerDetails().lastName,\n shippingAddressRequired: !quote.isVirtual(),\n address: self.getAddress(),\n paymentType: method,\n onPaymentStart: function (data, start) {\n start();\n },\n // This is a required option, however it will apparently never be used in the current payment flow.\n // Therefore, both values are set to allow the payment flow to continute, rather than erroring out.\n fallback: {\n url: 'N/A',\n buttonText: 'N/A'\n }\n }, function (startPaymentError, payload) {\n fullScreenLoader.stopLoader();\n if (startPaymentError) {\n switch (startPaymentError.code) {\n case 'LOCAL_PAYMENT_POPUP_CLOSED':\n self.setErrorMsg($t('Local Payment popup was closed unexpectedly.'));\n break;\n case 'LOCAL_PAYMENT_WINDOW_OPEN_FAILED':\n self.setErrorMsg($t('Local Payment popup failed to open.'));\n break;\n case 'LOCAL_PAYMENT_WINDOW_CLOSED':\n self.setErrorMsg($t('Local Payment popup was closed. Payment cancelled.'));\n break;\n default:\n self.setErrorMsg('Error! ' + startPaymentError);\n break;\n }\n } else {\n // Send the nonce to your server to create a transaction\n self.setPaymentMethodNonce(payload.nonce);\n self.placeOrder();\n }\n });\n });\n });\n }\n },\n\n getAddress: function () {\n var shippingAddress = quote.shippingAddress();\n\n if (quote.isVirtual()) {\n return {\n countryCode: shippingAddress.countryId\n }\n }\n\n return {\n streetAddress: shippingAddress.street[0],\n extendedAddress: shippingAddress.street[1],\n locality: shippingAddress.city,\n postalCode: shippingAddress.postcode,\n region: shippingAddress.region,\n countryCode: shippingAddress.countryId\n }\n },\n\n getAmount: function () {\n return quote.totals()['base_grand_total'].toString();\n },\n\n getBillingAddress: function () {\n return quote.billingAddress();\n },\n\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n },\n\n getCode: function () {\n return this.code;\n },\n\n getCurrencyCode: function () {\n return quote.totals()['base_currency_code'];\n },\n\n getCustomerDetails: function () {\n var billingAddress = quote.billingAddress();\n return {\n firstName: billingAddress.firstname,\n lastName: billingAddress.lastname,\n phone: billingAddress.telephone,\n email: typeof quote.guestEmail === 'string' ? quote.guestEmail : window.checkoutConfig.customerData.email\n }\n },\n\n getData: function () {\n let data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce,\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n return data;\n },\n\n getMerchantAccountId: function () {\n return window.checkoutConfig.payment[this.getCode()].merchantAccountId;\n },\n\n getPaymentMethod: function (method) {\n var methods = this.getPaymentMethods();\n\n for (var i = 0; i < methods.length; i++) {\n if (methods[i].method === method) {\n return methods[i]\n }\n }\n },\n\n getPaymentMethods: function () {\n return window.checkoutConfig.payment[this.getCode()].allowedMethods;\n },\n\n getPaymentMarkSrc: function () {\n return window.checkoutConfig.payment[this.getCode()].paymentIcons;\n },\n\n getTitle: function () {\n return window.checkoutConfig.payment[this.getCode()].title;\n },\n\n initialize: function () {\n this._super();\n return this;\n },\n\n isActive: function () {\n var address = quote.billingAddress() || quote.shippingAddress();\n var methods = this.getPaymentMethods();\n\n for (var i = 0; i < methods.length; i++) {\n if (methods[i].countries.includes(address.countryId)) {\n return true;\n }\n }\n\n return false;\n },\n\n isValidCountryAndCurrency: function (method) {\n var address = quote.billingAddress();\n\n if (!address) {\n this.paymentMethodsAvailable(false);\n return false;\n }\n\n var countryId = address.countryId;\n var quoteCurrency = quote.totals()['base_currency_code'];\n var paymentMethodDetails = this.getPaymentMethod(method);\n\n if ((countryId !== 'GB' && paymentMethodDetails.countries.includes(countryId) && (quoteCurrency === 'EUR' || quoteCurrency === 'PLN')) || (countryId === 'GB' && paymentMethodDetails.countries.includes(countryId) && quoteCurrency === 'GBP')) {\n this.paymentMethodsAvailable(true);\n return true;\n }\n\n return false;\n },\n\n setErrorMsg: function (message) {\n messageList.addErrorMessage({\n message: message\n });\n },\n\n setPaymentMethodNonce: function (nonce) {\n this.paymentMethodNonce = nonce;\n },\n\n validateForm: function (form) {\n return $(form).validation() && $(form).validation('isValid');\n }\n });\n }\n);\n","PayPal_Braintree/js/view/payment/method-renderer/multishipping/paypal.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'jquery',\n 'underscore',\n 'braintreeCheckoutPayPalAdapter',\n 'Magento_Checkout/js/model/quote',\n 'PayPal_Braintree/js/view/payment/method-renderer/paypal',\n 'Magento_Checkout/js/action/set-payment-information',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'mage/translate'\n], function (\n $,\n _,\n Braintree,\n quote,\n Component,\n setPaymentInformationAction,\n additionalValidators,\n fullScreenLoader,\n $t\n) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'PayPal_Braintree/payment/multishipping/paypal',\n submitButtonSelector: '[id=\"parent-payment-continue\"]',\n reviewButtonHtml: ''\n },\n\n /**\n * @override\n */\n initObservable: function () {\n this.reviewButtonHtml = $(this.submitButtonSelector).html();\n return this._super();\n },\n\n initClientConfig: function () {\n this.clientConfig = _.extend(this.clientConfig, this.getPayPalConfig());\n this.clientConfig.paypal.enableShippingAddress = false;\n\n _.each(this.clientConfig, function (fn, name) {\n if (typeof fn === 'function') {\n this.clientConfig[name] = fn.bind(this);\n }\n }, this);\n this.clientConfig.buttonPayPalId = 'parent-payment-continue';\n\n },\n\n /**\n * @override\n */\n onActiveChange: function (isActive) {\n this.updateSubmitButtonHtml(isActive);\n this._super(isActive);\n },\n\n /**\n * @override\n */\n beforePlaceOrder: function (data) {\n this._super(data);\n },\n\n /**\n * Re-init PayPal Auth Flow\n */\n reInitPayPal: function () {\n this.disableButton();\n this.clientConfig.paypal.amount = parseFloat(this.grandTotalAmount).toFixed(2);\n\n if (!quote.isVirtual()) {\n this.clientConfig.paypal.enableShippingAddress = false;\n this.clientConfig.paypal.shippingAddressEditable = false;\n }\n\n Braintree.setConfig(this.clientConfig);\n\n if (Braintree.getPayPalInstance()) {\n Braintree.getPayPalInstance().teardown(function () {\n Braintree.setup();\n }.bind(this));\n Braintree.setPayPalInstance(null);\n } else {\n Braintree.setup();\n this.enableButton();\n }\n },\n\n loadPayPalButton: function (paypalCheckoutInstance, funding) {\n let paypalPayment = Braintree.config.paypal,\n onPaymentMethodReceived = Braintree.config.onPaymentMethodReceived;\n let style = {\n color: Braintree.getColor(funding),\n shape: Braintree.getShape(funding),\n size: Braintree.getSize(funding),\n label: Braintree.getLabel(funding)\n };\n\n if (Braintree.getBranding()) {\n style.branding = Braintree.getBranding();\n }\n if (Braintree.getFundingIcons()) {\n style.fundingicons = Braintree.getFundingIcons();\n }\n\n if (funding === 'credit') {\n Braintree.config.buttonId = this.clientConfig.buttonCreditId;\n } else if (funding === 'paylater') {\n Braintree.config.buttonId = this.clientConfig.buttonPaylaterId;\n } else {\n Braintree.config.buttonId = this.clientConfig.buttonPayPalId;\n }\n\n // Render\n Braintree.config.paypalInstance = paypalCheckoutInstance;\n var events = Braintree.events;\n $('#' + Braintree.config.buttonId).html('');\n\n var button = paypal.Buttons({\n fundingSource: funding,\n env: Braintree.getEnvironment(),\n style: style,\n commit: true,\n locale: Braintree.config.paypal.locale,\n\n createOrder: function () {\n return paypalCheckoutInstance.createPayment(paypalPayment);\n },\n\n onCancel: function (data) {\n console.log('checkout.js payment cancelled', JSON.stringify(data, 0, 2));\n\n if (typeof events.onCancel === 'function') {\n events.onCancel();\n }\n },\n\n onError: function (err) {\n Braintree.showError($t(\"PayPal Checkout could not be initialized. Please contact the store owner.\"));\n Braintree.config.paypalInstance = null;\n console.error('Paypal checkout.js error', err);\n\n if (typeof events.onError === 'function') {\n events.onError(err);\n }\n }.bind(this),\n\n onClick: function (data) {\n // To check term & conditions input checked - validate additional validators.\n if (!additionalValidators.validate()) {\n return false;\n }\n\n if (typeof events.onClick === 'function') {\n events.onClick(data);\n }\n }.bind(this),\n\n onApprove: function (data, actions) {\n return paypalCheckoutInstance.tokenizePayment(data)\n .then(function (payload) {\n onPaymentMethodReceived(payload);\n });\n }\n\n });\n if (button.isEligible() && $('#' + Braintree.config.buttonId).length) {\n\n button.render('#' + Braintree.config.buttonId).then(function () {\n Braintree.enableButton();\n if (typeof Braintree.config.onPaymentMethodError === 'function') {\n Braintree.config.onPaymentMethodError();\n }\n }.bind(this)).then(function (data) {\n if (typeof events.onRender === 'function') {\n events.onRender(data);\n }\n });\n }\n },\n\n /**\n * Get configuration for PayPal\n * @returns {Object}\n */\n getPayPalConfig: function () {\n var totals = quote.totals(),\n config = {},\n isActiveVaultEnabler = this.isActiveVault();\n\n config.paypal = {\n flow: 'checkout',\n amount: parseFloat(this.grandTotalAmount).toFixed(2),\n currency: totals['base_currency_code'],\n locale: this.getLocale(),\n requestBillingAgreement: true,\n /**\n * Triggers on any Braintree error\n */\n onError: function () {\n this.paymentMethodNonce = null;\n },\n\n /**\n * Triggers if browser doesn't support PayPal Checkout\n */\n onUnsupported: function () {\n this.paymentMethodNonce = null;\n }\n };\n\n if (!quote.isVirtual()) {\n config.paypal.enableShippingAddress = false;\n config.paypal.shippingAddressEditable = false;\n }\n\n if (this.getMerchantName()) {\n config.paypal.displayName = this.getMerchantName();\n }\n\n return config;\n },\n\n getShippingAddress: function () {\n\n return {};\n },\n\n /**\n * @override\n */\n getData: function () {\n var data = this._super();\n\n data['additional_data']['is_active_payment_token_enabler'] = true;\n\n return data;\n },\n\n /**\n * @override\n */\n isActiveVault: function () {\n return true;\n },\n\n /**\n * Skipping order review step on checkout with multiple addresses is not allowed.\n *\n * @returns {Boolean}\n */\n isSkipOrderReview: function () {\n return false;\n },\n\n /**\n * Checks if payment method nonce is already received.\n *\n * @returns {Boolean}\n */\n isPaymentMethodNonceReceived: function () {\n return this.paymentMethodNonce !== null;\n },\n\n /**\n * Update submit button on multi-addresses checkout billing form.\n *\n * @param {Boolean} isActive\n */\n updateSubmitButtonHtml: function (isActive) {\n $(this.submitButtonSelector).removeClass(\"primary\");\n if (this.isPaymentMethodNonceReceived() || !isActive) {\n $(this.submitButtonSelector).addClass(\"primary\");\n $(this.submitButtonSelector).html(this.reviewButtonHtml);\n }\n },\n\n /**\n * @override\n */\n placeOrder: function () {\n if (!this.isPaymentMethodNonceReceived()) {\n this.payWithPayPal();\n } else {\n fullScreenLoader.startLoader();\n\n $.when(\n setPaymentInformationAction(\n this.messageContainer,\n this.getData()\n )\n ).done(this.done.bind(this))\n .fail(this.fail.bind(this));\n }\n },\n\n /**\n * {Function}\n */\n fail: function () {\n fullScreenLoader.stopLoader();\n\n return this;\n },\n\n /**\n * {Function}\n */\n done: function () {\n fullScreenLoader.stopLoader();\n $('#multishipping-billing-form').submit();\n\n return this;\n }\n });\n});\n","PayPal_Braintree/js/view/payment/method-renderer/multishipping/hosted-fields.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\n\ndefine([\n 'jquery',\n 'PayPal_Braintree/js/view/payment/method-renderer/hosted-fields',\n 'PayPal_Braintree/js/validator',\n 'Magento_Ui/js/model/messageList',\n 'mage/translate',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/action/set-payment-information',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'PayPal_Braintree/js/view/payment/adapter'\n], function (\n $,\n Component,\n validator,\n messageList,\n $t,\n fullScreenLoader,\n setPaymentInformationAction,\n additionalValidators,\n braintree\n) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'PayPal_Braintree/payment/multishipping/form'\n },\n\n /**\n * Get list of available CC types\n *\n * @returns {Object}\n */\n getCcAvailableTypes: function () {\n let availableTypes = validator.getAvailableCardTypes(),\n billingCountryId;\n\n billingCountryId = $('#multishipping_billing_country_id').val();\n\n if (billingCountryId && validator.getCountrySpecificCardTypes(billingCountryId)) {\n return validator.collectTypes(\n availableTypes, validator.getCountrySpecificCardTypes(billingCountryId)\n );\n }\n\n return availableTypes;\n },\n\n /**\n * @override\n */\n handleNonce: function (payload) {\n let self = this;\n this.setPaymentMethodNonce(payload.nonce);\n this.setCreditCardBin(payload.details.bin);\n\n // place order on success validation\n self.validatorManager.validate(self, function () {\n return self.setPaymentInformation();\n }, function() {\n self.isProcessing = false;\n self.paymentMethodNonce = null;\n self.creditCardBin = null;\n });\n },\n\n /**\n * @override\n */\n placeOrder: function () {\n if (this.isProcessing) {\n return false;\n } else {\n this.isProcessing = true;\n }\n\n braintree.tokenizeHostedFields();\n return false;\n },\n\n /**\n * @override\n */\n setPaymentInformation: function () {\n if (additionalValidators.validate()) {\n fullScreenLoader.startLoader();\n $.when(\n setPaymentInformationAction(\n this.messageContainer,\n this.getData()\n )\n ).done(this.done.bind(this))\n .fail(this.fail.bind(this));\n }\n },\n\n /**\n * {Function}\n */\n fail: function () {\n fullScreenLoader.stopLoader();\n\n return this;\n },\n\n /**\n * {Function}\n */\n done: function () {\n fullScreenLoader.stopLoader();\n $('#multishipping-billing-form').submit();\n\n return this;\n }\n });\n});\n","PayPal_Braintree/js/applepay/api.js":"/**\n * Braintree Apple Pay button API\n *\n **/\ndefine(\n [\n 'jquery',\n 'underscore',\n 'uiComponent',\n 'mage/translate',\n 'mage/storage',\n 'Magento_Customer/js/customer-data'\n ],\n function (\n $,\n _,\n Component,\n $t,\n storage,\n customerData\n ) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n clientToken: null,\n quoteId: 0,\n displayName: null,\n actionSuccess: null,\n grandTotalAmount: 0,\n isLoggedIn: false,\n storeCode: \"default\",\n shippingAddress: {},\n countryDirectory: null,\n shippingMethods: {}\n },\n\n initialize: function () {\n this._super();\n if (!this.countryDirectory) {\n storage.get(\"rest/V1/directory/countries\").done(function (result) {\n this.countryDirectory = {};\n let i, data, x, region;\n for (i = 0; i < result.length; ++i) {\n data = result[i];\n this.countryDirectory[data.two_letter_abbreviation] = {};\n if (typeof data.available_regions !== 'undefined') {\n for (x = 0; x < data.available_regions.length; ++x) {\n region = data.available_regions[x];\n this.countryDirectory[data.two_letter_abbreviation][region.name.toLowerCase().replace(/[^A-Z0-9]/ig, '')] = region.id;\n }\n }\n }\n }.bind(this));\n }\n },\n\n /**\n * Get region ID\n */\n getRegionId: function (countryCode, regionName) {\n if (typeof regionName !== 'string') {\n return null;\n }\n\n regionName = regionName.toLowerCase().replace(/[^A-Z0-9]/ig, '');\n\n if (typeof this.countryDirectory[countryCode] !== 'undefined' && typeof this.countryDirectory[countryCode][regionName] !== 'undefined') {\n return this.countryDirectory[countryCode][regionName];\n }\n\n return 0;\n },\n\n /**\n * Set & get api token\n */\n setClientToken: function (value) {\n this.clientToken = value;\n },\n getClientToken: function () {\n return this.clientToken;\n },\n\n /**\n * Set and get quote id\n */\n setQuoteId: function (value) {\n this.quoteId = value;\n },\n getQuoteId: function () {\n return this.quoteId;\n },\n\n /**\n * Set and get display name\n */\n setDisplayName: function (value) {\n this.displayName = value;\n },\n getDisplayName: function () {\n return this.displayName;\n },\n\n /**\n * Set and get success redirection url\n */\n setActionSuccess: function (value) {\n this.actionSuccess = value;\n },\n getActionSuccess: function () {\n return this.actionSuccess;\n },\n\n /**\n * Set and get grand total\n */\n setGrandTotalAmount: function (value) {\n this.grandTotalAmount = parseFloat(value).toFixed(2);\n },\n getGrandTotalAmount: function () {\n return parseFloat(this.grandTotalAmount);\n },\n\n /**\n * Set and get is logged in\n */\n setIsLoggedIn: function (value) {\n this.isLoggedIn = value;\n },\n getIsLoggedIn: function () {\n return this.isLoggedIn;\n },\n\n /**\n * Set and get store code\n */\n setStoreCode: function (value) {\n this.storeCode = value;\n },\n getStoreCode: function () {\n return this.storeCode;\n },\n\n /**\n * API Urls for logged in / guest\n */\n getApiUrl: function (uri) {\n if (this.getIsLoggedIn() === true) {\n return \"rest/\" + this.getStoreCode() + \"/V1/carts/mine/\" + uri;\n } else {\n return \"rest/\" + this.getStoreCode() + \"/V1/guest-carts/\" + this.getQuoteId() + \"/\" + uri;\n }\n },\n\n /**\n * Payment request info\n */\n getPaymentRequest: function () {\n return {\n total: {\n label: this.getDisplayName(),\n amount: this.getGrandTotalAmount()\n },\n requiredShippingContactFields: ['postalAddress', 'name', 'email', 'phone'],\n requiredBillingContactFields: ['postalAddress', 'name']\n };\n },\n\n /**\n * Retrieve shipping methods based on address\n */\n onShippingContactSelect: function (event, session) {\n // Get the address.\n let address = event.shippingContact;\n\n // Create a payload.\n let payload = {\n address: {\n city: address.locality,\n region: address.administrativeArea,\n country_id: address.countryCode.toUpperCase(),\n postcode: address.postalCode,\n save_in_address_book: 0\n }\n };\n\n this.shippingAddress = payload.address;\n\n // POST to endpoint for shipping methods.\n storage.post(\n this.getApiUrl(\"estimate-shipping-methods\"),\n JSON.stringify(payload)\n ).done(function (result) {\n // Stop if no shipping methods.\n let virtualFlag = false;\n if (result.length === 0) {\n let productItems = customerData.get('cart')().items;\n _.each(productItems,\n function (item) {\n if (item.is_virtual || item.product_type == 'bundle') {\n virtualFlag = true;\n } else {\n virtualFlag = false;\n }\n }\n );\n if (!virtualFlag) {\n session.abort();\n alert($t(\"There are no shipping methods available for you right now. Please try again or use an alternative payment method.\"));\n return false;\n }\n }\n\n let shippingMethods = [];\n this.shippingMethods = {};\n\n // Format shipping methods array.\n for (let i = 0; i < result.length; i++) {\n if (typeof result[i].method_code !== 'string') {\n continue;\n }\n\n let method = {\n identifier: result[i].method_code,\n label: result[i].method_title,\n detail: result[i].carrier_title ? result[i].carrier_title : \"\",\n amount: parseFloat(result[i].amount).toFixed(2)\n };\n\n // Add method object to array.\n shippingMethods.push(method);\n\n this.shippingMethods[result[i].method_code] = result[i];\n\n if (!this.shippingMethod) {\n this.shippingMethod = result[i].method_code;\n }\n }\n\n // Create payload to get totals\n let totalsPayload = {\n \"addressInformation\": {\n \"address\": {\n \"countryId\": this.shippingAddress.country_id,\n \"region\": this.shippingAddress.region,\n \"regionId\": this.getRegionId(this.shippingAddress.country_id, this.shippingAddress.region),\n \"postcode\": this.shippingAddress.postcode\n },\n \"shipping_method_code\": virtualFlag ? null : this.shippingMethods[shippingMethods[0].identifier].method_code,\n \"shipping_carrier_code\": virtualFlag ? null : this.shippingMethods[shippingMethods[0].identifier].carrier_code\n }\n };\n\n // POST to endpoint to get totals, using 1st shipping method\n storage.post(\n this.getApiUrl(\"totals-information\"),\n JSON.stringify(totalsPayload)\n ).done(function (result) {\n // Set total\n this.setGrandTotalAmount(result.base_grand_total);\n\n // Pass shipping methods back\n session.completeShippingContactSelection(\n ApplePaySession.STATUS_SUCCESS,\n shippingMethods,\n {\n label: this.getDisplayName(),\n amount: this.getGrandTotalAmount()\n },\n [{\n type: 'final',\n label: $t('Shipping'),\n amount: virtualFlag ? 0 : shippingMethods[0].amount\n }]\n );\n }.bind(this)).fail(function (result) {\n session.abort();\n alert($t(\"We're unable to fetch the cart totals for you. Please try an alternative payment method.\"));\n console.error(\"Braintree ApplePay: Unable to get totals\", result);\n return false;\n });\n\n }.bind(this)).fail(function (result) {\n session.abort();\n alert($t(\"We're unable to find any shipping methods for you. Please try an alternative payment method.\"));\n console.error(\"Braintree ApplePay: Unable to find shipping methods for estimate-shipping-methods\", result);\n return false;\n });\n },\n\n /**\n * Record which shipping method has been selected & Updated totals\n */\n onShippingMethodSelect: function (event, session) {\n let shippingMethod = event.shippingMethod;\n this.shippingMethod = shippingMethod.identifier;\n\n let payload = {\n \"addressInformation\": {\n \"address\": {\n \"countryId\": this.shippingAddress.country_id,\n \"region\": this.shippingAddress.region,\n \"regionId\": this.getRegionId(this.shippingAddress.country_id, this.shippingAddress.region),\n \"postcode\": this.shippingAddress.postcode\n },\n \"shipping_method_code\": this.shippingMethods[this.shippingMethod].method_code,\n \"shipping_carrier_code\": this.shippingMethods[this.shippingMethod].carrier_code\n }\n };\n\n storage.post(\n this.getApiUrl(\"totals-information\"),\n JSON.stringify(payload)\n ).done(function (r) {\n this.setGrandTotalAmount(r.base_grand_total);\n\n session.completeShippingMethodSelection(\n ApplePaySession.STATUS_SUCCESS,\n {\n label: this.getDisplayName(),\n amount: this.getGrandTotalAmount()\n },\n [{\n type: 'final',\n label: $t('Shipping'),\n amount: shippingMethod.amount\n }]\n );\n }.bind(this));\n },\n\n /**\n * Place the order\n */\n startPlaceOrder: function (nonce, event, session, device_data) {\n let shippingContact = event.payment.shippingContact,\n billingContact = event.payment.billingContact,\n payload = {\n \"addressInformation\": {\n \"shipping_address\": {\n \"email\": shippingContact.emailAddress,\n \"telephone\": shippingContact.phoneNumber,\n \"firstname\": shippingContact.givenName,\n \"lastname\": shippingContact.familyName,\n \"street\": shippingContact.addressLines,\n \"city\": shippingContact.locality,\n \"region\": shippingContact.administrativeArea,\n \"region_id\": this.getRegionId(shippingContact.countryCode.toUpperCase(), shippingContact.administrativeArea),\n \"region_code\": null,\n \"country_id\": shippingContact.countryCode.toUpperCase(),\n \"postcode\": shippingContact.postalCode,\n \"same_as_billing\": 0,\n \"customer_address_id\": 0,\n \"save_in_address_book\": 0\n },\n \"billing_address\": {\n \"email\": shippingContact.emailAddress,\n \"telephone\": shippingContact.phoneNumber,\n \"firstname\": billingContact.givenName,\n \"lastname\": billingContact.familyName,\n \"street\": billingContact.addressLines,\n \"city\": billingContact.locality,\n \"region\": billingContact.administrativeArea,\n \"region_id\": this.getRegionId(billingContact.countryCode.toUpperCase(), billingContact.administrativeArea),\n \"region_code\": null,\n \"country_id\": billingContact.countryCode.toUpperCase(),\n \"postcode\": billingContact.postalCode,\n \"same_as_billing\": 0,\n \"customer_address_id\": 0,\n \"save_in_address_book\": 0\n },\n \"shipping_method_code\": this.shippingMethod ? this.shippingMethods[this.shippingMethod].method_code : '' ,\n \"shipping_carrier_code\": this.shippingMethod ? this.shippingMethods[this.shippingMethod].carrier_code : ''\n }\n };\n\n // Set addresses\n storage.post(\n this.getApiUrl(\"shipping-information\"),\n JSON.stringify(payload)\n ).done(function () {\n // Submit payment information\n let paymentInformation = {\n \"email\": shippingContact.emailAddress,\n \"paymentMethod\": {\n \"method\": \"braintree_applepay\",\n \"additional_data\": {\n \"payment_method_nonce\": nonce,\n \"device_data\": device_data\n }\n }\n };\n if (window.checkout && window.checkout.agreementIds) {\n paymentInformation.paymentMethod.extension_attributes = {\n \"agreement_ids\": window.checkout.agreementIds\n };\n }\n storage.post(\n this.getApiUrl(\"payment-information\"),\n JSON.stringify(paymentInformation)\n ).done(function (r) {\n document.location = this.getActionSuccess();\n session.completePayment(ApplePaySession.STATUS_SUCCESS);\n }.bind(this)).fail(function (r) {\n session.completePayment(ApplePaySession.STATUS_FAILURE);\n session.abort();\n alert($t(\"We're unable to take your payment through Apple Pay. Please try an again or use an alternative payment method.\"));\n console.error(\"Braintree ApplePay Unable to take payment\", r);\n return false;\n });\n\n }.bind(this)).fail(function (r) {\n console.error(\"Braintree ApplePay Unable to set shipping information\", r);\n session.completePayment(ApplePaySession.STATUS_INVALID_BILLING_POSTAL_ADDRESS);\n });\n }\n });\n });\n","PayPal_Braintree/js/applepay/button.js":"/**\n * Braintree Apple Pay button\n **/\ndefine(\n [\n 'uiComponent',\n \"knockout\",\n \"jquery\",\n 'braintree',\n 'braintreeDataCollector',\n 'braintreeApplePay',\n 'mage/translate',\n 'Magento_Checkout/js/model/payment/additional-validators',\n ],\n function (\n Component,\n ko,\n jQuery,\n braintree,\n dataCollector,\n applePay,\n $t,\n additionalValidators\n ) {\n 'use strict';\n\n var that;\n\n return {\n init: function (element, context) {\n // No element or context\n if (!element || !context) {\n return;\n }\n\n // Context must implement these methods\n if (typeof context.getClientToken !== 'function') {\n console.error(\"Braintree ApplePay Context passed does not provide a getClientToken method\", context);\n return;\n }\n if (typeof context.getPaymentRequest !== 'function') {\n console.error(\"Braintree ApplePay Context passed does not provide a getPaymentRequest method\", context);\n return;\n }\n if (typeof context.startPlaceOrder !== 'function') {\n console.error(\"Braintree ApplePay Context passed does not provide a startPlaceOrder method\", context);\n return;\n }\n\n if (this.deviceSupported() === false) {\n return;\n }\n\n // init braintree api\n braintree.create({\n authorization: context.getClientToken()\n }, function (clientErr, clientInstance) {\n if (clientErr) {\n console.error('Error creating client:', clientErr);\n return;\n }\n\n dataCollector.create({\n client: clientInstance\n }, function (dataCollectorErr, dataCollectorInstance) {\n if (dataCollectorErr) {\n return;\n }\n\n applePay.create({\n client: clientInstance\n }, function (applePayErr, applePayInstance) {\n // No instance\n if (applePayErr) {\n console.error('Braintree ApplePay Error creating applePayInstance:', applePayErr);\n return;\n }\n\n // Create a button within the KO element, as apple pay can only be instantiated through\n // a valid on click event (ko onclick bind interferes with this).\n var el = document.createElement('div');\n el.className = \"braintree-apple-pay-button\";\n el.title = $t(\"Pay with Apple Pay\");\n el.alt = $t(\"Pay with Apple Pay\");\n el.addEventListener('click', function (e) {\n e.preventDefault();\n\n if (!additionalValidators.validate()) {\n return false;\n }\n // Payment request object\n var paymentRequest = applePayInstance.createPaymentRequest(context.getPaymentRequest());\n if (!paymentRequest) {\n alert($t(\"We're unable to take payments through Apple Pay at the moment. Please try an alternative payment method.\"));\n console.error('Braintree ApplePay Unable to create paymentRequest', paymentRequest);\n return;\n }\n\n // Show the loader\n jQuery(\"body\").loader('show');\n\n // Init apple pay session\n try {\n var session = new ApplePaySession(1, paymentRequest);\n } catch (err) {\n jQuery(\"body\").loader('hide');\n console.error('Braintree ApplePay Unable to create ApplePaySession', err);\n alert($t(\"We're unable to take payments through Apple Pay at the moment. Please try an alternative payment method.\"));\n return false;\n }\n\n // Handle invalid merchant\n session.onvalidatemerchant = function (event) {\n applePayInstance.performValidation({\n validationURL: event.validationURL,\n displayName: context.getDisplayName()\n }, function (validationErr, merchantSession) {\n if (validationErr) {\n session.abort();\n console.error('Braintree ApplePay Error validating merchant:', validationErr);\n alert($t(\"We're unable to take payments through Apple Pay at the moment. Please try an alternative payment method.\"));\n return;\n }\n\n session.completeMerchantValidation(merchantSession);\n });\n };\n\n // Attach payment auth event\n session.onpaymentauthorized = function (event) {\n applePayInstance.tokenize({\n token: event.payment.token\n }, function (tokenizeErr, payload) {\n if (tokenizeErr) {\n console.error('Error tokenizing Apple Pay:', tokenizeErr);\n session.completePayment(ApplePaySession.STATUS_FAILURE);\n return;\n }\n\n // Pass the nonce back to the payment method\n context.startPlaceOrder(payload.nonce, event, session, dataCollectorInstance.deviceData);\n });\n };\n\n // Attach onShippingContactSelect method\n if (typeof context.onShippingContactSelect === 'function') {\n session.onshippingcontactselected = function (event) {\n return context.onShippingContactSelect(event, session);\n };\n }\n\n // Attach onShippingMethodSelect method\n if (typeof context.onShippingMethodSelect === 'function') {\n session.onshippingmethodselected = function (event) {\n return context.onShippingMethodSelect(event, session);\n };\n }\n\n // Hook\n if (typeof context.onButtonClick === 'function') {\n context.onButtonClick(session, this, e);\n } else {\n jQuery(\"body\").loader('hide');\n session.begin();\n }\n });\n element.appendChild(el);\n });\n });\n\n });\n },\n\n /**\n * Check the site is using HTTPS & apple pay is supported on this device.\n * @return boolean\n */\n deviceSupported: function () {\n if (location.protocol != 'https:') {\n console.warn(\"Braintree Apple Pay requires your checkout be served over HTTPS\");\n return false;\n }\n\n if ((window.ApplePaySession && ApplePaySession.canMakePayments()) !== true) {\n console.warn(\"Braintree Apple Pay is not supported on this device/browser\");\n return false;\n }\n\n return true;\n }\n };\n }\n);\n","PayPal_Braintree/js/applepay/implementations/shortcut.js":"/**\n * Braintree Apple Pay mini cart payment method integration.\n **/\ndefine(\n [\n 'uiComponent',\n 'PayPal_Braintree/js/applepay/button',\n 'PayPal_Braintree/js/applepay/api',\n 'mage/translate',\n 'domReady!'\n ],\n function (\n Component,\n button,\n buttonApi,\n $t\n ) {\n 'use strict';\n\n return Component.extend({\n\n defaults: {\n id: null,\n clientToken: null,\n quoteId: 0,\n displayName: null,\n actionSuccess: null,\n grandTotalAmount: 0,\n isLoggedIn: false,\n storeCode: \"default\"\n },\n\n /**\n * @returns {Object}\n */\n initialize: function () {\n this._super();\n if (!this.displayName) {\n this.displayName = $t('Store');\n }\n\n var api = new buttonApi();\n api.setGrandTotalAmount(parseFloat(this.grandTotalAmount).toFixed(2));\n api.setClientToken(this.clientToken);\n api.setDisplayName(this.displayName);\n api.setQuoteId(this.quoteId);\n api.setActionSuccess(this.actionSuccess);\n api.setIsLoggedIn(this.isLoggedIn);\n api.setStoreCode(this.storeCode);\n\n // Attach the button\n button.init(\n document.getElementById(this.id),\n api\n );\n\n return this;\n }\n });\n }\n);\n","PayPal_Braintree/js/applepay/implementations/core-checkout/method-applepay.js":"define([\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n], function (Component, rendererList) {\n 'use strict';\n\n let config = window.checkoutConfig.payment;\n\n if (config['braintree_applepay'].clientToken) {\n rendererList.push({\n type: 'braintree_applepay',\n component: 'PayPal_Braintree/js/applepay/implementations/core-checkout/method-renderer/applepay'\n });\n }\n\n return Component.extend({});\n});\n","PayPal_Braintree/js/applepay/implementations/core-checkout/method-renderer/applepay.js":"/**\n * Braintree Apple Pay payment method integration.\n **/\ndefine([\n 'Magento_Checkout/js/view/payment/default',\n 'Magento_Checkout/js/model/quote',\n 'PayPal_Braintree/js/applepay/button'\n], function (\n Component,\n quote,\n button\n) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'PayPal_Braintree/applepay/core-checkout',\n paymentMethodNonce: null,\n deviceData: null,\n grandTotalAmount: 0,\n deviceSupported: button.deviceSupported()\n },\n\n /**\n * Inject the apple pay button into the target element\n */\n getApplePayBtn: function (id) {\n button.init(\n document.getElementById(id),\n this\n );\n },\n\n /**\n * Subscribe to grand totals\n */\n initObservable: function () {\n this._super();\n this.grandTotalAmount = parseFloat(quote.totals()['base_grand_total']).toFixed(2);\n\n quote.totals.subscribe(function () {\n if (this.grandTotalAmount !== quote.totals()['base_grand_total']) {\n this.grandTotalAmount = parseFloat(quote.totals()['base_grand_total']).toFixed(2);\n }\n }.bind(this));\n\n return this;\n },\n\n /**\n * Apple pay place order method\n */\n startPlaceOrder: function (nonce, event, session, device_data) {\n this.setPaymentMethodNonce(nonce);\n this.setDeviceData(device_data);\n this.placeOrder();\n\n session.completePayment(ApplePaySession.STATUS_SUCCESS);\n },\n\n /**\n * Save nonce\n */\n setPaymentMethodNonce: function (nonce) {\n this.paymentMethodNonce = nonce;\n },\n\n /**\n * Save nonce\n */\n setDeviceData: function (device_data) {\n this.deviceData = device_data;\n },\n\n /**\n * Retrieve the client token\n * @returns null|string\n */\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n },\n\n /**\n * Payment request data\n */\n getPaymentRequest: function () {\n return {\n total: {\n label: this.getDisplayName(),\n amount: this.grandTotalAmount\n }\n };\n },\n\n /**\n * Merchant display name\n */\n getDisplayName: function () {\n return window.checkoutConfig.payment[this.getCode()].merchantName;\n },\n\n /**\n * Get data\n * @returns {Object}\n */\n getData: function () {\n var data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce,\n 'device_data': this.deviceData\n }\n };\n return data;\n },\n\n /**\n * Return image url for the apple pay mark\n */\n getPaymentMarkSrc: function () {\n return window.checkoutConfig.payment[this.getCode()].paymentMarkSrc;\n }\n });\n});\n","PayPal_Braintree/js/reCaptcha/webapiReCaptchaRegistry-mixin.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([], function () {\n 'use strict';\n\n return function (originalFunction) {\n /**\n * {@inheritDoc}\n */\n originalFunction.addListener = function (id , func) {\n this._listeners[id] = func;\n };\n\n return originalFunction;\n };\n});\n","PayPal_Braintree/js/model/step-navigator-mixin.js":"define([\n 'mage/utils/wrapper',\n 'jquery'\n], function (wrapper, $) {\n 'use strict';\n\n let mixin = {\n handleHash: function (originalFn) {\n var hashString = window.location.hash.replace('#', '');\n if (hashString.indexOf('venmo') > -1) {\n return false;\n }\n\n return originalFn();\n }\n };\n\n return function (target) {\n return wrapper.extend(target, mixin);\n };\n});\n","PayPal_Braintree/js/model/place-order-mixin.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* eslint-disable max-nested-callbacks */\n\ndefine([\n 'jquery',\n 'mage/utils/wrapper',\n 'Magento_ReCaptchaWebapiUi/js/webapiReCaptchaRegistry'\n], function ($, wrapper, recaptchaRegistry) {\n 'use strict';\n\n return function (placeOrder) {\n return wrapper.wrap(placeOrder, function (originalAction, serviceUrl, payload, messageContainer) {\n var recaptchaDeferred;\n\n if (recaptchaRegistry.triggers.hasOwnProperty('recaptcha-checkout-braintree')) {\n //ReCaptcha is present for checkout\n recaptchaDeferred = $.Deferred();\n recaptchaRegistry.addListener('recaptcha-checkout-braintree', function (token) {\n //Add reCaptcha value to place-order request and resolve deferred with the API call results\n payload.xReCaptchaValue = token;\n originalAction(serviceUrl, payload, messageContainer).done(function () {\n recaptchaDeferred.resolve.apply(recaptchaDeferred, arguments);\n }).fail(function () {\n recaptchaDeferred.reject.apply(recaptchaDeferred, arguments);\n });\n });\n //Trigger ReCaptcha validation\n recaptchaRegistry.triggers['recaptcha-checkout-braintree']();\n //remove listener so that place order action is only triggered by the 'Place Order' button\n recaptchaRegistry.removeListener('recaptcha-checkout-braintree');\n return recaptchaDeferred;\n }\n\n //No ReCaptcha, just sending the request\n return originalAction(serviceUrl, payload, messageContainer);\n });\n };\n});\n","PayPal_Braintree/js/paypal/form-builder.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine(\n [\n 'jquery',\n 'underscore',\n 'mage/template'\n ],\n function ($, _, mageTemplate) {\n 'use strict';\n\n return {\n\n /**\n * @param {Object} formData\n * @returns {*|jQuery}\n */\n build: function (formData) {\n var formTmpl = mageTemplate('<form action=\"<%= data.action %>\"' +\n ' method=\"POST\" hidden enctype=\"application/x-www-form-urlencoded\">' +\n '<% _.each(data.fields, function(val, key){ %>' +\n '<input value=\\'<%= val %>\\' name=\"<%= key %>\" type=\"hidden\">' +\n '<% }); %>' +\n '</form>');\n\n return $(formTmpl({\n data: {\n action: formData.action,\n fields: formData.fields\n }\n })).appendTo($('[data-container=\"body\"]'));\n }\n };\n }\n);\n","PayPal_Braintree/js/paypal/button.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine(\n [\n 'rjsResolver',\n 'uiRegistry',\n 'uiComponent',\n 'underscore',\n 'jquery',\n 'Magento_Customer/js/customer-data',\n 'mage/translate',\n 'braintree',\n 'braintreeDataCollector',\n 'braintreePayPalCheckout',\n 'PayPal_Braintree/js/form-builder',\n 'domReady!'\n ],\n function (\n resolver,\n registry,\n Component,\n _,\n $,\n customerData,\n $t,\n braintree,\n dataCollector,\n paypalCheckout,\n formBuilder\n ) {\n 'use strict';\n let buttonIds = [];\n\n return {\n events: {\n onClick: null,\n onCancel: null,\n onError: null\n },\n\n /**\n * @param token\n * @param currency\n * @param env\n * @param local\n * @param lineItems\n */\n init: function (token, currency, env, local, lineItems) {\n if ($('.action-braintree-paypal-message').length) {\n $('.product-add-form form').on('keyup change paste', 'input, select, textarea', function () {\n var currentPrice, currencySymbol;\n currentPrice = $(\".product-info-main span\").find(\"[data-price-type='finalPrice']\").text();\n currencySymbol = $('.action-braintree-paypal-message[data-pp-type=\"product\"]').data('currency-symbol');\n $('.action-braintree-paypal-message[data-pp-type=\"product\"]').attr('data-pp-amount', currentPrice.replace(currencySymbol,''));\n });\n }\n\n buttonIds = [];\n $('.action-braintree-paypal-logo').each(function () {\n if (!$(this).hasClass(\"button-loaded\")) {\n $(this).addClass('button-loaded');\n buttonIds.push($(this).attr('id'));\n }\n });\n\n if (buttonIds.length > 0) {\n this.loadSDK(token, currency, env, local, lineItems);\n }\n },\n\n /**\n * Load Braintree PayPal SDK\n * @param token\n * @param currency\n * @param env\n * @param local\n * @param lineItems\n */\n loadSDK: function (token, currency, env, local, lineItems) {\n braintree.create({\n authorization: token\n }, function (clientErr, clientInstance) {\n if (clientErr) {\n console.error('paypalCheckout error', clientErr);\n return this.showError(\"PayPal Checkout could not be initialized. Please contact the store owner.\");\n }\n dataCollector.create({\n client: clientInstance,\n paypal: true\n }, function (err, dataCollectorInstance) {\n if (err) {\n return console.log(err);\n }\n });\n paypalCheckout.create({\n client: clientInstance\n }, function (err, paypalCheckoutInstance) {\n if (typeof paypal !== 'undefined' ) {\n this.renderPayPalButtons(buttonIds, paypalCheckoutInstance, lineItems);\n this.renderPayPalMessages();\n } else {\n var configSDK = {\n components: 'buttons,messages,funding-eligibility',\n \"enable-funding\": \"paylater\",\n currency: currency\n };\n if (env === 'sandbox' && local !== '') {\n configSDK[\"buyer-country\"] = local;\n }\n paypalCheckoutInstance.loadPayPalSDK(configSDK, function () {\n this.renderPayPalButtons(buttonIds, paypalCheckoutInstance, lineItems);\n this.renderPayPalMessages();\n }.bind(this));\n }\n }.bind(this));\n }.bind(this));\n },\n\n /**\n * Render PayPal buttons\n *\n * @param ids\n * @param paypalCheckoutInstance\n * @param lineItems\n */\n renderPayPalButtons: function (ids, paypalCheckoutInstance, lineItems) {\n _.each(ids, function (id) {\n this.payPalButton(id, paypalCheckoutInstance, lineItems);\n }.bind(this));\n },\n\n /**\n * Render PayPal messages\n */\n renderPayPalMessages: function () {\n $('.action-braintree-paypal-message').each(function () {\n paypal.Messages({\n amount: $(this).data('pp-amount'),\n pageType: $(this).data('pp-type'),\n style: {\n layout: $(this).data('messaging-layout'),\n text: {\n color: $(this).data('messaging-text-color')\n },\n logo: {\n type: $(this).data('messaging-logo'),\n position: $(this).data('messaging-logo-position')\n }\n }\n }).render('#' + $(this).attr('id'));\n\n\n });\n },\n\n /**\n * @param id\n * @param paypalCheckoutInstance\n * @param lineItems\n */\n payPalButton: function (id, paypalCheckoutInstance, lineItems) {\n let data = $('#' + id);\n let style = {\n color: data.data('color'),\n shape: data.data('shape'),\n size: data.data('size'),\n label: data.data('label')\n };\n\n if (data.data('fundingicons')) {\n style.fundingicons = data.data('fundingicons');\n }\n\n // Render\n var paypalActions;\n var button = paypal.Buttons({\n fundingSource: data.data('funding'),\n style: style,\n createOrder: function () {\n return paypalCheckoutInstance.createPayment({\n amount: data.data('amount'),\n locale: data.data('locale'),\n currency: data.data('currency'),\n flow: 'checkout',\n enableShippingAddress: true,\n displayName: data.data('displayname'),\n lineItems: $.parseJSON(lineItems)\n });\n },\n validate: function (actions) {\n var cart = customerData.get('cart'),\n customer = customerData.get('customer'),\n declinePayment = false,\n isGuestCheckoutAllowed;\n isGuestCheckoutAllowed = cart().isGuestCheckoutAllowed;\n declinePayment = !customer().firstname && !isGuestCheckoutAllowed;\n if (declinePayment) {\n actions.disable();\n }\n paypalActions = actions;\n },\n\n onCancel: function (data) {\n jQuery(\"#maincontent\").trigger('processStop');\n },\n\n onError: function (err) {\n console.error('paypalCheckout button render error', err);\n jQuery(\"#maincontent\").trigger('processStop');\n },\n\n onClick: function (data) {\n var cart = customerData.get('cart'),\n customer = customerData.get('customer'),\n declinePayment = false,\n isGuestCheckoutAllowed;\n\n isGuestCheckoutAllowed = cart().isGuestCheckoutAllowed;\n declinePayment = !customer().firstname && !isGuestCheckoutAllowed && (typeof isGuestCheckoutAllowed !== 'undefined');\n if (declinePayment) {\n alert($t('To check out, please sign in with your email address.'));\n }\n },\n\n onApprove: function (data1) {\n return paypalCheckoutInstance.tokenizePayment(data1, function (err, payload) {\n jQuery(\"#maincontent\").trigger('processStart');\n\n // Map the shipping address correctly\n var address = payload.details.shippingAddress;\n var recipientFirstName, recipientLastName;\n if (typeof address.recipientName !== 'undefined') {\n var recipientName = address.recipientName.split(\" \");\n recipientFirstName = recipientName[0].replace(/'/g, \"'\");\n recipientLastName = recipientName[1].replace(/'/g, \"'\");\n } else {\n recipientFirstName = payload.details.firstName.replace(/'/g, \"'\");\n recipientLastName = payload.details.lastName.replace(/'/g, \"'\");\n }\n payload.details.shippingAddress = {\n streetAddress: typeof address.line2 !== 'undefined' ? address.line1.replace(/'/g, \"'\") + \" \" + address.line2.replace(/'/g, \"'\") : address.line1.replace(/'/g, \"'\"),\n locality: address.city.replace(/'/g, \"'\"),\n postalCode: address.postalCode,\n countryCodeAlpha2: address.countryCode,\n email: payload.details.email.replace(/'/g, \"'\"),\n recipientFirstName: recipientFirstName,\n recipientLastName: recipientLastName,\n telephone: typeof payload.details.phone !== 'undefined' ? payload.details.phone : '',\n region: typeof address.state !== 'undefined' ? address.state.replace(/'/g, \"'\") : ''\n };\n\n payload.details.email = payload.details.email.replace(/'/g, \"'\");\n payload.details.firstName = payload.details.firstName.replace(/'/g, \"'\");\n payload.details.lastName = payload.details.lastName.replace(/'/g, \"'\");\n if (typeof payload.details.businessName !== 'undefined') {\n payload.details.businessName = payload.details.businessName.replace(/'/g, \"'\");\n }\n\n // Map the billing address correctly\n let isRequiredBillingAddress = data.data('requiredbillingaddress');\n if ((isRequiredBillingAddress === 1) && (typeof payload.details.billingAddress !== 'undefined')) {\n var billingAddress = payload.details.billingAddress;\n payload.details.billingAddress = {\n streetAddress: typeof billingAddress.line2 !== 'undefined' ? billingAddress.line1.replace(/'/g, \"'\") + \" \" + billingAddress.line2.replace(/'/g, \"'\") : billingAddress.line1.replace(/'/g, \"'\"),\n locality: billingAddress.city.replace(/'/g, \"'\"),\n postalCode: billingAddress.postalCode,\n countryCodeAlpha2: billingAddress.countryCode,\n telephone: typeof payload.details.phone !== 'undefined' ? payload.details.phone : '',\n region: typeof billingAddress.state !== 'undefined' ? billingAddress.state.replace(/'/g, \"'\") : ''\n };\n }\n\n if (data.data('location') == 'productpage') {\n var form = $(\"#product_addtocart_form\");\n if (!(form.validation() && form.validation('isValid'))) {\n return false;\n }\n payload.additionalData = form.serialize();\n }\n\n var actionSuccess = data.data('actionsuccess');\n formBuilder.build(\n {\n action: actionSuccess,\n fields: {\n result: JSON.stringify(payload)\n }\n }\n ).submit();\n });\n }\n });\n if (!button.isEligible()) {\n console.log('PayPal button is not elligible')\n data.parent().remove();\n return;\n }\n if ($('#' + data.attr('id')).length) {\n button.render('#' + data.attr('id'));\n }\n },\n }\n }\n);\n","PayPal_Braintree/js/paypal/product-page.js":"define(\n ['PayPal_Braintree/js/paypal/button', 'jquery'],\n function (button, $) {\n 'use strict';\n\n return button.extend({\n\n defaults: {\n label: 'buynow',\n branding: true,\n },\n\n /**\n * The validation on the add-to-cart form is done after the PayPal window has opened.\n * This is because the validate method exposed by the PP Button requires an event to disable/enable the button.\n * We can't fire an event due to the way the mage.validation widget works and we can't do something gross like\n * an interval because the validation() method shows the error messages and focuses the user's input on the\n * first erroring input field.\n * @param payload\n * @returns {*}\n */\n beforeSubmit: function (payload) {\n var form = $(\"#product_addtocart_form\");\n\n if (!(form.validation() && form.validation('isValid'))) {\n return false;\n }\n\n payload.additionalData = form.serialize();\n\n return payload;\n }\n });\n }\n);","PayPal_Braintree/js/paypal/credit/calculator.js":"define([\n 'underscore',\n 'uiComponent',\n 'jquery'\n], function (_, Component, $) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: \"PayPal_Braintree/credit/calculator\",\n displaySummary: true, // \"From X per month\"\n displayInterestDetails: false, // Display the more in-depth summary of interest rates\n instalmentsFrom: 0,\n currentInstalment: {\n term: 0,\n monthlyPayment: 0,\n apr: 0,\n cost: 0,\n costIncInterest: 0\n },\n endpoint: null,\n instalments: [],\n visible: false,\n merchantName: ''\n },\n\n initObservable: function () {\n this._super();\n if (this.instalments.length > 0) {\n this.currentInstalment = this.instalments[0];\n this.instalmentsFrom = this.instalments[this.instalments.length-1].monthlyPayment;\n this.visible = true;\n } else {\n this.loadInstalments();\n }\n\n this.observe(['instalments', 'currentInstalment', 'instalmentsFrom', 'visible']);\n return this;\n },\n\n isCurrentInstalment: function (term) {\n return (this.currentInstalment().term === term);\n },\n\n setCurrentInstalment: function (instalment) {\n this.currentInstalment(instalment);\n },\n\n loadInstalments: function () {\n if (!this.endpoint) {\n return false;\n }\n\n var self = this;\n require(['Magento_Checkout/js/model/quote', 'jquery'], function (quote, $) {\n if (typeof quote.totals().base_grand_total === 'undefined') {\n return false;\n }\n\n $.getJSON(self.endpoint, {amount: quote.totals().base_grand_total}, function (response) {\n self.instalments(response);\n self.setCurrentInstalment(response[0]);\n self.visible(true);\n });\n });\n }\n });\n});\n","PayPal_Braintree/js/googlepay/api.js":"/**\n * Braintree Google Pay button api\n **/\ndefine([\n 'uiComponent',\n 'mage/translate',\n 'mage/storage',\n 'jquery',\n 'PayPal_Braintree/js/form-builder'\n], function (Component, $t, storage, jQuery, formBuilder) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n clientToken: null,\n merchantId: null,\n currencyCode: null,\n actionSuccess: null,\n amount: null,\n cardTypes: [],\n btnColor: 0\n },\n\n /**\n * Set & get environment\n * \"PRODUCTION\" or \"TEST\"\n */\n setEnvironment: function (value) {\n this.environment = value;\n },\n getEnvironment: function () {\n return this.environment;\n },\n\n /**\n * Set & get api token\n */\n setClientToken: function (value) {\n this.clientToken = value;\n },\n getClientToken: function () {\n return this.clientToken;\n },\n\n /**\n * Set and get display name\n */\n setMerchantId: function (value) {\n this.merchantId = value;\n },\n getMerchantId: function () {\n return this.merchantId;\n },\n\n /**\n * Set and get currency code\n */\n setAmount: function (value) {\n this.amount = parseFloat(value).toFixed(2);\n },\n getAmount: function () {\n return this.amount;\n },\n\n /**\n * Set and get currency code\n */\n setCurrencyCode: function (value) {\n this.currencyCode = value;\n },\n getCurrencyCode: function () {\n return this.currencyCode;\n },\n\n /**\n * Set and get success redirection url\n */\n setActionSuccess: function (value) {\n this.actionSuccess = value;\n },\n getActionSuccess: function () {\n return this.actionSuccess;\n },\n\n /**\n * Set and get success redirection url\n */\n setCardTypes: function (value) {\n this.cardTypes = value;\n },\n getCardTypes: function () {\n return this.cardTypes;\n },\n\n /**\n * BTN Color\n */\n setBtnColor: function (value) {\n this.btnColor = value;\n },\n getBtnColor: function () {\n return this.btnColor;\n },\n\n /**\n * Payment request info\n */\n getPaymentRequest: function () {\n var result = {\n transactionInfo: {\n totalPriceStatus: 'ESTIMATED',\n totalPrice: this.getAmount(),\n currencyCode: this.getCurrencyCode()\n },\n allowedPaymentMethods: [\n {\n \"type\": \"CARD\",\n \"parameters\": {\n \"allowedCardNetworks\": this.getCardTypes(),\n \"billingAddressRequired\": true,\n \"billingAddressParameters\": {\n format: 'FULL',\n phoneNumberRequired: true\n },\n },\n\n }\n ],\n shippingAddressRequired: true,\n emailRequired: true,\n };\n\n if (this.getEnvironment() !== \"TEST\") {\n result.merchantInfo = { merchantId: this.getMerchantId() };\n }\n\n return result;\n },\n\n /**\n * Place the order\n */\n startPlaceOrder: function (nonce, paymentData, deviceData) {\n var payload = {\n details: {\n shippingAddress: {\n streetAddress: paymentData.shippingAddress.address1 + \"\\n\"\n + paymentData.shippingAddress.address2,\n locality: paymentData.shippingAddress.locality,\n postalCode: paymentData.shippingAddress.postalCode,\n countryCodeAlpha2: paymentData.shippingAddress.countryCode,\n email: paymentData.email,\n name: paymentData.shippingAddress.name,\n telephone: typeof paymentData.shippingAddress.phoneNumber !== 'undefined' ? paymentData.shippingAddress.phoneNumber : '',\n region: typeof paymentData.shippingAddress.administrativeArea !== 'undefined' ? paymentData.shippingAddress.administrativeArea : ''\n },\n billingAddress: {\n streetAddress: paymentData.paymentMethodData.info.billingAddress.address1 + \"\\n\"\n + paymentData.paymentMethodData.info.billingAddress.address2,\n locality: paymentData.paymentMethodData.info.billingAddress.locality,\n postalCode: paymentData.paymentMethodData.info.billingAddress.postalCode,\n countryCodeAlpha2: paymentData.paymentMethodData.info.billingAddress.countryCode,\n email: paymentData.email,\n name: paymentData.paymentMethodData.info.billingAddress.name,\n telephone: typeof paymentData.paymentMethodData.info.billingAddress.phoneNumber !== 'undefined' ? paymentData.paymentMethodData.info.billingAddress.phoneNumber : '',\n region: typeof paymentData.paymentMethodData.info.billingAddress.administrativeArea !== 'undefined' ? paymentData.paymentMethodData.info.billingAddress.administrativeArea : ''\n }\n },\n nonce: nonce,\n deviceData: deviceData,\n };\n\n formBuilder.build({\n action: this.getActionSuccess(),\n fields: {\n result: JSON.stringify(payload)\n }\n }).submit();\n }\n });\n});\n","PayPal_Braintree/js/googlepay/button.js":"/**\n * Braintree Google Pay button\n **/\ndefine(\n [\n 'uiComponent',\n \"knockout\",\n \"jquery\",\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Magento_CheckoutAgreements/js/view/checkout-agreements',\n 'braintree',\n 'braintreeDataCollector',\n 'braintreeGooglePay',\n 'mage/translate',\n 'googlePayLibrary'\n ],\n function (\n Component,\n ko,\n jQuery,\n additionalValidators,\n checkoutAgreements,\n braintree,\n dataCollector,\n googlePay,\n $t\n ) {\n 'use strict';\n\n return {\n init: function (element, context) {\n\n // No element or context\n if (!element || !context ) {\n return;\n }\n\n // Context must implement these methods\n if (typeof context.getClientToken !== 'function') {\n console.error(\"Braintree GooglePay Context passed does not provide a getClientToken method\", context);\n return;\n }\n if (typeof context.getPaymentRequest !== 'function') {\n console.error(\"Braintree GooglePay Context passed does not provide a getPaymentRequest method\", context);\n return;\n }\n if (typeof context.startPlaceOrder !== 'function') {\n console.error(\"Braintree GooglePay Context passed does not provide a startPlaceOrder method\", context);\n return;\n }\n\n // init google pay object\n var paymentsClient = new google.payments.api.PaymentsClient({\n environment: context.getEnvironment()\n });\n\n // Create a button within the KO element, as google pay can only be instantiated through\n // a valid on click event (ko onclick bind interferes with this).\n var deviceData;\n var button = document.createElement('button');\n button.className = \"braintree-googlepay-button long \" + (context.getBtnColor() == 1 ? 'black' : 'white');\n button.title = $t(\"Buy with Google Pay\");\n\n // init braintree api\n braintree.create({\n authorization: context.getClientToken()\n }, function (clientErr, clientInstance) {\n if (clientErr) {\n console.error('Error creating client:', clientErr);\n return;\n }\n dataCollector.create({\n client: clientInstance\n }, function (dataCollectorErr, dataCollectorInstance) {\n if (dataCollectorErr) {\n return;\n }\n googlePay.create({\n client: clientInstance,\n googlePayVersion: 2\n }, function (googlePayErr, googlePaymentInstance) {\n // No instance\n if (googlePayErr) {\n console.error('Braintree GooglePay Error creating googlePayInstance:', googlePayErr);\n return;\n }\n\n paymentsClient.isReadyToPay({\n apiVersion: 2,\n apiVersionMinor: 0,\n allowedPaymentMethods: googlePaymentInstance.createPaymentDataRequest().allowedPaymentMethods\n }).then(function(response) {\n if (response.result) {\n button.addEventListener('click', function (event) {\n\n var agreements = checkoutAgreements().agreements,\n shouldDisableActions = false;\n\n\n _.each(agreements, function (item, index) {\n if (checkoutAgreements().isAgreementRequired(item)) {\n var inputId = '#agreement_braintree_googlepay_' + item.agreementId,\n inputEl = document.querySelector(inputId);\n\n if (inputEl !== null && !inputEl.checked) {\n shouldDisableActions = true;\n }\n\n }\n });\n\n if (!additionalValidators.validate()) {\n event.preventDefault();\n return false;\n }\n\n if (!shouldDisableActions) {\n event.preventDefault();\n jQuery(\"body\").loader('show');\n var responseData;\n\n var paymentDataRequest = googlePaymentInstance.createPaymentDataRequest(context.getPaymentRequest());\n paymentsClient.loadPaymentData(paymentDataRequest).then(function (paymentData) {\n // Persist the paymentData (shipping address etc)\n responseData = paymentData;\n // Return the braintree nonce promise\n return googlePaymentInstance.parseResponse(paymentData);\n }).then(function (result) {\n context.startPlaceOrder(result.nonce, responseData, dataCollectorInstance.deviceData);\n }).catch(function (err) {\n // Handle errors\n // err = {statusCode: \"CANCELED\"}\n console.error(err);\n jQuery(\"body\").loader('hide');\n });\n }\n });\n\n element.appendChild(button);\n }\n }).catch(function (err) {\n console.error(err);\n jQuery(\"body\").loader('hide');\n });\n });\n });\n });\n }\n };\n }\n);\n","PayPal_Braintree/js/googlepay/implementations/shortcut.js":"/**\n * Braintree Google Pay mini cart payment method integration.\n **/\ndefine(\n [\n 'uiComponent',\n 'PayPal_Braintree/js/googlepay/button',\n 'PayPal_Braintree/js/googlepay/api',\n 'mage/translate',\n 'domReady!'\n ],\n function (\n Component,\n button,\n buttonApi,\n $t\n ) {\n 'use strict';\n\n return Component.extend({\n\n defaults: {\n id: null,\n clientToken: null,\n merchantId: null,\n currencyCode: null,\n actionSuccess: null,\n amount: null,\n environment: \"TEST\",\n cardType: [],\n btnColor: 0\n },\n\n /**\n * @returns {Object}\n */\n initialize: function () {\n this._super();\n\n var api = new buttonApi();\n api.setEnvironment(this.environment);\n api.setCurrencyCode(this.currencyCode);\n api.setClientToken(this.clientToken);\n api.setMerchantId(this.merchantId);\n api.setActionSuccess(this.actionSuccess);\n api.setAmount(this.amount);\n api.setCardTypes(this.cardTypes)\n api.setBtnColor(this.btnColor);\n\n // Attach the button\n button.init(\n document.getElementById(this.id),\n api\n );\n\n return this;\n }\n });\n }\n);\n","PayPal_Braintree/js/googlepay/implementations/core-checkout/method-googlepay.js":"define([\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n], function (Component, rendererList) {\n 'use strict';\n\n let config = window.checkoutConfig.payment;\n\n if (config['braintree_googlepay'].clientToken) {\n rendererList.push({\n type: 'braintree_googlepay',\n component: 'PayPal_Braintree/js/googlepay/implementations/core-checkout/method-renderer/googlepay'\n });\n }\n\n return Component.extend({});\n});\n","PayPal_Braintree/js/googlepay/implementations/core-checkout/method-renderer/googlepay.js":"/**\n * Braintree Google Pay payment method integration.\n **/\ndefine([\n 'Magento_Checkout/js/view/payment/default',\n 'Magento_Checkout/js/model/quote',\n 'PayPal_Braintree/js/googlepay/button'\n], function (\n Component,\n quote,\n button\n) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'PayPal_Braintree/googlepay/core-checkout',\n paymentMethodNonce: null,\n deviceData: null,\n grandTotalAmount: 0\n },\n\n /**\n * Inject the google pay button into the target element\n */\n getGooglePayBtn: function (id) {\n button.init(\n document.getElementById(id),\n this\n );\n },\n\n /**\n * Subscribe to grand totals\n */\n initObservable: function () {\n this._super();\n this.grandTotalAmount = parseFloat(quote.totals()['base_grand_total']).toFixed(2);\n this.currencyCode = quote.totals()['base_currency_code'];\n\n quote.totals.subscribe(function () {\n if (this.grandTotalAmount !== quote.totals()['base_grand_total']) {\n this.grandTotalAmount = parseFloat(quote.totals()['base_grand_total']).toFixed(2);\n }\n }.bind(this));\n\n return this;\n },\n\n /**\n * Google pay place order method\n */\n startPlaceOrder: function (nonce, paymentData, device_data) {\n this.setPaymentMethodNonce(nonce);\n this.setDeviceData(device_data);\n this.placeOrder();\n },\n\n /**\n * Save nonce\n */\n setPaymentMethodNonce: function (nonce) {\n this.paymentMethodNonce = nonce;\n },\n\n /**\n * Save device_data\n */\n setDeviceData: function (device_data) {\n this.deviceData = device_data;\n },\n\n /**\n * Retrieve the client token\n * @returns null|string\n */\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n },\n\n /**\n * Payment request info\n */\n getPaymentRequest: function () {\n var result = {\n transactionInfo: {\n totalPriceStatus: 'FINAL',\n totalPrice: this.grandTotalAmount,\n currencyCode: this.currencyCode\n },\n allowedPaymentMethods: [\n {\n \"type\": \"CARD\",\n \"parameters\": {\n \"allowedCardNetworks\": this.getCardTypes(),\n \"billingAddressRequired\": false,\n },\n\n }\n ],\n shippingAddressRequired: false,\n emailRequired: false,\n };\n\n if (this.getEnvironment() !== \"TEST\") {\n result.merchantInfo = { merchantId: this.getMerchantId() };\n }\n\n return result;\n },\n\n /**\n * Merchant display name\n */\n getMerchantId: function () {\n return window.checkoutConfig.payment[this.getCode()].merchantId;\n },\n\n /**\n * Environment\n */\n getEnvironment: function () {\n return window.checkoutConfig.payment[this.getCode()].environment;\n },\n\n /**\n * Card Types\n */\n getCardTypes: function () {\n return window.checkoutConfig.payment[this.getCode()].cardTypes;\n },\n\n /**\n * BTN Color\n */\n getBtnColor: function () {\n return window.checkoutConfig.payment[this.getCode()].btnColor;\n },\n\n /**\n * Get data\n * @returns {Object}\n */\n getData: function () {\n return {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce,\n 'device_data': this.deviceData\n }\n };\n },\n\n /**\n * Return image url for the google pay mark\n */\n getPaymentMarkSrc: function () {\n return window.checkoutConfig.payment[this.getCode()].paymentMarkSrc;\n }\n });\n});\n","Magento_Swatches/js/swatch-renderer.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 'mage/smart-keyboard-handler',\n 'mage/translate',\n 'priceUtils',\n 'jquery-ui-modules/widget',\n 'jquery/jquery.parsequery',\n 'mage/validation/validation'\n], function ($, _, mageTemplate, keyboardHandler, $t, priceUtils) {\n 'use strict';\n\n /**\n * Extend form validation to support swatch accessibility\n */\n $.widget('mage.validation', $.mage.validation, {\n /**\n * Handle form with swatches validation. Focus on first invalid swatch block.\n *\n * @param {jQuery.Event} event\n * @param {Object} validation\n */\n listenFormValidateHandler: function (event, validation) {\n var swatchWrapper, firstActive, swatches, swatch, successList, errorList, firstSwatch;\n\n this._superApply(arguments);\n\n swatchWrapper = '.swatch-attribute-options';\n swatches = $(event.target).find(swatchWrapper);\n\n if (!swatches.length) {\n return;\n }\n\n swatch = '.swatch-attribute';\n firstActive = $(validation.errorList[0].element || []);\n successList = validation.successList;\n errorList = validation.errorList;\n firstSwatch = $(firstActive).parent(swatch).find(swatchWrapper);\n\n keyboardHandler.focus(swatches);\n\n $.each(successList, function (index, item) {\n $(item).parent(swatch).find(swatchWrapper).attr('aria-invalid', false);\n });\n\n $.each(errorList, function (index, item) {\n $(item.element).parent(swatch).find(swatchWrapper).attr('aria-invalid', true);\n });\n\n if (firstSwatch.length) {\n $(firstSwatch).trigger('focus');\n }\n }\n });\n\n /**\n * Render tooltips by attributes (only to up).\n * Required element attributes:\n * - data-option-type (integer, 0-3)\n * - data-option-label (string)\n * - data-option-tooltip-thumb\n * - data-option-tooltip-value\n * - data-thumb-width\n * - data-thumb-height\n */\n $.widget('mage.SwatchRendererTooltip', {\n options: {\n delay: 200, //how much ms before tooltip to show\n tooltipClass: 'swatch-option-tooltip' //configurable, but remember about css\n },\n\n /**\n * @private\n */\n _init: function () {\n var $widget = this,\n $this = this.element,\n $element = $('.' + $widget.options.tooltipClass),\n timer,\n type = parseInt($this.data('option-type'), 10),\n label = $this.data('option-label'),\n thumb = $this.data('option-tooltip-thumb'),\n value = $this.data('option-tooltip-value'),\n width = $this.data('thumb-width'),\n height = $this.data('thumb-height'),\n $image,\n $title,\n $corner;\n\n if (!$element.length) {\n $element = $('<div class=\"' +\n $widget.options.tooltipClass +\n '\"><div class=\"image\"></div><div class=\"title\"></div><div class=\"corner\"></div></div>'\n );\n $('body').append($element);\n }\n\n $image = $element.find('.image');\n $title = $element.find('.title');\n $corner = $element.find('.corner');\n\n $this.on('mouseenter', function () {\n if (!$this.hasClass('disabled')) {\n timer = setTimeout(\n function () {\n var leftOpt = null,\n leftCorner = 0,\n left,\n $window;\n\n if (type === 2) {\n // Image\n $image.css({\n 'background': 'url(\"' + thumb + '\") no-repeat center', //Background case\n 'background-size': 'initial',\n 'width': width + 'px',\n 'height': height + 'px'\n });\n $image.show();\n } else if (type === 1) {\n // Color\n $image.css({\n background: value\n });\n $image.show();\n } else if (type === 0 || type === 3) {\n // Default\n $image.hide();\n }\n\n $title.text(label);\n\n leftOpt = $this.offset().left;\n left = leftOpt + $this.width() / 2 - $element.width() / 2;\n $window = $(window);\n\n // the numbers (5 and 5) is magick constants for offset from left or right page\n if (left < 0) {\n left = 5;\n } else if (left + $element.width() > $window.width()) {\n left = $window.width() - $element.width() - 5;\n }\n\n // the numbers (6, 3 and 18) is magick constants for offset tooltip\n leftCorner = 0;\n\n if ($element.width() < $this.width()) {\n leftCorner = $element.width() / 2 - 3;\n } else {\n leftCorner = (leftOpt > left ? leftOpt - left : left - leftOpt) + $this.width() / 2 - 6;\n }\n\n $corner.css({\n left: leftCorner\n });\n $element.css({\n left: left,\n top: $this.offset().top - $element.height() - $corner.height() - 18\n }).show();\n },\n $widget.options.delay\n );\n }\n });\n\n $this.on('mouseleave', function () {\n $element.hide();\n clearTimeout(timer);\n });\n\n $(document).on('tap', function () {\n $element.hide();\n clearTimeout(timer);\n });\n\n $this.on('tap', function (event) {\n event.stopPropagation();\n });\n }\n });\n\n /**\n * Render swatch controls with options and use tooltips.\n * Required two json:\n * - jsonConfig (magento's option config)\n * - jsonSwatchConfig (swatch's option config)\n *\n * Tuning:\n * - numberToShow (show \"more\" button if options are more)\n * - onlySwatches (hide selectboxes)\n * - moreButtonText (text for \"more\" button)\n * - selectorProduct (selector for product container)\n * - selectorProductPrice (selector for change price)\n */\n $.widget('mage.SwatchRenderer', {\n options: {\n classes: {\n attributeClass: 'swatch-attribute',\n attributeLabelClass: 'swatch-attribute-label',\n attributeSelectedOptionLabelClass: 'swatch-attribute-selected-option',\n attributeOptionsWrapper: 'swatch-attribute-options',\n attributeInput: 'swatch-input',\n optionClass: 'swatch-option',\n selectClass: 'swatch-select',\n moreButton: 'swatch-more',\n loader: 'swatch-option-loading'\n },\n // option's json config\n jsonConfig: {},\n\n // swatch's json config\n jsonSwatchConfig: {},\n\n // selector of parental block of prices and swatches (need to know where to seek for price block)\n selectorProduct: '.product-info-main',\n\n // selector of price wrapper (need to know where set price)\n selectorProductPrice: '[data-role=priceBox]',\n\n //selector of product images gallery wrapper\n mediaGallerySelector: '[data-gallery-role=gallery-placeholder]',\n\n // selector of category product tile wrapper\n selectorProductTile: '.product-item',\n\n // number of controls to show (false or zero = show all)\n numberToShow: false,\n\n // show only swatch controls\n onlySwatches: false,\n\n // enable label for control\n enableControlLabel: true,\n\n // control label id\n controlLabelId: '',\n\n // text for more button\n moreButtonText: $t('More'),\n\n // Callback url for media\n mediaCallback: '',\n\n // Local media cache\n mediaCache: {},\n\n // Cache for BaseProduct images. Needed when option unset\n mediaGalleryInitial: [{}],\n\n // Use ajax to get image data\n useAjax: false,\n\n /**\n * Defines the mechanism of how images of a gallery should be\n * updated when user switches between configurations of a product.\n *\n * As for now value of this option can be either 'replace' or 'prepend'.\n *\n * @type {String}\n */\n gallerySwitchStrategy: 'replace',\n\n // whether swatches are rendered in product list or on product page\n inProductList: false,\n\n // sly-old-price block selector\n slyOldPriceSelector: '.sly-old-price',\n\n // tier prise selectors start\n tierPriceTemplateSelector: '#tier-prices-template',\n tierPriceBlockSelector: '[data-role=\"tier-price-block\"]',\n tierPriceTemplate: '',\n // tier prise selectors end\n\n // A price label selector\n normalPriceLabelSelector: '.product-info-main .normal-price .price-label',\n qtyInfo: '#qty'\n },\n\n /**\n * Get chosen product\n *\n * @returns int|null\n */\n getProduct: function () {\n var products = this._CalcProducts();\n\n return _.isArray(products) ? products[0] : null;\n },\n\n /**\n * Get chosen product id\n *\n * @returns int|null\n */\n getProductId: function () {\n var products = this._CalcProducts();\n\n return _.isArray(products) && products.length === 1 ? products[0] : null;\n },\n\n /**\n * @private\n */\n _init: function () {\n // Don't render the same set of swatches twice\n if ($(this.element).attr('data-rendered')) {\n return;\n }\n\n $(this.element).attr('data-rendered', true);\n\n if (_.isEmpty(this.options.jsonConfig.images)) {\n this.options.useAjax = true;\n // creates debounced variant of _LoadProductMedia()\n // to use it in events handlers instead of _LoadProductMedia()\n this._debouncedLoadProductMedia = _.debounce(this._LoadProductMedia.bind(this), 500);\n }\n\n this.options.tierPriceTemplate = $(this.options.tierPriceTemplateSelector).html();\n\n if (this.options.jsonConfig !== '' && this.options.jsonSwatchConfig !== '') {\n // store unsorted attributes\n this.options.jsonConfig.mappedAttributes = _.clone(this.options.jsonConfig.attributes);\n this._sortAttributes();\n this._RenderControls();\n this._setPreSelectedGallery();\n $(this.element).trigger('swatch.initialized');\n } else {\n console.log('SwatchRenderer: No input data received');\n }\n },\n\n /**\n * @private\n */\n _sortAttributes: function () {\n this.options.jsonConfig.attributes = _.sortBy(this.options.jsonConfig.attributes, function (attribute) {\n return parseInt(attribute.position, 10);\n });\n },\n\n /**\n * @private\n */\n _create: function () {\n var options = this.options,\n gallery = $('[data-gallery-role=gallery-placeholder]', '.column.main'),\n productData = this._determineProductData(),\n $main = productData.isInProductView ?\n this.element.parents('.column.main') :\n this.element.parents('.product-item-info');\n\n if (productData.isInProductView) {\n gallery.data('gallery') ?\n this._onGalleryLoaded(gallery) :\n gallery.on('gallery:loaded', this._onGalleryLoaded.bind(this, gallery));\n } else {\n options.mediaGalleryInitial = [{\n 'img': $main.find('.product-image-photo').attr('src')\n }];\n }\n\n this.productForm = this.element.parents(this.options.selectorProductTile).find('form:first');\n this.inProductList = this.productForm.length > 0;\n $(this.options.qtyInfo).on('input', this._onQtyChanged.bind(this));\n },\n\n /**\n * Determine product id and related data\n *\n * @returns {{productId: *, isInProductView: bool}}\n * @private\n */\n _determineProductData: function () {\n // Check if product is in a list of products.\n var productId,\n isInProductView = false;\n\n productId = this.element.parents('.product-item-details')\n .find('.price-box.price-final_price').attr('data-product-id');\n\n if (!productId) {\n // Check individual product.\n productId = $('[name=product]').val();\n isInProductView = productId > 0;\n }\n\n return {\n productId: productId,\n isInProductView: isInProductView\n };\n },\n\n /**\n * Render controls\n *\n * @private\n */\n _RenderControls: function () {\n var $widget = this,\n container = this.element,\n classes = this.options.classes,\n chooseText = this.options.jsonConfig.chooseText,\n showTooltip = this.options.showTooltip;\n\n $widget.optionsMap = {};\n\n $.each(this.options.jsonConfig.attributes, function () {\n var item = this,\n controlLabelId = 'option-label-' + item.code + '-' + item.id,\n options = $widget._RenderSwatchOptions(item, controlLabelId),\n select = $widget._RenderSwatchSelect(item, chooseText),\n input = $widget._RenderFormInput(item),\n listLabel = '',\n label = '';\n\n // Show only swatch controls\n if ($widget.options.onlySwatches && !$widget.options.jsonSwatchConfig.hasOwnProperty(item.id)) {\n return;\n }\n\n if ($widget.options.enableControlLabel) {\n label +=\n '<span id=\"' + controlLabelId + '\" class=\"' + classes.attributeLabelClass + '\">' +\n $('<i></i>').text(item.label).html() +\n '</span>' +\n '<span class=\"' + classes.attributeSelectedOptionLabelClass + '\"></span>';\n }\n\n if ($widget.inProductList) {\n $widget.productForm.append(input);\n input = '';\n listLabel = 'aria-label=\"' + $('<i></i>').text(item.label).html() + '\"';\n } else {\n listLabel = 'aria-labelledby=\"' + controlLabelId + '\"';\n }\n\n // Create new control\n container.append(\n '<div class=\"' + classes.attributeClass + ' ' + item.code + '\" ' +\n 'data-attribute-code=\"' + item.code + '\" ' +\n 'data-attribute-id=\"' + item.id + '\">' +\n label +\n '<div aria-activedescendant=\"\" ' +\n 'tabindex=\"0\" ' +\n 'aria-invalid=\"false\" ' +\n 'aria-required=\"true\" ' +\n 'role=\"listbox\" ' + listLabel +\n 'class=\"' + classes.attributeOptionsWrapper + ' clearfix\">' +\n options + select +\n '</div>' + input +\n '</div>'\n );\n\n $widget.optionsMap[item.id] = {};\n\n // Aggregate options array to hash (key => value)\n $.each(item.options, function () {\n if (this.products.length > 0) {\n $widget.optionsMap[item.id][this.id] = {\n price: parseInt(\n $widget.options.jsonConfig.optionPrices[this.products[0]].finalPrice.amount,\n 10\n ),\n products: this.products\n };\n }\n });\n });\n\n if (showTooltip === 1) {\n // Connect Tooltip\n container\n .find('[data-option-type=\"1\"], [data-option-type=\"2\"],' +\n ' [data-option-type=\"0\"], [data-option-type=\"3\"]')\n .SwatchRendererTooltip();\n }\n\n // Hide all elements below more button\n $('.' + classes.moreButton).nextAll().hide();\n\n // Handle events like click or change\n $widget._EventListener();\n\n // Rewind options\n $widget._Rewind(container);\n\n //Emulate click on all swatches from Request\n $widget._EmulateSelected($.parseQuery());\n $widget._EmulateSelected($widget._getSelectedAttributes());\n },\n\n disableSwatchForOutOfStockProducts: function () {\n let $widget = this, container = this.element;\n\n $.each(this.options.jsonConfig.attributes, function () {\n let item = this;\n\n if ($widget.options.jsonConfig.canDisplayShowOutOfStockStatus) {\n let salableProducts = $widget.options.jsonConfig.salable[item.id],\n swatchOptions = $(container).find(`[data-attribute-id='${item.id}']`).find('.swatch-option');\n\n swatchOptions.each(function (key, value) {\n let optionId = $(value).data('option-id');\n\n if (!salableProducts.hasOwnProperty(optionId)) {\n $(value).attr('disabled', true).addClass('disabled');\n }\n });\n }\n });\n },\n\n /**\n * Render swatch options by part of config\n *\n * @param {Object} config\n * @param {String} controlId\n * @returns {String}\n * @private\n */\n _RenderSwatchOptions: function (config, controlId) {\n var optionConfig = this.options.jsonSwatchConfig[config.id],\n optionClass = this.options.classes.optionClass,\n sizeConfig = this.options.jsonSwatchImageSizeConfig,\n moreLimit = parseInt(this.options.numberToShow, 10),\n moreClass = this.options.classes.moreButton,\n moreText = this.options.moreButtonText,\n countAttributes = 0,\n html = '';\n\n if (!this.options.jsonSwatchConfig.hasOwnProperty(config.id)) {\n return '';\n }\n\n $.each(config.options, function (index) {\n var id,\n type,\n value,\n thumb,\n label,\n width,\n height,\n attr,\n swatchImageWidth,\n swatchImageHeight;\n\n if (!optionConfig.hasOwnProperty(this.id)) {\n return '';\n }\n\n // Add more button\n if (moreLimit === countAttributes++) {\n html += '<a href=\"#\" class=\"' + moreClass + '\"><span>' + moreText + '</span></a>';\n }\n\n id = this.id;\n type = parseInt(optionConfig[id].type, 10);\n value = optionConfig[id].hasOwnProperty('value') ?\n $('<i></i>').text(optionConfig[id].value).html() : '';\n thumb = optionConfig[id].hasOwnProperty('thumb') ? optionConfig[id].thumb : '';\n width = _.has(sizeConfig, 'swatchThumb') ? sizeConfig.swatchThumb.width : 110;\n height = _.has(sizeConfig, 'swatchThumb') ? sizeConfig.swatchThumb.height : 90;\n label = this.label ? $('<i></i>').text(this.label).html() : '';\n attr =\n ' id=\"' + controlId + '-item-' + id + '\"' +\n ' index=\"' + index + '\"' +\n ' aria-checked=\"false\"' +\n ' aria-describedby=\"' + controlId + '\"' +\n ' tabindex=\"0\"' +\n ' data-option-type=\"' + type + '\"' +\n ' data-option-id=\"' + id + '\"' +\n ' data-option-label=\"' + label + '\"' +\n ' aria-label=\"' + label + '\"' +\n ' role=\"option\"' +\n ' data-thumb-width=\"' + width + '\"' +\n ' data-thumb-height=\"' + height + '\"';\n\n attr += thumb !== '' ? ' data-option-tooltip-thumb=\"' + thumb + '\"' : '';\n attr += value !== '' ? ' data-option-tooltip-value=\"' + value + '\"' : '';\n\n swatchImageWidth = _.has(sizeConfig, 'swatchImage') ? sizeConfig.swatchImage.width : 30;\n swatchImageHeight = _.has(sizeConfig, 'swatchImage') ? sizeConfig.swatchImage.height : 20;\n\n if (!this.hasOwnProperty('products') || this.products.length <= 0) {\n attr += ' data-option-empty=\"true\"';\n }\n\n if (type === 0) {\n // Text\n html += '<div class=\"' + optionClass + ' text\" ' + attr + '>' + (value ? value : label) +\n '</div>';\n } else if (type === 1) {\n // Color\n html += '<div class=\"' + optionClass + ' color\" ' + attr +\n ' style=\"background: ' + value +\n ' no-repeat center; background-size: initial;\">' + '' +\n '</div>';\n } else if (type === 2) {\n // Image\n html += '<div class=\"' + optionClass + ' image\" ' + attr +\n ' style=\"background: url(' + value + ') no-repeat center; background-size: initial;width:' +\n swatchImageWidth + 'px; height:' + swatchImageHeight + 'px\">' + '' +\n '</div>';\n } else if (type === 3) {\n // Clear\n html += '<div class=\"' + optionClass + '\" ' + attr + '></div>';\n } else {\n // Default\n html += '<div class=\"' + optionClass + '\" ' + attr + '>' + label + '</div>';\n }\n });\n\n return html;\n },\n\n /**\n * Render select by part of config\n *\n * @param {Object} config\n * @param {String} chooseText\n * @returns {String}\n * @private\n */\n _RenderSwatchSelect: function (config, chooseText) {\n var html;\n\n if (this.options.jsonSwatchConfig.hasOwnProperty(config.id)) {\n return '';\n }\n\n html =\n '<select class=\"' + this.options.classes.selectClass + ' ' + config.code + '\">' +\n '<option value=\"0\" data-option-id=\"0\">' + chooseText + '</option>';\n\n $.each(config.options, function () {\n var label = this.label,\n attr = ' value=\"' + this.id + '\" data-option-id=\"' + this.id + '\"';\n\n if (!this.hasOwnProperty('products') || this.products.length <= 0) {\n attr += ' data-option-empty=\"true\"';\n }\n\n html += '<option ' + attr + '>' + label + '</option>';\n });\n\n html += '</select>';\n\n return html;\n },\n\n /**\n * Input for submit form.\n * This control shouldn't have \"type=hidden\", \"display: none\" for validation work :(\n *\n * @param {Object} config\n * @private\n */\n _RenderFormInput: function (config) {\n return '<input class=\"' + this.options.classes.attributeInput + ' super-attribute-select\" ' +\n 'name=\"super_attribute[' + config.id + ']\" ' +\n 'type=\"text\" ' +\n 'value=\"\" ' +\n 'data-selector=\"super_attribute[' + config.id + ']\" ' +\n 'data-validate=\"{required: true}\" ' +\n 'aria-required=\"true\" ' +\n 'aria-invalid=\"false\">';\n },\n\n /**\n * Event listener\n *\n * @private\n */\n _EventListener: function () {\n var $widget = this,\n options = this.options.classes,\n target;\n\n $widget.element.on('click', '.' + options.optionClass, function () {\n return $widget._OnClick($(this), $widget);\n });\n\n $widget.element.on('change', '.' + options.selectClass, function () {\n return $widget._OnChange($(this), $widget);\n });\n\n $widget.element.on('click', '.' + options.moreButton, function (e) {\n e.preventDefault();\n\n return $widget._OnMoreClick($(this));\n });\n\n $widget.element.on('keydown', function (e) {\n if (e.which === 13) {\n target = $(e.target);\n\n if (target.is('.' + options.optionClass)) {\n return $widget._OnClick(target, $widget);\n } else if (target.is('.' + options.selectClass)) {\n return $widget._OnChange(target, $widget);\n } else if (target.is('.' + options.moreButton)) {\n e.preventDefault();\n\n return $widget._OnMoreClick(target);\n }\n }\n });\n },\n\n /**\n * Load media gallery using ajax or json config.\n *\n * @private\n */\n _loadMedia: function () {\n var $main = this.inProductList ?\n this.element.parents('.product-item-info') :\n this.element.parents('.column.main'),\n images;\n\n if (this.options.useAjax) {\n this._debouncedLoadProductMedia();\n } else {\n images = this.options.jsonConfig.images[this.getProduct()];\n\n if (!images) {\n images = this.options.mediaGalleryInitial;\n }\n this.updateBaseImage(this._sortImages(images), $main, !this.inProductList);\n }\n },\n\n /**\n * Sorting images array\n *\n * @private\n */\n _sortImages: function (images) {\n return _.sortBy(images, function (image) {\n return parseInt(image.position, 10);\n });\n },\n\n /**\n * Event for swatch options\n *\n * @param {Object} $this\n * @param {Object} $widget\n * @private\n */\n _OnClick: function ($this, $widget) {\n var $parent = $this.parents('.' + $widget.options.classes.attributeClass),\n $wrapper = $this.parents('.' + $widget.options.classes.attributeOptionsWrapper),\n $label = $parent.find('.' + $widget.options.classes.attributeSelectedOptionLabelClass),\n attributeId = $parent.data('attribute-id'),\n $input = $parent.find('.' + $widget.options.classes.attributeInput),\n checkAdditionalData = JSON.parse(this.options.jsonSwatchConfig[attributeId]['additional_data']),\n $priceBox = $widget.element.parents($widget.options.selectorProduct)\n .find(this.options.selectorProductPrice);\n\n if ($widget.inProductList) {\n $input = $widget.productForm.find(\n '.' + $widget.options.classes.attributeInput + '[name=\"super_attribute[' + attributeId + ']\"]'\n );\n }\n\n if ($this.hasClass('disabled')) {\n return;\n }\n\n if ($this.hasClass('selected')) {\n $parent.removeAttr('data-option-selected').find('.selected').removeClass('selected');\n $input.val('');\n $label.text('');\n $this.attr('aria-checked', false);\n } else {\n $parent.attr('data-option-selected', $this.data('option-id')).find('.selected').removeClass('selected');\n $label.text($this.data('option-label'));\n $input.val($this.data('option-id'));\n $input.attr('data-attr-name', this._getAttributeCodeById(attributeId));\n $this.addClass('selected');\n $widget._toggleCheckedAttributes($this, $wrapper);\n }\n\n $widget._Rebuild();\n\n if ($priceBox.is(':data(mage-priceBox)')) {\n $widget._UpdatePrice();\n }\n\n $(document).trigger('updateMsrpPriceBlock',\n [\n this._getSelectedOptionPriceIndex(),\n $widget.options.jsonConfig.optionPrices,\n $priceBox\n ]);\n\n if (parseInt(checkAdditionalData['update_product_preview_image'], 10) === 1) {\n $widget._loadMedia();\n }\n\n $input.trigger('change');\n },\n\n /**\n * Get selected option price index\n *\n * @return {String|undefined}\n * @private\n */\n _getSelectedOptionPriceIndex: function () {\n var allowedProduct = this._getAllowedProductWithMinPrice(this._CalcProducts());\n\n if (_.isEmpty(allowedProduct)) {\n return undefined;\n }\n\n return allowedProduct;\n },\n\n /**\n * Get human readable attribute code (eg. size, color) by it ID from configuration\n *\n * @param {Number} attributeId\n * @returns {*}\n * @private\n */\n _getAttributeCodeById: function (attributeId) {\n var attribute = this.options.jsonConfig.mappedAttributes[attributeId];\n\n return attribute ? attribute.code : attributeId;\n },\n\n /**\n * Toggle accessibility attributes\n *\n * @param {Object} $this\n * @param {Object} $wrapper\n * @private\n */\n _toggleCheckedAttributes: function ($this, $wrapper) {\n $wrapper.attr('aria-activedescendant', $this.attr('id'))\n .find('.' + this.options.classes.optionClass).attr('aria-checked', false);\n $this.attr('aria-checked', true);\n },\n\n /**\n * Event for select\n *\n * @param {Object} $this\n * @param {Object} $widget\n * @private\n */\n _OnChange: function ($this, $widget) {\n var $parent = $this.parents('.' + $widget.options.classes.attributeClass),\n attributeId = $parent.data('attribute-id'),\n $input = $parent.find('.' + $widget.options.classes.attributeInput);\n\n if ($widget.productForm.length > 0) {\n $input = $widget.productForm.find(\n '.' + $widget.options.classes.attributeInput + '[name=\"super_attribute[' + attributeId + ']\"]'\n );\n }\n\n if ($this.val() > 0) {\n $parent.attr('data-option-selected', $this.val());\n $input.val($this.val());\n } else {\n $parent.removeAttr('data-option-selected');\n $input.val('');\n }\n\n $widget._Rebuild();\n $widget._UpdatePrice();\n $widget._loadMedia();\n $input.trigger('change');\n },\n\n /**\n * Event for more switcher\n *\n * @param {Object} $this\n * @private\n */\n _OnMoreClick: function ($this) {\n $this.nextAll().show();\n $this.trigger('blur').remove();\n },\n\n /**\n * Rewind options for controls\n *\n * @private\n */\n _Rewind: function (controls) {\n controls.find('div[data-option-id], option[data-option-id]')\n .removeClass('disabled')\n .prop('disabled', false);\n controls.find('div[data-option-empty], option[data-option-empty]')\n .attr('disabled', true)\n .addClass('disabled')\n .attr('tabindex', '-1');\n this.disableSwatchForOutOfStockProducts();\n },\n\n /**\n * Rebuild container\n *\n * @private\n */\n _Rebuild: function () {\n var $widget = this,\n controls = $widget.element.find('.' + $widget.options.classes.attributeClass + '[data-attribute-id]'),\n selected = controls.filter('[data-option-selected]');\n\n // Enable all options\n $widget._Rewind(controls);\n\n // done if nothing selected\n if (selected.length <= 0) {\n return;\n }\n\n // Disable not available options\n controls.each(function () {\n var $this = $(this),\n id = $this.data('attribute-id'),\n products = $widget._CalcProducts(id);\n\n if (selected.length === 1 && selected.first().data('attribute-id') === id) {\n return;\n }\n\n $this.find('[data-option-id]').each(function () {\n var $element = $(this),\n option = $element.data('option-id');\n\n if (!$widget.optionsMap.hasOwnProperty(id) || !$widget.optionsMap[id].hasOwnProperty(option) ||\n $element.hasClass('selected') ||\n $element.is(':selected')) {\n return;\n }\n\n if (_.intersection(products, $widget.optionsMap[id][option].products).length <= 0) {\n $element.attr('disabled', true).addClass('disabled');\n }\n });\n });\n },\n\n /**\n * Get selected product list\n *\n * @returns {Array}\n * @private\n */\n _CalcProducts: function ($skipAttributeId) {\n var $widget = this,\n selectedOptions = '.' + $widget.options.classes.attributeClass + '[data-option-selected]',\n products = [];\n\n // Generate intersection of products\n $widget.element.find(selectedOptions).each(function () {\n var id = $(this).data('attribute-id'),\n option = $(this).attr('data-option-selected');\n\n if ($skipAttributeId !== undefined && $skipAttributeId === id) {\n return;\n }\n\n if (!$widget.optionsMap.hasOwnProperty(id) || !$widget.optionsMap[id].hasOwnProperty(option)) {\n return;\n }\n\n if (products.length === 0) {\n products = $widget.optionsMap[id][option].products;\n } else {\n products = _.intersection(products, $widget.optionsMap[id][option].products);\n }\n });\n\n return products;\n },\n\n /**\n * Update total price\n *\n * @private\n */\n _UpdatePrice: function () {\n var $widget = this,\n $product = $widget.element.parents($widget.options.selectorProduct),\n $productPrice = $product.find(this.options.selectorProductPrice),\n result = $widget._getNewPrices(),\n tierPriceHtml,\n isShow;\n\n $productPrice.trigger(\n 'updatePrice',\n {\n 'prices': $widget._getPrices(result, $productPrice.priceBox('option').prices)\n }\n );\n\n isShow = typeof result != 'undefined' && result.oldPrice.amount !== result.finalPrice.amount;\n\n $productPrice.find('span:first').toggleClass('special-price', isShow);\n\n $product.find(this.options.slyOldPriceSelector)[isShow ? 'show' : 'hide']();\n\n if (typeof result != 'undefined' && result.tierPrices && result.tierPrices.length) {\n if (this.options.tierPriceTemplate) {\n tierPriceHtml = mageTemplate(\n this.options.tierPriceTemplate,\n {\n 'tierPrices': result.tierPrices,\n '$t': $t,\n 'currencyFormat': this.options.jsonConfig.currencyFormat,\n 'priceUtils': priceUtils\n }\n );\n $(this.options.tierPriceBlockSelector).html(tierPriceHtml).show();\n }\n } else {\n $(this.options.tierPriceBlockSelector).hide();\n }\n\n $(this.options.normalPriceLabelSelector).hide();\n\n _.each($('.' + this.options.classes.attributeOptionsWrapper), function (attribute) {\n if ($(attribute).find('.' + this.options.classes.optionClass + '.selected').length === 0) {\n if ($(attribute).find('.' + this.options.classes.selectClass).length > 0) {\n _.each($(attribute).find('.' + this.options.classes.selectClass), function (dropdown) {\n if ($(dropdown).val() === '0') {\n $(this.options.normalPriceLabelSelector).show();\n }\n }.bind(this));\n } else {\n $(this.options.normalPriceLabelSelector).show();\n }\n }\n }.bind(this));\n },\n\n /**\n * Get new prices for selected options\n *\n * @returns {*}\n * @private\n */\n _getNewPrices: function () {\n var $widget = this,\n newPrices = $widget.options.jsonConfig.prices,\n allowedProduct = this._getAllowedProductWithMinPrice(this._CalcProducts());\n\n if (!_.isEmpty(allowedProduct)) {\n newPrices = this.options.jsonConfig.optionPrices[allowedProduct];\n }\n\n return newPrices;\n },\n\n /**\n * Get prices\n *\n * @param {Object} newPrices\n * @param {Object} displayPrices\n * @returns {*}\n * @private\n */\n _getPrices: function (newPrices, displayPrices) {\n var $widget = this;\n\n if (_.isEmpty(newPrices)) {\n newPrices = $widget._getNewPrices();\n }\n _.each(displayPrices, function (price, code) {\n\n if (newPrices[code]) {\n displayPrices[code].amount = newPrices[code].amount - displayPrices[code].amount;\n }\n });\n\n return displayPrices;\n },\n\n /**\n * Get product with minimum price from selected options.\n *\n * @param {Array} allowedProducts\n * @returns {String}\n * @private\n */\n _getAllowedProductWithMinPrice: function (allowedProducts) {\n var optionPrices = this.options.jsonConfig.optionPrices,\n product = {},\n optionFinalPrice, optionMinPrice;\n\n _.each(allowedProducts, function (allowedProduct) {\n optionFinalPrice = parseFloat(optionPrices[allowedProduct].finalPrice.amount);\n\n if (_.isEmpty(product) || optionFinalPrice < optionMinPrice) {\n optionMinPrice = optionFinalPrice;\n product = allowedProduct;\n }\n }, this);\n\n return product;\n },\n\n /**\n * Gets all product media and change current to the needed one\n *\n * @private\n */\n _LoadProductMedia: function () {\n var $widget = this,\n $this = $widget.element,\n productData = this._determineProductData(),\n mediaCallData,\n mediaCacheKey,\n\n /**\n * Processes product media data\n *\n * @param {Object} data\n * @returns void\n */\n mediaSuccessCallback = function (data) {\n if (!(mediaCacheKey in $widget.options.mediaCache)) {\n $widget.options.mediaCache[mediaCacheKey] = data;\n }\n $widget._ProductMediaCallback($this, data, productData.isInProductView);\n setTimeout(function () {\n $widget._DisableProductMediaLoader($this);\n }, 300);\n };\n\n if (!$widget.options.mediaCallback) {\n return;\n }\n\n mediaCallData = {\n 'product_id': this.getProduct()\n };\n\n mediaCacheKey = JSON.stringify(mediaCallData);\n\n if (mediaCacheKey in $widget.options.mediaCache) {\n $widget._XhrKiller();\n $widget._EnableProductMediaLoader($this);\n mediaSuccessCallback($widget.options.mediaCache[mediaCacheKey]);\n } else {\n mediaCallData.isAjax = true;\n $widget._XhrKiller();\n $widget._EnableProductMediaLoader($this);\n $widget.xhr = $.ajax({\n url: $widget.options.mediaCallback,\n cache: true,\n type: 'GET',\n dataType: 'json',\n data: mediaCallData,\n success: mediaSuccessCallback\n }).done(function () {\n $widget._XhrKiller();\n });\n }\n },\n\n /**\n * Enable loader\n *\n * @param {Object} $this\n * @private\n */\n _EnableProductMediaLoader: function ($this) {\n var $widget = this;\n\n if ($('body.catalog-product-view').length > 0) {\n $this.parents('.column.main').find('.photo.image')\n .addClass($widget.options.classes.loader);\n } else {\n //Category View\n $this.parents('.product-item-info').find('.product-image-photo')\n .addClass($widget.options.classes.loader);\n }\n },\n\n /**\n * Disable loader\n *\n * @param {Object} $this\n * @private\n */\n _DisableProductMediaLoader: function ($this) {\n var $widget = this;\n\n if ($('body.catalog-product-view').length > 0) {\n $this.parents('.column.main').find('.photo.image')\n .removeClass($widget.options.classes.loader);\n } else {\n //Category View\n $this.parents('.product-item-info').find('.product-image-photo')\n .removeClass($widget.options.classes.loader);\n }\n },\n\n /**\n * Callback for product media\n *\n * @param {Object} $this\n * @param {String} response\n * @param {Boolean} isInProductView\n * @private\n */\n _ProductMediaCallback: function ($this, response, isInProductView) {\n var $main = isInProductView ? $this.parents('.column.main') : $this.parents('.product-item-info'),\n $widget = this,\n images = [],\n\n /**\n * Check whether object supported or not\n *\n * @param {Object} e\n * @returns {*|Boolean}\n */\n support = function (e) {\n return e.hasOwnProperty('large') && e.hasOwnProperty('medium') && e.hasOwnProperty('small');\n };\n\n if (_.size($widget) < 1 || !support(response)) {\n this.updateBaseImage(this.options.mediaGalleryInitial, $main, isInProductView);\n\n return;\n }\n\n images.push({\n full: response.large,\n img: response.medium,\n thumb: response.small,\n isMain: true\n });\n\n if (response.hasOwnProperty('gallery')) {\n $.each(response.gallery, function () {\n if (!support(this) || response.large === this.large) {\n return;\n }\n images.push({\n full: this.large,\n img: this.medium,\n thumb: this.small\n });\n });\n }\n\n this.updateBaseImage(images, $main, isInProductView);\n },\n\n /**\n * Check if images to update are initial and set their type\n * @param {Array} images\n */\n _setImageType: function (images) {\n\n images.map(function (img) {\n if (!img.type) {\n img.type = 'image';\n }\n });\n\n return images;\n },\n\n /**\n * Update [gallery-placeholder] or [product-image-photo]\n * @param {Array} images\n * @param {jQuery} context\n * @param {Boolean} isInProductView\n */\n updateBaseImage: function (images, context, isInProductView) {\n var justAnImage = images[0],\n initialImages = this.options.mediaGalleryInitial,\n imagesToUpdate,\n gallery = context.find(this.options.mediaGallerySelector).data('gallery'),\n isInitial;\n\n if (isInProductView) {\n if (_.isUndefined(gallery)) {\n context.find(this.options.mediaGallerySelector).on('gallery:loaded', function () {\n this.updateBaseImage(images, context, isInProductView);\n }.bind(this));\n\n return;\n }\n\n imagesToUpdate = images.length ? this._setImageType($.extend(true, [], images)) : [];\n isInitial = _.isEqual(imagesToUpdate, initialImages);\n\n if (this.options.gallerySwitchStrategy === 'prepend' && !isInitial) {\n imagesToUpdate = imagesToUpdate.concat(initialImages);\n }\n\n imagesToUpdate = this._setImageIndex(imagesToUpdate);\n\n gallery.updateData(imagesToUpdate);\n this._addFotoramaVideoEvents(isInitial);\n } else if (justAnImage && justAnImage.img) {\n context.find('.product-image-photo').attr('src', justAnImage.img);\n }\n },\n\n /**\n * Add video events\n *\n * @param {Boolean} isInitial\n * @private\n */\n _addFotoramaVideoEvents: function (isInitial) {\n if (_.isUndefined($.mage.AddFotoramaVideoEvents)) {\n return;\n }\n\n if (isInitial) {\n $(this.options.mediaGallerySelector).AddFotoramaVideoEvents();\n\n return;\n }\n\n $(this.options.mediaGallerySelector).AddFotoramaVideoEvents({\n selectedOption: this.getProduct(),\n dataMergeStrategy: this.options.gallerySwitchStrategy\n });\n },\n\n /**\n * Set correct indexes for image set.\n *\n * @param {Array} images\n * @private\n */\n _setImageIndex: function (images) {\n var length = images.length,\n i;\n\n for (i = 0; length > i; i++) {\n images[i].i = i + 1;\n }\n\n return images;\n },\n\n /**\n * Kill doubled AJAX requests\n *\n * @private\n */\n _XhrKiller: function () {\n var $widget = this;\n\n if ($widget.xhr !== undefined && $widget.xhr !== null) {\n $widget.xhr.abort();\n $widget.xhr = null;\n }\n },\n\n /**\n * Emulate mouse click on all swatches that should be selected\n * @param {Object} [selectedAttributes]\n * @private\n */\n _EmulateSelected: function (selectedAttributes) {\n $.each(selectedAttributes, $.proxy(function (attributeCode, optionId) {\n var elem = this.element.find('.' + this.options.classes.attributeClass +\n '[data-attribute-code=\"' + attributeCode + '\"] [data-option-id=\"' + optionId + '\"]'),\n parentInput = elem.parent();\n\n if (elem.hasClass('selected')) {\n return;\n }\n\n if (parentInput.hasClass(this.options.classes.selectClass)) {\n parentInput.val(optionId);\n parentInput.trigger('change');\n } else {\n elem.trigger('click');\n }\n }, this));\n },\n\n /**\n * Emulate mouse click or selection change on all swatches that should be selected\n * @param {Object} [selectedAttributes]\n * @private\n */\n _EmulateSelectedByAttributeId: function (selectedAttributes) {\n $.each(selectedAttributes, $.proxy(function (attributeId, optionId) {\n var elem = this.element.find('.' + this.options.classes.attributeClass +\n '[data-attribute-id=\"' + attributeId + '\"] [data-option-id=\"' + optionId + '\"]'),\n parentInput = elem.parent();\n\n if (elem.hasClass('selected')) {\n return;\n }\n\n if (parentInput.hasClass(this.options.classes.selectClass)) {\n parentInput.val(optionId);\n parentInput.trigger('change');\n } else {\n elem.trigger('click');\n }\n }, this));\n },\n\n /**\n * Get default options values settings with either URL query parameters\n * @private\n */\n _getSelectedAttributes: function () {\n var hashIndex = window.location.href.indexOf('#'),\n selectedAttributes = {},\n params;\n\n if (hashIndex !== -1) {\n params = $.parseQuery(window.location.href.substr(hashIndex + 1));\n\n selectedAttributes = _.invert(_.mapObject(_.invert(params), function (attributeId) {\n var attribute = this.options.jsonConfig.mappedAttributes[attributeId];\n\n return attribute ? attribute.code : attributeId;\n }.bind(this)));\n }\n\n return selectedAttributes;\n },\n\n /**\n * Callback which fired after gallery gets initialized.\n *\n * @param {HTMLElement} element - DOM element associated with a gallery.\n */\n _onGalleryLoaded: function (element) {\n var galleryObject = element.data('gallery');\n\n this.options.mediaGalleryInitial = galleryObject.returnCurrentImages();\n },\n\n /**\n * Sets mediaCache for cases when jsonConfig contains preSelectedGallery on layered navigation result pages\n *\n * @private\n */\n _setPreSelectedGallery: function () {\n var mediaCallData;\n\n if (this.options.jsonConfig.preSelectedGallery) {\n mediaCallData = {\n 'product_id': this.getProduct()\n };\n\n this.options.mediaCache[JSON.stringify(mediaCallData)] = this.options.jsonConfig.preSelectedGallery;\n }\n },\n\n /**\n * Callback for quantity change event.\n */\n _onQtyChanged: function () {\n var $price = this.element.parents(this.options.selectorProduct)\n .find(this.options.selectorProductPrice);\n\n $price.trigger(\n 'updatePrice',\n {\n 'prices': this._getPrices(this._getNewPrices(), $price.priceBox('option').prices)\n }\n );\n }\n });\n\n return $.mage.SwatchRenderer;\n});\n","Magento_Swatches/js/catalog-add-to-cart.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\nrequire([\n 'jquery'\n], function ($) {\n 'use strict';\n\n /**\n * Add selected swatch attributes to redirect url\n *\n * @see Magento_Catalog/js/catalog-add-to-cart\n */\n $('body').on('catalogCategoryAddToCartRedirect', function (event, data) {\n $(data.form).find('[name*=\"super\"]').each(function (index, item) {\n var $item = $(item),\n attr;\n\n if ($item.attr('data-attr-name')) {\n attr = $item.attr('data-attr-name');\n } else {\n attr = $item.parent().attr('attribute-code');\n }\n data.redirectParameters.push(attr + '=' + $item.val());\n\n });\n });\n});\n","Magento_Swatches/js/configurable-customer-data.js":"require([\n 'jquery',\n 'Magento_ConfigurableProduct/js/options-updater'\n], function ($, Updater) {\n 'use strict';\n\n var selectors = {\n formSelector: '#product_addtocart_form',\n swatchSelector: '.swatch-opt'\n },\n swatchWidgetName = 'mage-SwatchRenderer',\n widgetInitEvent = 'swatch.initialized',\n\n /**\n * Sets all configurable swatch attribute's selected values\n */\n updateSwatchOptions = function () {\n var swatchWidget = $(selectors.swatchSelector).data(swatchWidgetName);\n\n if (!swatchWidget || !swatchWidget._EmulateSelectedByAttributeId) {\n return;\n }\n swatchWidget._EmulateSelectedByAttributeId(this.productOptions);\n },\n updater = new Updater(widgetInitEvent, updateSwatchOptions);\n\n updater.listen();\n});\n","Magento_Weee/js/tax-toggle.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 /**\n * @param {Object} config\n * @param {jQuery.Event} e\n */\n function onToggle(config, e) {\n var elem = $(e.currentTarget),\n expandedClassName = config.expandedClassName || 'cart-tax-total-expanded';\n\n elem.toggleClass(expandedClassName);\n\n $(config.itemTaxId).toggle();\n }\n\n return function (data, el) {\n $(el).on('click', onToggle.bind(null, data));\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_Weee/js/view/cart/totals/weee.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'Magento_Weee/js/view/checkout/summary/weee'\n], function (Component) {\n 'use strict';\n\n return Component.extend({\n\n /**\n * @override\n */\n isFullMode: function () {\n return true;\n }\n });\n});\n","Magento_Weee/js/view/checkout/summary/weee.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 'Magento_Checkout/js/view/summary/abstract-total',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/model/totals',\n 'Magento_Catalog/js/price-utils'\n], function (Component, quote, totals) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Magento_Weee/checkout/summary/weee'\n },\n isIncludedInSubtotal: window.checkoutConfig.isIncludedInSubtotal,\n totals: totals.totals,\n\n /**\n * @returns {Number}\n */\n getWeeeTaxSegment: function () {\n var weee = totals.getSegment('weee_tax') || totals.getSegment('weee');\n\n if (weee !== null && weee.hasOwnProperty('value')) {\n return weee.value;\n }\n\n return 0;\n },\n\n /**\n * Get weee value\n * @returns {String}\n */\n getValue: function () {\n return this.getFormattedPrice(this.getWeeeTaxSegment());\n },\n\n /**\n * Weee display flag\n * @returns {Boolean}\n */\n isDisplayed: function () {\n return this.isFullMode() && this.getWeeeTaxSegment() > 0;\n }\n });\n});\n","Magento_Weee/js/view/checkout/summary/item/price/row_incl_tax.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 'Magento_Weee/js/view/checkout/summary/item/price/weee'\n], function (weee) {\n 'use strict';\n\n return weee.extend({\n defaults: {\n template: 'Magento_Weee/checkout/summary/item/price/row_incl_tax',\n displayArea: 'row_incl_tax'\n },\n\n /**\n * @param {Object} item\n * @return {Number}\n */\n getFinalRowDisplayPriceInclTax: function (item) {\n var rowTotalInclTax = parseFloat(item['row_total_incl_tax']);\n\n if (!window.checkoutConfig.getIncludeWeeeFlag) {\n rowTotalInclTax += this.getRowWeeeTaxInclTax(item);\n }\n\n return rowTotalInclTax;\n },\n\n /**\n * @param {Object} item\n * @return {Number}\n */\n getRowDisplayPriceInclTax: function (item) {\n var rowTotalInclTax = parseFloat(item['row_total_incl_tax']);\n\n if (window.checkoutConfig.getIncludeWeeeFlag) {\n rowTotalInclTax += this.getRowWeeeTaxInclTax(item);\n }\n\n return rowTotalInclTax;\n },\n\n /**\n * @param {Object}item\n * @return {Number}\n */\n getRowWeeeTaxInclTax: function (item) {\n var totalWeeeTaxInclTaxApplied = 0,\n weeeTaxAppliedAmounts;\n\n if (item['weee_tax_applied']) {\n weeeTaxAppliedAmounts = JSON.parse(item['weee_tax_applied']);\n weeeTaxAppliedAmounts.forEach(function (weeeTaxAppliedAmount) {\n totalWeeeTaxInclTaxApplied += parseFloat(Math.max(weeeTaxAppliedAmount['row_amount_incl_tax'], 0));\n });\n }\n\n return totalWeeeTaxInclTaxApplied;\n }\n\n });\n});\n","Magento_Weee/js/view/checkout/summary/item/price/row_excl_tax.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 'Magento_Weee/js/view/checkout/summary/item/price/weee'\n], function (weee) {\n 'use strict';\n\n return weee.extend({\n defaults: {\n template: 'Magento_Weee/checkout/summary/item/price/row_excl_tax'\n },\n\n /**\n * @param {Object} item\n * @return {Number}\n */\n getFinalRowDisplayPriceExclTax: function (item) {\n var rowTotalExclTax = parseFloat(item['row_total']);\n\n if (!window.checkoutConfig.getIncludeWeeeFlag) {\n rowTotalExclTax += parseFloat(item['qty']) *\n parseFloat(item['weee_tax_applied_amount']);\n }\n\n return rowTotalExclTax;\n },\n\n /**\n * @param {Object} item\n * @return {Number}\n */\n getRowDisplayPriceExclTax: function (item) {\n var rowTotalExclTax = parseFloat(item['row_total']);\n\n if (window.checkoutConfig.getIncludeWeeeFlag) {\n rowTotalExclTax += this.getRowWeeeTaxExclTax(item);\n }\n\n return rowTotalExclTax;\n },\n\n /**\n * @param {Object} item\n * @return {Number}\n */\n getRowWeeeTaxExclTax: function (item) {\n var totalWeeeTaxExclTaxApplied = 0,\n weeeTaxAppliedAmounts;\n\n if (item['weee_tax_applied']) {\n weeeTaxAppliedAmounts = JSON.parse(item['weee_tax_applied']);\n weeeTaxAppliedAmounts.forEach(function (weeeTaxAppliedAmount) {\n totalWeeeTaxExclTaxApplied += parseFloat(Math.max(weeeTaxAppliedAmount['row_amount'], 0));\n });\n }\n\n return totalWeeeTaxExclTaxApplied;\n }\n\n });\n});\n","Magento_Weee/js/view/checkout/summary/item/price/weee.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 'Magento_Checkout/js/view/summary/abstract-total',\n 'Magento_Checkout/js/model/quote'\n], function (Component) {\n 'use strict';\n\n return Component.extend({\n /**\n * @param {Object} item\n * @return {Boolean}\n */\n isDisplayPriceWithWeeeDetails: function (item) {\n if (!parseFloat(item['weee_tax_applied_amount']) || parseFloat(item['weee_tax_applied_amount'] <= 0)) {\n return false;\n }\n\n return window.checkoutConfig.isDisplayPriceWithWeeeDetails;\n },\n\n /**\n * @param {Object} item\n * @return {Boolean}\n */\n isDisplayFinalPrice: function (item) {\n if (!parseFloat(item['weee_tax_applied_amount'])) {\n return false;\n }\n\n return window.checkoutConfig.isDisplayFinalPrice;\n },\n\n /**\n * @param {Object} item\n * @return {Array}\n */\n getWeeeTaxApplied: function (item) {\n if (item['weee_tax_applied']) {\n return JSON.parse(item['weee_tax_applied']);\n }\n\n return [];\n }\n });\n});\n","Magento_Translation/js/i18n-config.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n(function () {\n 'use strict';\n\n require.config({\n config: {\n 'Magento_Ui/js/lib/knockout/bindings/i18n': {\n inlineTranslation: true\n }\n }\n });\n})();\n","Magento_Translation/js/mage-translation-dictionary.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'text!js-translation.json'\n], function (dict) {\n 'use strict';\n\n return JSON.parse(dict);\n});\n","Magento_Translation/js/add-class.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine(['jquery'], function ($) {\n 'use strict';\n\n return function (config, element) {\n $(element).addClass(config.class);\n };\n});\n","Amasty_Label/js/initLabel.js":"/**\n * Initialize Module depends on the area\n * @return widget\n */\n\ndefine([\n 'jquery',\n 'Amasty_Label/vendor/tooltipster/js/tooltipster.min',\n 'Amasty_Label/js/label',\n 'matchMedia',\n 'domReady!'\n// eslint-disable-next-line no-unused-vars\n], function ($, tooltipster) {\n 'use strict';\n\n $.widget('mage.amInitLabel', {\n options: {\n mode: null,\n isAdminArea: null,\n config: null,\n productId: null,\n selector: null\n },\n classes: {\n amSearchSection: 'amsearch-products-section'\n },\n tooltipVendorClass: 'tooltip',\n mediaBreakpoint: 'all and (max-width: 768px)',\n\n /**\n * @inheritDoc\n */\n _create: function () {\n var self = this,\n element = self.element.closest('.product-item, .item');\n\n // remove label duplication\n if (this.element.parent().hasClass(this.classes.amSearchSection)\n && this.element.parent().find(this.options.selector).length > 1) {\n return;\n }\n\n this.renderTooltip();\n\n // observe only on category pages and without swatches\n if (self.options.mode === 'prod'\n || self.options.isAdminArea\n || self.element.hasClass('amlabel-swatch')\n || self.isIE()\n ) {\n self.execLabel();\n } else if (self.options.mode === 'cat' && element.length && !self.element.hasClass('amlabel-swatch')) {\n self._handleIntersect(element);\n } else {\n self.execLabel();\n }\n },\n\n /**\n * Exec Amasty Label widget\n * @public\n * @returns {void}\n */\n execLabel: function () {\n this.element.amShowLabel(this.options.config);\n },\n\n /**\n * @public\n * @returns {Boolean}\n */\n isIE: function () {\n var ua = window.navigator.userAgent;\n\n return ua.indexOf('MSIE ') > -1 || ua.indexOf('Trident/') > -1;\n },\n\n /**\n * @public\n * @returns {void}\n */\n renderTooltip: function () {\n var tooltipOptions = this.options.config.tooltip,\n tooltipContent = decodeURIComponent(tooltipOptions.content);\n\n if (this._isHiddenOnMobile()) {\n return;\n }\n\n if (+tooltipOptions.status > 1 && tooltipContent && !this._isEmpty(tooltipContent)) {\n this.element.addClass(this.tooltipVendorClass).tooltipster({\n theme: 'tooltipster-shadow',\n interactive: true,\n content: $('<span>', {\n html: tooltipContent\n }),\n styles: {\n backgroundColor: tooltipOptions.backgroundColor,\n textColor: tooltipOptions.color\n }\n });\n }\n },\n\n /**\n * @param {String} html\n * @private\n * @returns {Boolean}\n */\n _isEmpty: function (html) {\n return html === null || html.match(/^ *$/) !== null;\n },\n\n /**\n * @private\n * @returns {Boolean}\n */\n _isHiddenOnMobile: function () {\n return matchMedia(this.mediaBreakpoint).matches && +this.options.config.tooltip.status === 3;\n },\n\n /**\n * Use IntersectionObserver to lazy loading Amasty Label widget\n *\n * @param {Object} element\n * @protected\n * @returns {function}\n */\n _handleIntersect: function (element) {\n var self = this,\n observer;\n\n observer = new IntersectionObserver(function (entries) {\n if (entries[0].isIntersecting) {\n self.execLabel();\n observer.disconnect();\n }\n });\n\n observer.observe(element[0]);\n }\n });\n\n return $.mage.amInitLabel;\n});\n","Amasty_Label/js/label.js":"define([\n 'jquery',\n 'underscore',\n 'Magento_Ui/js/modal/modal'\n], function ($, _) {\n 'use strict';\n\n $.widget('mage.amShowLabel', {\n options: {},\n textElement: null,\n image: null,\n imageWidth: null,\n imageHeight: null,\n parent: null,\n imageLabel: ['.amasty-label-container', '.amasty-label-image', '.amlabel-text'],\n fotoramaStage: '[data-fotorama-stage=\"fotorama__stage\"]',\n galleryPlaceholder: '[data-gallery-role=\"gallery-placeholder\"]',\n positionWrapper: 'amlabel-position-wrapper',\n mainContainer: '[data-gallery-role=\"amasty-main-container\"]',\n slickSlider: {\n selectors: {\n slider: '.slick-slider',\n slide: '.slick-slide'\n },\n classes: {\n cloned: 'slick-cloned',\n initialized: 'slick-initialized'\n }\n },\n\n /**\n * @inheritDoc\n * @private\n */\n _create: function () {\n var items,\n priceContainer,\n newParent,\n me;\n\n this.parentResizeListener = new ResizeObserver(function () {\n this.setLabelStyle();\n this._refreshSLickSlider();\n }.bind(this));\n\n this.element = $(this.element);\n\n if (this.element.attr('amlabel-js-observed')) {\n return;\n }\n\n this.element.attr('amlabel-js-observed', 1);\n\n /* code for moving product label */\n if (this.options.move === 1) {\n items = this.element.closest('.page-wrapper').find(this.getPriceSelector());\n\n if (items.length) { // find any element with product 'id'\n items = this._filterItems(items);\n\n priceContainer = items.first();\n newParent = this.getNewParent(priceContainer);\n\n // eslint-disable-next-line max-depth\n if (newParent && newParent.length) {\n priceContainer.attr('label-observered-' + this.options.label, '1');\n newParent.append(this.element);\n } else {\n this.element.hide();\n\n return;\n }\n } else {\n this.element.hide();\n\n return;\n }\n }\n\n this.image = this.element.find('.amasty-label-image');\n this.textElement = this.element.find('.amlabel-text');\n this.parent = this.element.parent();\n\n if (!this.image.length) {\n this.setStyleIfNotExist(\n this.element,\n {\n 'width': '100px',\n 'height': '50px'\n }\n );\n }\n\n if (!this.image.length && this.options.position.includes('center')) {\n this.textElement.addClass('-am-centered');\n }\n\n /* move label to container from settings*/\n if (this.options.path && this.options.path !== '') {\n newParent = this.parent.find(this.options.path);\n\n if (newParent.length) {\n this.parent = newParent;\n newParent.append(this.element);\n }\n }\n\n /* required for child position absolute */\n if (!(this.parent.css('position') === 'absolute' || this.parent.css('position') === 'relative')) {\n this.parent.css('position', 'relative');\n }\n\n if (this.parent.prop('tagName') === 'A' && !this.parent.closest('.block.widget').hasClass('list')) {\n this.parent.css('display', 'block');\n }\n\n /* fix issue with hover on product grid */\n if (!this.element.closest('.sidebar').length) {\n this.element.closest('.product-item-info').css('zIndex', '996');\n }\n\n /* get default image size */\n if (!this.imageLoaded(this.image)) {\n me = this;\n\n this.image.on('load', function () {\n me.element.fadeIn();\n me.imageWidth = this.naturalWidth;\n me.imageHeight = this.naturalHeight;\n me.setLabelStyle();\n });\n } else {\n this.element.fadeIn();\n\n if (this.image[0]) {\n this.imageWidth = this.image[0].naturalWidth;\n this.imageHeight = this.image[0].naturalHeight;\n }\n }\n\n this.setLabelPosition();\n this.updateStyles();\n\n /* observe zoom load event for moving label*/\n this.productPageZoomEvent();\n this.createResizeEvent();\n this.createFotoramaEvent();\n this.createRedirectEvent();\n this._refreshSLickSlider();\n },\n\n /**\n * @returns {void}\n */\n _refreshSLickSlider: function () {\n var slider = this.element.closest(this.slickSlider.selectors.slider);\n\n if (slider.length && slider.hasClass(this.slickSlider.classes.initialized)) {\n slider.slick('refresh');\n }\n },\n\n /**\n * Skip labels from slick slider cloned nodes,\n * Skip labels that already exist in the product container,\n * Skip labels from bundle packs\n *\n * @param {Array} items\n * @return {Array}\n */\n _filterItems: function (items) {\n return items.filter(function (index, element) {\n return !$(element).closest(this.slickSlider.selectors.slide).hasClass(this.slickSlider.classes.cloned)\n && !$(element).closest('.amrelated-pack-item').length\n && !$(element).closest('.product-item-info')\n .find('.amasty-label-container-' + this.options.label + '-' + this.options.product + '-cat')\n .length;\n }.bind(this));\n },\n\n /**\n * @return {void}\n */\n createRedirectEvent: function () {\n this.element.on('click', function (e) {\n this.openLink(e);\n }.bind(this));\n },\n\n /**\n * @param {event} event\n * @return {void}\n */\n openLink: function (event) {\n var redirectUrl = this.options['redirect_url'];\n\n if (redirectUrl && !this.isEmpty(redirectUrl)) {\n event.preventDefault();\n window.open(redirectUrl, '_blank');\n }\n },\n\n /**\n * @return {void}\n */\n createResizeEvent: function () {\n $(window).on('resize', _.debounce(function () {\n this.reloadParentSize();\n }.bind(this), 300));\n\n $(window).on('orientationchange', function () {\n this.reloadParentSize();\n }.bind(this));\n },\n\n /**\n * @return {void}\n */\n createFotoramaEvent: function () {\n $(this.galleryPlaceholder).on('fotorama:load', this.updatePositionInFotorama.bind(this));\n },\n\n /**\n * @return {void}\n */\n updatePositionInFotorama: function () {\n var self = this,\n newParent = this.parent.find(this.options.path),\n elementToMove = null;\n\n if (this\n && this.options.path\n && this.options.mode === 'prod'\n ) {\n if (newParent.length && newParent !== this.parent) {\n this.parent.css('position', '');\n this.parent = newParent;\n\n elementToMove = this.element.parent().hasClass(this.positionWrapper)\n ? this.element.parent()\n : this.element;\n newParent.append(elementToMove);\n newParent.css({ 'position': 'relative' });\n\n self.setLabelsEventOnFotorama();\n }\n }\n },\n\n setLabelsEventOnFotorama: function () {\n var self = this,\n fotoramaStage = $(this.fotoramaStage),\n mousedownOnFotoramaStage = $._data(fotoramaStage[0], 'events').mousedown,\n pointerdownOnFotoramaStage = $._data(fotoramaStage[0], 'events').pointerdown;\n\n if (!fotoramaStage[0].eventsUpdated) {\n fotoramaStage.on('mousedown pointerdown', function (e) {\n if (e.which === 1 && $(e.target).is(self.imageLabel.join(','))) {\n $(this).trigger('focusout');\n self.openLink(e);\n e.stopImmediatePropagation();\n }\n });\n\n // eslint-disable-next-line max-depth\n if (fotoramaStage.length && mousedownOnFotoramaStage) {\n mousedownOnFotoramaStage.unshift(mousedownOnFotoramaStage.pop());\n }\n\n if (fotoramaStage.length && pointerdownOnFotoramaStage) {\n pointerdownOnFotoramaStage.unshift(pointerdownOnFotoramaStage.pop());\n }\n\n fotoramaStage[0].eventsUpdated = true;\n }\n },\n\n /**\n * @param {Object} img\n * @return {boolean}\n */\n imageLoaded: function (img) {\n return !(!img.complete\n || typeof img.naturalWidth !== 'undefined' && img.naturalWidth === 0);\n },\n\n /**\n * @return {void}\n */\n productPageZoomEvent: function () {\n var amastyGallery = $(this.mainContainerSelector);\n\n if (this.options.mode === 'prod') {\n if (amastyGallery.length) {\n this.parent = amastyGallery;\n amastyGallery.append(this.element.parent());\n amastyGallery.css('position', 'relative');\n }\n }\n },\n\n /**\n * @return {void}\n */\n updateStyles: function () {\n this.setLabelStyle();\n this.setLabelPosition();\n },\n\n /**\n * @param {Object} element\n * @param {Object} styles\n * @return {void}\n */\n setStyleIfNotExist: function (element, styles) {\n // eslint-disable-next-line guard-for-in, vars-on-top\n for (var style in styles) {\n // eslint-disable-next-line\n var current = element.attr('style');\n\n if (!current ||\n current.indexOf('; ' + style) === -1 && current.indexOf(';' + style) === -1\n ) {\n // eslint-disable-next-line no-undef\n element.css(style, styles[style]);\n }\n }\n },\n\n /**\n * @return {void}\n */\n setLabelStyle: function () {\n var parentWidth,\n tmpWidth,\n tmpHeight,\n lineCount,\n redirectUrl = this.options['redirect_url'],\n display = this.options.alignment === 1 ? 'inline-block' : 'block';\n\n /* for text element */\n this.setStyleIfNotExist(\n this.textElement,\n {\n 'padding': '0 3px',\n 'position': 'absolute',\n 'box-sizing': 'border-box',\n 'white-space': 'nowrap',\n 'width': '100%'\n }\n );\n\n if (this.image.length) {\n /* for image */\n this.image.css({ 'width': '100%' });\n\n /* get block size depend settings */\n if (this.options.size > 0) {\n parentWidth = Math.round(this.parent.css('width').replace(/[^\\d.]/g, ''));\n\n if (!parentWidth) {\n this.parentResizeListener.observe(this.parent[0]);\n\n return;\n }\n\n // eslint-disable-next-line max-depth\n if (parentWidth) {\n this.parentResizeListener.disconnect();\n // eslint-disable-next-line no-mixed-operators\n this.imageWidth = Math.round(parentWidth * this.options.size / 100);\n }\n } else {\n this.imageWidth += 'px';\n }\n\n this.setStyleIfNotExist(this.element, { 'width': this.imageWidth });\n this.imageHeight = this.image.height();\n\n /* if container doesn't load(height = 0 ) set proportional height */\n if (!this.imageHeight && this.image[0] && this.image[0].naturalWidth !== 0) {\n tmpWidth = this.image[0].naturalWidth;\n tmpHeight = this.image[0].naturalHeight;\n\n this.imageHeight = Math.round(this.imageWidth * (tmpHeight / tmpWidth));\n }\n\n lineCount = this.textElement.html().split('<br>').length;\n lineCount = lineCount >= 1 ? lineCount : 1;\n this.textElement.css('lineHeight', Math.round(this.imageHeight / lineCount) + 'px');\n\n /* for whole block */\n if (this.imageHeight) {\n this.setStyleIfNotExist(this.element, {\n 'height': this.imageHeight + 'px'\n });\n }\n\n this._fitLabelText();\n }\n\n this.image\n .attr('width', this.image.width() + 'px')\n .attr('height', this.image.height() + 'px');\n\n this.element.parent().css({\n 'line-height': 'normal',\n 'position': 'absolute'\n });\n\n // dont reload display for configurable child label. visibility child label processed in reload.js\n if (!this.element.hasClass('amlabel-swatch')) {\n this.setStyleIfNotExist(\n this.element,\n {\n 'position': 'relative',\n 'display': display\n }\n );\n }\n\n if (redirectUrl && !this.isEmpty(redirectUrl)) {\n this.element.addClass('-link');\n }\n\n this.reloadParentSize();\n },\n\n /**\n * @return {void}\n */\n _fitLabelText: function () {\n if (this.options.size) {\n var flag = 1;\n\n this.textElement.css({ 'width': 'auto' });\n this.textElement.parent().css('display', 'block');\n\n while (this.textElement.width() > 0.9 * this.textElement.parent().width() && flag++ < 15) {\n this.textElement.css({ 'fontSize': 100 - flag * 5 + '%' });\n }\n\n this.textElement.parent().css('display', 'none');\n this.textElement.css({ 'width': '100%' });\n }\n },\n\n /**\n * @param {*} html\n * @return {Boolean}\n */\n isEmpty: function (html) {\n return html === null || html.match(/^ *$/) !== null;\n },\n\n setPosition: function (position) {\n this.options.position = position;\n this.setLabelPosition();\n this.reloadParentSize();\n },\n\n /**\n * @return {void}\n */\n setStyle: function () {\n this.setLabelStyle();\n },\n\n /**\n * @return {void}\n */\n reloadParentSize: function () {\n var parent = this.element.parent(),\n height = null,\n width = 5;\n\n parent.css({\n 'position': 'relative',\n 'display': 'inline-block',\n 'width': 'auto',\n 'height': 'auto'\n });\n\n height = parent.height();\n\n if (this.options.alignment === 1) {\n parent.children().each(function (index, element) {\n width += $(element).width() + parseInt($(element).css('margin-left'), 10)\n + parseInt($(element).css('margin-right'), 10);\n });\n } else {\n width = parent.width();\n }\n\n parent.css({\n 'position': 'absolute',\n 'display': 'block',\n 'height': height ? height + 'px' : '',\n 'width': width ? width + 'px' : ''\n });\n },\n\n /**\n * @return {string}\n */\n getWidgetLabelCode: function () {\n var label = '';\n\n if (this.element.parents('.widget-product-grid, .widget').length) {\n label = 'widget';\n }\n\n return label;\n },\n\n /**\n * @return {*|void}\n */\n setLabelPosition: function () {\n var parent,\n labelOrderMatch,\n className = 'amlabel-position-' + this.options.position\n + '-' + this.options.product + '-' + this.options.mode + this.getWidgetLabelCode(),\n wrapper = this.parent.find('.' + className);\n\n if (wrapper.length) {\n labelOrderMatch = false;\n\n $.each(wrapper.find('.amasty-label-container'), function (index, prevLabel) {\n var nextLabel = $(prevLabel).next(),\n currentOrder = parseInt(this.options.order, 10),\n prevOrder = null,\n nextOrder = null;\n\n if ($(prevLabel).length && $(prevLabel).data('mageAmShowLabel')) {\n prevOrder = parseInt($(prevLabel).data('mageAmShowLabel').options.order, 10);\n }\n\n if (nextLabel.length && $(nextLabel).data('mageAmShowLabel')) {\n nextOrder = parseInt(nextLabel.data('mageAmShowLabel').options.order, 10);\n }\n\n if (currentOrder >= prevOrder && (!nextOrder || currentOrder <= nextOrder)) {\n labelOrderMatch = true;\n\n $(prevLabel).after(this.element);\n\n return false;\n }\n }.bind(this));\n\n if (!labelOrderMatch) {\n wrapper.prepend(this.element);\n }\n } else {\n parent = this.element.parent();\n if (parent.hasClass(this.positionWrapper)) {\n parent.parent().html(this.element);\n }\n\n this.element.wrap('<div class=\"' + className + ' ' + this.positionWrapper + '\"></div>');\n wrapper = this.element.parent();\n }\n\n if (this.options.alignment === 1) {\n wrapper.children(':not(:first-child)').each(function (index, element) {\n this.setStyleIfNotExist(\n $(element),\n {\n 'marginLeft': this.options.margin + 'px'\n }\n );\n }.bind(this));\n } else {\n wrapper.children(':not(:first-child)').each(function (index, element) {\n this.setStyleIfNotExist(\n $(element),\n {\n 'marginTop': this.options.margin + 'px'\n }\n );\n }.bind(this));\n }\n\n // clear styles before changing\n wrapper.css({\n 'top': '',\n 'left': '',\n 'right': '',\n 'bottom': '',\n 'margin-top': '',\n 'margin-bottom': '',\n 'margin-left': '',\n 'margin-right': ''\n });\n\n switch (this.options.position) {\n case 'top-left':\n wrapper.css({\n 'top': 0,\n 'left': 0\n });\n break;\n case 'top-center':\n wrapper.css({\n 'top': 0,\n 'left': 0,\n 'right': 0,\n 'margin-left': 'auto',\n 'margin-right': 'auto'\n });\n break;\n case 'top-right':\n wrapper.css({\n 'top': 0,\n 'right': 0,\n 'text-align': 'right'\n });\n break;\n\n case 'middle-left':\n wrapper.css({\n 'left': 0,\n 'top': 0,\n 'bottom': 0,\n 'margin-top': 'auto',\n 'margin-bottom': 'auto'\n });\n break;\n case 'middle-center':\n wrapper.css({\n 'top': 0,\n 'bottom': 0,\n 'margin-top': 'auto',\n 'margin-bottom': 'auto',\n 'left': 0,\n 'right': 0,\n 'margin-left': 'auto',\n 'margin-right': 'auto'\n });\n break;\n case 'middle-right':\n wrapper.css({\n 'top': 0,\n 'bottom': 0,\n 'margin-top': 'auto',\n 'margin-bottom': 'auto',\n 'right': 0,\n 'text-align': 'right'\n });\n break;\n\n case 'bottom-left':\n wrapper.css({\n 'bottom': 0,\n 'left': 0\n });\n break;\n case 'bottom-center':\n wrapper.css({\n 'bottom': 0,\n 'left': 0,\n 'right': 0,\n 'margin-left': 'auto',\n 'margin-right': 'auto'\n });\n break;\n case 'bottom-right':\n wrapper.css({\n 'bottom': 0,\n 'right': 0,\n 'text-align': 'right'\n });\n break;\n }\n },\n\n /**\n * @param {jQuery} item\n * @return {jQuery | null}\n */\n getNewParent: function (item) {\n var imageContainer = null,\n productContainer = item.closest('.item.product');\n\n if (!productContainer.length) {\n productContainer = item.closest('.product-item');\n }\n\n if (productContainer && productContainer.length) {\n imageContainer = productContainer.find(this.options.path).first();\n }\n\n return imageContainer;\n },\n\n /**\n * @return {string}\n */\n getPriceSelector: function () {\n var notLabelObservered = ':not([label-observered-' + this.options.label + '])';\n\n return '[data-product-id=\"' + this.options.product + '\"]' + notLabelObservered + ', ' +\n '[id=\"product-price-' + this.options.product + '\"]' + notLabelObservered + ', ' +\n '[name=\"product\"][value=\"' + this.options.product + '\"]' + notLabelObservered;\n }\n });\n\n return $.mage.amShowLabel;\n});\n","Amasty_Label/js/configurable/configurable.js":"define([\n 'jquery',\n 'underscore',\n 'Amasty_Label/js/configurable/reload',\n 'Magento_Ui/js/modal/modal'\n], function ($, _, reloader) {\n 'use strict';\n\n return function (widget) {\n $.widget('mage.configurable', widget, {\n /**\n * Trigger label reload\n *\n * @return {void}\n */\n _processLabelReload: function () {\n var productId = this.simpleProduct,\n imageContainer = null,\n originalProductId = this.options.spConfig['original_product_id'];\n\n if (this.inProductList) {\n imageContainer = this.element.closest('li.item').find(this.options.spConfig['label_category']);\n } else {\n imageContainer = this.element.closest('.column.main').find(this.options.spConfig['label_product']);\n }\n\n if (!productId) {\n productId = this.options.spConfig['original_product_id'];\n }\n\n if (typeof this.options.spConfig['label_reload'] != 'undefined') {\n reloader.reload(\n imageContainer,\n productId,\n this.options.spConfig['label_reload'],\n this.inProductList ? 1 : 0,\n originalProductId\n );\n }\n },\n\n /**\n * OVERRIDE\n *\n * @inheritDoc\n */\n _changeProductImage: function (noLabel) {\n if (noLabel !== true) {\n this._processLabelReload();\n }\n\n var images,\n initialImages = this.options.mediaGalleryInitial,\n gallery = $(this.options.mediaGallerySelector).data('gallery');\n\n if (_.isUndefined(gallery)) {\n $(this.options.mediaGallerySelector).on('gallery:loaded', function () {\n this._changeProductImage(true); // skip label reloading to prevent duplicates\n }.bind(this));\n\n return;\n }\n\n images = this.options.spConfig.images[this.simpleProduct];\n\n if (images) {\n images = this._sortImages(images);\n\n if (this.options.gallerySwitchStrategy === 'prepend') {\n images = images.concat(initialImages);\n }\n\n images = $.extend(true, [], images);\n images = this._setImageIndex(images);\n\n gallery.updateData(images);\n this._addFotoramaVideoEvents(false);\n } else {\n gallery.updateData(initialImages);\n this._addFotoramaVideoEvents(true);\n }\n }\n });\n\n return $.mage.configurable;\n };\n});\n","Amasty_Label/js/configurable/reload.js":"define([\n 'jquery',\n 'underscore'\n], function ($, _) {\n 'use strict';\n\n return {\n cache: new Map(),\n xhrRequest: null,\n selectors: {\n imageContainer: '.product-image-container',\n postDataElement: '.action[data-post]'\n },\n\n /**\n * @param {String | jQuery} container\n * @param {object} data\n *\n * @private\n */\n reloadLabels: function (container, data) {\n var self = this,\n postData;\n\n if (!data.labels) {\n return;\n }\n\n if (typeof container !== 'string') {\n var label = data.labels instanceof Object ? Object.values(data.labels)[0] : data.labels;\n\n container.find('.amasty-label-container').remove();\n label = container.last().after(label);\n label.trigger('contentUpdated');\n\n return;\n }\n\n $(container).each(function (index, item) {\n postData = JSON.parse($(item).find(self.selectors.postDataElement).attr('data-post'));\n\n $(item).find(self.selectors.imageContainer)\n .after(data.labels[postData.data.product])\n .trigger('contentUpdated');\n });\n },\n\n /**\n * @param {string} url\n * @param {object} params\n * @param {function} callback\n *\n * @private\n */\n doAjax: function (url, params, callback) {\n if (this.xhrRequest !== null) {\n this.xhrRequest.abort();\n }\n\n this.xhrRequest = $.ajax({\n url: url,\n data: params,\n method: 'GET',\n cache: true,\n dataType: 'json',\n showLoader: false,\n success: function (data) {\n var cacheKey = this.generateCacheKey(params);\n\n this.cache.set(cacheKey, data);\n callback(data);\n }.bind(this)\n });\n },\n\n /**\n * @param {object} params\n *\n * @private\n */\n generateCacheKey: function (params) {\n var processedEntry;\n\n return Object.entries(params).reduce(function (carry, entry) {\n processedEntry = typeof entry[1] === 'object' ? entry[1].join('-') : entry[1];\n\n return carry + '_' + entry[0] + '_' + processedEntry;\n }, '');\n },\n\n /**\n * @param {String | jQuery} container\n * @param {number | Array} productId\n * @param {string} reloadUrl\n * @param {boolean} inProductList\n */\n reload: function (container, productId, reloadUrl, inProductList) {\n var imageBlock = $(container).find('.amasty-label-for-' + productId),\n params = {\n product_ids: _.isArray(productId) ? productId.join(',') : productId,\n in_product_list: inProductList\n },\n cacheKey = this.generateCacheKey(params);\n\n if (this.cache.has(cacheKey)) {\n this.reloadLabels(container, this.cache.get(cacheKey));\n } else {\n this.doAjax(reloadUrl, params, this.reloadLabels.bind(this, container));\n }\n\n imageBlock.show();\n }\n };\n});\n","Amasty_Label/js/configurable/swatch-renderer.js":"define([\n 'jquery',\n 'Amasty_Label/js/configurable/reload',\n 'Amasty_Label/js/initLabel'\n], function ($, reloader) {\n 'use strict';\n\n return function (widget) {\n $.widget('mage.SwatchRenderer', widget, {\n _loadMedia: function () {\n if (!window.isAmSwatchClickTriggered) {\n this.loadLabels();\n } else {\n window.isAmSwatchClickTriggered = false;\n }\n\n return this._super();\n },\n\n _LoadProductMedia: function () {\n this.loadLabels();\n\n return this._super();\n },\n\n loadLabels: function () {\n var productIds = this._CalcProducts(),\n imageContainer = null;\n\n if (this.inProductList) {\n imageContainer = this.element.closest('li.item')\n .find(this.options.jsonConfig['label_category']);\n } else {\n imageContainer = this.element.closest('.column.main')\n .find(this.options.jsonConfig['label_product']);\n }\n\n if (productIds.length === 0) {\n productIds.push(this.options.jsonConfig['original_product_id']);\n }\n\n if (typeof this.options.jsonConfig['label_reload'] != 'undefined') {\n !this.inProductList ?? imageContainer.find('.amlabel-position-wrapper').remove();\n reloader.reload(\n imageContainer,\n productIds[0],\n this.options.jsonConfig['label_reload'],\n this.inProductList ? 1 : 0\n );\n }\n }\n });\n\n return $.mage.SwatchRenderer;\n };\n});\n","Amasty_Label/js/uiWidget/amLoadUiLabel.js":"define([\n 'jquery',\n 'underscore',\n 'Amasty_Label/js/configurable/reload',\n 'mage/url',\n 'Magento_Customer/js/customer-data',\n 'Magento_Catalog/js/product/view/product-ids-resolver',\n 'uiRegistry'\n], function ($, _, reloader, url, customerData, productResolver, registry) {\n 'use strict';\n\n $.widget('mage.amInitLabelUi', {\n options: {\n config: null,\n productsLifetime: 1000,\n scope: 'group'\n },\n selectors: {\n widgetWrapper: '[data-bind=\"scope: \\'%1.%2\\'\"]',\n imageContainer: '.block-viewed-products-grid .product-item-info',\n addToCartForm: '#product_addtocart_form'\n },\n modules: {\n recentlyViewed: 'ns = widget_recently_viewed'\n },\n controller: 'amasty_label/ajax/label',\n\n /**\n * Widget constructor.\n * @protected\n */\n _create: function () {\n this.uiWidget('trigger', true);\n },\n\n /**\n * @public\n * @return {Object}\n */\n uiWidget: function () {\n return registry.get(this.modules.recentlyViewed, function (component) {\n this.setLabelHtml(component);\n }.bind(this));\n },\n\n /**\n * @public\n * @return {void}\n */\n setLabelHtml: function (component) {\n var self = this,\n idsData = Object.keys(component.ids()\n ? component.ids()\n : this.filterIds(JSON.parse(window.localStorage.getItem('recently_viewed_product')))),\n target = $(this.selectors.widgetWrapper\n .replace('%1', component.dataScope)\n .replace('%2', component.ns)),\n isSyncWidgetWithBackend = +component.idsStorage.allowToSendRequest,\n options = {\n childList: true,\n subtree: true\n },\n observer;\n\n if (!idsData.length && !isSyncWidgetWithBackend) {\n return;\n }\n\n observer = new MutationObserver(function (mutations) {\n mutations.forEach(function (mutation) {\n if (mutation.type === 'childList'\n && mutation.previousSibling\n && typeof mutation.previousSibling.dataset !== 'undefined'\n && typeof mutation.previousSibling.dataset.post !== 'undefined'\n ) {\n reloader.reload(\n self.selectors.imageContainer,\n isSyncWidgetWithBackend ? Object.keys(component.ids()) : idsData,\n url.build(self.controller),\n true\n );\n\n observer.disconnect();\n }\n });\n });\n\n observer.observe(target[0], options);\n },\n\n /**\n * @param ids\n * @public\n * @return {Object}\n */\n filterIds: function (ids) {\n var result = {},\n lifetime = this.options.productsLifetime,\n currentTime = new Date().getTime() / 1000,\n currentProductIds = productResolver($(this.selectors.addToCartForm)),\n productCurrentScope = this.options.scope,\n scopeId = productCurrentScope === 'store' ? window.checkout.storeId :\n productCurrentScope === 'group' ? window.checkout.storeGroupId :\n window.checkout.websiteId;\n\n _.each(ids, function (id, key) {\n if (\n currentTime - ids[key]['added_at'] < lifetime &&\n !_.contains(currentProductIds, ids[key]['product_id']) &&\n (!id.hasOwnProperty('scope_id') || ids[key]['scope_id'] === scopeId)\n ) {\n result[id['product_id']] = id;\n }\n }, this);\n\n return result;\n }\n });\n\n return $.mage.amInitLabelUi;\n});\n","Amasty_Label/vendor/tooltipster/js/tooltipster.min.js":"!function(t,i){\"function\"==typeof define&&define.amd?define([\"jquery\"],function(t){return i(t)}):\"object\"==typeof exports?module.exports=i(require(\"jquery\")):i(jQuery)}(0,function(t){var i={animation:\"fade\",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:[\"sideTip\"],repositionOnScroll:!1,restoration:\"none\",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:\"hover\",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:\"rotate\",zIndex:9999999,styles:{backgroundColor:\"\",textColor:\"\"}},o=\"undefined\"!=typeof window?window:null,e={hasTouchCapability:!(!o||!(\"ontouchstart\"in o||o.DocumentTouch&&o.document instanceof o.DocumentTouch||o.navigator.maxTouchPoints)),hasTransitions:function(){if(!o)return!1;var t=(o.document.body||o.document.documentElement).style,i=\"transition\",e=[\"Moz\",\"Webkit\",\"Khtml\",\"O\",\"ms\"];if(\"string\"==typeof t[i])return!0;i=i.charAt(0).toUpperCase()+i.substr(1);for(var n=0;n<e.length;n++)if(\"string\"==typeof t[e[n]+i])return!0;return!1}(),IE:!1,semVer:\"4.2.8\",window:o},n=function(){this.__$emitterPrivate=t({}),this.__$emitterPublic=t({}),this.__instancesLatestArr=[],this.__plugins={},this._env=e};function s(t){this.$container,this.constraints=null,this.__$tooltip,this.__init(t)}function r(i,o){var e=!0;return t.each(i,function(t,n){if(void 0===o[t]||i[t]!==o[t])return e=!1,!1}),e}function _(i){var o=i.attr(\"id\"),n=o?e.window.document.getElementById(o):null;return n?n===i[0]:t.contains(e.window.document.body,i[0])}n.prototype={__bridge:function(o,e,n){if(!e[n]){var s=function(){};s.prototype=o;var r=new s;r.__init&&r.__init(e),t.each(o,function(t,o){0!=t.indexOf(\"__\")&&(e[t]?i.debug&&console.log(\"The \"+t+\" method of the \"+n+\" plugin conflicts with another plugin or native methods\"):(e[t]=function(){return r[t].apply(r,Array.prototype.slice.apply(arguments))},e[t].bridged=r))}),e[n]=r}return this},__setWindow:function(t){return e.window=t,this},_getRuler:function(t){return new s(t)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(i){if(\"string\"==typeof i){var o=i,e=null;return o.indexOf(\".\")>0?e=this.__plugins[o]:t.each(this.__plugins,function(t,i){if(i.name.substring(i.name.length-o.length-1)==\".\"+o)return e=i,!1}),e}if(i.name.indexOf(\".\")<0)throw new Error(\"Plugins must be namespaced\");return this.__plugins[i.name]=i,i.core&&this.__bridge(i.core,this,i.name),this},_trigger:function(){var t=Array.prototype.slice.apply(arguments);return\"string\"==typeof t[0]&&(t[0]={type:t[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,t),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,t),this},instances:function(i){var o=[];return t(i||\".tooltipstered\").each(function(){var i=t(this),e=i.data(\"tooltipster-ns\");e&&t.each(e,function(t,e){o.push(i.data(e))})}),o},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(i){return t((i?i+\" \":\"\")+\".tooltipstered\").toArray()},setDefaults:function(o){return t.extend(i,o),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},t.tooltipster=new n,t.Tooltipster=function(i,o){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=t({}),this.__$emitterPublic=t({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace=\"tooltipster-\"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state=\"closed\",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(i,o)},t.Tooltipster.prototype={__init:function(o,n){var s=this;if(s._$origin=t(o),s.__options=t.extend(!0,{},i,n),s.__optionsFormat(),!e.IE||e.IE>=s.__options.IEmin){var r=null;if(void 0===s._$origin.data(\"tooltipster-initialTitle\")&&(void 0===(r=s._$origin.attr(\"title\"))&&(r=null),s._$origin.data(\"tooltipster-initialTitle\",r)),null!==s.__options.content)s.__contentSet(s.__options.content);else{var _,a=s._$origin.attr(\"data-tooltip-content\");a&&(_=t(a)),_&&_[0]?s.__contentSet(_.first()):s.__contentSet(r)}s._$origin.removeAttr(\"title\").addClass(\"tooltipstered\"),s.__prepareOrigin(),s.__prepareGC(),t.each(s.__options.plugins,function(t,i){s._plug(i)}),e.hasTouchCapability&&t(e.window.document.body).on(\"touchmove.\"+s.__namespace+\"-triggerOpen\",function(t){s._touchRecordEvent(t)}),s._on(\"created\",function(){s.__prepareTooltip()})._on(\"repositioned\",function(t){s.__lastPosition=t.position})}else s.__options.disabled=!0},__contentInsert:function(){var t=this._$tooltip.find(\".tooltipster-content\"),i=this.__Content;return this._trigger({type:\"format\",content:this.__Content,format:function(t){i=t}}),this.__options.functionFormat&&(i=this.__options.functionFormat.call(this,this,{origin:this._$origin[0]},this.__Content)),\"string\"!=typeof i||this.__options.contentAsHTML?t.empty().append(i):t.text(i),this},__contentSet:function(i){return i instanceof t&&this.__options.contentCloning&&(i=i.clone(!0)),this.__Content=i,this._trigger({type:\"updated\",content:i}),this},__destroyError:function(){throw new Error(\"This tooltip has been destroyed and cannot execute your method call.\")},__geometry:function(){var i=this._$origin,o=this._$origin.is(\"area\");if(o){var n=this._$origin.parent().attr(\"name\");i=t('img[usemap=\"#'+n+'\"]')}var s=i[0].getBoundingClientRect(),r=t(e.window.document),_=t(e.window),a=i,l={available:{document:null,window:null},document:{size:{height:r.height(),width:r.width()}},window:{scroll:{left:e.window.scrollX||e.window.document.documentElement.scrollLeft,top:e.window.scrollY||e.window.document.documentElement.scrollTop},size:{height:_.height(),width:_.width()}},origin:{fixedLineage:!1,offset:{},size:{height:s.bottom-s.top,width:s.right-s.left},usemapImage:o?i[0]:null,windowOffset:{bottom:s.bottom,left:s.left,right:s.right,top:s.top}}};if(o){var p=this._$origin.attr(\"shape\"),c=this._$origin.attr(\"coords\");if(c&&(c=c.split(\",\"),t.map(c,function(t,i){c[i]=parseInt(t)})),\"default\"!=p)switch(p){case\"circle\":var h=c[0],d=c[1],u=c[2],g=d-u,f=h-u;l.origin.size.height=2*u,l.origin.size.width=l.origin.size.height,l.origin.windowOffset.left+=f,l.origin.windowOffset.top+=g;break;case\"rect\":var m=c[0],w=c[1],v=c[2],y=c[3];l.origin.size.height=y-w,l.origin.size.width=v-m,l.origin.windowOffset.left+=m,l.origin.windowOffset.top+=w;break;case\"poly\":for(var b=0,$=0,C=0,O=0,T=\"even\",z=0;z<c.length;z++){var E=c[z];\"even\"==T?(E>C&&(C=E,0===z&&(b=C)),E<b&&(b=E),T=\"odd\"):(E>O&&(O=E,1==z&&($=O)),E<$&&($=E),T=\"even\")}l.origin.size.height=O-$,l.origin.size.width=C-b,l.origin.windowOffset.left+=b,l.origin.windowOffset.top+=$}}for(this._trigger({type:\"geometry\",edit:function(t){l.origin.size.height=t.height,l.origin.windowOffset.left=t.left,l.origin.windowOffset.top=t.top,l.origin.size.width=t.width},geometry:{height:l.origin.size.height,left:l.origin.windowOffset.left,top:l.origin.windowOffset.top,width:l.origin.size.width}}),l.origin.windowOffset.right=l.origin.windowOffset.left+l.origin.size.width,l.origin.windowOffset.bottom=l.origin.windowOffset.top+l.origin.size.height,l.origin.offset.left=l.origin.windowOffset.left+l.window.scroll.left,l.origin.offset.top=l.origin.windowOffset.top+l.window.scroll.top,l.origin.offset.bottom=l.origin.offset.top+l.origin.size.height,l.origin.offset.right=l.origin.offset.left+l.origin.size.width,l.available.document={bottom:{height:l.document.size.height-l.origin.offset.bottom,width:l.document.size.width},left:{height:l.document.size.height,width:l.origin.offset.left},right:{height:l.document.size.height,width:l.document.size.width-l.origin.offset.right},top:{height:l.origin.offset.top,width:l.document.size.width}},l.available.window={bottom:{height:Math.max(l.window.size.height-Math.max(l.origin.windowOffset.bottom,0),0),width:l.window.size.width},left:{height:l.window.size.height,width:Math.max(l.origin.windowOffset.left,0)},right:{height:l.window.size.height,width:Math.max(l.window.size.width-Math.max(l.origin.windowOffset.right,0),0)},top:{height:Math.max(l.origin.windowOffset.top,0),width:l.window.size.width}};\"html\"!=a[0].tagName.toLowerCase();){if(\"fixed\"==a.css(\"position\")){l.origin.fixedLineage=!0;break}a=a.parent()}return l},__optionsFormat:function(){return\"number\"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),\"number\"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),\"number\"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),\"string\"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=t(e.window.document.body):\"string\"==typeof this.__options.parent&&(this.__options.parent=t(this.__options.parent)),\"hover\"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):\"click\"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger(\"options\"),this},__prepareGC:function(){var i=this;return i.__options.selfDestruction?i.__garbageCollector=setInterval(function(){var o=(new Date).getTime();i.__touchEvents=t.grep(i.__touchEvents,function(t,i){return o-t.time>6e4}),_(i._$origin)||i.close(function(){i.destroy()})},2e4):clearInterval(i.__garbageCollector),i},__prepareOrigin:function(){var t=this;if(t._$origin.off(\".\"+t.__namespace+\"-triggerOpen\"),e.hasTouchCapability&&t._$origin.on(\"touchstart.\"+t.__namespace+\"-triggerOpen touchend.\"+t.__namespace+\"-triggerOpen touchcancel.\"+t.__namespace+\"-triggerOpen\",function(i){t._touchRecordEvent(i)}),t.__options.triggerOpen.click||t.__options.triggerOpen.tap&&e.hasTouchCapability){var i=\"\";t.__options.triggerOpen.click&&(i+=\"click.\"+t.__namespace+\"-triggerOpen \"),t.__options.triggerOpen.tap&&e.hasTouchCapability&&(i+=\"touchend.\"+t.__namespace+\"-triggerOpen\"),t._$origin.on(i,function(i){t._touchIsMeaningfulEvent(i)&&t._open(i)})}if(t.__options.triggerOpen.mouseenter||t.__options.triggerOpen.touchstart&&e.hasTouchCapability){i=\"\";t.__options.triggerOpen.mouseenter&&(i+=\"mouseenter.\"+t.__namespace+\"-triggerOpen \"),t.__options.triggerOpen.touchstart&&e.hasTouchCapability&&(i+=\"touchstart.\"+t.__namespace+\"-triggerOpen\"),t._$origin.on(i,function(i){!t._touchIsTouchEvent(i)&&t._touchIsEmulatedEvent(i)||(t.__pointerIsOverOrigin=!0,t._openShortly(i))})}if(t.__options.triggerClose.mouseleave||t.__options.triggerClose.touchleave&&e.hasTouchCapability){i=\"\";t.__options.triggerClose.mouseleave&&(i+=\"mouseleave.\"+t.__namespace+\"-triggerOpen \"),t.__options.triggerClose.touchleave&&e.hasTouchCapability&&(i+=\"touchend.\"+t.__namespace+\"-triggerOpen touchcancel.\"+t.__namespace+\"-triggerOpen\"),t._$origin.on(i,function(i){t._touchIsMeaningfulEvent(i)&&(t.__pointerIsOverOrigin=!1)})}return t},__prepareTooltip:function(){var i=this,o=i.__options.interactive?\"auto\":\"\";return i._$tooltip.attr(\"id\",i.__namespace).css({\"pointer-events\":o,zIndex:i.__options.zIndex}),t.each(i.__previousThemes,function(t,o){i._$tooltip.removeClass(o)}),t.each(i.__options.theme,function(t,o){i._$tooltip.addClass(o)}),i.__previousThemes=t.merge([],i.__options.theme),i},__scrollHandler:function(i){if(this.__options.triggerClose.scroll)this._close(i);else if(_(this._$origin)&&_(this._$tooltip)){var o=null;if(i.target===e.window.document)this.__Geometry.origin.fixedLineage||this.__options.repositionOnScroll&&this.reposition(i);else{o=this.__geometry();var n=!1;if(\"fixed\"!=this._$origin.css(\"position\")&&this.__$originParents.each(function(i,e){var s=t(e),r=s.css(\"overflow-x\"),_=s.css(\"overflow-y\");if(\"visible\"!=r||\"visible\"!=_){var a=e.getBoundingClientRect();if(\"visible\"!=r&&(o.origin.windowOffset.left<a.left||o.origin.windowOffset.right>a.right))return n=!0,!1;if(\"visible\"!=_&&(o.origin.windowOffset.top<a.top||o.origin.windowOffset.bottom>a.bottom))return n=!0,!1}if(\"fixed\"==s.css(\"position\"))return!1}),n)this._$tooltip.css(\"visibility\",\"hidden\");else if(this._$tooltip.css(\"visibility\",\"visible\"),this.__options.repositionOnScroll)this.reposition(i);else{var s=o.origin.offset.left-this.__Geometry.origin.offset.left,r=o.origin.offset.top-this.__Geometry.origin.offset.top;this._$tooltip.css({left:this.__lastPosition.coord.left+s,top:this.__lastPosition.coord.top+r})}}this._trigger({type:\"scroll\",event:i,geo:o})}return this},__stateSet:function(t){return this.__state=t,this._trigger({type:\"state\",state:t}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,t.each(this.__timeouts.close,function(t,i){clearTimeout(i)}),this.__timeouts.close=[],this},__trackerStart:function(){var t=this,i=t._$tooltip.find(\".tooltipster-content\");return t.__options.trackTooltip&&(t.__contentBcr=i[0].getBoundingClientRect()),t.__tracker=setInterval(function(){if(_(t._$origin)&&_(t._$tooltip)){if(t.__options.trackOrigin){var o=t.__geometry(),e=!1;r(o.origin.size,t.__Geometry.origin.size)&&(t.__Geometry.origin.fixedLineage?r(o.origin.windowOffset,t.__Geometry.origin.windowOffset)&&(e=!0):r(o.origin.offset,t.__Geometry.origin.offset)&&(e=!0)),e||(t.__options.triggerClose.mouseleave?t._close():t.reposition())}if(t.__options.trackTooltip){var n=i[0].getBoundingClientRect();n.height===t.__contentBcr.height&&n.width===t.__contentBcr.width||(t.reposition(),t.__contentBcr=n)}}else t._close()},t.__options.trackerInterval),t},_close:function(i,o,n){var s=this,r=!0;if(s._trigger({type:\"close\",event:i,stop:function(){r=!1}}),r||n){o&&s.__callbacks.close.push(o),s.__callbacks.open=[],s.__timeoutsClear();var _=function(){t.each(s.__callbacks.close,function(t,o){o.call(s,s,{event:i,origin:s._$origin[0]})}),s.__callbacks.close=[]};if(\"closed\"!=s.__state){var a=!0,l=(new Date).getTime()+s.__options.animationDuration[1];if(\"disappearing\"==s.__state&&l>s.__closingTime&&s.__options.animationDuration[1]>0&&(a=!1),a){s.__closingTime=l,\"disappearing\"!=s.__state&&s.__stateSet(\"disappearing\");var p=function(){clearInterval(s.__tracker),s._trigger({type:\"closing\",event:i}),s._$tooltip.off(\".\"+s.__namespace+\"-triggerClose\").removeClass(\"tooltipster-dying\"),t(e.window).off(\".\"+s.__namespace+\"-triggerClose\"),s.__$originParents.each(function(i,o){t(o).off(\"scroll.\"+s.__namespace+\"-triggerClose\")}),s.__$originParents=null,t(e.window.document.body).off(\".\"+s.__namespace+\"-triggerClose\"),s._$origin.off(\".\"+s.__namespace+\"-triggerClose\"),s._off(\"dismissable\"),s.__stateSet(\"closed\"),s._trigger({type:\"after\",event:i}),s.__options.functionAfter&&s.__options.functionAfter.call(s,s,{event:i,origin:s._$origin[0]}),_()};e.hasTransitions?(s._$tooltip.css({\"-moz-animation-duration\":s.__options.animationDuration[1]+\"ms\",\"-ms-animation-duration\":s.__options.animationDuration[1]+\"ms\",\"-o-animation-duration\":s.__options.animationDuration[1]+\"ms\",\"-webkit-animation-duration\":s.__options.animationDuration[1]+\"ms\",\"animation-duration\":s.__options.animationDuration[1]+\"ms\",\"transition-duration\":s.__options.animationDuration[1]+\"ms\"}),s._$tooltip.clearQueue().removeClass(\"tooltipster-show\").addClass(\"tooltipster-dying\"),s.__options.animationDuration[1]>0&&s._$tooltip.delay(s.__options.animationDuration[1]),s._$tooltip.queue(p)):s._$tooltip.stop().fadeOut(s.__options.animationDuration[1],p)}}else _()}return s},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(i,o){var n=this;if(!n.__destroying&&_(n._$origin)&&n.__enabled){var s=!0;if(\"closed\"==n.__state&&(n._trigger({type:\"before\",event:i,stop:function(){s=!1}}),s&&n.__options.functionBefore&&(s=n.__options.functionBefore.call(n,n,{event:i,origin:n._$origin[0]}))),!1!==s&&null!==n.__Content){o&&n.__callbacks.open.push(o),n.__callbacks.close=[],n.__timeoutsClear();var r,a=function(){\"stable\"!=n.__state&&n.__stateSet(\"stable\"),t.each(n.__callbacks.open,function(t,i){i.call(n,n,{origin:n._$origin[0],tooltip:n._$tooltip[0]})}),n.__callbacks.open=[]};if(\"closed\"!==n.__state)r=0,\"disappearing\"===n.__state?(n.__stateSet(\"appearing\"),e.hasTransitions?(n._$tooltip.clearQueue().removeClass(\"tooltipster-dying\").addClass(\"tooltipster-show\"),n.__options.animationDuration[0]>0&&n._$tooltip.delay(n.__options.animationDuration[0]),n._$tooltip.queue(a)):n._$tooltip.stop().fadeIn(a)):\"stable\"==n.__state&&a();else{if(n.__stateSet(\"appearing\"),r=n.__options.animationDuration[0],n.__contentInsert(),n.reposition(i,!0),e.hasTransitions?(n._$tooltip.addClass(\"tooltipster-\"+n.__options.animation).addClass(\"tooltipster-initial\").css({\"-moz-animation-duration\":n.__options.animationDuration[0]+\"ms\",\"-ms-animation-duration\":n.__options.animationDuration[0]+\"ms\",\"-o-animation-duration\":n.__options.animationDuration[0]+\"ms\",\"-webkit-animation-duration\":n.__options.animationDuration[0]+\"ms\",\"animation-duration\":n.__options.animationDuration[0]+\"ms\",\"transition-duration\":n.__options.animationDuration[0]+\"ms\"}),setTimeout(function(){\"closed\"!=n.__state&&(n._$tooltip.addClass(\"tooltipster-show\").removeClass(\"tooltipster-initial\"),n.__options.animationDuration[0]>0&&n._$tooltip.delay(n.__options.animationDuration[0]),n._$tooltip.queue(a))},0)):n._$tooltip.css(\"display\",\"none\").fadeIn(n.__options.animationDuration[0],a),n.__trackerStart(),t(e.window).on(\"resize.\"+n.__namespace+\"-triggerClose\",function(i){var o=t(document.activeElement);(o.is(\"input\")||o.is(\"textarea\"))&&t.contains(n._$tooltip[0],o[0])||n.reposition(i)}).on(\"scroll.\"+n.__namespace+\"-triggerClose\",function(t){n.__scrollHandler(t)}),n.__$originParents=n._$origin.parents(),n.__$originParents.each(function(i,o){t(o).on(\"scroll.\"+n.__namespace+\"-triggerClose\",function(t){n.__scrollHandler(t)})}),n.__options.triggerClose.mouseleave||n.__options.triggerClose.touchleave&&e.hasTouchCapability){n._on(\"dismissable\",function(t){t.dismissable?t.delay?(h=setTimeout(function(){n._close(t.event)},t.delay),n.__timeouts.close.push(h)):n._close(t):clearTimeout(h)});var l=n._$origin,p=\"\",c=\"\",h=null;n.__options.interactive&&(l=l.add(n._$tooltip)),n.__options.triggerClose.mouseleave&&(p+=\"mouseenter.\"+n.__namespace+\"-triggerClose \",c+=\"mouseleave.\"+n.__namespace+\"-triggerClose \"),n.__options.triggerClose.touchleave&&e.hasTouchCapability&&(p+=\"touchstart.\"+n.__namespace+\"-triggerClose\",c+=\"touchend.\"+n.__namespace+\"-triggerClose touchcancel.\"+n.__namespace+\"-triggerClose\"),l.on(c,function(t){if(n._touchIsTouchEvent(t)||!n._touchIsEmulatedEvent(t)){var i=\"mouseleave\"==t.type?n.__options.delay:n.__options.delayTouch;n._trigger({delay:i[1],dismissable:!0,event:t,type:\"dismissable\"})}}).on(p,function(t){!n._touchIsTouchEvent(t)&&n._touchIsEmulatedEvent(t)||n._trigger({dismissable:!1,event:t,type:\"dismissable\"})})}n.__options.triggerClose.originClick&&n._$origin.on(\"click.\"+n.__namespace+\"-triggerClose\",function(t){n._touchIsTouchEvent(t)||n._touchIsEmulatedEvent(t)||n._close(t)}),(n.__options.triggerClose.click||n.__options.triggerClose.tap&&e.hasTouchCapability)&&setTimeout(function(){if(\"closed\"!=n.__state){var i=\"\",o=t(e.window.document.body);n.__options.triggerClose.click&&(i+=\"click.\"+n.__namespace+\"-triggerClose \"),n.__options.triggerClose.tap&&e.hasTouchCapability&&(i+=\"touchend.\"+n.__namespace+\"-triggerClose\"),o.on(i,function(i){n._touchIsMeaningfulEvent(i)&&(n._touchRecordEvent(i),n.__options.interactive&&t.contains(n._$tooltip[0],i.target)||n._close(i))}),n.__options.triggerClose.tap&&e.hasTouchCapability&&o.on(\"touchstart.\"+n.__namespace+\"-triggerClose\",function(t){n._touchRecordEvent(t)})}},0),n._trigger(\"ready\"),n.__options.functionReady&&n.__options.functionReady.call(n,n,{origin:n._$origin[0],tooltip:n._$tooltip[0]})}if(n.__options.timer>0){h=setTimeout(function(){n._close()},n.__options.timer+r);n.__timeouts.close.push(h)}}}return n},_openShortly:function(t){var i=this,o=!0;if(\"stable\"!=i.__state&&\"appearing\"!=i.__state&&!i.__timeouts.open&&(i._trigger({type:\"start\",event:t,stop:function(){o=!1}}),o)){var e=0==t.type.indexOf(\"touch\")?i.__options.delayTouch:i.__options.delay;e[0]?i.__timeouts.open=setTimeout(function(){i.__timeouts.open=null,i.__pointerIsOverOrigin&&i._touchIsMeaningfulEvent(t)?(i._trigger(\"startend\"),i._open(t)):i._trigger(\"startcancel\")},e[0]):(i._trigger(\"startend\"),i._open(t))}return i},_optionsExtract:function(i,o){var e=this,n=t.extend(!0,{},o),s=e.__options[i];return s||(s={},t.each(o,function(t,i){var o=e.__options[t];void 0!==o&&(s[t]=o)})),t.each(n,function(i,o){void 0!==s[i]&&(\"object\"!=typeof o||o instanceof Array||null==o||\"object\"!=typeof s[i]||s[i]instanceof Array||null==s[i]?n[i]=s[i]:t.extend(n[i],s[i]))}),n},_plug:function(i){var o=t.tooltipster._plugin(i);if(!o)throw new Error('The \"'+i+'\" plugin is not defined');return o.instance&&t.tooltipster.__bridge(o.instance,this,o.name),this},_touchIsEmulatedEvent:function(t){for(var i=!1,o=(new Date).getTime(),e=this.__touchEvents.length-1;e>=0;e--){var n=this.__touchEvents[e];if(!(o-n.time<500))break;n.target===t.target&&(i=!0)}return i},_touchIsMeaningfulEvent:function(t){return this._touchIsTouchEvent(t)&&!this._touchSwiped(t.target)||!this._touchIsTouchEvent(t)&&!this._touchIsEmulatedEvent(t)},_touchIsTouchEvent:function(t){return 0==t.type.indexOf(\"touch\")},_touchRecordEvent:function(t){return this._touchIsTouchEvent(t)&&(t.time=(new Date).getTime(),this.__touchEvents.push(t)),this},_touchSwiped:function(t){for(var i=!1,o=this.__touchEvents.length-1;o>=0;o--){var e=this.__touchEvents[o];if(\"touchmove\"==e.type){i=!0;break}if(\"touchstart\"==e.type&&t===e.target)break}return i},_trigger:function(){var i=Array.prototype.slice.apply(arguments);return\"string\"==typeof i[0]&&(i[0]={type:i[0]}),i[0].instance=this,i[0].origin=this._$origin?this._$origin[0]:null,i[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,i),t.tooltipster._trigger.apply(t.tooltipster,i),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,i),this},_unplug:function(i){var o=this;if(o[i]){var e=t.tooltipster._plugin(i);e.instance&&t.each(e.instance,function(t,e){o[t]&&o[t].bridged===o[i]&&delete o[t]}),o[i].__destroy&&o[i].__destroy(),delete o[i]}return o},close:function(t){return this.__destroyed?this.__destroyError():this._close(null,t),this},content:function(t){var i=this;if(void 0===t)return i.__Content;if(i.__destroyed)i.__destroyError();else if(i.__contentSet(t),null!==i.__Content){if(\"closed\"!==i.__state&&(i.__contentInsert(),i.reposition(),i.__options.updateAnimation))if(e.hasTransitions){var o=i.__options.updateAnimation;i._$tooltip.addClass(\"tooltipster-update-\"+o),setTimeout(function(){\"closed\"!=i.__state&&i._$tooltip.removeClass(\"tooltipster-update-\"+o)},1e3)}else i._$tooltip.fadeTo(200,.5,function(){\"closed\"!=i.__state&&i._$tooltip.fadeTo(200,1)})}else i._close();return i},destroy:function(){var i=this;if(i.__destroyed)i.__destroyError();else{\"closed\"!=i.__state?i.option(\"animationDuration\",0)._close(null,null,!0):i.__timeoutsClear(),i._trigger(\"destroy\"),i.__destroyed=!0,i._$origin.removeData(i.__namespace).off(\".\"+i.__namespace+\"-triggerOpen\"),t(e.window.document.body).off(\".\"+i.__namespace+\"-triggerOpen\");var o=i._$origin.data(\"tooltipster-ns\");if(o)if(1===o.length){var n=null;\"previous\"==i.__options.restoration?n=i._$origin.data(\"tooltipster-initialTitle\"):\"current\"==i.__options.restoration&&(n=\"string\"==typeof i.__Content?i.__Content:t(\"<div></div>\").append(i.__Content).html()),n&&i._$origin.attr(\"title\",n),i._$origin.removeClass(\"tooltipstered\"),i._$origin.removeData(\"tooltipster-ns\").removeData(\"tooltipster-initialTitle\")}else o=t.grep(o,function(t,o){return t!==i.__namespace}),i._$origin.data(\"tooltipster-ns\",o);i._trigger(\"destroyed\"),i._off(),i.off(),i.__Content=null,i.__$emitterPrivate=null,i.__$emitterPublic=null,i.__options.parent=null,i._$origin=null,i._$tooltip=null,t.tooltipster.__instancesLatestArr=t.grep(t.tooltipster.__instancesLatestArr,function(t,o){return i!==t}),clearInterval(i.__garbageCollector)}return i},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){if(!this.__destroyed)return this._$origin[0];this.__destroyError()},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(t){return this.close(t)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(t){return this.__destroyed?this.__destroyError():this._open(null,t),this},option:function(i,o){return void 0===o?this.__options[i]:(this.__destroyed?this.__destroyError():(this.__options[i]=o,this.__optionsFormat(),t.inArray(i,[\"trigger\",\"triggerClose\",\"triggerOpen\"])>=0&&this.__prepareOrigin(),\"selfDestruction\"===i&&this.__prepareGC()),this)},reposition:function(t,i){return this.__destroyed?this.__destroyError():\"closed\"!=this.__state&&_(this._$origin)&&(i||_(this._$tooltip))&&(i||this._$tooltip.detach(),this.__Geometry=this.__geometry(),this._trigger({type:\"reposition\",event:t,helper:{geo:this.__Geometry}})),this},show:function(t){return this.open(t)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:\"closed\"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},t.fn.tooltipster=function(){var o=Array.prototype.slice.apply(arguments),e=\"You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.\";if(0===this.length)return this;if(\"string\"==typeof o[0]){var n=\"#*$~&\";return this.each(function(){var i=t(this).data(\"tooltipster-ns\"),s=i?t(this).data(i[0]):null;if(!s)throw new Error(\"You called Tooltipster's \\\"\"+o[0]+'\" method on an uninitialized element');if(\"function\"!=typeof s[o[0]])throw new Error('Unknown method \"'+o[0]+'\"');this.length>1&&\"content\"==o[0]&&(o[1]instanceof t||\"object\"==typeof o[1]&&null!=o[1]&&o[1].tagName)&&!s.__options.contentCloning&&s.__options.debug&&console.log(e);var r=s[o[0]](o[1],o[2]);if(r!==s||\"instance\"===o[0])return n=r,!1}),\"#*$~&\"!==n?n:this}t.tooltipster.__instancesLatestArr=[];var s=o[0]&&void 0!==o[0].multiple,r=s&&o[0].multiple||!s&&i.multiple,_=o[0]&&void 0!==o[0].content,a=_&&o[0].content||!_&&i.content,l=o[0]&&void 0!==o[0].contentCloning,p=l&&o[0].contentCloning||!l&&i.contentCloning,c=o[0]&&void 0!==o[0].debug,h=c&&o[0].debug||!c&&i.debug;return this.length>1&&(a instanceof t||\"object\"==typeof a&&null!=a&&a.tagName)&&!p&&h&&console.log(e),this.each(function(){var i=!1,e=t(this),n=e.data(\"tooltipster-ns\"),s=null;n?r?i=!0:h&&(console.log(\"Tooltipster: one or more tooltips are already attached to the element below. Ignoring.\"),console.log(this)):i=!0,i&&(s=new t.Tooltipster(this,o[0]),n||(n=[]),n.push(s.__namespace),e.data(\"tooltipster-ns\",n),e.data(s.__namespace,s),s.__options.functionInit&&s.__options.functionInit.call(s,s,{origin:this}),s._trigger(\"init\")),t.tooltipster.__instancesLatestArr.push(s)}),this},s.prototype={__init:function(i){this.__$tooltip=i,this.__$tooltip.css({left:0,overflow:\"hidden\",position:\"absolute\",top:0}).find(\".tooltipster-content\").css(\"overflow\",\"auto\"),this.$container=t('<div class=\"tooltipster-ruler\"></div>').append(this.__$tooltip).appendTo(e.window.document.body)},__forceRedraw:function(){var t=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(t)},constrain:function(t,i){return this.constraints={width:t,height:i},this.__$tooltip.css({display:\"block\",height:\"\",overflow:\"auto\",width:t}),this},destroy:function(){this.__$tooltip.detach().find(\".tooltipster-content\").css({display:\"\",overflow:\"\"}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:\"\",height:\"\",overflow:\"visible\",width:\"\"}),this},measure:function(){this.__forceRedraw();var t=this.__$tooltip[0].getBoundingClientRect(),i={size:{height:t.height||t.bottom-t.top,width:t.width||t.right-t.left}};if(this.constraints){var o=this.__$tooltip.find(\".tooltipster-content\"),n=this.__$tooltip.outerHeight(),s=o[0].getBoundingClientRect(),r={height:n<=this.constraints.height,width:t.width<=this.constraints.width&&s.width>=o[0].scrollWidth-1};i.fits=r.height&&r.width}return e.IE&&e.IE<=11&&i.size.width!==e.window.document.documentElement.clientWidth&&(i.size.width=Math.ceil(i.size.width)+1),i}};var a=navigator.userAgent.toLowerCase();-1!=a.indexOf(\"msie\")?e.IE=parseInt(a.split(\"msie\")[1]):-1!==a.toLowerCase().indexOf(\"trident\")&&-1!==a.indexOf(\" rv:11\")?e.IE=11:-1!=a.toLowerCase().indexOf(\"edge/\")&&(e.IE=parseInt(a.toLowerCase().split(\"edge/\")[1]));return t.tooltipster._plugin({name:\"tooltipster.sideTip\",instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:\"top\",viewportAware:!0,defaultStyles:{backgroundColor:\"#fff\",textColor:\"#000\"}}},__init:function(t){var i=this;i.__instance=t,i.__namespace=\"tooltipster-sideTip-\"+Math.round(1e6*Math.random()),i.__previousState=\"closed\",i.__options,i.__optionsFormat(),i.__instance._on(\"state.\"+i.__namespace,function(t){\"closed\"==t.state?i.__close():\"appearing\"==t.state&&\"closed\"==i.__previousState&&i.__create(),i.__previousState=t.state}),i.__instance._on(\"options.\"+i.__namespace,function(){i.__optionsFormat()}),i.__instance._on(\"reposition.\"+i.__namespace,function(t){i.__reposition(t.event,t.helper)})},__close:function(){this.__instance.content()instanceof t&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var i=this.__instance.__options.styles,o=t('<div class=\"tooltipster-base tooltipster-sidetip\"><div class=\"tooltipster-box\"><div class=\"tooltipster-content\"></div></div><div class=\"tooltipster-arrow\"><div class=\"tooltipster-arrow-uncropped\"><div class=\"tooltipster-arrow-border\"></div><div class=\"tooltipster-arrow-background\"></div></div></div></div>');o.find(\".tooltipster-box\").css({color:i.textColor?i.textColor:this.__options.defaultStyles.textColor,backgroundColor:i.backgroundColor?i.backgroundColor:this.__options.defaultStyles.backgroundColor}),o.find(\".tooltipster-arrow-border\").css({backgroundColor:i.backgroundColor?i.backgroundColor:this.__options.defaultStyles.backgroundColor}),this.__options.arrow||o.find(\".tooltipster-box\").css(\"margin\",0).end().find(\".tooltipster-arrow\").hide(),this.__options.minWidth&&o.css(\"min-width\",this.__options.minWidth+\"px\"),this.__options.maxWidth&&o.css(\"max-width\",this.__options.maxWidth+\"px\"),this.__instance._$tooltip=o,this.__instance._trigger(\"created\")},__destroy:function(){this.__instance._off(\".\"+self.__namespace)},__optionsFormat:function(){if(this.__options=this.__instance._optionsExtract(\"tooltipster.sideTip\",this.__defaults()),this.__options.position&&(this.__options.side=this.__options.position),\"object\"!=typeof this.__options.distance&&(this.__options.distance=[this.__options.distance]),this.__options.distance.length<4&&(void 0===this.__options.distance[1]&&(this.__options.distance[1]=this.__options.distance[0]),void 0===this.__options.distance[2]&&(this.__options.distance[2]=this.__options.distance[0]),void 0===this.__options.distance[3]&&(this.__options.distance[3]=this.__options.distance[1])),this.__options.distance={top:this.__options.distance[0],right:this.__options.distance[1],bottom:this.__options.distance[2],left:this.__options.distance[3]},\"string\"==typeof this.__options.side){this.__options.side=[this.__options.side,{top:\"bottom\",right:\"left\",bottom:\"top\",left:\"right\"}[this.__options.side]],\"left\"==this.__options.side[0]||\"right\"==this.__options.side[0]?this.__options.side.push(\"top\",\"bottom\"):this.__options.side.push(\"right\",\"left\")}6===t.tooltipster._env.IE&&!0!==this.__options.arrow&&(this.__options.arrow=!1)},__reposition:function(i,o){var e,n=this,s=n.__targetFind(o),r=[];n.__instance._$tooltip.detach();var _=n.__instance._$tooltip.clone(),a=t.tooltipster._getRuler(_),l=!1,p=n.__instance.option(\"animation\");switch(p&&_.removeClass(\"tooltipster-\"+p),t.each([\"window\",\"document\"],function(e,p){var c=null;if(n.__instance._trigger({container:p,helper:o,satisfied:l,takeTest:function(t){c=t},results:r,type:\"positionTest\"}),1==c||0!=c&&0==l&&(\"window\"!=p||n.__options.viewportAware))for(e=0;e<n.__options.side.length;e++){var h={horizontal:0,vertical:0},d=n.__options.side[e];\"top\"==d||\"bottom\"==d?h.vertical=n.__options.distance[d]:h.horizontal=n.__options.distance[d],n.__sideChange(_,d),t.each([\"natural\",\"constrained\"],function(t,e){if(c=null,n.__instance._trigger({container:p,event:i,helper:o,mode:e,results:r,satisfied:l,side:d,takeTest:function(t){c=t},type:\"positionTest\"}),1==c||0!=c&&0==l){var _={container:p,distance:h,fits:null,mode:e,outerSize:null,side:d,size:null,target:s[d],whole:null},u=(\"natural\"==e?a.free():a.constrain(o.geo.available[p][d].width-h.horizontal,o.geo.available[p][d].height-h.vertical)).measure();if(_.size=u.size,_.outerSize={height:u.size.height+h.vertical,width:u.size.width+h.horizontal},\"natural\"==e?o.geo.available[p][d].width>=_.outerSize.width&&o.geo.available[p][d].height>=_.outerSize.height?_.fits=!0:_.fits=!1:_.fits=u.fits,\"window\"==p&&(_.fits?_.whole=\"top\"==d||\"bottom\"==d?o.geo.origin.windowOffset.right>=n.__options.minIntersection&&o.geo.window.size.width-o.geo.origin.windowOffset.left>=n.__options.minIntersection:o.geo.origin.windowOffset.bottom>=n.__options.minIntersection&&o.geo.window.size.height-o.geo.origin.windowOffset.top>=n.__options.minIntersection:_.whole=!1),r.push(_),_.whole)l=!0;else if(\"natural\"==_.mode&&(_.fits||_.size.width<=o.geo.available[p][d].width))return!1}})}}),n.__instance._trigger({edit:function(t){r=t},event:i,helper:o,results:r,type:\"positionTested\"}),r.sort(function(t,i){return t.whole&&!i.whole?-1:!t.whole&&i.whole?1:t.whole&&i.whole?(o=n.__options.side.indexOf(t.side))<(e=n.__options.side.indexOf(i.side))?-1:o>e?1:\"natural\"==t.mode?-1:1:t.fits&&!i.fits?-1:!t.fits&&i.fits?1:t.fits&&i.fits?(o=n.__options.side.indexOf(t.side))<(e=n.__options.side.indexOf(i.side))?-1:o>e?1:\"natural\"==t.mode?-1:1:\"document\"==t.container&&\"bottom\"==t.side&&\"natural\"==t.mode?-1:1;var o,e}),(e=r[0]).coord={},e.side){case\"left\":case\"right\":e.coord.top=Math.floor(e.target-e.size.height/2);break;case\"bottom\":case\"top\":e.coord.left=Math.floor(e.target-e.size.width/2)}switch(e.side){case\"left\":e.coord.left=o.geo.origin.windowOffset.left-e.outerSize.width;break;case\"right\":e.coord.left=o.geo.origin.windowOffset.right+e.distance.horizontal;break;case\"top\":e.coord.top=o.geo.origin.windowOffset.top-e.outerSize.height;break;case\"bottom\":e.coord.top=o.geo.origin.windowOffset.bottom+e.distance.vertical}\"window\"==e.container?\"top\"==e.side||\"bottom\"==e.side?e.coord.left<0?o.geo.origin.windowOffset.right-this.__options.minIntersection>=0?e.coord.left=0:e.coord.left=o.geo.origin.windowOffset.right-this.__options.minIntersection-1:e.coord.left>o.geo.window.size.width-e.size.width&&(o.geo.origin.windowOffset.left+this.__options.minIntersection<=o.geo.window.size.width?e.coord.left=o.geo.window.size.width-e.size.width:e.coord.left=o.geo.origin.windowOffset.left+this.__options.minIntersection+1-e.size.width):e.coord.top<0?o.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?e.coord.top=0:e.coord.top=o.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:e.coord.top>o.geo.window.size.height-e.size.height&&(o.geo.origin.windowOffset.top+this.__options.minIntersection<=o.geo.window.size.height?e.coord.top=o.geo.window.size.height-e.size.height:e.coord.top=o.geo.origin.windowOffset.top+this.__options.minIntersection+1-e.size.height):(e.coord.left>o.geo.window.size.width-e.size.width&&(e.coord.left=o.geo.window.size.width-e.size.width),e.coord.left<0&&(e.coord.left=0)),n.__sideChange(_,e.side),o.tooltipClone=_[0],o.tooltipParent=n.__instance.option(\"parent\").parent[0],o.mode=e.mode,o.whole=e.whole,o.origin=n.__instance._$origin[0],o.tooltip=n.__instance._$tooltip[0],delete e.container,delete e.fits,delete e.mode,delete e.outerSize,delete e.whole,e.distance=e.distance.horizontal||e.distance.vertical;var c,h,d,u=t.extend(!0,{},e);if(n.__instance._trigger({edit:function(t){e=t},event:i,helper:o,position:u,type:\"position\"}),n.__options.functionPosition){var g=n.__options.functionPosition.call(n,n.__instance,o,u);g&&(e=g)}a.destroy(),\"top\"==e.side||\"bottom\"==e.side?(c={prop:\"left\",val:e.target-e.coord.left},h=e.size.width-this.__options.minIntersection):(c={prop:\"top\",val:e.target-e.coord.top},h=e.size.height-this.__options.minIntersection),c.val<this.__options.minIntersection?c.val=this.__options.minIntersection:c.val>h&&(c.val=h),d=o.geo.origin.fixedLineage?o.geo.origin.windowOffset:{left:o.geo.origin.windowOffset.left+o.geo.window.scroll.left,top:o.geo.origin.windowOffset.top+o.geo.window.scroll.top},e.coord={left:d.left+(e.coord.left-o.geo.origin.windowOffset.left),top:d.top+(e.coord.top-o.geo.origin.windowOffset.top)},n.__sideChange(n.__instance._$tooltip,e.side),o.geo.origin.fixedLineage?n.__instance._$tooltip.css(\"position\",\"fixed\"):n.__instance._$tooltip.css(\"position\",\"\"),n.__instance._$tooltip.css({left:e.coord.left,top:e.coord.top,height:e.size.height,width:e.size.width}).find(\".tooltipster-arrow\").css({left:\"\",top:\"\"}).css(c.prop,c.val),n.__instance._$tooltip.appendTo(n.__instance.option(\"parent\")),n.__instance._trigger({type:\"repositioned\",event:i,position:e})},__sideChange:function(t,i){t.removeClass(\"tooltipster-bottom\").removeClass(\"tooltipster-left\").removeClass(\"tooltipster-right\").removeClass(\"tooltipster-top\").addClass(\"tooltipster-\"+i)},__targetFind:function(t){var i={},o=this.__instance._$origin[0].getClientRects();o.length>1&&(1==this.__instance._$origin.css(\"opacity\")&&(this.__instance._$origin.css(\"opacity\",.99),o=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css(\"opacity\",1)));if(o.length<2)i.top=Math.floor(t.geo.origin.windowOffset.left+t.geo.origin.size.width/2),i.bottom=i.top,i.left=Math.floor(t.geo.origin.windowOffset.top+t.geo.origin.size.height/2),i.right=i.left;else{var e=o[0];i.top=Math.floor(e.left+(e.right-e.left)/2),e=o.length>2?o[Math.ceil(o.length/2)-1]:o[0],i.right=Math.floor(e.top+(e.bottom-e.top)/2),e=o[o.length-1],i.bottom=Math.floor(e.left+(e.right-e.left)/2),e=o.length>2?o[Math.ceil((o.length+1)/2)-1]:o[o.length-1],i.left=Math.floor(e.top+(e.bottom-e.top)/2)}return i}}}),t});\n","Amasty_Base/vendor/slick/slick.min.js":"/* phpcs:ignoreFile */\n/*\n _ _ _ _\n ___| (_) ___| | __ (_)___\n/ __| | |/ __| |/ / | / __|\n\\__ \\ | | (__| < _ | \\__ \\\n|___/_|_|\\___|_|\\_(_)/ |___/\n |__/\n Version: 1.9.0\n Author: Ken Wheeler\n Website: http://kenwheeler.github.io\n Docs: http://kenwheeler.github.io/slick\n Repo: http://github.com/kenwheeler/slick\n Issues: http://github.com/kenwheeler/slick/issues\n */\n(function(i){\"use strict\";\"function\"==typeof define&&define.amd?define([\"jquery\"],i):\"undefined\"!=typeof exports?module.exports=i(require(\"jquery\")):i(jQuery)})(function(i){\"use strict\";var e=window.Slick||{};e=function(){function e(e,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(e),appendDots:i(e),arrows:!0,asNavFor:null,prevArrow:'<button class=\"slick-prev\" aria-label=\"Previous\" type=\"button\">Previous</button>',nextArrow:'<button class=\"slick-next\" aria-label=\"Next\" type=\"button\">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:\"50px\",cssEase:\"ease\",customPaging:function(e,t){return i('<button type=\"button\" />').text(t+1)},dots:!1,dotsClass:\"slick-dots\",draggable:!0,easing:\"linear\",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:\"ondemand\",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:\"window\",responsive:null,rows:1,rtl:!1,slide:\"\",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden=\"hidden\",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(e),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange=\"visibilitychange\",n.windowWidth=0,n.windowTimer=null,s=i(e).data(\"slick\")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,\"undefined\"!=typeof document.mozHidden?(n.hidden=\"mozHidden\",n.visibilityChange=\"mozvisibilitychange\"):\"undefined\"!=typeof document.webkitHidden&&(n.hidden=\"webkitHidden\",n.visibilityChange=\"webkitvisibilitychange\"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=t++,n.htmlExpr=/^(?:\\s*(<[\\w\\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}var t=0;return e}(),e.prototype.activateADA=function(){var i=this;i.$slideTrack.find(\".slick-active\").attr({\"aria-hidden\":\"false\"}).find(\"a, input, button, select\").attr({tabindex:\"0\"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if(\"boolean\"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),\"number\"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):o===!0?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr(\"data-slick-index\",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),s.options.rtl===!0&&s.options.vertical===!1&&(e=-e),s.transformsEnabled===!1?s.options.vertical===!1?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):s.cssTransitions===!1?(s.options.rtl===!0&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),s.options.vertical===!1?(o[s.animType]=\"translate(\"+i+\"px, 0px)\",s.$slideTrack.css(o)):(o[s.animType]=\"translate(0px,\"+i+\"px)\",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),s.options.vertical===!1?o[s.animType]=\"translate3d(\"+e+\"px, 0px, 0px)\":o[s.animType]=\"translate3d(0px,\"+e+\"px, 0px)\",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this,o=t.getNavTarget();null!==o&&\"object\"==typeof o&&o.each(function(){var t=i(this).slick(\"getSlick\");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};e.options.fade===!1?t[e.transitionType]=e.transformType+\" \"+e.options.speed+\"ms \"+e.options.cssEase:t[e.transitionType]=\"opacity \"+e.options.speed+\"ms \"+e.options.cssEase,e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(i.options.infinite===!1&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1===0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;e.options.arrows===!0&&(e.$prevArrow=i(e.options.prevArrow).addClass(\"slick-arrow\"),e.$nextArrow=i(e.options.nextArrow).addClass(\"slick-arrow\"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass(\"slick-hidden\").removeAttr(\"aria-hidden tabindex\"),e.$nextArrow.removeClass(\"slick-hidden\").removeAttr(\"aria-hidden tabindex\"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),e.options.infinite!==!0&&e.$prevArrow.addClass(\"slick-disabled\").attr(\"aria-disabled\",\"true\")):e.$prevArrow.add(e.$nextArrow).addClass(\"slick-hidden\").attr({\"aria-disabled\":\"true\",tabindex:\"-1\"}))},e.prototype.buildDots=function(){var e,t,o=this;if(o.options.dots===!0&&o.slideCount>o.options.slidesToShow){for(o.$slider.addClass(\"slick-dotted\"),t=i(\"<ul />\").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i(\"<li />\").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find(\"li\").first().addClass(\"slick-active\")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+\":not(.slick-cloned)\").addClass(\"slick-slide\"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr(\"data-slick-index\",e).data(\"originalStyling\",i(t).attr(\"style\")||\"\")}),e.$slider.addClass(\"slick-slider\"),e.$slideTrack=0===e.slideCount?i('<div class=\"slick-track\"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class=\"slick-track\"/>').parent(),e.$list=e.$slideTrack.wrap('<div class=\"slick-list\"/>').parent(),e.$slideTrack.css(\"opacity\",0),e.options.centerMode!==!0&&e.options.swipeToSlide!==!0||(e.options.slidesToScroll=1),i(\"img[data-lazy]\",e.$slider).not(\"[src]\").addClass(\"slick-loading\"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses(\"number\"==typeof e.currentSlide?e.currentSlide:0),e.options.draggable===!0&&e.$list.addClass(\"draggable\")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.options.rows>0){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement(\"div\");for(e=0;e<l.options.rows;e++){var a=document.createElement(\"div\");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+\"%\",display:\"inline-block\"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if(\"window\"===r.respondTo?n=a:\"slider\"===r.respondTo?n=d:\"min\"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(r.originalSettings.mobileFirst===!1?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,\"unslick\"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,\"unslick\"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||l===!1||r.$slider.trigger(\"breakpoint\",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is(\"a\")&&e.preventDefault(),l.is(\"li\")||(l=l.closest(\"li\")),n=r.slideCount%r.options.slidesToScroll!==0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case\"previous\":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case\"next\":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case\"index\":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger(\"focus\");break;default:return}},e.prototype.checkNavigable=function(i){var e,t,o=this;if(e=o.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var s in e){if(i<e[s]){i=t;break}t=e[s]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i(\"li\",e.$dots).off(\"click.slick\",e.changeSlide).off(\"mouseenter.slick\",i.proxy(e.interrupt,e,!0)).off(\"mouseleave.slick\",i.proxy(e.interrupt,e,!1)),e.options.accessibility===!0&&e.$dots.off(\"keydown.slick\",e.keyHandler)),e.$slider.off(\"focus.slick blur.slick\"),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off(\"click.slick\",e.changeSlide),e.$nextArrow&&e.$nextArrow.off(\"click.slick\",e.changeSlide),e.options.accessibility===!0&&(e.$prevArrow&&e.$prevArrow.off(\"keydown.slick\",e.keyHandler),e.$nextArrow&&e.$nextArrow.off(\"keydown.slick\",e.keyHandler))),e.$list.off(\"touchstart.slick mousedown.slick\",e.swipeHandler),e.$list.off(\"touchmove.slick mousemove.slick\",e.swipeHandler),e.$list.off(\"touchend.slick mouseup.slick\",e.swipeHandler),e.$list.off(\"touchcancel.slick mouseleave.slick\",e.swipeHandler),e.$list.off(\"click.slick\",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),e.options.accessibility===!0&&e.$list.off(\"keydown.slick\",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().off(\"click.slick\",e.selectHandler),i(window).off(\"orientationchange.slick.slick-\"+e.instanceUid,e.orientationChange),i(window).off(\"resize.slick.slick-\"+e.instanceUid,e.resize),i(\"[draggable!=true]\",e.$slideTrack).off(\"dragstart\",e.preventDefault),i(window).off(\"load.slick.slick-\"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off(\"mouseenter.slick\",i.proxy(e.interrupt,e,!0)),e.$list.off(\"mouseleave.slick\",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>0&&(i=e.$slides.children().children(),i.removeAttr(\"style\"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){var e=this;e.shouldClick===!1&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(\".slick-cloned\",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass(\"slick-disabled slick-arrow slick-hidden\").removeAttr(\"aria-hidden aria-disabled tabindex\").css(\"display\",\"\"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass(\"slick-disabled slick-arrow slick-hidden\").removeAttr(\"aria-hidden aria-disabled tabindex\").css(\"display\",\"\"),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass(\"slick-slide slick-active slick-center slick-visible slick-current\").removeAttr(\"aria-hidden\").removeAttr(\"data-slick-index\").each(function(){i(this).attr(\"style\",i(this).data(\"originalStyling\"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass(\"slick-slider\"),t.$slider.removeClass(\"slick-initialized\"),t.$slider.removeClass(\"slick-dotted\"),t.unslicked=!0,e||t.$slider.trigger(\"destroy\",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]=\"\",e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;t.cssTransitions===!1?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;e.cssTransitions===!1?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off(\"focus.slick blur.slick\").on(\"focus.slick\",\"*\",function(t){var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&o.is(\":focus\")&&(e.focussed=!0,e.autoPlay())},0)}).on(\"blur.slick\",\"*\",function(t){i(this);e.options.pauseOnFocus&&(e.focussed=!1,e.autoPlay())})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){var i=this;return i.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(i.options.infinite===!0)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(i.options.centerMode===!0)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),n.options.infinite===!0?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,n.options.vertical===!0&&n.options.centerMode===!0&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!==0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),n.options.centerMode===!0&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:n.options.centerMode===!0&&n.options.infinite===!0?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:n.options.centerMode===!0&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=n.options.vertical===!1?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,n.options.variableWidth===!0&&(o=n.slideCount<=n.options.slidesToShow||n.options.infinite===!1?n.$slideTrack.children(\".slick-slide\").eq(i):n.$slideTrack.children(\".slick-slide\").eq(i+n.options.slidesToShow),e=n.options.rtl===!0?o[0]?(n.$slideTrack.width()-o[0].offsetLeft-o.width())*-1:0:o[0]?o[0].offsetLeft*-1:0,n.options.centerMode===!0&&(o=n.slideCount<=n.options.slidesToShow||n.options.infinite===!1?n.$slideTrack.children(\".slick-slide\").eq(i):n.$slideTrack.children(\".slick-slide\").eq(i+n.options.slidesToShow+1),e=n.options.rtl===!0?o[0]?(n.$slideTrack.width()-o[0].offsetLeft-o.width())*-1:0:o[0]?o[0].offsetLeft*-1:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){var e=this;return e.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(e.options.infinite===!1?i=e.slideCount:(t=e.options.slidesToScroll*-1,o=e.options.slidesToScroll*-1,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o,s,n=this;return s=n.options.centerMode===!0?Math.floor(n.$list.width()/2):0,o=n.swipeLeft*-1+s,n.options.swipeToSlide===!0?(n.$slideTrack.find(\".slick-slide\").each(function(e,s){var r,l,d;if(r=i(s).outerWidth(),l=s.offsetLeft,n.options.centerMode!==!0&&(l+=r/2),d=l+r,o<d)return t=s,!1}),e=Math.abs(i(t).attr(\"data-slick-index\")-n.currentSlide)||1):n.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){var t=this;t.changeSlide({data:{message:\"index\",index:parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass(\"slick-initialized\")||(i(t.$slider).addClass(\"slick-initialized\"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger(\"init\",[t]),t.options.accessibility===!0&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(\".slick-cloned\")).attr({\"aria-hidden\":\"true\",tabindex:\"-1\"}).find(\"a, input, button, select\").attr({tabindex:\"-1\"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(\".slick-cloned\")).each(function(t){var s=o.indexOf(t);if(i(this).attr({role:\"tabpanel\",id:\"slick-slide\"+e.instanceUid+t,tabindex:-1}),s!==-1){var n=\"slick-slide-control\"+e.instanceUid+s;i(\"#\"+n).length&&i(this).attr({\"aria-describedby\":n})}}),e.$dots.attr(\"role\",\"tablist\").find(\"li\").each(function(s){var n=o[s];i(this).attr({role:\"presentation\"}),i(this).find(\"button\").first().attr({role:\"tab\",id:\"slick-slide-control\"+e.instanceUid+s,\"aria-controls\":\"slick-slide\"+e.instanceUid+n,\"aria-label\":s+1+\" of \"+t,\"aria-selected\":null,tabindex:\"-1\"})}).eq(e.currentSlide).find(\"button\").attr({\"aria-selected\":\"true\",tabindex:\"0\"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.options.focusOnChange?e.$slides.eq(s).attr({tabindex:\"0\"}):e.$slides.eq(s).removeAttr(\"tabindex\");e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off(\"click.slick\").on(\"click.slick\",{message:\"previous\"},i.changeSlide),i.$nextArrow.off(\"click.slick\").on(\"click.slick\",{message:\"next\"},i.changeSlide),i.options.accessibility===!0&&(i.$prevArrow.on(\"keydown.slick\",i.keyHandler),i.$nextArrow.on(\"keydown.slick\",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;e.options.dots===!0&&e.slideCount>e.options.slidesToShow&&(i(\"li\",e.$dots).on(\"click.slick\",{message:\"index\"},e.changeSlide),e.options.accessibility===!0&&e.$dots.on(\"keydown.slick\",e.keyHandler)),e.options.dots===!0&&e.options.pauseOnDotsHover===!0&&e.slideCount>e.options.slidesToShow&&i(\"li\",e.$dots).on(\"mouseenter.slick\",i.proxy(e.interrupt,e,!0)).on(\"mouseleave.slick\",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on(\"mouseenter.slick\",i.proxy(e.interrupt,e,!0)),e.$list.on(\"mouseleave.slick\",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on(\"touchstart.slick mousedown.slick\",{action:\"start\"},e.swipeHandler),e.$list.on(\"touchmove.slick mousemove.slick\",{action:\"move\"},e.swipeHandler),e.$list.on(\"touchend.slick mouseup.slick\",{action:\"end\"},e.swipeHandler),e.$list.on(\"touchcancel.slick mouseleave.slick\",{action:\"end\"},e.swipeHandler),e.$list.on(\"click.slick\",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),e.options.accessibility===!0&&e.$list.on(\"keydown.slick\",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on(\"click.slick\",e.selectHandler),i(window).on(\"orientationchange.slick.slick-\"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on(\"resize.slick.slick-\"+e.instanceUid,i.proxy(e.resize,e)),i(\"[draggable!=true]\",e.$slideTrack).on(\"dragstart\",e.preventDefault),i(window).on(\"load.slick.slick-\"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match(\"TEXTAREA|INPUT|SELECT\")||(37===i.keyCode&&e.options.accessibility===!0?e.changeSlide({data:{message:e.options.rtl===!0?\"next\":\"previous\"}}):39===i.keyCode&&e.options.accessibility===!0&&e.changeSlide({data:{message:e.options.rtl===!0?\"previous\":\"next\"}}))},e.prototype.lazyLoad=function(){function e(e){i(\"img[data-lazy]\",e).each(function(){var e=i(this),t=i(this).attr(\"data-lazy\"),o=i(this).attr(\"data-srcset\"),s=i(this).attr(\"data-sizes\")||r.$slider.attr(\"data-sizes\"),n=document.createElement(\"img\");n.onload=function(){e.animate({opacity:0},100,function(){o&&(e.attr(\"srcset\",o),s&&e.attr(\"sizes\",s)),e.attr(\"src\",t).animate({opacity:1},200,function(){e.removeAttr(\"data-lazy data-srcset data-sizes\").removeClass(\"slick-loading\")}),r.$slider.trigger(\"lazyLoaded\",[r,e,t])})},n.onerror=function(){e.removeAttr(\"data-lazy\").removeClass(\"slick-loading\").addClass(\"slick-lazyload-error\"),r.$slider.trigger(\"lazyLoadError\",[r,e,t])},n.src=t})}var t,o,s,n,r=this;if(r.options.centerMode===!0?r.options.infinite===!0?(s=r.currentSlide+(r.options.slidesToShow/2+1),n=s+r.options.slidesToShow+2):(s=Math.max(0,r.currentSlide-(r.options.slidesToShow/2+1)),n=2+(r.options.slidesToShow/2+1)+r.currentSlide):(s=r.options.infinite?r.options.slidesToShow+r.currentSlide:r.currentSlide,n=Math.ceil(s+r.options.slidesToShow),r.options.fade===!0&&(s>0&&s--,n<=r.slideCount&&n++)),t=r.$slider.find(\".slick-slide\").slice(s,n),\"anticipated\"===r.options.lazyLoad)for(var l=s-1,d=n,a=r.$slider.find(\".slick-slide\"),c=0;c<r.options.slidesToScroll;c++)l<0&&(l=r.slideCount-1),t=t.add(a.eq(l)),t=t.add(a.eq(d)),l--,d++;e(t),r.slideCount<=r.options.slidesToShow?(o=r.$slider.find(\".slick-slide\"),e(o)):r.currentSlide>=r.slideCount-r.options.slidesToShow?(o=r.$slider.find(\".slick-cloned\").slice(0,r.options.slidesToShow),e(o)):0===r.currentSlide&&(o=r.$slider.find(\".slick-cloned\").slice(r.options.slidesToShow*-1),e(o))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass(\"slick-loading\"),i.initUI(),\"progressive\"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){var i=this;i.changeSlide({data:{message:\"next\"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;if(!t.unslicked&&(t.$slider.trigger(\"afterChange\",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),t.options.accessibility===!0&&(t.initADA(),t.options.focusOnChange))){var o=i(t.$slides.get(t.currentSlide));o.attr(\"tabindex\",0).focus()}},e.prototype.prev=e.prototype.slickPrev=function(){var i=this;i.changeSlide({data:{message:\"previous\"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i(\"img[data-lazy]\",l.$slider);d.length?(t=d.first(),o=t.attr(\"data-lazy\"),s=t.attr(\"data-srcset\"),n=t.attr(\"data-sizes\")||l.$slider.attr(\"data-sizes\"),r=document.createElement(\"img\"),r.onload=function(){s&&(t.attr(\"srcset\",s),n&&t.attr(\"sizes\",n)),t.attr(\"src\",o).removeAttr(\"data-lazy data-srcset data-sizes\").removeClass(\"slick-loading\"),l.options.adaptiveHeight===!0&&l.setPosition(),l.$slider.trigger(\"lazyLoaded\",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr(\"data-lazy\").removeClass(\"slick-loading\").addClass(\"slick-lazyload-error\"),l.$slider.trigger(\"lazyLoadError\",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger(\"allImagesLoaded\",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:\"index\",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if(\"array\"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||\"window\";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass(\"slick-slide\"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on(\"click.slick\",e.selectHandler),e.setSlideClasses(\"number\"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger(\"reInit\",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;return\"boolean\"==typeof i?(e=i,i=e===!0?0:o.slideCount-1):i=e===!0?--i:i,!(o.slideCount<1||i<0||i>o.slideCount-1)&&(o.unload(),t===!0?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,void o.reinit())},e.prototype.setCSS=function(i){var e,t,o=this,s={};o.options.rtl===!0&&(i=-i),e=\"left\"==o.positionProp?Math.ceil(i)+\"px\":\"0px\",t=\"top\"==o.positionProp?Math.ceil(i)+\"px\":\"0px\",s[o.positionProp]=i,o.transformsEnabled===!1?o.$slideTrack.css(s):(s={},o.cssTransitions===!1?(s[o.animType]=\"translate(\"+e+\", \"+t+\")\",o.$slideTrack.css(s)):(s[o.animType]=\"translate3d(\"+e+\", \"+t+\", 0px)\",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;i.options.vertical===!1?i.options.centerMode===!0&&i.$list.css({padding:\"0px \"+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),i.options.centerMode===!0&&i.$list.css({padding:i.options.centerPadding+\" 0px\"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),i.options.vertical===!1&&i.options.variableWidth===!1?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(\".slick-slide\").length))):i.options.variableWidth===!0?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(\".slick-slide\").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();i.options.variableWidth===!1&&i.$slideTrack.children(\".slick-slide\").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,t.options.rtl===!0?i(s).css({position:\"relative\",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}):i(s).css({position:\"relative\",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css(\"height\",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if(\"object\"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n=\"multiple\"):\"string\"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],\"responsive\"===arguments[0]&&\"array\"===i.type(arguments[1])?n=\"responsive\":\"undefined\"!=typeof arguments[1]&&(n=\"single\")),\"single\"===n)r.options[o]=s;else if(\"multiple\"===n)i.each(o,function(i,e){r.options[i]=e});else if(\"responsive\"===n)for(t in s)if(\"array\"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),i.options.fade===!1?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger(\"setPosition\",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=i.options.vertical===!0?\"top\":\"left\",\n \"top\"===i.positionProp?i.$slider.addClass(\"slick-vertical\"):i.$slider.removeClass(\"slick-vertical\"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||i.options.useCSS===!0&&(i.cssTransitions=!0),i.options.fade&&(\"number\"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType=\"OTransform\",i.transformType=\"-o-transform\",i.transitionType=\"OTransition\",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType=\"MozTransform\",i.transformType=\"-moz-transform\",i.transitionType=\"MozTransition\",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType=\"webkitTransform\",i.transformType=\"-webkit-transform\",i.transitionType=\"webkitTransition\",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType=\"msTransform\",i.transformType=\"-ms-transform\",i.transitionType=\"msTransition\",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&i.animType!==!1&&(i.animType=\"transform\",i.transformType=\"transform\",i.transitionType=\"transition\"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&i.animType!==!1},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(\".slick-slide\").removeClass(\"slick-active slick-center slick-current\").attr(\"aria-hidden\",\"true\"),n.$slides.eq(i).addClass(\"slick-current\"),n.options.centerMode===!0){var r=n.options.slidesToShow%2===0?1:0;e=Math.floor(n.options.slidesToShow/2),n.options.infinite===!0&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass(\"slick-active\").attr(\"aria-hidden\",\"false\"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass(\"slick-active\").attr(\"aria-hidden\",\"false\")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass(\"slick-center\"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass(\"slick-center\")),n.$slides.eq(i).addClass(\"slick-center\")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass(\"slick-active\").attr(\"aria-hidden\",\"false\"):t.length<=n.options.slidesToShow?t.addClass(\"slick-active\").attr(\"aria-hidden\",\"false\"):(s=n.slideCount%n.options.slidesToShow,o=n.options.infinite===!0?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass(\"slick-active\").attr(\"aria-hidden\",\"false\"):t.slice(o,o+n.options.slidesToShow).addClass(\"slick-active\").attr(\"aria-hidden\",\"false\"));\"ondemand\"!==n.options.lazyLoad&&\"anticipated\"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(s.options.fade===!0&&(s.options.centerMode=!1),s.options.infinite===!0&&s.options.fade===!1&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=s.options.centerMode===!0?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr(\"id\",\"\").attr(\"data-slick-index\",t-s.slideCount).prependTo(s.$slideTrack).addClass(\"slick-cloned\");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr(\"id\",\"\").attr(\"data-slick-index\",t+s.slideCount).appendTo(s.$slideTrack).addClass(\"slick-cloned\");s.$slideTrack.find(\".slick-cloned\").find(\"[id]\").each(function(){i(this).attr(\"id\",\"\")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(\".slick-slide\")?i(e.target):i(e.target).parents(\".slick-slide\"),s=parseInt(o.attr(\"data-slick-index\"));return s||(s=0),t.slideCount<=t.options.slidesToShow?void t.slideHandler(s,!1,!0):void t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(a.animating===!0&&a.options.waitForAnimate===!0||a.options.fade===!0&&a.currentSlide===i))return e===!1&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,a.options.infinite===!1&&a.options.centerMode===!1&&(i<0||i>a.getDotCount()*a.options.slidesToScroll)?void(a.options.fade===!1&&(o=a.currentSlide,t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o))):a.options.infinite===!1&&a.options.centerMode===!0&&(i<0||i>a.slideCount-a.options.slidesToScroll)?void(a.options.fade===!1&&(o=a.currentSlide,t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o))):(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!==0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!==0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger(\"beforeChange\",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=a.getNavTarget(),l=l.slick(\"getSlick\"),l.slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide)),a.updateDots(),a.updateArrows(),a.options.fade===!0?(t!==!0?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight()):void(t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)))},e.prototype.startLoad=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass(\"slick-loading\")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),o=Math.round(180*t/Math.PI),o<0&&(o=360-Math.abs(o)),o<=45&&o>=0?s.options.rtl===!1?\"left\":\"right\":o<=360&&o>=315?s.options.rtl===!1?\"left\":\"right\":o>=135&&o<=225?s.options.rtl===!1?\"right\":\"left\":s.options.verticalSwiping===!0?o>=35&&o<=135?\"down\":\"up\":\"vertical\"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(o.touchObject.edgeHit===!0&&o.$slider.trigger(\"edge\",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case\"left\":case\"down\":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case\"right\":case\"up\":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}\"vertical\"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger(\"swipe\",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(e.options.swipe===!1||\"ontouchend\"in document&&e.options.swipe===!1||e.options.draggable===!1&&i.type.indexOf(\"mouse\")!==-1))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,e.options.verticalSwiping===!0&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case\"start\":e.swipeStart(i);break;case\"move\":e.swipeMove(i);break;case\"end\":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(l.options.verticalSwiping===!0&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(l.options.rtl===!1?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),l.options.verticalSwiping===!0&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,l.options.infinite===!1&&(0===l.currentSlide&&\"right\"===t||l.currentSlide>=l.getDotCount()&&\"left\"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),l.options.vertical===!1?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,l.options.verticalSwiping===!0&&(l.swipeLeft=e+o*s),l.options.fade!==!0&&l.options.touchMove!==!1&&(l.animating===!0?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;return t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow?(t.touchObject={},!1):(void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,void(t.dragging=!0))},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(\".slick-cloned\",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass(\"slick-slide slick-active slick-visible slick-current\").attr(\"aria-hidden\",\"true\").css(\"width\",\"\")},e.prototype.unslick=function(i){var e=this;e.$slider.trigger(\"unslick\",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i,e=this;i=Math.floor(e.options.slidesToShow/2),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&!e.options.infinite&&(e.$prevArrow.removeClass(\"slick-disabled\").attr(\"aria-disabled\",\"false\"),e.$nextArrow.removeClass(\"slick-disabled\").attr(\"aria-disabled\",\"false\"),0===e.currentSlide?(e.$prevArrow.addClass(\"slick-disabled\").attr(\"aria-disabled\",\"true\"),e.$nextArrow.removeClass(\"slick-disabled\").attr(\"aria-disabled\",\"false\")):e.currentSlide>=e.slideCount-e.options.slidesToShow&&e.options.centerMode===!1?(e.$nextArrow.addClass(\"slick-disabled\").attr(\"aria-disabled\",\"true\"),e.$prevArrow.removeClass(\"slick-disabled\").attr(\"aria-disabled\",\"false\")):e.currentSlide>=e.slideCount-1&&e.options.centerMode===!0&&(e.$nextArrow.addClass(\"slick-disabled\").attr(\"aria-disabled\",\"true\"),e.$prevArrow.removeClass(\"slick-disabled\").attr(\"aria-disabled\",\"false\")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find(\"li\").removeClass(\"slick-active\").end(),i.$dots.find(\"li\").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass(\"slick-active\"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if(\"object\"==typeof s||\"undefined\"==typeof s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),\"undefined\"!=typeof t)return t;return o}});\n","Amasty_Base/js/http_build_query.js":"/**\n * PHP htp_build_query() analog\n */\ndefine(\n [],\n function () {\n 'use strict';\n\n /**\n * Encodes param according to RFC3986 standard.\n *\n * @param {string} str\n * @returns {string}\n */\n function encodeComponentRaw(str)\n {\n str = (str + '');\n return encodeURIComponent(str)\n .replace(/!/g, '%21')\n .replace(/'/g, '%27')\n .replace(/\\(/g, '%28')\n .replace(/\\)/g, '%29')\n .replace(/\\*/g, '%2A');\n }\n\n /**\n * Encodes param according to RF1738 standard.\n *\n * @param {string} str\n * @returns {string}\n */\n function encodeComponent(str)\n {\n return encodeComponentRaw(str).replace(/%20/g, '+');\n }\n\n /**\n * Encode single GET param.\n *\n * @param {string} key\n * @param {string} val\n * @param {string} argSeparator\n * @param {function (string)} encodeFunc\n * @returns {string}\n */\n function buildParam(key, val, argSeparator, encodeFunc)\n {\n var result = [];\n if (val === true) {\n val = '1';\n } else if (val === false) {\n val = '0';\n }\n\n if (val !== null) {\n if (typeof val === 'object') {\n for (var index in val) {\n if (val[index] !== null) {\n result.push(buildParam(key + '[' + index + ']', val[index], argSeparator, encodeFunc));\n }\n }\n\n return result.join(argSeparator);\n } else if (typeof val !== 'function') {\n return encodeFunc(key) + '=' + encodeFunc(val);\n } else {\n throw new Error('There was an error processing for http_build_query().');\n }\n } else {\n return '';\n }\n };\n\n /**\n * Builds HTTP query in the same way as PHP htp_build_query() function.\n *\n * @param {array} formData\n * @param {string} numericPrefix\n * @param {string} argSeparator\n * @param {string} encType\n * @returns {string}\n */\n function httpBuildQuery(formData, numericPrefix, argSeparator, encType)\n {\n var result = [],\n encode = (encType == 'PHP_QUERY_RFC3986') ? encodeComponentRaw : encodeComponent;\n if (!argSeparator) {\n argSeparator = '&';\n }\n\n for (var key in formData) {\n if (numericPrefix && !isNaN(key)) {\n key = String(numericPrefix) + key;\n }\n var query = buildParam(key, formData[key], argSeparator, encode);\n if (query !== '') {\n result.push(query);\n }\n }\n\n return result.join(argSeparator);\n };\n\n return function (formData, numericPrefix, argSeparator, encType) {\n return httpBuildQuery(formData, numericPrefix, argSeparator, encType);\n }\n }\n);\n","Smartwave_Filterproducts/js/packery.pkgd.js":"/*!\n * Packery PACKAGED v1.4.3\n * bin-packing layout library\n *\n * Licensed GPLv3 for open source use\n * or Flickity Commercial License for commercial use\n *\n * http://packery.metafizzy.co\n * Copyright 2015 Metafizzy\n */\n\n/**\n * Bridget makes jQuery widgets\n * v1.1.0\n * MIT license\n */\n\n( function( window ) {\n\n\n\n// -------------------------- utils -------------------------- //\n\nvar slice = Array.prototype.slice;\n\nfunction noop() {}\n\n// -------------------------- definition -------------------------- //\n\nfunction defineBridget( $ ) {\n\n// bail if no jQuery\nif ( !$ ) {\n return;\n}\n\n// -------------------------- addOptionMethod -------------------------- //\n\n/**\n * adds option method -> $().plugin('option', {...})\n * @param {Function} PluginClass - constructor class\n */\nfunction addOptionMethod( PluginClass ) {\n // don't overwrite original option method\n if ( PluginClass.prototype.option ) {\n return;\n }\n\n // option setter\n PluginClass.prototype.option = function( opts ) {\n // bail out if not an object\n if ( !$.isPlainObject( opts ) ){\n return;\n }\n this.options = $.extend( true, this.options, opts );\n };\n}\n\n// -------------------------- plugin bridge -------------------------- //\n\n// helper function for logging errors\n// $.error breaks jQuery chaining\nvar logError = typeof console === 'undefined' ? noop :\n function( message ) {\n console.error( message );\n };\n\n/**\n * jQuery plugin bridge, access methods like $elem.plugin('method')\n * @param {String} namespace - plugin name\n * @param {Function} PluginClass - constructor class\n */\nfunction bridge( namespace, PluginClass ) {\n // add to jQuery fn namespace\n $.fn[ namespace ] = function( options ) {\n if ( typeof options === 'string' ) {\n // call plugin method when first argument is a string\n // get arguments for method\n var args = slice.call( arguments, 1 );\n\n for ( var i=0, len = this.length; i < len; i++ ) {\n var elem = this[i];\n var instance = $.data( elem, namespace );\n if ( !instance ) {\n logError( \"cannot call methods on \" + namespace + \" prior to initialization; \" +\n \"attempted to call '\" + options + \"'\" );\n continue;\n }\n if ( !$.isFunction( instance[options] ) || options.charAt(0) === '_' ) {\n logError( \"no such method '\" + options + \"' for \" + namespace + \" instance\" );\n continue;\n }\n\n // trigger method with arguments\n var returnValue = instance[ options ].apply( instance, args );\n\n // break look and return first value if provided\n if ( returnValue !== undefined ) {\n return returnValue;\n }\n }\n // return this if no return value\n return this;\n } else {\n return this.each( function() {\n var instance = $.data( this, namespace );\n if ( instance ) {\n // apply options & init\n instance.option( options );\n instance._init();\n } else {\n // initialize new instance\n instance = new PluginClass( this, options );\n $.data( this, namespace, instance );\n }\n });\n }\n };\n\n}\n\n// -------------------------- bridget -------------------------- //\n\n/**\n * converts a Prototypical class into a proper jQuery plugin\n * the class must have a ._init method\n * @param {String} namespace - plugin name, used in $().pluginName\n * @param {Function} PluginClass - constructor class\n */\n$.bridget = function( namespace, PluginClass ) {\n addOptionMethod( PluginClass );\n bridge( namespace, PluginClass );\n};\n\nreturn $.bridget;\n\n}\n\n// transport\nif ( typeof define === 'function' && define.amd ) {\n // AMD\n define( 'jquery-bridget/jquery.bridget',[ 'jquery' ], defineBridget );\n} else if ( typeof exports === 'object' ) {\n defineBridget( require('jquery') );\n} else {\n // get jquery from browser global\n defineBridget( window.jQuery );\n}\ndefineBridget( window.jQuery );\n})( window );\n\n/*!\n * classie v1.0.1\n * class helper functions\n * from bonzo https://github.com/ded/bonzo\n * MIT license\n * \n * classie.has( elem, 'my-class' ) -> true/false\n * classie.add( elem, 'my-new-class' )\n * classie.remove( elem, 'my-unwanted-class' )\n * classie.toggle( elem, 'my-class' )\n */\n\n/*jshint browser: true, strict: true, undef: true, unused: true */\n/*global define: false, module: false */\n\n( function( window ) {\n\n\n\n// class helper functions from bonzo https://github.com/ded/bonzo\n\nfunction classReg( className ) {\n return new RegExp(\"(^|\\\\s+)\" + className + \"(\\\\s+|$)\");\n}\n\n// classList support for class management\n// altho to be fair, the api sucks because it won't accept multiple classes at once\nvar hasClass, addClass, removeClass;\n\nif ( 'classList' in document.documentElement ) {\n hasClass = function( elem, c ) {\n return elem.classList.contains( c );\n };\n addClass = function( elem, c ) {\n elem.classList.add( c );\n };\n removeClass = function( elem, c ) {\n elem.classList.remove( c );\n };\n}\nelse {\n hasClass = function( elem, c ) {\n return classReg( c ).test( elem.className );\n };\n addClass = function( elem, c ) {\n if ( !hasClass( elem, c ) ) {\n elem.className = elem.className + ' ' + c;\n }\n };\n removeClass = function( elem, c ) {\n elem.className = elem.className.replace( classReg( c ), ' ' );\n };\n}\n\nfunction toggleClass( elem, c ) {\n var fn = hasClass( elem, c ) ? removeClass : addClass;\n fn( elem, c );\n}\n\nvar classie = {\n // full names\n hasClass: hasClass,\n addClass: addClass,\n removeClass: removeClass,\n toggleClass: toggleClass,\n // short names\n has: hasClass,\n add: addClass,\n remove: removeClass,\n toggle: toggleClass\n};\n\n// transport\nif ( typeof define === 'function' && define.amd ) {\n // AMD\n define( 'classie/classie',classie );\n} else if ( typeof exports === 'object' ) {\n // CommonJS\n module.exports = classie;\n} else {\n // browser global\n window.classie = classie;\n}\n\n})( window );\n\n/*!\n * getStyleProperty v1.0.4\n * original by kangax\n * http://perfectionkills.com/feature-testing-css-properties/\n * MIT license\n */\n\n/*jshint browser: true, strict: true, undef: true */\n/*global define: false, exports: false, module: false */\n\n( function( window ) {\n\n\n\nvar prefixes = 'Webkit Moz ms Ms O'.split(' ');\nvar docElemStyle = document.documentElement.style;\n\nfunction getStyleProperty( propName ) {\n if ( !propName ) {\n return;\n }\n\n // test standard property first\n if ( typeof docElemStyle[ propName ] === 'string' ) {\n return propName;\n }\n\n // capitalize\n propName = propName.charAt(0).toUpperCase() + propName.slice(1);\n\n // test vendor specific properties\n var prefixed;\n for ( var i=0, len = prefixes.length; i < len; i++ ) {\n prefixed = prefixes[i] + propName;\n if ( typeof docElemStyle[ prefixed ] === 'string' ) {\n return prefixed;\n }\n }\n}\n\n// transport\nif ( typeof define === 'function' && define.amd ) {\n // AMD\n define( 'get-style-property/get-style-property',[],function() {\n return getStyleProperty;\n });\n} else if ( typeof exports === 'object' ) {\n // CommonJS for Component\n module.exports = getStyleProperty;\n} else {\n // browser global\n window.getStyleProperty = getStyleProperty;\n}\n\n})( window );\n\n/*!\n * getSize v1.2.2\n * measure size of elements\n * MIT license\n */\n\n/*jshint browser: true, strict: true, undef: true, unused: true */\n/*global define: false, exports: false, require: false, module: false, console: false */\n\n( function( window, undefined ) {\n\n\n\n// -------------------------- helpers -------------------------- //\n\n// get a number from a string, not a percentage\nfunction getStyleSize( value ) {\n var num = parseFloat( value );\n // not a percent like '100%', and a number\n var isValid = value.indexOf('%') === -1 && !isNaN( num );\n return isValid && num;\n}\n\nfunction noop() {}\n\nvar logError = typeof console === 'undefined' ? noop :\n function( message ) {\n console.error( message );\n };\n\n// -------------------------- measurements -------------------------- //\n\nvar measurements = [\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'paddingBottom',\n 'marginLeft',\n 'marginRight',\n 'marginTop',\n 'marginBottom',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopWidth',\n 'borderBottomWidth'\n];\n\nfunction getZeroSize() {\n var size = {\n width: 0,\n height: 0,\n innerWidth: 0,\n innerHeight: 0,\n outerWidth: 0,\n outerHeight: 0\n };\n for ( var i=0, len = measurements.length; i < len; i++ ) {\n var measurement = measurements[i];\n size[ measurement ] = 0;\n }\n return size;\n}\n\n\n\nfunction defineGetSize( getStyleProperty ) {\n\n// -------------------------- setup -------------------------- //\n\nvar isSetup = false;\n\nvar getStyle, boxSizingProp, isBoxSizeOuter;\n\n/**\n * setup vars and functions\n * do it on initial getSize(), rather than on script load\n * For Firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n */\nfunction setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n var getComputedStyle = window.getComputedStyle;\n getStyle = ( function() {\n var getStyleFn = getComputedStyle ?\n function( elem ) {\n return getComputedStyle( elem, null );\n } :\n function( elem ) {\n return elem.currentStyle;\n };\n\n return function getStyle( elem ) {\n var style = getStyleFn( elem );\n if ( !style ) {\n logError( 'Style returned ' + style +\n '. Are you running this code in a hidden iframe on Firefox? ' +\n 'See http://bit.ly/getsizebug1' );\n }\n return style;\n };\n })();\n\n // -------------------------- box sizing -------------------------- //\n\n boxSizingProp = getStyleProperty('boxSizing');\n\n /**\n * WebKit measures the outer-width on style.width on border-box elems\n * IE & Firefox measures the inner-width\n */\n if ( boxSizingProp ) {\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style[ boxSizingProp ] = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n\n isBoxSizeOuter = getStyleSize( style.width ) === 200;\n body.removeChild( div );\n }\n\n}\n\n// -------------------------- getSize -------------------------- //\n\nfunction getSize( elem ) {\n setup();\n\n // use querySeletor if elem is string\n if ( typeof elem === 'string' ) {\n elem = document.querySelector( elem );\n }\n\n // do not proceed on non-objects\n if ( !elem || typeof elem !== 'object' || !elem.nodeType ) {\n return;\n }\n\n var style = getStyle( elem );\n\n // if hidden, everything is 0\n if ( style.display === 'none' ) {\n return getZeroSize();\n }\n\n var size = {};\n size.width = elem.offsetWidth;\n size.height = elem.offsetHeight;\n\n var isBorderBox = size.isBorderBox = !!( boxSizingProp &&\n style[ boxSizingProp ] && style[ boxSizingProp ] === 'border-box' );\n\n // get all measurements\n for ( var i=0, len = measurements.length; i < len; i++ ) {\n var measurement = measurements[i];\n var value = style[ measurement ];\n value = mungeNonPixel( elem, value );\n var num = parseFloat( value );\n // any 'auto', 'medium' value will be 0\n size[ measurement ] = !isNaN( num ) ? num : 0;\n }\n\n var paddingWidth = size.paddingLeft + size.paddingRight;\n var paddingHeight = size.paddingTop + size.paddingBottom;\n var marginWidth = size.marginLeft + size.marginRight;\n var marginHeight = size.marginTop + size.marginBottom;\n var borderWidth = size.borderLeftWidth + size.borderRightWidth;\n var borderHeight = size.borderTopWidth + size.borderBottomWidth;\n\n var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;\n\n // overwrite width and height if we can get it from style\n var styleWidth = getStyleSize( style.width );\n if ( styleWidth !== false ) {\n size.width = styleWidth +\n // add padding and border unless it's already including it\n ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth );\n }\n\n var styleHeight = getStyleSize( style.height );\n if ( styleHeight !== false ) {\n size.height = styleHeight +\n // add padding and border unless it's already including it\n ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight );\n }\n\n size.innerWidth = size.width - ( paddingWidth + borderWidth );\n size.innerHeight = size.height - ( paddingHeight + borderHeight );\n\n size.outerWidth = size.width + marginWidth;\n size.outerHeight = size.height + marginHeight;\n\n return size;\n}\n\n// IE8 returns percent values, not pixels\n// taken from jQuery's curCSS\nfunction mungeNonPixel( elem, value ) {\n // IE8 and has percent value\n if ( window.getComputedStyle || value.indexOf('%') === -1 ) {\n return value;\n }\n var style = elem.style;\n // Remember the original values\n var left = style.left;\n var rs = elem.runtimeStyle;\n var rsLeft = rs && rs.left;\n\n // Put in the new values to get a computed value out\n if ( rsLeft ) {\n rs.left = elem.currentStyle.left;\n }\n style.left = value;\n value = style.pixelLeft;\n\n // Revert the changed values\n style.left = left;\n if ( rsLeft ) {\n rs.left = rsLeft;\n }\n\n return value;\n}\n\nreturn getSize;\n\n}\n\n// transport\nif ( typeof define === 'function' && define.amd ) {\n // AMD for RequireJS\n define( 'get-size/get-size',[ 'get-style-property/get-style-property' ], defineGetSize );\n} else if ( typeof exports === 'object' ) {\n // CommonJS for Component\n module.exports = defineGetSize( require('desandro-get-style-property') );\n} else {\n // browser global\n window.getSize = defineGetSize( window.getStyleProperty );\n}\n\n})( window );\n\n/*!\n * eventie v1.0.6\n * event binding helper\n * eventie.bind( elem, 'click', myFn )\n * eventie.unbind( elem, 'click', myFn )\n * MIT license\n */\n\n/*jshint browser: true, undef: true, unused: true */\n/*global define: false, module: false */\n\n( function( window ) {\n\n\n\nvar docElem = document.documentElement;\n\nvar bind = function() {};\n\nfunction getIEEvent( obj ) {\n var event = window.event;\n // add event.target\n event.target = event.target || event.srcElement || obj;\n return event;\n}\n\nif ( docElem.addEventListener ) {\n bind = function( obj, type, fn ) {\n obj.addEventListener( type, fn, false );\n };\n} else if ( docElem.attachEvent ) {\n bind = function( obj, type, fn ) {\n obj[ type + fn ] = fn.handleEvent ?\n function() {\n var event = getIEEvent( obj );\n fn.handleEvent.call( fn, event );\n } :\n function() {\n var event = getIEEvent( obj );\n fn.call( obj, event );\n };\n obj.attachEvent( \"on\" + type, obj[ type + fn ] );\n };\n}\n\nvar unbind = function() {};\n\nif ( docElem.removeEventListener ) {\n unbind = function( obj, type, fn ) {\n obj.removeEventListener( type, fn, false );\n };\n} else if ( docElem.detachEvent ) {\n unbind = function( obj, type, fn ) {\n obj.detachEvent( \"on\" + type, obj[ type + fn ] );\n try {\n delete obj[ type + fn ];\n } catch ( err ) {\n // can't delete window object properties\n obj[ type + fn ] = undefined;\n }\n };\n}\n\nvar eventie = {\n bind: bind,\n unbind: unbind\n};\n\n// ----- module definition ----- //\n\nif ( typeof define === 'function' && define.amd ) {\n // AMD\n define( 'eventie/eventie',eventie );\n} else if ( typeof exports === 'object' ) {\n // CommonJS\n module.exports = eventie;\n} else {\n // browser global\n window.eventie = eventie;\n}\nwindow.eventie = eventie;\n})( window );\n\n/*!\n * EventEmitter v4.2.11 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function () {\n \n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var exports = this;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listeners = this.getListenersAsObject(evt);\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n i = listeners[key].length;\n\n while (i--) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[key][i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define('eventEmitter/EventEmitter',[],function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}.call(this));\n\n/*!\n * docReady v1.0.4\n * Cross browser DOMContentLoaded event emitter\n * MIT license\n */\n\n/*jshint browser: true, strict: true, undef: true, unused: true*/\n/*global define: false, require: false, module: false */\n\n( function( window ) {\n\n\n\nvar document = window.document;\n// collection of functions to be triggered on ready\nvar queue = [];\n\nfunction docReady( fn ) {\n // throw out non-functions\n if ( typeof fn !== 'function' ) {\n return;\n }\n\n if ( docReady.isReady ) {\n // ready now, hit it\n fn();\n } else {\n // queue function when ready\n queue.push( fn );\n }\n}\n\ndocReady.isReady = false;\n\n// triggered on various doc ready events\nfunction onReady( event ) {\n // bail if already triggered or IE8 document is not ready just yet\n var isIE8NotReady = event.type === 'readystatechange' && document.readyState !== 'complete';\n if ( docReady.isReady || isIE8NotReady ) {\n return;\n }\n\n trigger();\n}\n\nfunction trigger() {\n docReady.isReady = true;\n // process queue\n for ( var i=0, len = queue.length; i < len; i++ ) {\n var fn = queue[i];\n fn();\n }\n}\n\nfunction defineDocReady( eventie ) {\n // trigger ready if page is ready\n if ( document.readyState === 'complete' ) {\n trigger();\n } else {\n // listen for events\n window.eventie.bind( document, 'DOMContentLoaded', onReady );\n window.eventie.bind( document, 'readystatechange', onReady );\n window.eventie.bind( window, 'load', onReady );\n }\n\n return docReady;\n}\n\n// transport\nif ( typeof define === 'function' && define.amd ) {\n // AMD\n define( 'doc-ready/doc-ready',[ 'eventie/eventie' ], defineDocReady );\n} else if ( typeof exports === 'object' ) {\n module.exports = defineDocReady( require('eventie') );\n} else {\n // browser global\n window.docReady = defineDocReady( window.eventie );\n}\n\n})( window );\n\n/**\n * matchesSelector v1.0.3\n * matchesSelector( element, '.selector' )\n * MIT license\n */\n\n/*jshint browser: true, strict: true, undef: true, unused: true */\n/*global define: false, module: false */\n\n( function( ElemProto ) {\n\n \n\n var matchesMethod = ( function() {\n // check for the standard method name first\n if ( ElemProto.matches ) {\n return 'matches';\n }\n // check un-prefixed\n if ( ElemProto.matchesSelector ) {\n return 'matchesSelector';\n }\n // check vendor prefixes\n var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];\n\n for ( var i=0, len = prefixes.length; i < len; i++ ) {\n var prefix = prefixes[i];\n var method = prefix + 'MatchesSelector';\n if ( ElemProto[ method ] ) {\n return method;\n }\n }\n })();\n\n // ----- match ----- //\n\n function match( elem, selector ) {\n return elem[ matchesMethod ]( selector );\n }\n\n // ----- appendToFragment ----- //\n\n function checkParent( elem ) {\n // not needed if already has parent\n if ( elem.parentNode ) {\n return;\n }\n var fragment = document.createDocumentFragment();\n fragment.appendChild( elem );\n }\n\n // ----- query ----- //\n\n // fall back to using QSA\n // thx @jonathantneal https://gist.github.com/3062955\n function query( elem, selector ) {\n // append to fragment if no parent\n checkParent( elem );\n\n // match elem with all selected elems of parent\n var elems = elem.parentNode.querySelectorAll( selector );\n for ( var i=0, len = elems.length; i < len; i++ ) {\n // return true if match\n if ( elems[i] === elem ) {\n return true;\n }\n }\n // otherwise return false\n return false;\n }\n\n // ----- matchChild ----- //\n\n function matchChild( elem, selector ) {\n checkParent( elem );\n return match( elem, selector );\n }\n\n // ----- matchesSelector ----- //\n\n var matchesSelector;\n\n if ( matchesMethod ) {\n // IE9 supports matchesSelector, but doesn't work on orphaned elems\n // check for that\n var div = document.createElement('div');\n var supportsOrphans = match( div, 'div' );\n matchesSelector = supportsOrphans ? match : matchChild;\n } else {\n matchesSelector = query;\n }\n\n // transport\n if ( typeof define === 'function' && define.amd ) {\n // AMD\n define( 'matches-selector/matches-selector',[],function() {\n return matchesSelector;\n });\n } else if ( typeof exports === 'object' ) {\n module.exports = matchesSelector;\n }\n else {\n // browser global\n window.matchesSelector = matchesSelector;\n }\n\n})( Element.prototype );\n\n/**\n * Fizzy UI utils v1.0.1\n * MIT license\n */\n\n/*jshint browser: true, undef: true, unused: true, strict: true */\n\n( function( window, factory ) {\n /*global define: false, module: false, require: false */\n \n // universal module definition\n\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( 'fizzy-ui-utils/utils',[\n 'doc-ready/doc-ready',\n 'matches-selector/matches-selector'\n ], function( docReady, matchesSelector ) {\n return factory( window, docReady, matchesSelector );\n });\n } else if ( typeof exports == 'object' ) {\n // CommonJS\n module.exports = factory(\n window,\n require('doc-ready'),\n require('desandro-matches-selector')\n );\n } else {\n // browser global\n window.fizzyUIUtils = factory(\n window,\n window.docReady,\n window.matchesSelector\n );\n }\n\n}( window, function factory( window, docReady, matchesSelector ) {\n\n\n\nvar utils = {};\n\n// ----- extend ----- //\n\n// extends objects\nutils.extend = function( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n};\n\n// ----- modulo ----- //\n\nutils.modulo = function( num, div ) {\n return ( ( num % div ) + div ) % div;\n};\n\n// ----- isArray ----- //\n \nvar objToString = Object.prototype.toString;\nutils.isArray = function( obj ) {\n return objToString.call( obj ) == '[object Array]';\n};\n\n// ----- makeArray ----- //\n\n// turn element or nodeList into an array\nutils.makeArray = function( obj ) {\n var ary = [];\n if ( utils.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( obj && typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n};\n\n// ----- indexOf ----- //\n\n// index of helper cause IE8\nutils.indexOf = Array.prototype.indexOf ? function( ary, obj ) {\n return ary.indexOf( obj );\n } : function( ary, obj ) {\n for ( var i=0, len = ary.length; i < len; i++ ) {\n if ( ary[i] === obj ) {\n return i;\n }\n }\n return -1;\n };\n\n// ----- removeFrom ----- //\n\nutils.removeFrom = function( ary, obj ) {\n var index = utils.indexOf( ary, obj );\n if ( index != -1 ) {\n ary.splice( index, 1 );\n }\n};\n\n// ----- isElement ----- //\n\n// http://stackoverflow.com/a/384380/182183\nutils.isElement = ( typeof HTMLElement == 'function' || typeof HTMLElement == 'object' ) ?\n function isElementDOM2( obj ) {\n return obj instanceof HTMLElement;\n } :\n function isElementQuirky( obj ) {\n return obj && typeof obj == 'object' &&\n obj.nodeType == 1 && typeof obj.nodeName == 'string';\n };\n\n// ----- setText ----- //\n\nutils.setText = ( function() {\n var setTextProperty;\n function setText( elem, text ) {\n // only check setTextProperty once\n setTextProperty = setTextProperty || ( document.documentElement.textContent !== undefined ? 'textContent' : 'innerText' );\n elem[ setTextProperty ] = text;\n }\n return setText;\n})();\n\n// ----- getParent ----- //\n\nutils.getParent = function( elem, selector ) {\n while ( elem != document.body ) {\n elem = elem.parentNode;\n if ( matchesSelector( elem, selector ) ) {\n return elem;\n }\n }\n};\n\n// ----- getQueryElement ----- //\n\n// use element as selector string\nutils.getQueryElement = function( elem ) {\n if ( typeof elem == 'string' ) {\n return document.querySelector( elem );\n }\n return elem;\n};\n\n// ----- handleEvent ----- //\n\n// enable .ontype to trigger from .addEventListener( elem, 'type' )\nutils.handleEvent = function( event ) {\n var method = 'on' + event.type;\n if ( this[ method ] ) {\n this[ method ]( event );\n }\n};\n\n// ----- filterFindElements ----- //\n\nutils.filterFindElements = function( elems, selector ) {\n // make array of elems\n elems = utils.makeArray( elems );\n var ffElems = [];\n\n for ( var i=0, len = elems.length; i < len; i++ ) {\n var elem = elems[i];\n // check that elem is an actual element\n if ( !utils.isElement( elem ) ) {\n continue;\n }\n // filter & find items if we have a selector\n if ( selector ) {\n // filter siblings\n if ( matchesSelector( elem, selector ) ) {\n ffElems.push( elem );\n }\n // find children\n var childElems = elem.querySelectorAll( selector );\n // concat childElems to filterFound array\n for ( var j=0, jLen = childElems.length; j < jLen; j++ ) {\n ffElems.push( childElems[j] );\n }\n } else {\n ffElems.push( elem );\n }\n }\n\n return ffElems;\n};\n\n// ----- debounceMethod ----- //\n\nutils.debounceMethod = function( _class, methodName, threshold ) {\n // original method\n var method = _class.prototype[ methodName ];\n var timeoutName = methodName + 'Timeout';\n\n _class.prototype[ methodName ] = function() {\n var timeout = this[ timeoutName ];\n if ( timeout ) {\n clearTimeout( timeout );\n }\n var args = arguments;\n\n var _this = this;\n this[ timeoutName ] = setTimeout( function() {\n method.apply( _this, args );\n delete _this[ timeoutName ];\n }, threshold || 100 );\n };\n};\n\n// ----- htmlInit ----- //\n\n// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/\nutils.toDashed = function( str ) {\n return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {\n return $1 + '-' + $2;\n }).toLowerCase();\n};\n\nvar console = window.console;\n/**\n * allow user to initialize classes via .js-namespace class\n * htmlInit( Widget, 'widgetName' )\n * options are parsed from data-namespace-option attribute\n */\nutils.htmlInit = function( WidgetClass, namespace ) {\n docReady( function() {\n var dashedNamespace = utils.toDashed( namespace );\n var elems = document.querySelectorAll( '.js-' + dashedNamespace );\n var dataAttr = 'data-' + dashedNamespace + '-options';\n\n for ( var i=0, len = elems.length; i < len; i++ ) {\n var elem = elems[i];\n var attr = elem.getAttribute( dataAttr );\n var options;\n try {\n options = attr && JSON.parse( attr );\n } catch ( error ) {\n // log error, do not initialize\n if ( console ) {\n console.error( 'Error parsing ' + dataAttr + ' on ' +\n elem.nodeName.toLowerCase() + ( elem.id ? '#' + elem.id : '' ) + ': ' +\n error );\n }\n continue;\n }\n // initialize\n var instance = new WidgetClass( elem, options );\n // make available via $().data('layoutname')\n var jQuery = window.jQuery;\n if ( jQuery ) {\n jQuery.data( elem, namespace, instance );\n }\n }\n });\n};\n\n// ----- ----- //\n\nreturn utils;\n\n}));\n\n/**\n * Outlayer Item\n */\n\n( function( window, factory ) {\n \n // universal module definition\n if ( typeof define === 'function' && define.amd ) {\n // AMD\n define( 'outlayer/item',[\n 'eventEmitter/EventEmitter',\n 'get-size/get-size',\n 'get-style-property/get-style-property',\n 'fizzy-ui-utils/utils'\n ],\n function( EventEmitter, getSize, getStyleProperty, utils ) {\n return factory( window, EventEmitter, getSize, getStyleProperty, utils );\n }\n );\n } else if (typeof exports === 'object') {\n // CommonJS\n module.exports = factory(\n window,\n require('wolfy87-eventemitter'),\n require('get-size'),\n require('desandro-get-style-property'),\n require('fizzy-ui-utils')\n );\n } else {\n // browser global\n window.Outlayer = {};\n window.Outlayer.Item = factory(\n window,\n window.EventEmitter,\n window.getSize,\n window.getStyleProperty,\n window.fizzyUIUtils\n );\n }\n\n}( window, function factory( window, EventEmitter, getSize, getStyleProperty, utils ) {\n\n\n// ----- helpers ----- //\n\nvar getComputedStyle = window.getComputedStyle;\nvar getStyle = getComputedStyle ?\n function( elem ) {\n return getComputedStyle( elem, null );\n } :\n function( elem ) {\n return elem.currentStyle;\n };\n\n\nfunction isEmptyObj( obj ) {\n for ( var prop in obj ) {\n return false;\n }\n prop = null;\n return true;\n}\n\n// -------------------------- CSS3 support -------------------------- //\n\nvar transitionProperty = getStyleProperty('transition');\nvar transformProperty = getStyleProperty('transform');\nvar supportsCSS3 = transitionProperty && transformProperty;\nvar is3d = !!getStyleProperty('perspective');\n\nvar transitionEndEvent = {\n WebkitTransition: 'webkitTransitionEnd',\n MozTransition: 'transitionend',\n OTransition: 'otransitionend',\n transition: 'transitionend'\n}[ transitionProperty ];\n\n// properties that could have vendor prefix\nvar prefixableProperties = [\n 'transform',\n 'transition',\n 'transitionDuration',\n 'transitionProperty'\n];\n\n// cache all vendor properties\nvar vendorProperties = ( function() {\n var cache = {};\n for ( var i=0, len = prefixableProperties.length; i < len; i++ ) {\n var prop = prefixableProperties[i];\n var supportedProp = getStyleProperty( prop );\n if ( supportedProp && supportedProp !== prop ) {\n cache[ prop ] = supportedProp;\n }\n }\n return cache;\n})();\n\n// -------------------------- Item -------------------------- //\n\nfunction Item( element, layout ) {\n if ( !element ) {\n return;\n }\n\n this.element = element;\n // parent layout class, i.e. Masonry, Isotope, or Packery\n this.layout = layout;\n this.position = {\n x: 0,\n y: 0\n };\n\n this._create();\n}\n\n// inherit EventEmitter\nutils.extend( Item.prototype, EventEmitter.prototype );\n\nItem.prototype._create = function() {\n // transition objects\n this._transn = {\n ingProperties: {},\n clean: {},\n onEnd: {}\n };\n\n this.css({\n position: 'absolute'\n });\n};\n\n// trigger specified handler for event type\nItem.prototype.handleEvent = function( event ) {\n var method = 'on' + event.type;\n if ( this[ method ] ) {\n this[ method ]( event );\n }\n};\n\nItem.prototype.getSize = function() {\n this.size = getSize( this.element );\n};\n\n/**\n * apply CSS styles to element\n * @param {Object} style\n */\nItem.prototype.css = function( style ) {\n var elemStyle = this.element.style;\n\n for ( var prop in style ) {\n // use vendor property if available\n var supportedProp = vendorProperties[ prop ] || prop;\n elemStyle[ supportedProp ] = style[ prop ];\n }\n};\n\n // measure position, and sets it\nItem.prototype.getPosition = function() {\n var style = getStyle( this.element );\n var layoutOptions = this.layout.options;\n var isOriginLeft = layoutOptions.isOriginLeft;\n var isOriginTop = layoutOptions.isOriginTop;\n var xValue = style[ isOriginLeft ? 'left' : 'right' ];\n var yValue = style[ isOriginTop ? 'top' : 'bottom' ];\n // convert percent to pixels\n var layoutSize = this.layout.size;\n var x = xValue.indexOf('%') != -1 ?\n ( parseFloat( xValue ) / 100 ) * layoutSize.width : parseInt( xValue, 10 );\n var y = yValue.indexOf('%') != -1 ?\n ( parseFloat( yValue ) / 100 ) * layoutSize.height : parseInt( yValue, 10 );\n\n // clean up 'auto' or other non-integer values\n x = isNaN( x ) ? 0 : x;\n y = isNaN( y ) ? 0 : y;\n // remove padding from measurement\n x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight;\n y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom;\n\n this.position.x = x;\n this.position.y = y;\n};\n\n// set settled position, apply padding\nItem.prototype.layoutPosition = function() {\n var layoutSize = this.layout.size;\n var layoutOptions = this.layout.options;\n var style = {};\n\n // x\n var xPadding = layoutOptions.isOriginLeft ? 'paddingLeft' : 'paddingRight';\n var xProperty = layoutOptions.isOriginLeft ? 'left' : 'right';\n var xResetProperty = layoutOptions.isOriginLeft ? 'right' : 'left';\n\n var x = this.position.x + layoutSize[ xPadding ];\n // set in percentage or pixels\n style[ xProperty ] = this.getXValue( x );\n // reset other property\n style[ xResetProperty ] = '';\n\n // y\n var yPadding = layoutOptions.isOriginTop ? 'paddingTop' : 'paddingBottom';\n var yProperty = layoutOptions.isOriginTop ? 'top' : 'bottom';\n var yResetProperty = layoutOptions.isOriginTop ? 'bottom' : 'top';\n\n var y = this.position.y + layoutSize[ yPadding ];\n // set in percentage or pixels\n style[ yProperty ] = this.getYValue( y );\n // reset other property\n style[ yResetProperty ] = '';\n\n this.css( style );\n this.emitEvent( 'layout', [ this ] );\n};\n\nItem.prototype.getXValue = function( x ) {\n var layoutOptions = this.layout.options;\n return layoutOptions.percentPosition && !layoutOptions.isHorizontal ?\n ( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px';\n};\n\nItem.prototype.getYValue = function( y ) {\n var layoutOptions = this.layout.options;\n return layoutOptions.percentPosition && layoutOptions.isHorizontal ?\n ( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px';\n};\n\n\nItem.prototype._transitionTo = function( x, y ) {\n this.getPosition();\n // get current x & y from top/left\n var curX = this.position.x;\n var curY = this.position.y;\n\n var compareX = parseInt( x, 10 );\n var compareY = parseInt( y, 10 );\n var didNotMove = compareX === this.position.x && compareY === this.position.y;\n\n // save end position\n this.setPosition( x, y );\n\n // if did not move and not transitioning, just go to layout\n if ( didNotMove && !this.isTransitioning ) {\n this.layoutPosition();\n return;\n }\n\n var transX = x - curX;\n var transY = y - curY;\n var transitionStyle = {};\n transitionStyle.transform = this.getTranslate( transX, transY );\n\n this.transition({\n to: transitionStyle,\n onTransitionEnd: {\n transform: this.layoutPosition\n },\n isCleaning: true\n });\n};\n\nItem.prototype.getTranslate = function( x, y ) {\n // flip cooridinates if origin on right or bottom\n var layoutOptions = this.layout.options;\n x = layoutOptions.isOriginLeft ? x : -x;\n y = layoutOptions.isOriginTop ? y : -y;\n\n if ( is3d ) {\n return 'translate3d(' + x + 'px, ' + y + 'px, 0)';\n }\n\n return 'translate(' + x + 'px, ' + y + 'px)';\n};\n\n// non transition + transform support\nItem.prototype.goTo = function( x, y ) {\n this.setPosition( x, y );\n this.layoutPosition();\n};\n\n// use transition and transforms if supported\nItem.prototype.moveTo = supportsCSS3 ?\n Item.prototype._transitionTo : Item.prototype.goTo;\n\nItem.prototype.setPosition = function( x, y ) {\n this.position.x = parseInt( x, 10 );\n this.position.y = parseInt( y, 10 );\n};\n\n// ----- transition ----- //\n\n/**\n * @param {Object} style - CSS\n * @param {Function} onTransitionEnd\n */\n\n// non transition, just trigger callback\nItem.prototype._nonTransition = function( args ) {\n this.css( args.to );\n if ( args.isCleaning ) {\n this._removeStyles( args.to );\n }\n for ( var prop in args.onTransitionEnd ) {\n args.onTransitionEnd[ prop ].call( this );\n }\n};\n\n/**\n * proper transition\n * @param {Object} args - arguments\n * @param {Object} to - style to transition to\n * @param {Object} from - style to start transition from\n * @param {Boolean} isCleaning - removes transition styles after transition\n * @param {Function} onTransitionEnd - callback\n */\nItem.prototype._transition = function( args ) {\n // redirect to nonTransition if no transition duration\n if ( !parseFloat( this.layout.options.transitionDuration ) ) {\n this._nonTransition( args );\n return;\n }\n\n var _transition = this._transn;\n // keep track of onTransitionEnd callback by css property\n for ( var prop in args.onTransitionEnd ) {\n _transition.onEnd[ prop ] = args.onTransitionEnd[ prop ];\n }\n // keep track of properties that are transitioning\n for ( prop in args.to ) {\n _transition.ingProperties[ prop ] = true;\n // keep track of properties to clean up when transition is done\n if ( args.isCleaning ) {\n _transition.clean[ prop ] = true;\n }\n }\n\n // set from styles\n if ( args.from ) {\n this.css( args.from );\n // force redraw. http://blog.alexmaccaw.com/css-transitions\n var h = this.element.offsetHeight;\n // hack for JSHint to hush about unused var\n h = null;\n }\n // enable transition\n this.enableTransition( args.to );\n // set styles that are transitioning\n this.css( args.to );\n\n this.isTransitioning = true;\n\n};\n\n// dash before all cap letters, including first for\n// WebkitTransform => -webkit-transform\nfunction toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}\n\nvar transitionProps = 'opacity,' +\n toDashedAll( vendorProperties.transform || 'transform' );\n\nItem.prototype.enableTransition = function(/* style */) {\n // HACK changing transitionProperty during a transition\n // will cause transition to jump\n if ( this.isTransitioning ) {\n return;\n }\n\n // make `transition: foo, bar, baz` from style object\n // HACK un-comment this when enableTransition can work\n // while a transition is happening\n // var transitionValues = [];\n // for ( var prop in style ) {\n // // dash-ify camelCased properties like WebkitTransition\n // prop = vendorProperties[ prop ] || prop;\n // transitionValues.push( toDashedAll( prop ) );\n // }\n // enable transition styles\n this.css({\n transitionProperty: transitionProps,\n transitionDuration: this.layout.options.transitionDuration\n });\n // listen for transition end event\n this.element.addEventListener( transitionEndEvent, this, false );\n};\n\nItem.prototype.transition = Item.prototype[ transitionProperty ? '_transition' : '_nonTransition' ];\n\n// ----- events ----- //\n\nItem.prototype.onwebkitTransitionEnd = function( event ) {\n this.ontransitionend( event );\n};\n\nItem.prototype.onotransitionend = function( event ) {\n this.ontransitionend( event );\n};\n\n// properties that I munge to make my life easier\nvar dashedVendorProperties = {\n '-webkit-transform': 'transform',\n '-moz-transform': 'transform',\n '-o-transform': 'transform'\n};\n\nItem.prototype.ontransitionend = function( event ) {\n // disregard bubbled events from children\n if ( event.target !== this.element ) {\n return;\n }\n var _transition = this._transn;\n // get property name of transitioned property, convert to prefix-free\n var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName;\n\n // remove property that has completed transitioning\n delete _transition.ingProperties[ propertyName ];\n // check if any properties are still transitioning\n if ( isEmptyObj( _transition.ingProperties ) ) {\n // all properties have completed transitioning\n this.disableTransition();\n }\n // clean style\n if ( propertyName in _transition.clean ) {\n // clean up style\n this.element.style[ event.propertyName ] = '';\n delete _transition.clean[ propertyName ];\n }\n // trigger onTransitionEnd callback\n if ( propertyName in _transition.onEnd ) {\n var onTransitionEnd = _transition.onEnd[ propertyName ];\n onTransitionEnd.call( this );\n delete _transition.onEnd[ propertyName ];\n }\n\n this.emitEvent( 'transitionEnd', [ this ] );\n};\n\nItem.prototype.disableTransition = function() {\n this.removeTransitionStyles();\n this.element.removeEventListener( transitionEndEvent, this, false );\n this.isTransitioning = false;\n};\n\n/**\n * removes style property from element\n * @param {Object} style\n**/\nItem.prototype._removeStyles = function( style ) {\n // clean up transition styles\n var cleanStyle = {};\n for ( var prop in style ) {\n cleanStyle[ prop ] = '';\n }\n this.css( cleanStyle );\n};\n\nvar cleanTransitionStyle = {\n transitionProperty: '',\n transitionDuration: ''\n};\n\nItem.prototype.removeTransitionStyles = function() {\n // remove transition\n this.css( cleanTransitionStyle );\n};\n\n// ----- show/hide/remove ----- //\n\n// remove element from DOM\nItem.prototype.removeElem = function() {\n this.element.parentNode.removeChild( this.element );\n // remove display: none\n this.css({ display: '' });\n this.emitEvent( 'remove', [ this ] );\n};\n\nItem.prototype.remove = function() {\n // just remove element if no transition support or no transition\n if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) {\n this.removeElem();\n return;\n }\n\n // start transition\n var _this = this;\n this.once( 'transitionEnd', function() {\n _this.removeElem();\n });\n this.hide();\n};\n\nItem.prototype.reveal = function() {\n delete this.isHidden;\n // remove display: none\n this.css({ display: '' });\n\n var options = this.layout.options;\n\n var onTransitionEnd = {};\n var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle');\n onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd;\n\n this.transition({\n from: options.hiddenStyle,\n to: options.visibleStyle,\n isCleaning: true,\n onTransitionEnd: onTransitionEnd\n });\n};\n\nItem.prototype.onRevealTransitionEnd = function() {\n // check if still visible\n // during transition, item may have been hidden\n if ( !this.isHidden ) {\n this.emitEvent('reveal');\n }\n};\n\n/**\n * get style property use for hide/reveal transition end\n * @param {String} styleProperty - hiddenStyle/visibleStyle\n * @returns {String}\n */\nItem.prototype.getHideRevealTransitionEndProperty = function( styleProperty ) {\n var optionStyle = this.layout.options[ styleProperty ];\n // use opacity\n if ( optionStyle.opacity ) {\n return 'opacity';\n }\n // get first property\n for ( var prop in optionStyle ) {\n return prop;\n }\n};\n\nItem.prototype.hide = function() {\n // set flag\n this.isHidden = true;\n // remove display: none\n this.css({ display: '' });\n\n var options = this.layout.options;\n\n var onTransitionEnd = {};\n var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle');\n onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd;\n\n this.transition({\n from: options.visibleStyle,\n to: options.hiddenStyle,\n // keep hidden stuff hidden\n isCleaning: true,\n onTransitionEnd: onTransitionEnd\n });\n};\n\nItem.prototype.onHideTransitionEnd = function() {\n // check if still hidden\n // during transition, item may have been un-hidden\n if ( this.isHidden ) {\n this.css({ display: 'none' });\n this.emitEvent('hide');\n }\n};\n\nItem.prototype.destroy = function() {\n this.css({\n position: '',\n left: '',\n right: '',\n top: '',\n bottom: '',\n transition: '',\n transform: ''\n });\n};\n\nreturn Item;\n\n}));\n\n/*!\n * Outlayer v1.4.2\n * the brains and guts of a layout library\n * MIT license\n */\n\n( function( window, factory ) {\n \n // universal module definition\n\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( 'outlayer/outlayer',[\n 'eventie/eventie',\n 'eventEmitter/EventEmitter',\n 'get-size/get-size',\n 'fizzy-ui-utils/utils',\n './item'\n ],\n function( eventie, EventEmitter, getSize, utils, Item ) {\n return factory( window, eventie, EventEmitter, getSize, utils, Item);\n }\n );\n } else if ( typeof exports == 'object' ) {\n // CommonJS\n module.exports = factory(\n window,\n require('eventie'),\n require('wolfy87-eventemitter'),\n require('get-size'),\n require('fizzy-ui-utils'),\n require('./item')\n );\n } else {\n // browser global\n window.Outlayer = factory(\n window,\n window.eventie,\n window.EventEmitter,\n window.getSize,\n window.fizzyUIUtils,\n window.Outlayer.Item\n );\n }\n\n}( window, function factory( window, eventie, EventEmitter, getSize, utils, Item ) {\n\n\n// ----- vars ----- //\n\nvar console = window.console;\nvar jQuery = window.jQuery;\nvar noop = function() {};\n\n// -------------------------- Outlayer -------------------------- //\n\n// globally unique identifiers\nvar GUID = 0;\n// internal store of all Outlayer intances\nvar instances = {};\n\n\n/**\n * @param {Element, String} element\n * @param {Object} options\n * @constructor\n */\nfunction Outlayer( element, options ) {\n var queryElement = utils.getQueryElement( element );\n if ( !queryElement ) {\n if ( console ) {\n console.error( 'Bad element for ' + this.constructor.namespace +\n ': ' + ( queryElement || element ) );\n }\n return;\n }\n this.element = queryElement;\n // add jQuery\n if ( jQuery ) {\n this.$element = jQuery( this.element );\n }\n\n // options\n this.options = utils.extend( {}, this.constructor.defaults );\n this.option( options );\n\n // add id for Outlayer.getFromElement\n var id = ++GUID;\n this.element.outlayerGUID = id; // expando\n instances[ id ] = this; // associate via id\n\n // kick it off\n this._create();\n\n if ( this.options.isInitLayout ) {\n this.layout();\n }\n}\n\n// settings are for internal use only\nOutlayer.namespace = 'outlayer';\nOutlayer.Item = Item;\n\n// default options\nOutlayer.defaults = {\n containerStyle: {\n position: 'relative'\n },\n isInitLayout: true,\n isOriginLeft: true,\n isOriginTop: true,\n isResizeBound: true,\n isResizingContainer: true,\n // item options\n transitionDuration: '0.4s',\n hiddenStyle: {\n opacity: 0,\n transform: 'scale(0.001)'\n },\n visibleStyle: {\n opacity: 1,\n transform: 'scale(1)'\n }\n};\n\n// inherit EventEmitter\nutils.extend( Outlayer.prototype, EventEmitter.prototype );\n\n/**\n * set options\n * @param {Object} opts\n */\nOutlayer.prototype.option = function( opts ) {\n utils.extend( this.options, opts );\n};\n\nOutlayer.prototype._create = function() {\n // get items from children\n this.reloadItems();\n // elements that affect layout, but are not laid out\n this.stamps = [];\n this.stamp( this.options.stamp );\n // set container style\n utils.extend( this.element.style, this.options.containerStyle );\n\n // bind resize method\n if ( this.options.isResizeBound ) {\n this.bindResize();\n }\n};\n\n// goes through all children again and gets bricks in proper order\nOutlayer.prototype.reloadItems = function() {\n // collection of item elements\n this.items = this._itemize( this.element.children );\n};\n\n\n/**\n * turn elements into Outlayer.Items to be used in layout\n * @param {Array or NodeList or HTMLElement} elems\n * @returns {Array} items - collection of new Outlayer Items\n */\nOutlayer.prototype._itemize = function( elems ) {\n\n var itemElems = this._filterFindItemElements( elems );\n var Item = this.constructor.Item;\n\n // create new Outlayer Items for collection\n var items = [];\n for ( var i=0, len = itemElems.length; i < len; i++ ) {\n var elem = itemElems[i];\n var item = new Item( elem, this );\n items.push( item );\n }\n\n return items;\n};\n\n/**\n * get item elements to be used in layout\n * @param {Array or NodeList or HTMLElement} elems\n * @returns {Array} items - item elements\n */\nOutlayer.prototype._filterFindItemElements = function( elems ) {\n return utils.filterFindElements( elems, this.options.itemSelector );\n};\n\n/**\n * getter method for getting item elements\n * @returns {Array} elems - collection of item elements\n */\nOutlayer.prototype.getItemElements = function() {\n var elems = [];\n for ( var i=0, len = this.items.length; i < len; i++ ) {\n elems.push( this.items[i].element );\n }\n return elems;\n};\n\n// ----- init & layout ----- //\n\n/**\n * lays out all items\n */\nOutlayer.prototype.layout = function() {\n this._resetLayout();\n this._manageStamps();\n\n // don't animate first layout\n var isInstant = this.options.isLayoutInstant !== undefined ?\n this.options.isLayoutInstant : !this._isLayoutInited;\n this.layoutItems( this.items, isInstant );\n\n // flag for initalized\n this._isLayoutInited = true;\n};\n\n// _init is alias for layout\nOutlayer.prototype._init = Outlayer.prototype.layout;\n\n/**\n * logic before any new layout\n */\nOutlayer.prototype._resetLayout = function() {\n this.getSize();\n};\n\n\nOutlayer.prototype.getSize = function() {\n this.size = getSize( this.element );\n};\n\n/**\n * get measurement from option, for columnWidth, rowHeight, gutter\n * if option is String -> get element from selector string, & get size of element\n * if option is Element -> get size of element\n * else use option as a number\n *\n * @param {String} measurement\n * @param {String} size - width or height\n * @private\n */\nOutlayer.prototype._getMeasurement = function( measurement, size ) {\n var option = this.options[ measurement ];\n var elem;\n if ( !option ) {\n // default to 0\n this[ measurement ] = 0;\n } else {\n // use option as an element\n if ( typeof option === 'string' ) {\n elem = this.element.querySelector( option );\n } else if ( utils.isElement( option ) ) {\n elem = option;\n }\n // use size of element, if element\n this[ measurement ] = elem ? getSize( elem )[ size ] : option;\n }\n};\n\n/**\n * layout a collection of item elements\n * @api public\n */\nOutlayer.prototype.layoutItems = function( items, isInstant ) {\n items = this._getItemsForLayout( items );\n\n this._layoutItems( items, isInstant );\n\n this._postLayout();\n};\n\n/**\n * get the items to be laid out\n * you may want to skip over some items\n * @param {Array} items\n * @returns {Array} items\n */\nOutlayer.prototype._getItemsForLayout = function( items ) {\n var layoutItems = [];\n for ( var i=0, len = items.length; i < len; i++ ) {\n var item = items[i];\n if ( !item.isIgnored ) {\n layoutItems.push( item );\n }\n }\n return layoutItems;\n};\n\n/**\n * layout items\n * @param {Array} items\n * @param {Boolean} isInstant\n */\nOutlayer.prototype._layoutItems = function( items, isInstant ) {\n this._emitCompleteOnItems( 'layout', items );\n\n if ( !items || !items.length ) {\n // no items, emit event with empty array\n return;\n }\n\n var queue = [];\n\n for ( var i=0, len = items.length; i < len; i++ ) {\n var item = items[i];\n // get x/y object from method\n var position = this._getItemLayoutPosition( item );\n // enqueue\n position.item = item;\n position.isInstant = isInstant || item.isLayoutInstant;\n queue.push( position );\n }\n\n this._processLayoutQueue( queue );\n};\n\n/**\n * get item layout position\n * @param {Outlayer.Item} item\n * @returns {Object} x and y position\n */\nOutlayer.prototype._getItemLayoutPosition = function( /* item */ ) {\n return {\n x: 0,\n y: 0\n };\n};\n\n/**\n * iterate over array and position each item\n * Reason being - separating this logic prevents 'layout invalidation'\n * thx @paul_irish\n * @param {Array} queue\n */\nOutlayer.prototype._processLayoutQueue = function( queue ) {\n for ( var i=0, len = queue.length; i < len; i++ ) {\n var obj = queue[i];\n this._positionItem( obj.item, obj.x, obj.y, obj.isInstant );\n }\n};\n\n/**\n * Sets position of item in DOM\n * @param {Outlayer.Item} item\n * @param {Number} x - horizontal position\n * @param {Number} y - vertical position\n * @param {Boolean} isInstant - disables transitions\n */\nOutlayer.prototype._positionItem = function( item, x, y, isInstant ) {\n if ( isInstant ) {\n // if not transition, just set CSS\n item.goTo( x, y );\n } else {\n item.moveTo( x, y );\n }\n};\n\n/**\n * Any logic you want to do after each layout,\n * i.e. size the container\n */\nOutlayer.prototype._postLayout = function() {\n this.resizeContainer();\n};\n\nOutlayer.prototype.resizeContainer = function() {\n if ( !this.options.isResizingContainer ) {\n return;\n }\n var size = this._getContainerSize();\n if ( size ) {\n this._setContainerMeasure( size.width, true );\n this._setContainerMeasure( size.height, false );\n }\n};\n\n/**\n * Sets width or height of container if returned\n * @returns {Object} size\n * @param {Number} width\n * @param {Number} height\n */\nOutlayer.prototype._getContainerSize = noop;\n\n/**\n * @param {Number} measure - size of width or height\n * @param {Boolean} isWidth\n */\nOutlayer.prototype._setContainerMeasure = function( measure, isWidth ) {\n if ( measure === undefined ) {\n return;\n }\n\n var elemSize = this.size;\n // add padding and border width if border box\n if ( elemSize.isBorderBox ) {\n measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight +\n elemSize.borderLeftWidth + elemSize.borderRightWidth :\n elemSize.paddingBottom + elemSize.paddingTop +\n elemSize.borderTopWidth + elemSize.borderBottomWidth;\n }\n\n measure = Math.max( measure, 0 );\n this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px';\n};\n\n/**\n * emit eventComplete on a collection of items events\n * @param {String} eventName\n * @param {Array} items - Outlayer.Items\n */\nOutlayer.prototype._emitCompleteOnItems = function( eventName, items ) {\n var _this = this;\n function onComplete() {\n _this.dispatchEvent( eventName + 'Complete', null, [ items ] );\n }\n\n var count = items.length;\n if ( !items || !count ) {\n onComplete();\n return;\n }\n\n var doneCount = 0;\n function tick() {\n doneCount++;\n if ( doneCount === count ) {\n onComplete();\n }\n }\n\n // bind callback\n for ( var i=0, len = items.length; i < len; i++ ) {\n var item = items[i];\n item.once( eventName, tick );\n }\n};\n\n/**\n * emits events via eventEmitter and jQuery events\n * @param {String} type - name of event\n * @param {Event} event - original event\n * @param {Array} args - extra arguments\n */\nOutlayer.prototype.dispatchEvent = function( type, event, args ) {\n // add original event to arguments\n var emitArgs = event ? [ event ].concat( args ) : args;\n this.emitEvent( type, emitArgs );\n\n if ( jQuery ) {\n // set this.$element\n this.$element = this.$element || jQuery( this.element );\n if ( event ) {\n // create jQuery event\n var $event = jQuery.Event( event );\n $event.type = type;\n this.$element.trigger( $event, args );\n } else {\n // just trigger with type if no event available\n this.$element.trigger( type, args );\n }\n }\n};\n\n// -------------------------- ignore & stamps -------------------------- //\n\n\n/**\n * keep item in collection, but do not lay it out\n * ignored items do not get skipped in layout\n * @param {Element} elem\n */\nOutlayer.prototype.ignore = function( elem ) {\n var item = this.getItem( elem );\n if ( item ) {\n item.isIgnored = true;\n }\n};\n\n/**\n * return item to layout collection\n * @param {Element} elem\n */\nOutlayer.prototype.unignore = function( elem ) {\n var item = this.getItem( elem );\n if ( item ) {\n delete item.isIgnored;\n }\n};\n\n/**\n * adds elements to stamps\n * @param {NodeList, Array, Element, or String} elems\n */\nOutlayer.prototype.stamp = function( elems ) {\n elems = this._find( elems );\n if ( !elems ) {\n return;\n }\n\n this.stamps = this.stamps.concat( elems );\n // ignore\n for ( var i=0, len = elems.length; i < len; i++ ) {\n var elem = elems[i];\n this.ignore( elem );\n }\n};\n\n/**\n * removes elements to stamps\n * @param {NodeList, Array, or Element} elems\n */\nOutlayer.prototype.unstamp = function( elems ) {\n elems = this._find( elems );\n if ( !elems ){\n return;\n }\n\n for ( var i=0, len = elems.length; i < len; i++ ) {\n var elem = elems[i];\n // filter out removed stamp elements\n utils.removeFrom( this.stamps, elem );\n this.unignore( elem );\n }\n\n};\n\n/**\n * finds child elements\n * @param {NodeList, Array, Element, or String} elems\n * @returns {Array} elems\n */\nOutlayer.prototype._find = function( elems ) {\n if ( !elems ) {\n return;\n }\n // if string, use argument as selector string\n if ( typeof elems === 'string' ) {\n elems = this.element.querySelectorAll( elems );\n }\n elems = utils.makeArray( elems );\n return elems;\n};\n\nOutlayer.prototype._manageStamps = function() {\n if ( !this.stamps || !this.stamps.length ) {\n return;\n }\n\n this._getBoundingRect();\n\n for ( var i=0, len = this.stamps.length; i < len; i++ ) {\n var stamp = this.stamps[i];\n this._manageStamp( stamp );\n }\n};\n\n// update boundingLeft / Top\nOutlayer.prototype._getBoundingRect = function() {\n // get bounding rect for container element\n var boundingRect = this.element.getBoundingClientRect();\n var size = this.size;\n this._boundingRect = {\n left: boundingRect.left + size.paddingLeft + size.borderLeftWidth,\n top: boundingRect.top + size.paddingTop + size.borderTopWidth,\n right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ),\n bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth )\n };\n};\n\n/**\n * @param {Element} stamp\n**/\nOutlayer.prototype._manageStamp = noop;\n\n/**\n * get x/y position of element relative to container element\n * @param {Element} elem\n * @returns {Object} offset - has left, top, right, bottom\n */\nOutlayer.prototype._getElementOffset = function( elem ) {\n var boundingRect = elem.getBoundingClientRect();\n var thisRect = this._boundingRect;\n var size = getSize( elem );\n var offset = {\n left: boundingRect.left - thisRect.left - size.marginLeft,\n top: boundingRect.top - thisRect.top - size.marginTop,\n right: thisRect.right - boundingRect.right - size.marginRight,\n bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom\n };\n return offset;\n};\n\n// -------------------------- resize -------------------------- //\n\n// enable event handlers for listeners\n// i.e. resize -> onresize\nOutlayer.prototype.handleEvent = function( event ) {\n var method = 'on' + event.type;\n if ( this[ method ] ) {\n this[ method ]( event );\n }\n};\n\n/**\n * Bind layout to window resizing\n */\nOutlayer.prototype.bindResize = function() {\n // bind just one listener\n if ( this.isResizeBound ) {\n return;\n }\n window.eventie.bind( window, 'resize', this );\n this.isResizeBound = true;\n};\n\n/**\n * Unbind layout to window resizing\n */\nOutlayer.prototype.unbindResize = function() {\n if ( this.isResizeBound ) {\n window.eventie.unbind( window, 'resize', this );\n }\n this.isResizeBound = false;\n};\n\n// original debounce by John Hann\n// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/\n\n// this fires every resize\nOutlayer.prototype.onresize = function() {\n if ( this.resizeTimeout ) {\n clearTimeout( this.resizeTimeout );\n }\n\n var _this = this;\n function delayed() {\n _this.resize();\n delete _this.resizeTimeout;\n }\n\n this.resizeTimeout = setTimeout( delayed, 100 );\n};\n\n// debounced, layout on resize\nOutlayer.prototype.resize = function() {\n // don't trigger if size did not change\n // or if resize was unbound. See #9\n if ( !this.isResizeBound || !this.needsResizeLayout() ) {\n return;\n }\n\n this.layout();\n};\n\n/**\n * check if layout is needed post layout\n * @returns Boolean\n */\nOutlayer.prototype.needsResizeLayout = function() {\n var size = getSize( this.element );\n // check that this.size and size are there\n // IE8 triggers resize on body size change, so they might not be\n var hasSizes = this.size && size;\n return hasSizes && size.innerWidth !== this.size.innerWidth;\n};\n\n// -------------------------- methods -------------------------- //\n\n/**\n * add items to Outlayer instance\n * @param {Array or NodeList or Element} elems\n * @returns {Array} items - Outlayer.Items\n**/\nOutlayer.prototype.addItems = function( elems ) {\n var items = this._itemize( elems );\n // add items to collection\n if ( items.length ) {\n this.items = this.items.concat( items );\n }\n return items;\n};\n\n/**\n * Layout newly-appended item elements\n * @param {Array or NodeList or Element} elems\n */\nOutlayer.prototype.appended = function( elems ) {\n var items = this.addItems( elems );\n if ( !items.length ) {\n return;\n }\n // layout and reveal just the new items\n this.layoutItems( items, true );\n this.reveal( items );\n};\n\n/**\n * Layout prepended elements\n * @param {Array or NodeList or Element} elems\n */\nOutlayer.prototype.prepended = function( elems ) {\n var items = this._itemize( elems );\n if ( !items.length ) {\n return;\n }\n // add items to beginning of collection\n var previousItems = this.items.slice(0);\n this.items = items.concat( previousItems );\n // start new layout\n this._resetLayout();\n this._manageStamps();\n // layout new stuff without transition\n this.layoutItems( items, true );\n this.reveal( items );\n // layout previous items\n this.layoutItems( previousItems );\n};\n\n/**\n * reveal a collection of items\n * @param {Array of Outlayer.Items} items\n */\nOutlayer.prototype.reveal = function( items ) {\n this._emitCompleteOnItems( 'reveal', items );\n\n var len = items && items.length;\n for ( var i=0; len && i < len; i++ ) {\n var item = items[i];\n item.reveal();\n }\n};\n\n/**\n * hide a collection of items\n * @param {Array of Outlayer.Items} items\n */\nOutlayer.prototype.hide = function( items ) {\n this._emitCompleteOnItems( 'hide', items );\n\n var len = items && items.length;\n for ( var i=0; len && i < len; i++ ) {\n var item = items[i];\n item.hide();\n }\n};\n\n/**\n * reveal item elements\n * @param {Array}, {Element}, {NodeList} items\n */\nOutlayer.prototype.revealItemElements = function( elems ) {\n var items = this.getItems( elems );\n this.reveal( items );\n};\n\n/**\n * hide item elements\n * @param {Array}, {Element}, {NodeList} items\n */\nOutlayer.prototype.hideItemElements = function( elems ) {\n var items = this.getItems( elems );\n this.hide( items );\n};\n\n/**\n * get Outlayer.Item, given an Element\n * @param {Element} elem\n * @param {Function} callback\n * @returns {Outlayer.Item} item\n */\nOutlayer.prototype.getItem = function( elem ) {\n // loop through items to get the one that matches\n for ( var i=0, len = this.items.length; i < len; i++ ) {\n var item = this.items[i];\n if ( item.element === elem ) {\n // return item\n return item;\n }\n }\n};\n\n/**\n * get collection of Outlayer.Items, given Elements\n * @param {Array} elems\n * @returns {Array} items - Outlayer.Items\n */\nOutlayer.prototype.getItems = function( elems ) {\n elems = utils.makeArray( elems );\n var items = [];\n for ( var i=0, len = elems.length; i < len; i++ ) {\n var elem = elems[i];\n var item = this.getItem( elem );\n if ( item ) {\n items.push( item );\n }\n }\n\n return items;\n};\n\n/**\n * remove element(s) from instance and DOM\n * @param {Array or NodeList or Element} elems\n */\nOutlayer.prototype.remove = function( elems ) {\n var removeItems = this.getItems( elems );\n\n this._emitCompleteOnItems( 'remove', removeItems );\n\n // bail if no items to remove\n if ( !removeItems || !removeItems.length ) {\n return;\n }\n\n for ( var i=0, len = removeItems.length; i < len; i++ ) {\n var item = removeItems[i];\n item.remove();\n // remove item from collection\n utils.removeFrom( this.items, item );\n }\n};\n\n// ----- destroy ----- //\n\n// remove and disable Outlayer instance\nOutlayer.prototype.destroy = function() {\n // clean up dynamic styles\n var style = this.element.style;\n style.height = '';\n style.position = '';\n style.width = '';\n // destroy items\n for ( var i=0, len = this.items.length; i < len; i++ ) {\n var item = this.items[i];\n item.destroy();\n }\n\n this.unbindResize();\n\n var id = this.element.outlayerGUID;\n delete instances[ id ]; // remove reference to instance by id\n delete this.element.outlayerGUID;\n // remove data for jQuery\n if ( jQuery ) {\n jQuery.removeData( this.element, this.constructor.namespace );\n }\n\n};\n\n// -------------------------- data -------------------------- //\n\n/**\n * get Outlayer instance from element\n * @param {Element} elem\n * @returns {Outlayer}\n */\nOutlayer.data = function( elem ) {\n elem = utils.getQueryElement( elem );\n var id = elem && elem.outlayerGUID;\n return id && instances[ id ];\n};\n\n\n// -------------------------- create Outlayer class -------------------------- //\n\n/**\n * create a layout class\n * @param {String} namespace\n */\nOutlayer.create = function( namespace, options ) {\n // sub-class Outlayer\n function Layout() {\n Outlayer.apply( this, arguments );\n }\n // inherit Outlayer prototype, use Object.create if there\n if ( Object.create ) {\n Layout.prototype = Object.create( Outlayer.prototype );\n } else {\n utils.extend( Layout.prototype, Outlayer.prototype );\n }\n // set contructor, used for namespace and Item\n Layout.prototype.constructor = Layout;\n\n Layout.defaults = utils.extend( {}, Outlayer.defaults );\n // apply new options\n utils.extend( Layout.defaults, options );\n // keep prototype.settings for backwards compatibility (Packery v1.2.0)\n Layout.prototype.settings = {};\n\n Layout.namespace = namespace;\n\n Layout.data = Outlayer.data;\n\n // sub-class Item\n Layout.Item = function LayoutItem() {\n Item.apply( this, arguments );\n };\n\n Layout.Item.prototype = new Item();\n\n // -------------------------- declarative -------------------------- //\n\n utils.htmlInit( Layout, namespace );\n\n // -------------------------- jQuery bridge -------------------------- //\n\n // make into jQuery plugin\n if ( jQuery && jQuery.bridget ) {\n jQuery.bridget( namespace, Layout );\n }\n\n return Layout;\n};\n\n// ----- fin ----- //\n\n// back in global\nOutlayer.Item = Item;\n\nreturn Outlayer;\n\n}));\n\n\n/**\n * Rect\n * low-level utility class for basic geometry\n */\n\n( function( window, factory ) {\n \n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( 'packery/js/rect',factory );\n } else if ( typeof exports == 'object' ) {\n // CommonJS\n module.exports = factory();\n } else {\n // browser global\n window.Packery = window.Packery || {};\n window.Packery.Rect = factory();\n }\n\n}( window, function factory() {\n\n\n// -------------------------- Packery -------------------------- //\n\n// global namespace\nvar Packery = window.Packery = function() {};\n\n// -------------------------- Rect -------------------------- //\n\nfunction Rect( props ) {\n // extend properties from defaults\n for ( var prop in Rect.defaults ) {\n this[ prop ] = Rect.defaults[ prop ];\n }\n\n for ( prop in props ) {\n this[ prop ] = props[ prop ];\n }\n\n}\n\n// make available\nPackery.Rect = Rect;\n\nRect.defaults = {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n};\n\n/**\n * Determines whether or not this rectangle wholly encloses another rectangle or point.\n * @param {Rect} rect\n * @returns {Boolean}\n**/\nRect.prototype.contains = function( rect ) {\n // points don't have width or height\n var otherWidth = rect.width || 0;\n var otherHeight = rect.height || 0;\n return this.x <= rect.x &&\n this.y <= rect.y &&\n this.x + this.width >= rect.x + otherWidth &&\n this.y + this.height >= rect.y + otherHeight;\n};\n\n/**\n * Determines whether or not the rectangle intersects with another.\n * @param {Rect} rect\n * @returns {Boolean}\n**/\nRect.prototype.overlaps = function( rect ) {\n var thisRight = this.x + this.width;\n var thisBottom = this.y + this.height;\n var rectRight = rect.x + rect.width;\n var rectBottom = rect.y + rect.height;\n\n // http://stackoverflow.com/a/306332\n return this.x < rectRight &&\n thisRight > rect.x &&\n this.y < rectBottom &&\n thisBottom > rect.y;\n};\n\n/**\n * @param {Rect} rect - the overlapping rect\n * @returns {Array} freeRects - rects representing the area around the rect\n**/\nRect.prototype.getMaximalFreeRects = function( rect ) {\n\n // if no intersection, return false\n if ( !this.overlaps( rect ) ) {\n return false;\n }\n\n var freeRects = [];\n var freeRect;\n\n var thisRight = this.x + this.width;\n var thisBottom = this.y + this.height;\n var rectRight = rect.x + rect.width;\n var rectBottom = rect.y + rect.height;\n\n // top\n if ( this.y < rect.y ) {\n freeRect = new Rect({\n x: this.x,\n y: this.y,\n width: this.width,\n height: rect.y - this.y\n });\n freeRects.push( freeRect );\n }\n\n // right\n if ( thisRight > rectRight ) {\n freeRect = new Rect({\n x: rectRight,\n y: this.y,\n width: thisRight - rectRight,\n height: this.height\n });\n freeRects.push( freeRect );\n }\n\n // bottom\n if ( thisBottom > rectBottom ) {\n freeRect = new Rect({\n x: this.x,\n y: rectBottom,\n width: this.width,\n height: thisBottom - rectBottom\n });\n freeRects.push( freeRect );\n }\n\n // left\n if ( this.x < rect.x ) {\n freeRect = new Rect({\n x: this.x,\n y: this.y,\n width: rect.x - this.x,\n height: this.height\n });\n freeRects.push( freeRect );\n }\n\n return freeRects;\n};\n\nRect.prototype.canFit = function( rect ) {\n return this.width >= rect.width && this.height >= rect.height;\n};\n\nreturn Rect;\n\n}));\n\n/**\n * Packer\n * bin-packing algorithm\n */\n\n( function( window, factory ) {\n \n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( 'packery/js/packer',[ './rect' ], factory );\n } else if ( typeof exports == 'object' ) {\n // CommonJS\n module.exports = factory(\n require('./rect')\n );\n } else {\n // browser global\n var Packery = window.Packery = window.Packery || {};\n Packery.Packer = factory( Packery.Rect );\n }\n\n}( window, function factory( Rect ) {\n\n\n// -------------------------- Packer -------------------------- //\n\n/**\n * @param {Number} width\n * @param {Number} height\n * @param {String} sortDirection\n * topLeft for vertical, leftTop for horizontal\n */\nfunction Packer( width, height, sortDirection ) {\n this.width = width || 0;\n this.height = height || 0;\n this.sortDirection = sortDirection || 'downwardLeftToRight';\n\n this.reset();\n}\n\nPacker.prototype.reset = function() {\n this.spaces = [];\n this.newSpaces = [];\n\n var initialSpace = new Rect({\n x: 0,\n y: 0,\n width: this.width,\n height: this.height\n });\n\n this.spaces.push( initialSpace );\n // set sorter\n this.sorter = sorters[ this.sortDirection ] || sorters.downwardLeftToRight;\n};\n\n// change x and y of rect to fit with in Packer's available spaces\nPacker.prototype.pack = function( rect ) {\n for ( var i=0, len = this.spaces.length; i < len; i++ ) {\n var space = this.spaces[i];\n if ( space.canFit( rect ) ) {\n this.placeInSpace( rect, space );\n break;\n }\n }\n};\n\nPacker.prototype.placeInSpace = function( rect, space ) {\n // place rect in space\n rect.x = space.x;\n rect.y = space.y;\n\n this.placed( rect );\n};\n\n// update spaces with placed rect\nPacker.prototype.placed = function( rect ) {\n // update spaces\n var revisedSpaces = [];\n for ( var i=0, len = this.spaces.length; i < len; i++ ) {\n var space = this.spaces[i];\n var newSpaces = space.getMaximalFreeRects( rect );\n // add either the original space or the new spaces to the revised spaces\n if ( newSpaces ) {\n revisedSpaces.push.apply( revisedSpaces, newSpaces );\n } else {\n revisedSpaces.push( space );\n }\n }\n\n this.spaces = revisedSpaces;\n\n this.mergeSortSpaces();\n};\n\nPacker.prototype.mergeSortSpaces = function() {\n // remove redundant spaces\n Packer.mergeRects( this.spaces );\n this.spaces.sort( this.sorter );\n};\n\n// add a space back\nPacker.prototype.addSpace = function( rect ) {\n this.spaces.push( rect );\n this.mergeSortSpaces();\n};\n\n// -------------------------- utility functions -------------------------- //\n\n/**\n * Remove redundant rectangle from array of rectangles\n * @param {Array} rects: an array of Rects\n * @returns {Array} rects: an array of Rects\n**/\nPacker.mergeRects = function( rects ) {\n for ( var i=0, len = rects.length; i < len; i++ ) {\n var rect = rects[i];\n // skip over this rect if it was already removed\n if ( !rect ) {\n continue;\n }\n // clone rects we're testing, remove this rect\n var compareRects = rects.slice(0);\n // do not compare with self\n compareRects.splice( i, 1 );\n // compare this rect with others\n var removedCount = 0;\n for ( var j=0, jLen = compareRects.length; j < jLen; j++ ) {\n var compareRect = compareRects[j];\n // if this rect contains another,\n // remove that rect from test collection\n var indexAdjust = i > j ? 0 : 1;\n if ( rect.contains( compareRect ) ) {\n // console.log( 'current test rects:' + testRects.length, testRects );\n // console.log( i, j, indexAdjust, rect, compareRect );\n rects.splice( j + indexAdjust - removedCount, 1 );\n removedCount++;\n }\n }\n }\n\n return rects;\n};\n\n\n// -------------------------- sorters -------------------------- //\n\n// functions for sorting rects in order\nvar sorters = {\n // top down, then left to right\n downwardLeftToRight: function( a, b ) {\n return a.y - b.y || a.x - b.x;\n },\n // left to right, then top down\n rightwardTopToBottom: function( a, b ) {\n return a.x - b.x || a.y - b.y;\n }\n};\n\n\n// -------------------------- -------------------------- //\n\nreturn Packer;\n\n}));\n/**\n * Packery Item Element\n**/\n\n( function( window, factory ) {\n \n // universal module definition\n\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( 'packery/js/item',[\n 'get-style-property/get-style-property',\n 'outlayer/outlayer',\n './rect'\n ],\n factory );\n } else if ( typeof exports == 'object' ) {\n // CommonJS\n module.exports = factory(\n require('desandro-get-style-property'),\n require('outlayer'),\n require('./rect')\n );\n } else {\n // browser global\n window.Packery.Item = factory(\n window.getStyleProperty,\n window.Outlayer,\n window.Packery.Rect\n );\n }\n\n}( window, function factory( getStyleProperty, Outlayer, Rect ) {\n\n\n// -------------------------- Item -------------------------- //\n\nvar transformProperty = getStyleProperty('transform');\n\n// sub-class Item\nvar Item = function PackeryItem() {\n Outlayer.Item.apply( this, arguments );\n};\n\nItem.prototype = new Outlayer.Item();\n\nvar protoCreate = Item.prototype._create;\nItem.prototype._create = function() {\n // call default _create logic\n protoCreate.call( this );\n this.rect = new Rect();\n // rect used for placing, in drag or Packery.fit()\n this.placeRect = new Rect();\n};\n\n// -------------------------- drag -------------------------- //\n\nItem.prototype.dragStart = function() {\n this.getPosition();\n this.removeTransitionStyles();\n // remove transform property from transition\n if ( this.isTransitioning && transformProperty ) {\n this.element.style[ transformProperty ] = 'none';\n }\n this.getSize();\n // create place rect, used for position when dragged then dropped\n // or when positioning\n this.isPlacing = true;\n this.needsPositioning = false;\n this.positionPlaceRect( this.position.x, this.position.y );\n this.isTransitioning = false;\n this.didDrag = false;\n};\n\n/**\n * handle item when it is dragged\n * @param {Number} x - horizontal position of dragged item\n * @param {Number} y - vertical position of dragged item\n */\nItem.prototype.dragMove = function( x, y ) {\n this.didDrag = true;\n var packerySize = this.layout.size;\n x -= packerySize.paddingLeft;\n y -= packerySize.paddingTop;\n this.positionPlaceRect( x, y );\n};\n\nItem.prototype.dragStop = function() {\n this.getPosition();\n var isDiffX = this.position.x != this.placeRect.x;\n var isDiffY = this.position.y != this.placeRect.y;\n // set post-drag positioning flag\n this.needsPositioning = isDiffX || isDiffY;\n // reset flag\n this.didDrag = false;\n};\n\n// -------------------------- placing -------------------------- //\n\n/**\n * position a rect that will occupy space in the packer\n * @param {Number} x\n * @param {Number} y\n * @param {Boolean} isMaxYContained\n */\nItem.prototype.positionPlaceRect = function( x, y, isMaxYOpen ) {\n this.placeRect.x = this.getPlaceRectCoord( x, true );\n this.placeRect.y = this.getPlaceRectCoord( y, false, isMaxYOpen );\n};\n\n/**\n * get x/y coordinate for place rect\n * @param {Number} coord - x or y\n * @param {Boolean} isX\n * @param {Boolean} isMaxOpen - does not limit value to outer bound\n * @returns {Number} coord - processed x or y\n */\nItem.prototype.getPlaceRectCoord = function( coord, isX, isMaxOpen ) {\n var measure = isX ? 'Width' : 'Height';\n var size = this.size[ 'outer' + measure ];\n var segment = this.layout[ isX ? 'columnWidth' : 'rowHeight' ];\n var parentSize = this.layout.size[ 'inner' + measure ];\n\n // additional parentSize calculations for Y\n if ( !isX ) {\n parentSize = Math.max( parentSize, this.layout.maxY );\n // prevent gutter from bumping up height when non-vertical grid\n if ( !this.layout.rowHeight ) {\n parentSize -= this.layout.gutter;\n }\n }\n\n var max;\n\n if ( segment ) {\n segment += this.layout.gutter;\n // allow for last column to reach the edge\n parentSize += isX ? this.layout.gutter : 0;\n // snap to closest segment\n coord = Math.round( coord / segment );\n // contain to outer bound\n // contain non-growing bound, allow growing bound to grow\n var mathMethod;\n if ( this.layout.options.isHorizontal ) {\n mathMethod = !isX ? 'floor' : 'ceil';\n } else {\n mathMethod = isX ? 'floor' : 'ceil';\n }\n var maxSegments = Math[ mathMethod ]( parentSize / segment );\n maxSegments -= Math.ceil( size / segment );\n max = maxSegments;\n } else {\n max = parentSize - size;\n }\n\n coord = isMaxOpen ? coord : Math.min( coord, max );\n coord *= segment || 1;\n\n return Math.max( 0, coord );\n};\n\nItem.prototype.copyPlaceRectPosition = function() {\n this.rect.x = this.placeRect.x;\n this.rect.y = this.placeRect.y;\n};\n\n// ----- ----- //\n\n// remove element from DOM\nItem.prototype.removeElem = function() {\n this.element.parentNode.removeChild( this.element );\n // add space back to packer\n this.layout.packer.addSpace( this.rect );\n this.emitEvent( 'remove', [ this ] );\n};\n\n// ----- ----- //\n\nreturn Item;\n\n}));\n\n/*!\n * Packery v1.4.3\n * bin-packing layout library\n *\n * Licensed GPLv3 for open source use\n * or Flickity Commercial License for commercial use\n *\n * http://packery.metafizzy.co\n * Copyright 2015 Metafizzy\n */\n\n( function( window, factory ) {\n \n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n 'classie/classie',\n 'get-size/get-size',\n 'outlayer/outlayer',\n 'packery/js/rect',\n 'packery/js/packer',\n 'packery/js/item'\n ],\n factory );\n } else if ( typeof exports == 'object' ) {\n // CommonJS\n module.exports = factory(\n require('desandro-classie'),\n require('get-size'),\n require('outlayer'),\n require('./rect'),\n require('./packer'),\n require('./item')\n );\n } else {\n // browser global\n window.Packery = factory(\n window.classie,\n window.getSize,\n window.Outlayer,\n window.Packery.Rect,\n window.Packery.Packer,\n window.Packery.Item\n );\n }\n\n}( window, function factory( classie, getSize, Outlayer, Rect, Packer, Item ) {\n\n\n// ----- Rect ----- //\n\n// allow for pixel rounding errors IE8-IE11 & Firefox; #227\nRect.prototype.canFit = function( rect ) {\n return this.width >= rect.width - 1 && this.height >= rect.height - 1;\n};\n\n// -------------------------- Packery -------------------------- //\n\n// create an Outlayer layout class\nvar Packery = Outlayer.create('packery');\nPackery.Item = Item;\n\nPackery.prototype._create = function() {\n // call super\n Outlayer.prototype._create.call( this );\n\n // initial properties\n this.packer = new Packer();\n\n // Left over from v1.0\n this.stamp( this.options.stamped );\n\n // create drag handlers\n var _this = this;\n this.handleDraggabilly = {\n dragStart: function() {\n _this.itemDragStart( this.element );\n },\n dragMove: function() {\n _this.itemDragMove( this.element, this.position.x, this.position.y );\n },\n dragEnd: function() {\n _this.itemDragEnd( this.element );\n }\n };\n\n this.handleUIDraggable = {\n start: function handleUIDraggableStart( event, ui ) {\n // HTML5 may trigger dragstart, dismiss HTML5 dragging\n if ( !ui ) {\n return;\n }\n _this.itemDragStart( event.currentTarget );\n },\n drag: function handleUIDraggableDrag( event, ui ) {\n if ( !ui ) {\n return;\n }\n _this.itemDragMove( event.currentTarget, ui.position.left, ui.position.top );\n },\n stop: function handleUIDraggableStop( event, ui ) {\n if ( !ui ) {\n return;\n }\n _this.itemDragEnd( event.currentTarget );\n }\n };\n\n};\n\n\n// ----- init & layout ----- //\n\n/**\n * logic before any new layout\n */\nPackery.prototype._resetLayout = function() {\n this.getSize();\n\n this._getMeasurements();\n\n // reset packer\n var packer = this.packer;\n // packer settings, if horizontal or vertical\n if ( this.options.isHorizontal ) {\n packer.width = Number.POSITIVE_INFINITY;\n packer.height = this.size.innerHeight + this.gutter;\n packer.sortDirection = 'rightwardTopToBottom';\n } else {\n packer.width = this.size.innerWidth + this.gutter;\n packer.height = Number.POSITIVE_INFINITY;\n packer.sortDirection = 'downwardLeftToRight';\n }\n\n packer.reset();\n\n // layout\n this.maxY = 0;\n this.maxX = 0;\n};\n\n/**\n * update columnWidth, rowHeight, & gutter\n * @private\n */\nPackery.prototype._getMeasurements = function() {\n this._getMeasurement( 'columnWidth', 'width' );\n this._getMeasurement( 'rowHeight', 'height' );\n this._getMeasurement( 'gutter', 'width' );\n};\n\nPackery.prototype._getItemLayoutPosition = function( item ) {\n this._packItem( item );\n return item.rect;\n};\n\n\n/**\n * layout item in packer\n * @param {Packery.Item} item\n */\nPackery.prototype._packItem = function( item ) {\n this._setRectSize( item.element, item.rect );\n // pack the rect in the packer\n this.packer.pack( item.rect );\n this._setMaxXY( item.rect );\n};\n\n/**\n * set max X and Y value, for size of container\n * @param {Packery.Rect} rect\n * @private\n */\nPackery.prototype._setMaxXY = function( rect ) {\n this.maxX = Math.max( rect.x + rect.width, this.maxX );\n this.maxY = Math.max( rect.y + rect.height, this.maxY );\n};\n\n/**\n * set the width and height of a rect, applying columnWidth and rowHeight\n * @param {Element} elem\n * @param {Packery.Rect} rect\n */\nPackery.prototype._setRectSize = function( elem, rect ) {\n var size = getSize( elem );\n var w = size.outerWidth;\n var h = size.outerHeight;\n // size for columnWidth and rowHeight, if available\n // only check if size is non-zero, #177\n if ( w || h ) {\n w = this._applyGridGutter( w, this.columnWidth );\n h = this._applyGridGutter( h, this.rowHeight );\n }\n // rect must fit in packer\n rect.width = Math.min( w, this.packer.width );\n rect.height = Math.min( h, this.packer.height );\n};\n\n/**\n * fits item to columnWidth/rowHeight and adds gutter\n * @param {Number} measurement - item width or height\n * @param {Number} gridSize - columnWidth or rowHeight\n * @returns measurement\n */\nPackery.prototype._applyGridGutter = function( measurement, gridSize ) {\n // just add gutter if no gridSize\n if ( !gridSize ) {\n return measurement + this.gutter;\n }\n gridSize += this.gutter;\n // fit item to columnWidth/rowHeight\n var remainder = measurement % gridSize;\n var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil';\n measurement = Math[ mathMethod ]( measurement / gridSize ) * gridSize;\n return measurement;\n};\n\nPackery.prototype._getContainerSize = function() {\n if ( this.options.isHorizontal ) {\n return {\n width: this.maxX - this.gutter\n };\n } else {\n return {\n height: this.maxY - this.gutter\n };\n }\n};\n\n\n// -------------------------- stamp -------------------------- //\n\n/**\n * makes space for element\n * @param {Element} elem\n */\nPackery.prototype._manageStamp = function( elem ) {\n\n var item = this.getItem( elem );\n var rect;\n if ( item && item.isPlacing ) {\n rect = item.placeRect;\n } else {\n var offset = this._getElementOffset( elem );\n rect = new Rect({\n x: this.options.isOriginLeft ? offset.left : offset.right,\n y: this.options.isOriginTop ? offset.top : offset.bottom\n });\n }\n\n this._setRectSize( elem, rect );\n // save its space in the packer\n this.packer.placed( rect );\n this._setMaxXY( rect );\n};\n\n// -------------------------- methods -------------------------- //\n\nfunction verticalSorter( a, b ) {\n return a.position.y - b.position.y || a.position.x - b.position.x;\n}\n\nfunction horizontalSorter( a, b ) {\n return a.position.x - b.position.x || a.position.y - b.position.y;\n}\n\nPackery.prototype.sortItemsByPosition = function() {\n var sorter = this.options.isHorizontal ? horizontalSorter : verticalSorter;\n this.items.sort( sorter );\n};\n\n/**\n * Fit item element in its current position\n * Packery will position elements around it\n * useful for expanding elements\n *\n * @param {Element} elem\n * @param {Number} x - horizontal destination position, optional\n * @param {Number} y - vertical destination position, optional\n */\nPackery.prototype.fit = function( elem, x, y ) {\n var item = this.getItem( elem );\n if ( !item ) {\n return;\n }\n\n // prepare internal properties\n this._getMeasurements();\n\n // stamp item to get it out of layout\n this.stamp( item.element );\n // required for positionPlaceRect\n item.getSize();\n // set placing flag\n item.isPlacing = true;\n // fall back to current position for fitting\n x = x === undefined ? item.rect.x: x;\n y = y === undefined ? item.rect.y: y;\n\n // position it best at its destination\n item.positionPlaceRect( x, y, true );\n\n this._bindFitEvents( item );\n item.moveTo( item.placeRect.x, item.placeRect.y );\n // layout everything else\n this.layout();\n\n // return back to regularly scheduled programming\n this.unstamp( item.element );\n this.sortItemsByPosition();\n // un set placing flag, back to normal\n item.isPlacing = false;\n // copy place rect position\n item.copyPlaceRectPosition();\n};\n\n/**\n * emit event when item is fit and other items are laid out\n * @param {Packery.Item} item\n * @private\n */\nPackery.prototype._bindFitEvents = function( item ) {\n var _this = this;\n var ticks = 0;\n function tick() {\n ticks++;\n if ( ticks != 2 ) {\n return;\n }\n _this.dispatchEvent( 'fitComplete', null, [ item ] );\n }\n // when item is laid out\n item.on( 'layout', function() {\n tick();\n return true;\n });\n // when all items are laid out\n this.on( 'layoutComplete', function() {\n tick();\n return true;\n });\n};\n\n// -------------------------- resize -------------------------- //\n\n// debounced, layout on resize\nPackery.prototype.resize = function() {\n // don't trigger if size did not change\n var size = getSize( this.element );\n // check that this.size and size are there\n // IE8 triggers resize on body size change, so they might not be\n var hasSizes = this.size && size;\n var innerSize = this.options.isHorizontal ? 'innerHeight' : 'innerWidth';\n if ( hasSizes && size[ innerSize ] == this.size[ innerSize ] ) {\n return;\n }\n\n this.layout();\n};\n\n// -------------------------- drag -------------------------- //\n\n/**\n * handle an item drag start event\n * @param {Element} elem\n */\nPackery.prototype.itemDragStart = function( elem ) {\n this.stamp( elem );\n var item = this.getItem( elem );\n if ( item ) {\n item.dragStart();\n }\n};\n\n/**\n * handle an item drag move event\n * @param {Element} elem\n * @param {Number} x - horizontal change in position\n * @param {Number} y - vertical change in position\n */\nPackery.prototype.itemDragMove = function( elem, x, y ) {\n var item = this.getItem( elem );\n if ( item ) {\n item.dragMove( x, y );\n }\n\n // debounce\n var _this = this;\n // debounce triggering layout\n function delayed() {\n _this.layout();\n delete _this.dragTimeout;\n }\n\n this.clearDragTimeout();\n\n this.dragTimeout = setTimeout( delayed, 40 );\n};\n\nPackery.prototype.clearDragTimeout = function() {\n if ( this.dragTimeout ) {\n clearTimeout( this.dragTimeout );\n }\n};\n\n/**\n * handle an item drag end event\n * @param {Element} elem\n */\nPackery.prototype.itemDragEnd = function( elem ) {\n var item = this.getItem( elem );\n var itemDidDrag;\n if ( item ) {\n itemDidDrag = item.didDrag;\n item.dragStop();\n }\n // if elem didn't move, or if it doesn't need positioning\n // unignore and unstamp and call it a day\n if ( !item || ( !itemDidDrag && !item.needsPositioning ) ) {\n this.unstamp( elem );\n return;\n }\n // procced with dragged item\n\n classie.add( item.element, 'is-positioning-post-drag' );\n\n // save this var, as it could get reset in dragStart\n var onLayoutComplete = this._getDragEndLayoutComplete( elem, item );\n\n if ( item.needsPositioning ) {\n item.on( 'layout', onLayoutComplete );\n item.moveTo( item.placeRect.x, item.placeRect.y );\n } else if ( item ) {\n // item didn't need placement\n item.copyPlaceRectPosition();\n }\n\n this.clearDragTimeout();\n this.on( 'layoutComplete', onLayoutComplete );\n this.layout();\n\n};\n\n/**\n * get drag end callback\n * @param {Element} elem\n * @param {Packery.Item} item\n * @returns {Function} onLayoutComplete\n */\nPackery.prototype._getDragEndLayoutComplete = function( elem, item ) {\n var itemNeedsPositioning = item && item.needsPositioning;\n var completeCount = 0;\n var asyncCount = itemNeedsPositioning ? 2 : 1;\n var _this = this;\n\n return function onLayoutComplete() {\n completeCount++;\n // don't proceed if not complete\n if ( completeCount != asyncCount ) {\n return true;\n }\n // reset item\n if ( item ) {\n classie.remove( item.element, 'is-positioning-post-drag' );\n item.isPlacing = false;\n item.copyPlaceRectPosition();\n }\n\n _this.unstamp( elem );\n // only sort when item moved\n _this.sortItemsByPosition();\n\n // emit item drag event now that everything is done\n if ( itemNeedsPositioning ) {\n _this.dispatchEvent( 'dragItemPositioned', null, [ item ] );\n }\n // listen once\n return true;\n };\n};\n\n/**\n * binds Draggabilly events\n * @param {Draggabilly} draggie\n */\nPackery.prototype.bindDraggabillyEvents = function( draggie ) {\n draggie.on( 'dragStart', this.handleDraggabilly.dragStart );\n draggie.on( 'dragMove', this.handleDraggabilly.dragMove );\n draggie.on( 'dragEnd', this.handleDraggabilly.dragEnd );\n};\n\n/**\n * binds jQuery UI Draggable events\n * @param {jQuery} $elems\n */\nPackery.prototype.bindUIDraggableEvents = function( $elems ) {\n $elems\n .on( 'dragstart', this.handleUIDraggable.start )\n .on( 'drag', this.handleUIDraggable.drag )\n .on( 'dragstop', this.handleUIDraggable.stop );\n};\n\nPackery.Rect = Rect;\nPackery.Packer = Packer;\n\nreturn Packery;\n\n}));\n\n","Smartwave_Filterproducts/js/imagesloaded.js":"/*!\n * imagesLoaded PACKAGED v5.0.0\n * JavaScript is all like \"You images are done yet or what?\"\n * MIT License\n */\n\n/**\n * EvEmitter v2.1.1\n * Lil' event emitter\n * MIT License\n */\n\n( function( global, factory ) {\n // universal module definition\n if ( typeof module == 'object' && module.exports ) {\n // CommonJS - Browserify, Webpack\n module.exports = factory();\n } else {\n // Browser globals\n global.EvEmitter = factory();\n }\n\n}( typeof window != 'undefined' ? window : this, function() {\n\nfunction EvEmitter() {}\n\nlet proto = EvEmitter.prototype;\n\nproto.on = function( eventName, listener ) {\n if ( !eventName || !listener ) return this;\n\n // set events hash\n let events = this._events = this._events || {};\n // set listeners array\n let listeners = events[ eventName ] = events[ eventName ] || [];\n // only add once\n if ( !listeners.includes( listener ) ) {\n listeners.push( listener );\n }\n\n return this;\n};\n\nproto.once = function( eventName, listener ) {\n if ( !eventName || !listener ) return this;\n\n // add event\n this.on( eventName, listener );\n // set once flag\n // set onceEvents hash\n let onceEvents = this._onceEvents = this._onceEvents || {};\n // set onceListeners object\n let onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};\n // set flag\n onceListeners[ listener ] = true;\n\n return this;\n};\n\nproto.off = function( eventName, listener ) {\n let listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) return this;\n\n let index = listeners.indexOf( listener );\n if ( index != -1 ) {\n listeners.splice( index, 1 );\n }\n\n return this;\n};\n\nproto.emitEvent = function( eventName, args ) {\n let listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) return this;\n\n // copy over to avoid interference if .off() in listener\n listeners = listeners.slice( 0 );\n args = args || [];\n // once stuff\n let onceListeners = this._onceEvents && this._onceEvents[ eventName ];\n\n for ( let listener of listeners ) {\n let isOnce = onceListeners && onceListeners[ listener ];\n if ( isOnce ) {\n // remove listener\n // remove before trigger to prevent recursion\n this.off( eventName, listener );\n // unset once flag\n delete onceListeners[ listener ];\n }\n // trigger listener\n listener.apply( this, args );\n }\n\n return this;\n};\n\nproto.allOff = function() {\n delete this._events;\n delete this._onceEvents;\n return this;\n};\n\nreturn EvEmitter;\n\n} ) );\n/*!\n * imagesLoaded v5.0.0\n * JavaScript is all like \"You images are done yet or what?\"\n * MIT License\n */\n\n( function( window, factory ) {\n // universal module definition\n if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory( window, require('ev-emitter') );\n } else {\n // browser global\n window.imagesLoaded = factory( window, window.EvEmitter );\n }\n\n} )( typeof window !== 'undefined' ? window : this,\n function factory( window, EvEmitter ) {\n\nlet $ = window.jQuery;\nlet console = window.console;\n\n// -------------------------- helpers -------------------------- //\n\n// turn element or nodeList into an array\nfunction makeArray( obj ) {\n // use object if already an array\n if ( Array.isArray( obj ) ) return obj;\n\n let isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n // convert nodeList to array\n if ( isArrayLike ) return [ ...obj ];\n\n // array of single index\n return [ obj ];\n}\n\n// -------------------------- imagesLoaded -------------------------- //\n\n/**\n * @param {[Array, Element, NodeList, String]} elem\n * @param {[Object, Function]} options - if function, use as callback\n * @param {Function} onAlways - callback function\n * @returns {ImagesLoaded}\n */\nfunction ImagesLoaded( elem, options, onAlways ) {\n // coerce ImagesLoaded() without new, to be new ImagesLoaded()\n if ( !( this instanceof ImagesLoaded ) ) {\n return new ImagesLoaded( elem, options, onAlways );\n }\n // use elem as selector string\n let queryElem = elem;\n if ( typeof elem == 'string' ) {\n queryElem = document.querySelectorAll( elem );\n }\n // bail if bad element\n if ( !queryElem ) {\n console.error(`Bad element for imagesLoaded ${queryElem || elem}`);\n return;\n }\n\n this.elements = makeArray( queryElem );\n this.options = {};\n // shift arguments if no options set\n if ( typeof options == 'function' ) {\n onAlways = options;\n } else {\n Object.assign( this.options, options );\n }\n\n if ( onAlways ) this.on( 'always', onAlways );\n\n this.getImages();\n // add jQuery Deferred object\n if ( $ ) this.jqDeferred = new $.Deferred();\n\n // HACK check async to allow time to bind listeners\n setTimeout( this.check.bind( this ) );\n}\n\nImagesLoaded.prototype = Object.create( EvEmitter.prototype );\n\nImagesLoaded.prototype.getImages = function() {\n this.images = [];\n\n // filter & find items if we have an item selector\n this.elements.forEach( this.addElementImages, this );\n};\n\nconst elementNodeTypes = [ 1, 9, 11 ];\n\n/**\n * @param {Node} elem\n */\nImagesLoaded.prototype.addElementImages = function( elem ) {\n // filter siblings\n if ( elem.nodeName === 'IMG' ) {\n this.addImage( elem );\n }\n // get background image on element\n if ( this.options.background === true ) {\n this.addElementBackgroundImages( elem );\n }\n\n // find children\n // no non-element nodes, #143\n let { nodeType } = elem;\n if ( !nodeType || !elementNodeTypes.includes( nodeType ) ) return;\n\n let childImgs = elem.querySelectorAll('img');\n // concat childElems to filterFound array\n for ( let img of childImgs ) {\n this.addImage( img );\n }\n\n // get child background images\n if ( typeof this.options.background == 'string' ) {\n let children = elem.querySelectorAll( this.options.background );\n for ( let child of children ) {\n this.addElementBackgroundImages( child );\n }\n }\n};\n\nconst reURL = /url\\((['\"])?(.*?)\\1\\)/gi;\n\nImagesLoaded.prototype.addElementBackgroundImages = function( elem ) {\n let style = getComputedStyle( elem );\n // Firefox returns null if in a hidden iframe https://bugzil.la/548397\n if ( !style ) return;\n\n // get url inside url(\"...\")\n let matches = reURL.exec( style.backgroundImage );\n while ( matches !== null ) {\n let url = matches && matches[2];\n if ( url ) {\n this.addBackground( url, elem );\n }\n matches = reURL.exec( style.backgroundImage );\n }\n};\n\n/**\n * @param {Image} img\n */\nImagesLoaded.prototype.addImage = function( img ) {\n let loadingImage = new LoadingImage( img );\n this.images.push( loadingImage );\n};\n\nImagesLoaded.prototype.addBackground = function( url, elem ) {\n let background = new Background( url, elem );\n this.images.push( background );\n};\n\nImagesLoaded.prototype.check = function() {\n this.progressedCount = 0;\n this.hasAnyBroken = false;\n // complete if no images\n if ( !this.images.length ) {\n this.complete();\n return;\n }\n\n /* eslint-disable-next-line func-style */\n let onProgress = ( image, elem, message ) => {\n // HACK - Chrome triggers event before object properties have changed. #83\n setTimeout( () => {\n this.progress( image, elem, message );\n } );\n };\n\n this.images.forEach( function( loadingImage ) {\n loadingImage.once( 'progress', onProgress );\n loadingImage.check();\n } );\n};\n\nImagesLoaded.prototype.progress = function( image, elem, message ) {\n this.progressedCount++;\n this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;\n // progress event\n this.emitEvent( 'progress', [ this, image, elem ] );\n if ( this.jqDeferred && this.jqDeferred.notify ) {\n this.jqDeferred.notify( this, image );\n }\n // check if completed\n if ( this.progressedCount === this.images.length ) {\n this.complete();\n }\n\n if ( this.options.debug && console ) {\n console.log( `progress: ${message}`, image, elem );\n }\n};\n\nImagesLoaded.prototype.complete = function() {\n let eventName = this.hasAnyBroken ? 'fail' : 'done';\n this.isComplete = true;\n this.emitEvent( eventName, [ this ] );\n this.emitEvent( 'always', [ this ] );\n if ( this.jqDeferred ) {\n let jqMethod = this.hasAnyBroken ? 'reject' : 'resolve';\n this.jqDeferred[ jqMethod ]( this );\n }\n};\n\n// -------------------------- -------------------------- //\n\nfunction LoadingImage( img ) {\n this.img = img;\n}\n\nLoadingImage.prototype = Object.create( EvEmitter.prototype );\n\nLoadingImage.prototype.check = function() {\n // If complete is true and browser supports natural sizes,\n // try to check for image status manually.\n let isComplete = this.getIsImageComplete();\n if ( isComplete ) {\n // report based on naturalWidth\n this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );\n return;\n }\n\n // If none of the checks above matched, simulate loading on detached element.\n this.proxyImage = new Image();\n // add crossOrigin attribute. #204\n if ( this.img.crossOrigin ) {\n this.proxyImage.crossOrigin = this.img.crossOrigin;\n }\n this.proxyImage.addEventListener( 'load', this );\n this.proxyImage.addEventListener( 'error', this );\n // bind to image as well for Firefox. #191\n this.img.addEventListener( 'load', this );\n this.img.addEventListener( 'error', this );\n this.proxyImage.src = this.img.currentSrc || this.img.src;\n};\n\nLoadingImage.prototype.getIsImageComplete = function() {\n // check for non-zero, non-undefined naturalWidth\n // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671\n return this.img.complete && this.img.naturalWidth;\n};\n\nLoadingImage.prototype.confirm = function( isLoaded, message ) {\n this.isLoaded = isLoaded;\n let { parentNode } = this.img;\n // emit progress with parent <picture> or self <img>\n let elem = parentNode.nodeName === 'PICTURE' ? parentNode : this.img;\n this.emitEvent( 'progress', [ this, elem, message ] );\n};\n\n// ----- events ----- //\n\n// trigger specified handler for event type\nLoadingImage.prototype.handleEvent = function( event ) {\n let method = 'on' + event.type;\n if ( this[ method ] ) {\n this[ method ]( event );\n }\n};\n\nLoadingImage.prototype.onload = function() {\n this.confirm( true, 'onload' );\n this.unbindEvents();\n};\n\nLoadingImage.prototype.onerror = function() {\n this.confirm( false, 'onerror' );\n this.unbindEvents();\n};\n\nLoadingImage.prototype.unbindEvents = function() {\n this.proxyImage.removeEventListener( 'load', this );\n this.proxyImage.removeEventListener( 'error', this );\n this.img.removeEventListener( 'load', this );\n this.img.removeEventListener( 'error', this );\n};\n\n// -------------------------- Background -------------------------- //\n\nfunction Background( url, element ) {\n this.url = url;\n this.element = element;\n this.img = new Image();\n}\n\n// inherit LoadingImage prototype\nBackground.prototype = Object.create( LoadingImage.prototype );\n\nBackground.prototype.check = function() {\n this.img.addEventListener( 'load', this );\n this.img.addEventListener( 'error', this );\n this.img.src = this.url;\n // check if image is already complete\n let isComplete = this.getIsImageComplete();\n if ( isComplete ) {\n this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );\n this.unbindEvents();\n }\n};\n\nBackground.prototype.unbindEvents = function() {\n this.img.removeEventListener( 'load', this );\n this.img.removeEventListener( 'error', this );\n};\n\nBackground.prototype.confirm = function( isLoaded, message ) {\n this.isLoaded = isLoaded;\n this.emitEvent( 'progress', [ this, this.element, message ] );\n};\n\n// -------------------------- jQuery -------------------------- //\n\nImagesLoaded.makeJQueryPlugin = function( jQuery ) {\n jQuery = jQuery || window.jQuery;\n if ( !jQuery ) return;\n\n // set local variable\n $ = jQuery;\n // $().imagesLoaded()\n $.fn.imagesLoaded = function( options, onAlways ) {\n let instance = new ImagesLoaded( this, options, onAlways );\n return instance.jqDeferred.promise( $( this ) );\n };\n};\n// try making plugin\nImagesLoaded.makeJQueryPlugin();\n\n// -------------------------- -------------------------- //\n\nreturn ImagesLoaded;\n\n} );\n","Smartwave_Filterproducts/js/lazyload/jquery.lazyload.js":"/*!\n * Lazy Load - JavaScript plugin for lazy loading images\n *\n * Copyright (c) 2007-2019 Mika Tuupola\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * Project home:\n * https://appelsiini.net/projects/lazyload\n *\n * Version: 2.0.0-rc.2\n *\n */\n\n(function (root, factory) {\n if (typeof exports === \"object\") {\n module.exports = factory(root);\n } else if (typeof define === \"function\" && define.amd) {\n define([], factory);\n } else {\n root.LazyLoad = factory(root);\n }\n}) (typeof global !== \"undefined\" ? global : this.window || this.global, function (root) {\n\n \"use strict\";\n\n if (typeof define === \"function\" && define.amd){\n root = window;\n }\n\n const defaults = {\n src: \"data-src\",\n srcset: \"data-srcset\",\n selector: \".lazyload\",\n root: null,\n rootMargin: \"0px\",\n threshold: 0\n };\n\n /**\n * Merge two or more objects. Returns a new object.\n * @private\n * @param {Boolean} deep If true, do a deep (or recursive) merge [optional]\n * @param {Object} objects The objects to merge together\n * @returns {Object} Merged values of defaults and options\n */\n const extend = function () {\n\n let extended = {};\n let deep = false;\n let i = 0;\n let length = arguments.length;\n\n /* Check if a deep merge */\n if (Object.prototype.toString.call(arguments[0]) === \"[object Boolean]\") {\n deep = arguments[0];\n i++;\n }\n\n /* Merge the object into the extended object */\n let merge = function (obj) {\n for (let prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n /* If deep merge and property is an object, merge properties */\n if (deep && Object.prototype.toString.call(obj[prop]) === \"[object Object]\") {\n extended[prop] = extend(true, extended[prop], obj[prop]);\n } else {\n extended[prop] = obj[prop];\n }\n }\n }\n };\n\n /* Loop through each object and conduct a merge */\n for (; i < length; i++) {\n let obj = arguments[i];\n merge(obj);\n }\n\n return extended;\n };\n\n function LazyLoad(images, options) {\n this.settings = extend(defaults, options || {});\n this.images = images || document.querySelectorAll(this.settings.selector);\n this.observer = null;\n this.init();\n }\n\n LazyLoad.prototype = {\n init: function() {\n\n /* Without observers load everything and bail out early. */\n if (!root.IntersectionObserver) {\n this.loadImages();\n return;\n }\n\n let self = this;\n let observerConfig = {\n root: this.settings.root,\n rootMargin: this.settings.rootMargin,\n threshold: [this.settings.threshold]\n };\n\n this.observer = new IntersectionObserver(function(entries) {\n Array.prototype.forEach.call(entries, function (entry) {\n if (entry.isIntersecting) {\n self.observer.unobserve(entry.target);\n let src = entry.target.getAttribute(self.settings.src);\n let srcset = entry.target.getAttribute(self.settings.srcset);\n if (\"img\" === entry.target.tagName.toLowerCase()) {\n if (src) {\n entry.target.src = src;\n }\n if (srcset) {\n entry.target.srcset = srcset;\n }\n } else {\n entry.target.style.backgroundImage = \"url(\" + src + \")\";\n }\n }\n });\n }, observerConfig);\n\n Array.prototype.forEach.call(this.images, function (image) {\n self.observer.observe(image);\n });\n },\n\n loadAndDestroy: function () {\n if (!this.settings) { return; }\n this.loadImages();\n this.destroy();\n },\n\n loadImages: function () {\n if (!this.settings) { return; }\n\n let self = this;\n Array.prototype.forEach.call(this.images, function (image) {\n let src = image.getAttribute(self.settings.src);\n let srcset = image.getAttribute(self.settings.srcset);\n if (\"img\" === image.tagName.toLowerCase()) {\n if (src) {\n image.src = src;\n }\n if (srcset) {\n image.srcset = srcset;\n }\n } else {\n image.style.backgroundImage = \"url('\" + src + \"')\";\n }\n });\n },\n\n destroy: function () {\n if (!this.settings) { return; }\n this.observer.disconnect();\n this.settings = null;\n }\n };\n\n root.lazyload = function(images, options) {\n return new LazyLoad(images, options);\n };\n\n if (root.jQuery) {\n const $ = root.jQuery;\n $.fn.lazyload = function (options) {\n options = options || {};\n options.attribute = options.attribute || \"data-src\";\n new LazyLoad($.makeArray(this), options);\n return this;\n };\n }\n\n return LazyLoad;\n});\n","Smartwave_Filterproducts/js/owl.carousel/owl.carousel.min.js":"/**\n * Owl Carousel v2.3.4\n * Copyright 2013-2018 David Deutsch\n * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE\n */!(function (factory) {\n 'use strict';\n\n if (typeof define === 'function' && define.amd) {\n define([\n 'jquery'\n ], factory);\n } else {\n factory(window.jQuery);\n }\n}(function (a) {\n 'use strict';\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,\n animateIn:!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);\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/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.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-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-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-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.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-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.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/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-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/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/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-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-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-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-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-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.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/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/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-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.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-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/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","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/js/jquery.ui.touch-punch.min.js":"/*!\n * jQuery UI Touch Punch 0.2.3\n *\n * Copyright 2011\u20132014, Dave Furfero\n * Dual licensed under the MIT or GPL Version 2 licenses.\n *\n * Depends:\n * jquery.ui.widget.js\n * jquery.ui.mouse.js\n */\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);\n","Mageplaza_Core/js/jquery.magnific-popup.min.js":"// Magnific Popup v1.1.0 by Dmitry Semenov\n// http://bit.ly/magnific-popup#build=inline+image+ajax+iframe+gallery+retina+imagezoom\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/owl.carousel.min.js":"!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this.drag=a.extend({},m),this.state=a.extend({},n),this.e=a.extend({},o),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._invalidated={},this._pipe=[],a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a[0].toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Pipe,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}function f(a){if(a.touches!==d)return{x:a.touches[0].pageX,y:a.touches[0].pageY};if(a.touches===d){if(a.pageX!==d)return{x:a.pageX,y:a.pageY};if(a.pageX===d)return{x:a.clientX,y:a.clientY}}}function g(a){var b,d,e=c.createElement(\"div\"),f=a;for(b in f)if(d=f[b],\"undefined\"!=typeof e.style[d])return e=null,[d,b];return[!1]}function h(){return g([\"transition\",\"WebkitTransition\",\"MozTransition\",\"OTransition\"])[1]}function i(){return g([\"transform\",\"WebkitTransform\",\"MozTransform\",\"OTransform\",\"msTransform\"])[0]}function j(){return g([\"perspective\",\"webkitPerspective\",\"MozPerspective\",\"OPerspective\",\"MsPerspective\"])[0]}function k(){return\"ontouchstart\"in b||!!navigator.msMaxTouchPoints}function l(){return b.navigator.msPointerEnabled}var m,n,o;m={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,offsetX:0,offsetY:0,distance:null,startTime:0,endTime:0,updatedX:0,targetEl:null},n={isTouch:!1,isScrolling:!1,isSwiping:!1,direction:!1,inMotion:!1},o={_onDragStart:null,_onDragMove:null,_onDragEnd:null,_transitionEnd:null,_resizer:null,_responsiveCall:null,_goToLoop:null,_checkVisibile:null},e.Defaults={items:3,loop:!1,center:!1,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,responsiveClass:!1,fallbackEasing:\"swing\",info:!1,nestedItemSelector:!1,itemElement:\"div\",stageElement:\"div\",themeClass:\"owl-theme\",baseClass:\"owl-carousel\",itemClass:\"owl-item\",centerClass:\"center\",activeClass:\"active\"},e.Width={Default:\"default\",Inner:\"inner\",Outer:\"outer\"},e.Plugins={},e.Pipe=[{filter:[\"width\",\"items\",\"settings\"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:[\"items\",\"settings\"],run:function(){var a=this._clones,b=this.$stage.children(\".cloned\");(b.length!==a.length||!this.settings.loop&&a.length>0)&&(this.$stage.children(\".cloned\").remove(),this._clones=[])}},{filter:[\"items\",\"settings\"],run:function(){var a,b,c=this._clones,d=this._items,e=this.settings.loop?c.length-Math.max(2*this.settings.items,4):0;for(a=0,b=Math.abs(e/2);b>a;a++)e>0?(this.$stage.children().eq(d.length+c.length-1).remove(),c.pop(),this.$stage.children().eq(0).remove(),c.pop()):(c.push(c.length/2),this.$stage.append(d[c[c.length-1]].clone().addClass(\"cloned\")),c.push(d.length-1-(c.length-1)/2),this.$stage.prepend(d[c[c.length-1]].clone().addClass(\"cloned\")))}},{filter:[\"width\",\"items\",\"settings\"],run:function(){var a,b,c,d=this.settings.rtl?1:-1,e=(this.width()/this.settings.items).toFixed(3),f=0;for(this._coordinates=[],b=0,c=this._clones.length+this._items.length;c>b;b++)a=this._mergers[this.relative(b)],a=this.settings.mergeFit&&Math.min(a,this.settings.items)||a,f+=(this.settings.autoWidth?this._items[this.relative(b)].width()+this.settings.margin:e*a)*d,this._coordinates.push(f)}},{filter:[\"width\",\"items\",\"settings\"],run:function(){var b,c,d=(this.width()/this.settings.items).toFixed(3),e={width:Math.abs(this._coordinates[this._coordinates.length-1])+2*this.settings.stagePadding,\"padding-left\":this.settings.stagePadding||\"\",\"padding-right\":this.settings.stagePadding||\"\"};if(this.$stage.css(e),e={width:this.settings.autoWidth?\"auto\":d-this.settings.margin},e[this.settings.rtl?\"margin-left\":\"margin-right\"]=this.settings.margin,!this.settings.autoWidth&&a.grep(this._mergers,function(a){return a>1}).length>0)for(b=0,c=this._coordinates.length;c>b;b++)e.width=Math.abs(this._coordinates[b])-Math.abs(this._coordinates[b-1]||0)-this.settings.margin,this.$stage.children().eq(b).css(e);else this.$stage.children().css(e)}},{filter:[\"width\",\"items\",\"settings\"],run:function(a){a.current&&this.reset(this.$stage.children().index(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;d>c;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(\".\"+this.settings.activeClass).removeClass(this.settings.activeClass),this.$stage.children(\":eq(\"+i.join(\"), :eq(\")+\")\").addClass(this.settings.activeClass),this.settings.center&&(this.$stage.children(\".\"+this.settings.centerClass).removeClass(this.settings.centerClass),this.$stage.children().eq(this.current()).addClass(this.settings.centerClass))}}],e.prototype.initialize=function(){if(this.trigger(\"initialize\"),this.$element.addClass(this.settings.baseClass).addClass(this.settings.themeClass).toggleClass(\"owl-rtl\",this.settings.rtl),this.browserSupport(),this.settings.autoWidth&&this.state.imagesLoaded!==!0){var b,c,e;if(b=this.$element.find(\"img\"),c=this.settings.nestedItemSelector?\".\"+this.settings.nestedItemSelector:d,e=this.$element.children(c).width(),b.length&&0>=e)return this.preloadAutoWidthImages(b),!1}this.$element.addClass(\"owl-loading\"),this.$stage=a(\"<\"+this.settings.stageElement+' class=\"owl-stage\"/>').wrap('<div class=\"owl-stage-outer\">'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this._width=this.$element.width(),this.refresh(),this.$element.removeClass(\"owl-loading\").addClass(\"owl-loaded\"),this.eventsCall(),this.internalEvents(),this.addTriggerableEvents(),this.trigger(\"initialized\")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){b>=a&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),delete e.responsive,e.responsiveClass&&this.$element.attr(\"class\",function(a,b){return b.replace(/\\b owl-responsive-\\S+/g,\"\")}).addClass(\"owl-responsive-\"+d)):e=a.extend({},this.options),(null===this.settings||this._breakpoint!==d)&&(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.$element.toggleClass(\"owl-center\",this.settings.center),this.settings.loop&&this._items.length<this.settings.items&&(this.settings.loop=!1),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.settings.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={};c>b;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={}},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(){if(0===this._items.length)return!1;(new Date).getTime();this.trigger(\"refresh\"),this.setup(),this.optionsLogic(),this.$stage.addClass(\"owl-refresh\"),this.update(),this.$stage.removeClass(\"owl-refresh\"),this.state.orientation=b.orientation,this.watchVisibility(),this.trigger(\"refreshed\")},e.prototype.eventsCall=function(){this.e._onDragStart=a.proxy(function(a){this.onDragStart(a)},this),this.e._onDragMove=a.proxy(function(a){this.onDragMove(a)},this),this.e._onDragEnd=a.proxy(function(a){this.onDragEnd(a)},this),this.e._onResize=a.proxy(function(a){this.onResize(a)},this),this.e._transitionEnd=a.proxy(function(a){this.transitionEnd(a)},this),this.e._preventClick=a.proxy(function(a){this.preventClick(a)},this)},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this.e._onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return this._items.length?this._width===this.$element.width()?!1:this.trigger(\"resize\").isDefaultPrevented()?!1:(this._width=this.$element.width(),this.invalidate(\"width\"),this.refresh(),void this.trigger(\"resized\")):!1},e.prototype.eventsRouter=function(a){var b=a.type;\"mousedown\"===b||\"touchstart\"===b?this.onDragStart(a):\"mousemove\"===b||\"touchmove\"===b?this.onDragMove(a):\"mouseup\"===b||\"touchend\"===b?this.onDragEnd(a):\"touchcancel\"===b&&this.onDragEnd(a)},e.prototype.internalEvents=function(){var c=(k(),l());this.settings.mouseDrag?(this.$stage.on(\"mousedown\",a.proxy(function(a){this.eventsRouter(a)},this)),this.$stage.on(\"dragstart\",function(){return!1}),this.$stage.get(0).onselectstart=function(){return!1}):this.$element.addClass(\"owl-text-select-on\"),this.settings.touchDrag&&!c&&this.$stage.on(\"touchstart touchcancel\",a.proxy(function(a){this.eventsRouter(a)},this)),this.transitionEndVendor&&this.on(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd,!1),this.settings.responsive!==!1&&this.on(b,\"resize\",a.proxy(this.onThrottledResize,this))},e.prototype.onDragStart=function(d){var e,g,h,i;if(e=d.originalEvent||d||b.event,3===e.which||this.state.isTouch)return!1;if(\"mousedown\"===e.type&&this.$stage.addClass(\"owl-grab\"),this.trigger(\"drag\"),this.drag.startTime=(new Date).getTime(),this.speed(0),this.state.isTouch=!0,this.state.isScrolling=!1,this.state.isSwiping=!1,this.drag.distance=0,g=f(e).x,h=f(e).y,this.drag.offsetX=this.$stage.position().left,this.drag.offsetY=this.$stage.position().top,this.settings.rtl&&(this.drag.offsetX=this.$stage.position().left+this.$stage.width()-this.width()+this.settings.margin),this.state.inMotion&&this.support3d)i=this.getTransformProperty(),this.drag.offsetX=i,this.animate(i),this.state.inMotion=!0;else if(this.state.inMotion&&!this.support3d)return this.state.inMotion=!1,!1;this.drag.startX=g-this.drag.offsetX,this.drag.startY=h-this.drag.offsetY,this.drag.start=g-this.drag.startX,this.drag.targetEl=e.target||e.srcElement,this.drag.updatedX=this.drag.start,(\"IMG\"===this.drag.targetEl.tagName||\"A\"===this.drag.targetEl.tagName)&&(this.drag.targetEl.draggable=!1),a(c).on(\"mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents\",a.proxy(function(a){this.eventsRouter(a)},this))},e.prototype.onDragMove=function(a){var c,e,g,h,i,j;this.state.isTouch&&(this.state.isScrolling||(c=a.originalEvent||a||b.event,e=f(c).x,g=f(c).y,this.drag.currentX=e-this.drag.startX,this.drag.currentY=g-this.drag.startY,this.drag.distance=this.drag.currentX-this.drag.offsetX,this.drag.distance<0?this.state.direction=this.settings.rtl?\"right\":\"left\":this.drag.distance>0&&(this.state.direction=this.settings.rtl?\"left\":\"right\"),this.settings.loop?this.op(this.drag.currentX,\">\",this.coordinates(this.minimum()))&&\"right\"===this.state.direction?this.drag.currentX-=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length):this.op(this.drag.currentX,\"<\",this.coordinates(this.maximum()))&&\"left\"===this.state.direction&&(this.drag.currentX+=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length)):(h=this.coordinates(this.settings.rtl?this.maximum():this.minimum()),i=this.coordinates(this.settings.rtl?this.minimum():this.maximum()),j=this.settings.pullDrag?this.drag.distance/5:0,this.drag.currentX=Math.max(Math.min(this.drag.currentX,h+j),i+j)),(this.drag.distance>8||this.drag.distance<-8)&&(c.preventDefault!==d?c.preventDefault():c.returnValue=!1,this.state.isSwiping=!0),this.drag.updatedX=this.drag.currentX,(this.drag.currentY>16||this.drag.currentY<-16)&&this.state.isSwiping===!1&&(this.state.isScrolling=!0,this.drag.updatedX=this.drag.start),this.animate(this.drag.updatedX)))},e.prototype.onDragEnd=function(b){var d,e,f;if(this.state.isTouch){if(\"mouseup\"===b.type&&this.$stage.removeClass(\"owl-grab\"),this.trigger(\"dragged\"),this.drag.targetEl.removeAttribute(\"draggable\"),this.state.isTouch=!1,this.state.isScrolling=!1,this.state.isSwiping=!1,0===this.drag.distance&&this.state.inMotion!==!0)return this.state.inMotion=!1,!1;this.drag.endTime=(new Date).getTime(),d=this.drag.endTime-this.drag.startTime,e=Math.abs(this.drag.distance),(e>3||d>300)&&this.removeClick(this.drag.targetEl),f=this.closest(this.drag.updatedX),this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(f),this.invalidate(\"position\"),this.update(),this.settings.pullDrag||this.drag.updatedX!==this.coordinates(f)||this.transitionEnd(),this.drag.distance=0,a(c).off(\".owl.dragEvents\")}},e.prototype.removeClick=function(c){this.drag.targetEl=c,a(c).on(\"click.preventClick\",this.e._preventClick),b.setTimeout(function(){a(c).off(\"click.preventClick\")},300)},e.prototype.preventClick=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation&&b.stopPropagation(),a(b.target).off(\"click.preventClick\")},e.prototype.getTransformProperty=function(){var a,c;return a=b.getComputedStyle(this.$stage.get(0),null).getPropertyValue(this.vendorName+\"transform\"),a=a.replace(/matrix(3d)?\\(|\\)/g,\"\").split(\",\"),c=16===a.length,c!==!0?a[4]:a[12]},e.prototype.closest=function(b){var c=-1,d=30,e=this.width(),f=this.coordinates();return this.settings.freeDrag||a.each(f,a.proxy(function(a,g){return b>g-d&&g+d>b?c=a:this.op(b,\"<\",g)&&this.op(b,\">\",f[a+1]||g-e)&&(c=\"left\"===this.state.direction?a+1:a),-1===c},this)),this.settings.loop||(this.op(b,\">\",f[this.minimum()])?c=b=this.minimum():this.op(b,\"<\",f[this.maximum()])&&(c=b=this.maximum())),c},e.prototype.animate=function(b){this.trigger(\"translate\"),this.state.inMotion=this.speed()>0,this.support3d?this.$stage.css({transform:\"translate3d(\"+b+\"px,0px, 0px)\",transition:this.speed()/1e3+\"s\"}):this.state.isTouch?this.$stage.css({left:b+\"px\"}):this.$stage.animate({left:b},this.speed()/1e3,this.settings.fallbackEasing,a.proxy(function(){this.state.inMotion&&this.transitionEnd()},this))},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(a){this._invalidated[a]=!0},e.prototype.reset=function(a){a=this.normalize(a),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(b,c){var e=c?this._items.length:this._items.length+this._clones.length;return!a.isNumeric(b)||1>e?d:b=this._clones.length?(b%e+e)%e:Math.max(this.minimum(c),Math.min(this.maximum(c),b))},e.prototype.relative=function(a){return a=this.normalize(a),a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=0,f=this.settings;if(a)return this._items.length-1;if(!f.loop&&f.center)b=this._items.length-1;else if(f.loop||f.center)if(f.loop||f.center)b=this._items.length+f.items;else{if(!f.autoWidth&&!f.merge)throw\"Can not detect maximum absolute position.\";for(revert=f.rtl?1:-1,c=this.$stage.width()-this.$element.width();(d=this.coordinates(e))&&!(d*revert>=c);)b=++e}else b=this._items.length-f.items;return b},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=null;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[b-1]||0))/2*(this.settings.rtl?-1:1)):c=this._coordinates[b-1]||0,c)},e.prototype.duration=function(a,b,c){return Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(c,d){if(this.settings.loop){var e=c-this.relative(this.current()),f=this.current(),g=this.current(),h=this.current()+e,i=0>g-h?!0:!1,j=this._clones.length+this._items.length;h<this.settings.items&&i===!1?(f=g+this._items.length,this.reset(f)):h>=j-this.settings.items&&i===!0&&(f=g-this._items.length,this.reset(f)),b.clearTimeout(this.e._goToLoop),this.e._goToLoop=b.setTimeout(a.proxy(function(){this.speed(this.duration(this.current(),f+e,d)),this.current(f+e),this.update()},this),30)}else this.speed(this.duration(this.current(),c,d)),this.current(c),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.transitionEnd=function(a){return a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0))?!1:(this.state.inMotion=!1,void this.trigger(\"translated\"))},e.prototype.viewport=function(){var d;if(this.options.responsiveBaseElement!==b)d=a(this.options.responsiveBaseElement).width();else if(b.innerWidth)d=b.innerWidth;else{if(!c.documentElement||!c.documentElement.clientWidth)throw\"Can not detect viewport width.\";d=c.documentElement.clientWidth}return 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]\").andSelf(\"[data-merge]\").attr(\"data-merge\")||1)},this)),this.reset(a.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate(\"items\")},e.prototype.add=function(a,b){b=b===d?this._items.length:this.normalize(b,!0),this.trigger(\"add\",{content:a,position:b}),0===this._items.length||b===this._items.length?(this.$stage.append(a),this._items.push(a),this._mergers.push(1*a.find(\"[data-merge]\").andSelf(\"[data-merge]\").attr(\"data-merge\")||1)):(this._items[b].before(a),this._items.splice(b,0,a),this._mergers.splice(b,0,1*a.find(\"[data-merge]\").andSelf(\"[data-merge]\").attr(\"data-merge\")||1)),this.invalidate(\"items\"),this.trigger(\"added\",{content:a,position:b})},e.prototype.remove=function(a){a=this.normalize(a,!0),a!==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.addTriggerableEvents=function(){var b=a.proxy(function(b,c){return a.proxy(function(a){a.relatedTarget!==this&&(this.suppress([c]),b.apply(this,[].slice.call(arguments,1)),this.release([c]))},this)},this);a.each({next:this.next,prev:this.prev,to:this.to,destroy:this.destroy,refresh:this.refresh,replace:this.replace,add:this.add,remove:this.remove},a.proxy(function(a,c){this.$element.on(a+\".owl.carousel\",b(c,a+\".owl.carousel\"))},this))},e.prototype.watchVisibility=function(){function c(a){return a.offsetWidth>0&&a.offsetHeight>0}function d(){c(this.$element.get(0))&&(this.$element.removeClass(\"owl-hidden\"),this.refresh(),b.clearInterval(this.e._checkVisibile))}c(this.$element.get(0))||(this.$element.addClass(\"owl-hidden\"),b.clearInterval(this.e._checkVisibile),this.e._checkVisibile=b.setInterval(a.proxy(d,this),500))},e.prototype.preloadAutoWidthImages=function(b){var c,d,e,f;c=0,d=this,b.each(function(g,h){e=a(h),f=new Image,f.onload=function(){c++,e.attr(\"src\",f.src),e.css(\"opacity\",1),c>=b.length&&(d.state.imagesLoaded=!0,d.initialize())},f.src=e.attr(\"src\")||e.attr(\"data-src\")||e.attr(\"data-src-retina\")})},e.prototype.destroy=function(){this.$element.hasClass(this.settings.themeClass)&&this.$element.removeClass(this.settings.themeClass),this.settings.responsive!==!1&&a(b).off(\"resize.owl.carousel\"),this.transitionEndVendor&&this.off(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd);for(var d in this._plugins)this._plugins[d].destroy();(this.settings.mouseDrag||this.settings.touchDrag)&&(this.$stage.off(\"mousedown touchstart touchcancel\"),a(c).off(\".owl.dragEvents\"),this.$stage.get(0).onselectstart=function(){},this.$stage.off(\"dragstart\",function(){return!1})),this.$element.off(\".owl\"),this.$stage.children(\".cloned\").remove(),this.e=null,this.$element.removeData(\"owlCarousel\"),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.unwrap()},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case\"<\":return d?a>c:c>a;case\">\":return d?c>a:a>c;case\">=\":return d?c>=a:a>=c;case\"<=\":return d?a>=c:c>=a}},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){var e={item:{count:this._items.length,index:this.current()}},f=a.camelCase(a.grep([\"on\",b,d],function(a){return a}).join(\"-\").toLowerCase()),g=a.Event([b,\"owl\",d||\"carousel\"].join(\".\").toLowerCase(),a.extend({relatedTarget:this},e,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(g)}),this.$element.trigger(g),this.settings&&\"function\"==typeof this.settings[f]&&this.settings[f].apply(this,g)),g},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.browserSupport=function(){if(this.support3d=j(),this.support3d){this.transformVendor=i();var a=[\"transitionend\",\"webkitTransitionEnd\",\"transitionend\",\"oTransitionEnd\"];this.transitionEndVendor=a[h()],this.vendorName=this.transformVendor.replace(/Transform/i,\"\"),this.vendorName=\"\"!==this.vendorName?\"-\"+this.vendorName.toLowerCase()+\"-\":\"\"}this.state.orientation=b.orientation},a.fn.owlCarousel=function(b){return this.each(function(){a(this).data(\"owlCarousel\")||a(this).data(\"owlCarousel\",new e(this,b))})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b){var c=function(b){this._core=b,this._loaded=[],this._handlers={\"initialized.owl.carousel change.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))for(var c=this._core.settings,d=c.center&&Math.ceil(c.items/2)||c.items,e=c.center&&-1*d||0,f=(b.property&&b.property.value||this._core.current())+e,g=this._core.clones().length,h=a.proxy(function(a,b){this.load(b)},this);e++<d;)this.load(g/2+this._core.relative(f)),g&&a.each(this._core.clones(this._core.relative(f++)),h)},this)},this._core.options=a.extend({},c.Defaults,this._core.options),this._core.$element.on(this._handlers)};c.Defaults={lazyLoad:!1},c.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\");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):(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)))},c.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=c}(window.Zepto||window.jQuery,window,document),function(a){var b=function(c){this._core=c,this._handlers={\"initialized.owl.carousel\":a.proxy(function(){this._core.settings.autoHeight&&this.update()},this),\"changed.owl.carousel\":a.proxy(function(a){this._core.settings.autoHeight&&\"position\"==a.property.name&&this.update()},this),\"loaded.owl.lazy\":a.proxy(function(a){this._core.settings.autoHeight&&a.element.closest(\".\"+this._core.settings.itemClass)===this._core.$stage.children().eq(this._core.current())&&this.update()},this)},this._core.options=a.extend({},b.Defaults,this._core.options),this._core.$element.on(this._handlers)};b.Defaults={autoHeight:!1,autoHeightClass:\"owl-height\"},b.prototype.update=function(){this._core.$stage.parent().height(this._core.$stage.children().eq(this._core.current()).height()).addClass(this._core.settings.autoHeightClass)},b.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=b}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this._core=b,this._videos={},this._playing=null,this._fullscreen=!1,this._handlers={\"resize.owl.carousel\":a.proxy(function(a){this._core.settings.video&&!this.isInFullScreen()&&a.preventDefault()},this),\"refresh.owl.carousel changed.owl.carousel\":a.proxy(function(){this._playing&&this.stop()},this),\"prepared.owl.carousel\":a.proxy(function(b){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({},d.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))};d.Defaults={video:!1,videoHeight:!1,videoWidth:!1},d.prototype.fetch=function(a,b){var c=a.attr(\"data-vimeo-id\")?\"vimeo\":\"youtube\",d=a.attr(\"data-vimeo-id\")||a.attr(\"data-youtube-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.)?(vimeo\\.com|youtu(be\\.com|\\.be|be\\.googleapis\\.com))\\/(video\\/|embed\\/|watch\\?v=|v\\/)?([A-Za-z0-9._%-]*)(\\&\\S+)?/),d[3].indexOf(\"youtu\")>-1)c=\"youtube\";else{if(!(d[3].indexOf(\"vimeo\")>-1))throw new Error(\"Video URL not supported.\");c=\"vimeo\"}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])},d.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style=\"width:'+c.width+\"px;height:\"+c.height+'px;\"':\"\",h=b.find(\"img\"),i=\"src\",j=\"\",k=this._core.settings,l=function(a){e='<div class=\"owl-video-play-icon\"></div>',d=k.lazyLoad?'<div class=\"owl-video-tn '+j+'\" '+i+'=\"'+a+'\"></div>':'<div class=\"owl-video-tn\" style=\"opacity:1;background-image:url('+a+')\"></div>',b.after(d),b.after(e)};return b.wrap('<div class=\"owl-video-wrapper\"'+g+\"></div>\"),this._core.settings.lazyLoad&&(i=\"data-src\",j=\"owl-lazy\"),h.length?(l(h.attr(i)),h.remove(),!1):void(\"youtube\"===c.type?(f=\"http://img.youtube.com/vi/\"+c.id+\"/hqdefault.jpg\",l(f)):\"vimeo\"===c.type&&a.ajax({type:\"GET\",url:\"http://vimeo.com/api/v2/video/\"+c.id+\".json\",jsonp:\"callback\",dataType:\"jsonp\",success:function(a){f=a[0].thumbnail_large,l(f)}}))},d.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},d.prototype.play=function(b){this._core.trigger(\"play\",null,\"video\"),this._playing&&this.stop();var c,d,e=a(b.target||b.srcElement),f=e.closest(\".\"+this._core.settings.itemClass),g=this._videos[f.attr(\"data-video\")],h=g.width||\"100%\",i=g.height||this._core.$stage.height();\"youtube\"===g.type?c='<iframe width=\"'+h+'\" height=\"'+i+'\" src=\"http://www.youtube.com/embed/'+g.id+\"?autoplay=1&v=\"+g.id+'\" frameborder=\"0\" allowfullscreen></iframe>':\"vimeo\"===g.type&&(c='<iframe src=\"http://player.vimeo.com/video/'+g.id+'?autoplay=1\" width=\"'+h+'\" height=\"'+i+'\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'),f.addClass(\"owl-video-playing\"),this._playing=f,d=a('<div style=\"height:'+i+\"px; width:\"+h+'px\" class=\"owl-video-frame\">'+c+\"</div>\"),e.after(d)},d.prototype.isInFullScreen=function(){var d=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return d&&a(d).parent().hasClass(\"owl-video-frame\")&&(this._core.speed(0),this._fullscreen=!0),d&&this._fullscreen&&this._playing?!1:this._fullscreen?(this._fullscreen=!1,!1):this._playing&&this._core.state.orientation!==b.orientation?(this._core.state.orientation=b.orientation,!1):!0},d.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=d}(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){\"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){this.swapping=\"translated\"==a.type},this),\"translate.owl.carousel\":a.proxy(function(){this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&this.core.support3d){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.css({left:b+\"px\"}).addClass(\"animated owl-animated-out\").addClass(g).one(\"webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend\",c)),f&&e.addClass(\"animated owl-animated-in\").addClass(f).one(\"webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend\",c))}},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.transitionEnd()},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){var d=function(b){this.core=b,this.core.options=a.extend({},d.Defaults,this.core.options),this.handlers={\"translated.owl.carousel refreshed.owl.carousel\":a.proxy(function(){this.autoplay()\n},this),\"play.owl.autoplay\":a.proxy(function(a,b,c){this.play(b,c)},this),\"stop.owl.autoplay\":a.proxy(function(){this.stop()},this),\"mouseover.owl.autoplay\":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.pause()},this),\"mouseleave.owl.autoplay\":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.autoplay()},this)},this.core.$element.on(this.handlers)};d.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},d.prototype.autoplay=function(){this.core.settings.autoplay&&!this.core.state.videoPlay?(b.clearInterval(this.interval),this.interval=b.setInterval(a.proxy(function(){this.play()},this),this.core.settings.autoplayTimeout)):b.clearInterval(this.interval)},d.prototype.play=function(){return c.hidden===!0||this.core.state.isTouch||this.core.state.isScrolling||this.core.state.isSwiping||this.core.state.inMotion?void 0:this.core.settings.autoplay===!1?void b.clearInterval(this.interval):void this.core.next(this.core.settings.autoplaySpeed)},d.prototype.stop=function(){b.clearInterval(this.interval)},d.prototype.pause=function(){b.clearInterval(this.interval)},d.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.autoplay=d}(window.Zepto||window.jQuery,window,document),function(a){\"use strict\";var b=function(c){this._core=c,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){this._core.settings.dotsData&&this._templates.push(a(b.content).find(\"[data-dot]\").andSelf(\"[data-dot]\").attr(\"data-dot\"))},this),\"add.owl.carousel\":a.proxy(function(b){this._core.settings.dotsData&&this._templates.splice(b.position,0,a(b.content).find(\"[data-dot]\").andSelf(\"[data-dot]\").attr(\"data-dot\"))},this),\"remove.owl.carousel prepared.owl.carousel\":a.proxy(function(a){this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),\"change.owl.carousel\":a.proxy(function(a){if(\"position\"==a.property.name&&!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){var b=this._core.current(),c=this._core.maximum(),d=this._core.minimum();a.data=a.property.value>c?b>=c?d:c:a.property.value<d?c:a.property.value}},this),\"changed.owl.carousel\":a.proxy(function(a){\"position\"==a.property.name&&this.draw()},this),\"refreshed.owl.carousel\":a.proxy(function(){this._initialized||(this.initialize(),this._initialized=!0),this._core.trigger(\"refresh\",null,\"navigation\"),this.update(),this.draw(),this._core.trigger(\"refreshed\",null,\"navigation\")},this)},this._core.options=a.extend({},b.Defaults,this._core.options),this.$element.on(this._handlers)};b.Defaults={nav:!1,navRewind:!0,navText:[\"prev\",\"next\"],navSpeed:!1,navElement:\"div\",navContainer:!1,navContainerClass:\"owl-nav\",navClass:[\"owl-prev\",\"owl-next\"],slideBy:1,dotClass:\"owl-dot\",dotsClass:\"owl-dots\",dots:!0,dotsEach:!1,dotData:!1,dotsSpeed:!1,dotsContainer:!1,controlsClass:\"owl-controls\"},b.prototype.initialize=function(){var b,c,d=this._core.settings;d.dotsData||(this._templates=[a(\"<div>\").addClass(d.dotClass).append(a(\"<span>\")).prop(\"outerHTML\")]),d.navContainer&&d.dotsContainer||(this._controls.$container=a(\"<div>\").addClass(d.controlsClass).appendTo(this.$element)),this._controls.$indicators=d.dotsContainer?a(d.dotsContainer):a(\"<div>\").hide().addClass(d.dotsClass).appendTo(this._controls.$container),this._controls.$indicators.on(\"click\",\"div\",a.proxy(function(b){var c=a(b.target).parent().is(this._controls.$indicators)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(c,d.dotsSpeed)},this)),b=d.navContainer?a(d.navContainer):a(\"<div>\").addClass(d.navContainerClass).prependTo(this._controls.$container),this._controls.$next=a(\"<\"+d.navElement+\">\"),this._controls.$previous=this._controls.$next.clone(),this._controls.$previous.addClass(d.navClass[0]).html(d.navText[0]).hide().prependTo(b).on(\"click\",a.proxy(function(){this.prev(d.navSpeed)},this)),this._controls.$next.addClass(d.navClass[1]).html(d.navText[1]).hide().appendTo(b).on(\"click\",a.proxy(function(){this.next(d.navSpeed)},this));for(c in this._overrides)this._core[c]=a.proxy(this[c],this)},b.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)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)},b.prototype.update=function(){var a,b,c,d=this._core.settings,e=this._core.clones().length/2,f=e+this._core.items().length,g=d.center||d.autoWidth||d.dotData?1:d.dotsEach||d.items;if(\"page\"!==d.slideBy&&(d.slideBy=Math.min(d.slideBy,d.items)),d.dots||\"page\"==d.slideBy)for(this._pages=[],a=e,b=0,c=0;f>a;a++)(b>=g||0===b)&&(this._pages.push({start:a-e,end:a-e+g-1}),b=0,++c),b+=this._core.mergers(this._core.relative(a))},b.prototype.draw=function(){var b,c,d=\"\",e=this._core.settings,f=(this._core.$stage.children(),this._core.relative(this._core.current()));if(!e.nav||e.loop||e.navRewind||(this._controls.$previous.toggleClass(\"disabled\",0>=f),this._controls.$next.toggleClass(\"disabled\",f>=this._core.maximum())),this._controls.$previous.toggle(e.nav),this._controls.$next.toggle(e.nav),e.dots){if(b=this._pages.length-this._controls.$indicators.children().length,e.dotData&&0!==b){for(c=0;c<this._controls.$indicators.children().length;c++)d+=this._templates[this._core.relative(c)];this._controls.$indicators.html(d)}else b>0?(d=new Array(b+1).join(this._templates[0]),this._controls.$indicators.append(d)):0>b&&this._controls.$indicators.children().slice(b).remove();this._controls.$indicators.find(\".active\").removeClass(\"active\"),this._controls.$indicators.children().eq(a.inArray(this.current(),this._pages)).addClass(\"active\")}this._controls.$indicators.toggle(e.dots)},b.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.dotData?1:c.dotsEach||c.items)}},b.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,function(a){return a.start<=b&&a.end>=b}).pop()},b.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},b.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},b.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},b.prototype.to=function(b,c,d){var e;d?a.proxy(this._overrides.to,this._core)(b,c):(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=b}(window.Zepto||window.jQuery,window,document),function(a,b){\"use strict\";var c=function(d){this._core=d,this._hashes={},this.$element=this._core.$element,this._handlers={\"initialized.owl.carousel\":a.proxy(function(){\"URLHash\"==this._core.settings.startPosition&&a(b).trigger(\"hashchange.owl.navigation\")},this),\"prepared.owl.carousel\":a.proxy(function(b){var c=a(b.content).find(\"[data-hash]\").andSelf(\"[data-hash]\").attr(\"data-hash\");this._hashes[c]=b.content},this)},this._core.options=a.extend({},c.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on(\"hashchange.owl.navigation\",a.proxy(function(){var a=b.location.hash.substring(1),c=this._core.$stage.children(),d=this._hashes[a]&&c.index(this._hashes[a])||0;return a?void this._core.to(d,!1,!0):!1},this))};c.Defaults={URLhashListener:!1},c.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=c}(window.Zepto||window.jQuery,window,document);","Mageplaza_Core/js/ion.rangeSlider.min.js":"// Ion.RangeSlider | version 2.1.6 | https://github.com/IonDen/ion.rangeSlider\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\"!=\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>=\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),\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:[],\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,\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\"),\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\"),\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)&&\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,\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>');\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>');\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>'),\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\"),\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=\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);\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-\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_\"+\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,\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,\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\")),\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_\"+\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\")),\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_\"+\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)))}},\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(),\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\"),\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();\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])),\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);\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=\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);\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;\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>\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;\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\");\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,\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);\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=\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=\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]));\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=\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?\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/\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,\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=\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);\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||\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||\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=\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=\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?\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();\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\"===\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=\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)-\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=\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\"===\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\",\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();\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;\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)*\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):\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,\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);\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=\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=\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>\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]?\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])},\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);\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;\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]);\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]!==\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),\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),\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\",\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)})})()});\n","Mageplaza_Core/js/jquery.autocomplete.min.js":"/**\n * Ajax Autocomplete for jQuery, version 1.3.0\n * (c) 2017 Tomas Kirda\n *\n * Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.\n * For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete\n */\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)}});"} }});