/*! * * js-cloudimage-responsive v4.7.0 with low quality image placeholder technique * https://github.com/scaleflex/js-cloudimage-responsive * * Copyright (c) 2019 scaleflex * Released under the MIT license * * Date: 2021-02-24T07:32:07.496Z * */ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 40); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var check = function (it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = /* global globalThis -- safe */ check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || // eslint-disable-next-line no-new-func -- fallback (function () { return this; })() || Function('return this')(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(44))) /***/ }), /* 1 */ /***/ (function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(3); // Detect IE8's incomplete defineProperty implementation module.exports = !fails(function () { return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); /***/ }), /* 3 */ /***/ (function(module, exports) { module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; /***/ }), /* 4 */ /***/ (function(module, exports) { module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(2); var definePropertyModule = __webpack_require__(6); var createPropertyDescriptor = __webpack_require__(17); module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(2); var IE8_DOM_DEFINE = __webpack_require__(22); var anObject = __webpack_require__(7); var toPrimitive = __webpack_require__(21); var nativeDefineProperty = Object.defineProperty; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return nativeDefineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(4); module.exports = function (it) { if (!isObject(it)) { throw TypeError(String(it) + ' is not an object'); } return it; }; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { // toObject with fallback for non-array-like ES3 strings var IndexedObject = __webpack_require__(18); var requireObjectCoercible = __webpack_require__(20); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var createNonEnumerableProperty = __webpack_require__(5); module.exports = function (key, value) { try { createNonEnumerableProperty(global, key, value); } catch (error) { global[key] = value; } return value; }; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var setGlobal = __webpack_require__(9); var SHARED = '__core-js_shared__'; var store = global[SHARED] || setGlobal(SHARED, {}); module.exports = store; /***/ }), /* 11 */ /***/ (function(module, exports) { module.exports = {}; /***/ }), /* 12 */ /***/ (function(module, exports) { // IE8- don't enum bug keys module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.destroyNodeImgSize = exports.getFreshCIElements = exports.setBackgroundSrc = exports.setSrcset = exports.setSrc = exports.isLazy = exports.getWrapper = exports.addClass = exports.getBackgroundImageProps = exports.getImageProps = exports.getParams = exports.filterImages = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _getParamsFromUrl = __webpack_require__(72); var filterImages = exports.filterImages = function filterImages(images, type) { var filtered = []; for (var i = 0; i < images.length; i++) { var image = images[i]; var isProcessed = image.className.indexOf(type) !== -1; if (!isProcessed) { filtered.push(image); } } return filtered; }; var getCommonImageProps = function getCommonImageProps(image) { return { sizes: getSize(attr(image, 'ci-sizes') || attr(image, 'data-ci-size') || {}) || undefined, params: getParams(attr(image, 'ci-params') || attr(image, 'data-ci-params') || {}), imgNodeRatio: attr(image, 'ci-ratio') || attr(image, 'data-ci-ratio') || undefined, blurHash: attr(image, 'ci-blur-hash') || attr(image, 'data-ci-blur-hash') || undefined, isLazyCanceled: attr(image, 'ci-not-lazy') !== null || attr(image, 'data-ci-not-lazy') !== null || undefined, preserveSize: attr(image, 'ci-preserve-size') !== null || attr(image, 'data-preserve-size') !== null || undefined, imgNodeWidth: attr(image, 'width'), imgNodeHeight: attr(image, 'height') }; }; var getParams = exports.getParams = function getParams(params) { var resultParams = undefined; try { var temp = params.replace(/(\w+:)|(\w+ :)/g, function (matchedStr) { return '"' + matchedStr.substring(0, matchedStr.length - 1) + '":'; }); resultParams = JSON.parse(temp); } catch (e) {} if (!resultParams) { try { resultParams = JSON.parse('{"' + decodeURI(params.replace(/&/g, "\",\"").replace(/=/g, "\":\"")) + '"}'); } catch (e) {} } return resultParams; }; var getSize = function getSize(sizes) { var resultSizes = null; try { // add quotes around params var temp = sizes.replace(/(\w+:)|(\w+ :)/g, function (matchedStr) { if (matchedStr === 'https:' || matchedStr === 'http:') { return matchedStr; } else { return '"' + matchedStr.substring(0, matchedStr.length - 1) + '":'; } }); // change single quotes to double quotes temp = temp.replace(/'/g, '"').replace(/-"width":/g, '-width:'); resultSizes = JSON.parse(temp); } catch (e) {} if (resultSizes) { Object.keys(resultSizes).forEach(function (key) { if (typeof resultSizes[key] === 'string') { try { resultSizes[key] = JSON.parse('{"' + decodeURI(resultSizes[key].replace(/&/g, "\",\"").replace(/=/g, "\":\"")) + '"}'); } catch (e) {} } }); } return resultSizes; }; var getImageProps = exports.getImageProps = function getImageProps(image, imgSelector) { var props = _extends({}, getCommonImageProps(image), { imgNodeSRC: attr(image, imgSelector) || undefined }); var params = _extends({}, (0, _getParamsFromUrl.getParamsFromURL)(props.imgNodeSRC || ''), props.params); return _extends({}, props, { params: params, isAdaptive: !!props.sizes, imgNodeSRC: getURLWithoutQueryParams(props.imgNodeSRC) }); }; var getBackgroundImageProps = exports.getBackgroundImageProps = function getBackgroundImageProps(image, bgSelector) { var props = _extends({}, getCommonImageProps(image), { imgNodeSRC: attr(image, bgSelector) || undefined, minWindowWidth: attr(image, 'ci-min-window-width') || attr(image, 'data-min-window-width') || undefined }); var params = _extends({}, (0, _getParamsFromUrl.getParamsFromURL)(props.imgNodeSRC || ''), props.params); return _extends({}, props, { params: params, isAdaptive: !!props.sizes, imgNodeSRC: getURLWithoutQueryParams(props.imgNodeSRC) }); }; var getURLWithoutQueryParams = function getURLWithoutQueryParams() { var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; return url.split('?')[0]; }; var attr = function attr(element, attribute) { return element.getAttribute(attribute); }; var addClass = exports.addClass = function addClass(elem, className) { if (!(elem.className.indexOf(className) > -1)) { elem.className += ' ' + className; } }; var getWrapper = exports.getWrapper = function getWrapper(image) { if ((image.parentNode.className || '').indexOf('ci-image-wrapper') > -1) { return image.parentNode; } else if ((image.parentNode.parentNode.className || '').indexOf('ci-image-wrapper') > -1) { return image.parentNode.parentNode; } }; var isLazy = exports.isLazy = function isLazy(lazyLoading, isLazyCanceled, isUpdate) { if (isLazyCanceled && lazyLoading || isUpdate) { lazyLoading = false; } return lazyLoading; }; var setSrc = exports.setSrc = function setSrc(image, url, propertyName, lazy, imgSrc, isSVG, dataSrcAttr) { image.setAttribute(lazy ? propertyName ? propertyName : 'data-src' : dataSrcAttr ? dataSrcAttr : 'src', isSVG ? imgSrc : url); }; var setSrcset = exports.setSrcset = function setSrcset(image, urls, propertyName, lazy, imgSrc, isSVG, dataSrcAttr) { if (isSVG) return; image.setAttribute(lazy ? propertyName ? propertyName : 'data-srcset' : dataSrcAttr ? dataSrcAttr : 'srcset', urls.map(function (_ref) { var dpr = _ref.dpr, url = _ref.url; return url + ' ' + dpr + 'x'; }).join(', ')); }; var setBackgroundSrc = exports.setBackgroundSrc = function setBackgroundSrc(image, url, lazy, imgSrc, isSVG, dataSrcAttr) { var resultLink = isSVG ? imgSrc : url; if (lazy) { image.setAttribute(dataSrcAttr ? dataSrcAttr : 'data-bg', resultLink); } else { image.style.backgroundImage = 'url(\'' + resultLink + '\')'; } }; var getFreshCIElements = exports.getFreshCIElements = function getFreshCIElements(isUpdate, rootElement, imgSelector, bgSelector) { var images = void 0, backgroundImages = void 0; if (rootElement !== document && !(rootElement instanceof HTMLElement)) { throw new TypeError('rootElement should be an HTMLElement'); } if (isUpdate) { images = rootElement.querySelectorAll('img[' + imgSelector + ']'); backgroundImages = rootElement.querySelectorAll('[' + bgSelector + ']'); } else { images = filterImages(rootElement.querySelectorAll('img[' + imgSelector + ']'), 'ci-image'); backgroundImages = filterImages(rootElement.querySelectorAll('[' + bgSelector + ']'), 'ci-bg'); } return [images, backgroundImages]; }; var destroyNodeImgSize = exports.destroyNodeImgSize = function destroyNodeImgSize(imgNode) { imgNode.removeAttribute("height"); imgNode.removeAttribute("width"); }; /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DEVICE_PIXEL_RATIO_LIST = void 0; var DEVICE_PIXEL_RATIO_LIST = [1, 1.5, 2, 3, 4]; exports.DEVICE_PIXEL_RATIO_LIST = DEVICE_PIXEL_RATIO_LIST; /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var getOwnPropertyDescriptor = __webpack_require__(16).f; var createNonEnumerableProperty = __webpack_require__(5); var redefine = __webpack_require__(46); var setGlobal = __webpack_require__(9); var copyConstructorProperties = __webpack_require__(50); var isForced = __webpack_require__(56); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global; } else if (STATIC) { target = global[TARGET] || setGlobal(TARGET, {}); } else { target = (global[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty === typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } // extend global redefine(target, key, sourceProperty, options); } }; /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(2); var propertyIsEnumerableModule = __webpack_require__(45); var createPropertyDescriptor = __webpack_require__(17); var toIndexedObject = __webpack_require__(8); var toPrimitive = __webpack_require__(21); var has = __webpack_require__(1); var IE8_DOM_DEFINE = __webpack_require__(22); var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return nativeGetOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); }; /***/ }), /* 17 */ /***/ (function(module, exports) { module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(3); var classof = __webpack_require__(19); var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) == 'String' ? split.call(it, '') : Object(it); } : Object; /***/ }), /* 19 */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; /***/ }), /* 20 */ /***/ (function(module, exports) { // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(4); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (input, PREFERRED_STRING) { if (!isObject(input)) return input; var fn, val; if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; throw TypeError("Can't convert object to primitive value"); }; /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(2); var fails = __webpack_require__(3); var createElement = __webpack_require__(23); // Thank's IE8 for his funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var isObject = __webpack_require__(4); var document = global.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { var store = __webpack_require__(10); var functionToString = Function.toString; // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper if (typeof store.inspectSource != 'function') { store.inspectSource = function (it) { return functionToString.call(it); }; } module.exports = store.inspectSource; /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { var shared = __webpack_require__(26); var uid = __webpack_require__(27); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; /***/ }), /* 26 */ /***/ (function(module, exports, __webpack_require__) { var IS_PURE = __webpack_require__(49); var store = __webpack_require__(10); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.9.0', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2021 Denis Pushkarev (zloirock.ru)' }); /***/ }), /* 27 */ /***/ (function(module, exports) { var id = 0; var postfix = Math.random(); module.exports = function (key) { return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); }; /***/ }), /* 28 */ /***/ (function(module, exports, __webpack_require__) { var path = __webpack_require__(29); var global = __webpack_require__(0); var aFunction = function (variable) { return typeof variable == 'function' ? variable : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; }; /***/ }), /* 29 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); module.exports = global; /***/ }), /* 30 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(1); var toIndexedObject = __webpack_require__(8); var indexOf = __webpack_require__(53).indexOf; var hiddenKeys = __webpack_require__(11); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~indexOf(result, key) || result.push(key); } return result; }; /***/ }), /* 31 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(32); var min = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength module.exports = function (argument) { return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; /***/ }), /* 32 */ /***/ (function(module, exports) { var ceil = Math.ceil; var floor = Math.floor; // `ToInteger` abstract operation // https://tc39.es/ecma262/#sec-tointeger module.exports = function (argument) { return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); }; /***/ }), /* 33 */ /***/ (function(module, exports, __webpack_require__) { var aFunction = __webpack_require__(58); // optional / simple context binding module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 0: return function () { return fn.call(that); }; case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var shared = __webpack_require__(26); var has = __webpack_require__(1); var uid = __webpack_require__(27); var NATIVE_SYMBOL = __webpack_require__(35); var USE_SYMBOL_AS_UID = __webpack_require__(62); var WellKnownSymbolsStore = shared('wks'); var Symbol = global.Symbol; var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { if (!has(WellKnownSymbolsStore, name)) { if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name]; else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; /***/ }), /* 35 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(3); module.exports = !!Object.getOwnPropertySymbols && !fails(function () { // Chrome 38 Symbol has incorrect toString conversion /* global Symbol -- required for testing */ return !String(Symbol()); }); /***/ }), /* 36 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isCrop = void 0; var isCrop = function isCrop(func) { return ['crop', 'fit', 'bound', 'cover'].indexOf(func) !== -1; }; exports.isCrop = isCrop; /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.convertToPX = void 0; var convertToPX = function convertToPX() { var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; size = size.toString(); if (size.indexOf('px') > -1) { return parseInt(size); } else if (size.indexOf('%') > -1) { // todo calculate container width * % // todo could be the potenial problem when the plugin set 100% width and on update it can calculate wrong value return null; } else if (size.indexOf('vw') > -1) { return window.innerWidth * parseInt(size) / 100; } else if (size.indexOf('vh') > -1) { return window.innerHeight * parseInt(size) / 100; } return parseInt(size) || null; }; exports.convertToPX = convertToPX; /***/ }), /* 38 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getParentContainerSize = void 0; var getParentContainerSize = function getParentContainerSize(img) { var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'width'; var parentNode = null; var size = 0; do { parentNode = parentNode && parentNode.parentNode || img.parentNode; size = typeof parentNode.getBoundingClientRect === 'function' ? parentNode.getBoundingClientRect()[type] : window.innerWidth; } while (parentNode && !size); var leftPadding = size && parentNode && parentNode.nodeType === 1 ? parseInt(window.getComputedStyle(parentNode).paddingLeft) : 0; var rightPadding = size && parentNode && parentNode.nodeType === 1 ? parseInt(window.getComputedStyle(parentNode).paddingRight) : 0; return size + (size ? -leftPadding - rightPadding : 0); }; exports.getParentContainerSize = getParentContainerSize; /***/ }), /* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateURL = void 0; var _constants = __webpack_require__(14); function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var generateURL = function generateURL(props) { var src = props.src, params = props.params, config = props.config, containerProps = props.containerProps, _props$devicePixelRat = props.devicePixelRatio, devicePixelRatio = _props$devicePixelRat === void 0 ? 1 : _props$devicePixelRat; var size = containerProps && containerProps.sizes[_constants.DEVICE_PIXEL_RATIO_LIST.indexOf(devicePixelRatio)]; var _ref = size || {}, width = _ref.width, height = _ref.height; var token = config.token, domain = config.domain, doNotReplaceURL = config.doNotReplaceURL; return [doNotReplaceURL ? '' : "https://".concat(token, ".").concat(domain, "/v7/"), src, src.indexOf('?') !== -1 ? '&' : '?', getQueryString({ params: _objectSpread(_objectSpread({}, config.params), params), width: width, height: height, config: config })].join(''); }; exports.generateURL = generateURL; var getQueryString = function getQueryString(props) { var _props$params = props.params, params = _props$params === void 0 ? {} : _props$params, width = props.width, height = props.height, config = props.config; var processOnlyWidth = config.processOnlyWidth; var _processParamsExceptS = processParamsExceptSizeRelated(params), _processParamsExceptS2 = _slicedToArray(_processParamsExceptS, 3), restParams = _processParamsExceptS2[0], _processParamsExceptS3 = _processParamsExceptS2[1], widthFromParam = _processParamsExceptS3 === void 0 ? null : _processParamsExceptS3, heightFromParam = _processParamsExceptS2[2]; var widthQ = width ? width : widthFromParam; var heightQ = height ? height : heightFromParam; var restParamsQ = Object.keys(restParams).map(function (key) { return encodeURIComponent(key) + "=" + encodeURIComponent(restParams[key]); }).join('&'); return [widthQ ? "w=".concat(widthQ) : '', heightQ && !processOnlyWidth ? (widthQ ? '&' : '') + "h=".concat(heightQ) : '', restParamsQ ? '&' + restParamsQ : ''].join(''); }; var processParamsExceptSizeRelated = function processParamsExceptSizeRelated(params) { var w = params.w, h = params.h, width = params.width, height = params.height, restParams = _objectWithoutProperties(params, ["w", "h", "width", "height"]); return [restParams, w || width, h || height]; }; /***/ }), /* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(41); __webpack_require__(69); var _ci = __webpack_require__(71); var _ci2 = _interopRequireDefault(_ci); __webpack_require__(87); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } window.CIResponsive = _ci2.default; /***/ }), /* 41 */ /***/ (function(module, exports, __webpack_require__) { var parent = __webpack_require__(42); module.exports = parent; /***/ }), /* 42 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(43); var entryUnbind = __webpack_require__(68); module.exports = entryUnbind('Array', 'find'); /***/ }), /* 43 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(15); var $find = __webpack_require__(57).find; var addToUnscopables = __webpack_require__(63); var FIND = 'find'; var SKIPS_HOLES = true; // Shouldn't skip holes if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { find: function find(callbackfn /* , that = undefined */) { return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables(FIND); /***/ }), /* 44 */ /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || new Function("return this")(); } catch (e) { // This works if the window reference is available if (typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /* 45 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var nativePropertyIsEnumerable = {}.propertyIsEnumerable; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : nativePropertyIsEnumerable; /***/ }), /* 46 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var createNonEnumerableProperty = __webpack_require__(5); var has = __webpack_require__(1); var setGlobal = __webpack_require__(9); var inspectSource = __webpack_require__(24); var InternalStateModule = __webpack_require__(47); var getInternalState = InternalStateModule.get; var enforceInternalState = InternalStateModule.enforce; var TEMPLATE = String(String).split('String'); (module.exports = function (O, key, value, options) { var unsafe = options ? !!options.unsafe : false; var simple = options ? !!options.enumerable : false; var noTargetGet = options ? !!options.noTargetGet : false; var state; if (typeof value == 'function') { if (typeof key == 'string' && !has(value, 'name')) { createNonEnumerableProperty(value, 'name', key); } state = enforceInternalState(value); if (!state.source) { state.source = TEMPLATE.join(typeof key == 'string' ? key : ''); } } if (O === global) { if (simple) O[key] = value; else setGlobal(key, value); return; } else if (!unsafe) { delete O[key]; } else if (!noTargetGet && O[key]) { simple = true; } if (simple) O[key] = value; else createNonEnumerableProperty(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, 'toString', function toString() { return typeof this == 'function' && getInternalState(this).source || inspectSource(this); }); /***/ }), /* 47 */ /***/ (function(module, exports, __webpack_require__) { var NATIVE_WEAK_MAP = __webpack_require__(48); var global = __webpack_require__(0); var isObject = __webpack_require__(4); var createNonEnumerableProperty = __webpack_require__(5); var objectHas = __webpack_require__(1); var shared = __webpack_require__(10); var sharedKey = __webpack_require__(25); var hiddenKeys = __webpack_require__(11); var WeakMap = global.WeakMap; var set, get, has; var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP) { var store = shared.state || (shared.state = new WeakMap()); var wmget = store.get; var wmhas = store.has; var wmset = store.set; set = function (it, metadata) { metadata.facade = it; wmset.call(store, it, metadata); return metadata; }; get = function (it) { return wmget.call(store, it) || {}; }; has = function (it) { return wmhas.call(store, it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; }; get = function (it) { return objectHas(it, STATE) ? it[STATE] : {}; }; has = function (it) { return objectHas(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; /***/ }), /* 48 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var inspectSource = __webpack_require__(24); var WeakMap = global.WeakMap; module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); /***/ }), /* 49 */ /***/ (function(module, exports) { module.exports = false; /***/ }), /* 50 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(1); var ownKeys = __webpack_require__(51); var getOwnPropertyDescriptorModule = __webpack_require__(16); var definePropertyModule = __webpack_require__(6); module.exports = function (target, source) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } }; /***/ }), /* 51 */ /***/ (function(module, exports, __webpack_require__) { var getBuiltIn = __webpack_require__(28); var getOwnPropertyNamesModule = __webpack_require__(52); var getOwnPropertySymbolsModule = __webpack_require__(55); var anObject = __webpack_require__(7); // all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; }; /***/ }), /* 52 */ /***/ (function(module, exports, __webpack_require__) { var internalObjectKeys = __webpack_require__(30); var enumBugKeys = __webpack_require__(12); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; /***/ }), /* 53 */ /***/ (function(module, exports, __webpack_require__) { var toIndexedObject = __webpack_require__(8); var toLength = __webpack_require__(31); var toAbsoluteIndex = __webpack_require__(54); // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare -- NaN check if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; module.exports = { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; /***/ }), /* 54 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(32); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). module.exports = function (index, length) { var integer = toInteger(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; /***/ }), /* 55 */ /***/ (function(module, exports) { exports.f = Object.getOwnPropertySymbols; /***/ }), /* 56 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(3); var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; /***/ }), /* 57 */ /***/ (function(module, exports, __webpack_require__) { var bind = __webpack_require__(33); var IndexedObject = __webpack_require__(18); var toObject = __webpack_require__(59); var toLength = __webpack_require__(31); var arraySpeciesCreate = __webpack_require__(60); var push = [].push; // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation var createMethod = function (TYPE) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; var IS_EVERY = TYPE == 4; var IS_FIND_INDEX = TYPE == 6; var IS_FILTER_OUT = TYPE == 7; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function ($this, callbackfn, that, specificCreate) { var O = toObject($this); var self = IndexedObject(O); var boundFunction = bind(callbackfn, that, 3); var length = toLength(self.length); var index = 0; var create = specificCreate || arraySpeciesCreate; var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined; var value, result; for (;length > index; index++) if (NO_HOLES || index in self) { value = self[index]; result = boundFunction(value, index, O); if (TYPE) { if (IS_MAP) target[index] = result; // map else if (result) switch (TYPE) { case 3: return true; // some case 5: return value; // find case 6: return index; // findIndex case 2: push.call(target, value); // filter } else switch (TYPE) { case 4: return false; // every case 7: push.call(target, value); // filterOut } } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; }; }; module.exports = { // `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach forEach: createMethod(0), // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map map: createMethod(1), // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter filter: createMethod(2), // `Array.prototype.some` method // https://tc39.es/ecma262/#sec-array.prototype.some some: createMethod(3), // `Array.prototype.every` method // https://tc39.es/ecma262/#sec-array.prototype.every every: createMethod(4), // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find find: createMethod(5), // `Array.prototype.findIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findIndex findIndex: createMethod(6), // `Array.prototype.filterOut` method // https://github.com/tc39/proposal-array-filtering filterOut: createMethod(7) }; /***/ }), /* 58 */ /***/ (function(module, exports) { module.exports = function (it) { if (typeof it != 'function') { throw TypeError(String(it) + ' is not a function'); } return it; }; /***/ }), /* 59 */ /***/ (function(module, exports, __webpack_require__) { var requireObjectCoercible = __webpack_require__(20); // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject module.exports = function (argument) { return Object(requireObjectCoercible(argument)); }; /***/ }), /* 60 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(4); var isArray = __webpack_require__(61); var wellKnownSymbol = __webpack_require__(34); var SPECIES = wellKnownSymbol('species'); // `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate module.exports = function (originalArray, length) { var C; if (isArray(originalArray)) { C = originalArray.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; else if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); }; /***/ }), /* 61 */ /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__(19); // `IsArray` abstract operation // https://tc39.es/ecma262/#sec-isarray module.exports = Array.isArray || function isArray(arg) { return classof(arg) == 'Array'; }; /***/ }), /* 62 */ /***/ (function(module, exports, __webpack_require__) { var NATIVE_SYMBOL = __webpack_require__(35); module.exports = NATIVE_SYMBOL /* global Symbol -- safe */ && !Symbol.sham && typeof Symbol.iterator == 'symbol'; /***/ }), /* 63 */ /***/ (function(module, exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__(34); var create = __webpack_require__(64); var definePropertyModule = __webpack_require__(6); var UNSCOPABLES = wellKnownSymbol('unscopables'); var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype[UNSCOPABLES] == undefined) { definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { configurable: true, value: create(null) }); } // add a key to Array.prototype[@@unscopables] module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; /***/ }), /* 64 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(7); var defineProperties = __webpack_require__(65); var enumBugKeys = __webpack_require__(12); var hiddenKeys = __webpack_require__(11); var html = __webpack_require__(67); var documentCreateElement = __webpack_require__(23); var sharedKey = __webpack_require__(25); var GT = '>'; var LT = '<'; var PROTOTYPE = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey('IE_PROTO'); var EmptyConstructor = function () { /* empty */ }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; activeXDocument = null; // avoid memory leak return temp; }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; }; // Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug var activeXDocument; var NullProtoObject = function () { try { /* global ActiveXObject -- old IE */ activeXDocument = document.domain && new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; return NullProtoObject(); }; hiddenKeys[IE_PROTO] = true; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE] = anObject(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = NullProtoObject(); return Properties === undefined ? result : defineProperties(result, Properties); }; /***/ }), /* 65 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(2); var definePropertyModule = __webpack_require__(6); var anObject = __webpack_require__(7); var objectKeys = __webpack_require__(66); // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); return O; }; /***/ }), /* 66 */ /***/ (function(module, exports, __webpack_require__) { var internalObjectKeys = __webpack_require__(30); var enumBugKeys = __webpack_require__(12); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { var getBuiltIn = __webpack_require__(28); module.exports = getBuiltIn('document', 'documentElement'); /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var bind = __webpack_require__(33); var call = Function.call; module.exports = function (CONSTRUCTOR, METHOD, length) { return bind(call, global[CONSTRUCTOR].prototype[METHOD], length); }; /***/ }), /* 69 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(70); var path = __webpack_require__(29); module.exports = path.Math.trunc; /***/ }), /* 70 */ /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__(15); var ceil = Math.ceil; var floor = Math.floor; // `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc $({ target: 'Math', stat: true }, { trunc: function trunc(it) { return (it > 0 ? floor : ceil)(it); } }); /***/ }), /* 71 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _ci = __webpack_require__(13); var _isLowQualityPreview = __webpack_require__(73); var _determineContainerProps = __webpack_require__(74); var _getImgSrc = __webpack_require__(79); var _generateUrl = __webpack_require__(39); var _getPreviewSrc = __webpack_require__(81); var _getBreakpoint = __webpack_require__(82); var _isSupportedInBrowser = __webpack_require__(83); var _ci2 = __webpack_require__(84); var _ci3 = __webpack_require__(85); var _throttleDebounce = __webpack_require__(86); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var CIResponsive = function () { function CIResponsive(config) { _classCallCheck(this, CIResponsive); _initialiseProps.call(this); this.config = (0, _ci2.getInitialConfigLowPreview)(config); if (this.config.init) this.init(); this.innerWidth = window.innerWidth; } _createClass(CIResponsive, [{ key: 'init', value: function init() { document.addEventListener('lazybeforeunveil', _ci3.onLazyBeforeUnveil); window.addEventListener('resize', (0, _throttleDebounce.debounce)(100, this.onUpdateDimensions.bind(this))); this.process(); } }, { key: 'onUpdateDimensions', value: function onUpdateDimensions() { this.process(true); if (this.innerWidth < window.innerWidth) { this.innerWidth = window.innerWidth; } } }, { key: 'process', value: function process(isUpdate) { var _this = this; var rootElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; var _config = this.config, imgSelector = _config.imgSelector, bgSelector = _config.bgSelector; var windowScreenBecomesBigger = this.innerWidth < window.innerWidth; var _getFreshCIElements = (0, _ci.getFreshCIElements)(isUpdate, rootElement, imgSelector, bgSelector), _getFreshCIElements2 = _slicedToArray(_getFreshCIElements, 2), images = _getFreshCIElements2[0], backgroundImages = _getFreshCIElements2[1]; if (images.length > -1) { images.forEach(function (imgNode) { _this.getBasicInfo(imgNode, isUpdate, windowScreenBecomesBigger, 'image'); }); } if (backgroundImages.length > -1) { backgroundImages.forEach(function (imgNode) { _this.getBasicInfo(imgNode, isUpdate, windowScreenBecomesBigger, 'background'); }); } } }, { key: 'processImage', value: function processImage(props) { var imgNode = props.imgNode, isUpdate = props.isUpdate, imgProps = props.imgProps, lazy = props.lazy, isPreview = props.isPreview, containerProps = props.containerProps, isSVG = props.isSVG, cloudimageUrl = props.cloudimageUrl, src = props.src, preserveSize = props.preserveSize, cloudimageSrcset = props.cloudimageSrcset, isAdaptive = props.isAdaptive; var params = imgProps.params; var width = containerProps.width, ratio = containerProps.ratio; var config = this.config; var dataSrcAttr = config.dataSrcAttr, placeholderBackground = config.placeholderBackground; var _applyOrUpdateWrapper = (0, _ci3.applyOrUpdateWrapper)(_extends({ isUpdate: isUpdate, imgNode: imgNode, ratio: ratio, lazy: lazy, placeholderBackground: placeholderBackground, preserveSize: preserveSize, isPreview: isPreview }, imgProps)), wrapper = _applyOrUpdateWrapper.wrapper, previewImgNode = _applyOrUpdateWrapper.previewImgNode, previewWrapper = _applyOrUpdateWrapper.previewWrapper; if (!isUpdate) { (0, _ci3.initImageClasses)({ imgNode: imgNode, lazy: lazy }); if (config.destroyNodeImgSize) { (0, _ci.destroyNodeImgSize)(imgNode); } if (isPreview) { var previewImgURL = (0, _getPreviewSrc.getPreviewSRC)({ src: src, params: params, config: config, containerProps: containerProps }); (0, _ci3.setAnimation)(previewWrapper, previewImgNode, (0, _ci3.updateSizeWithPixelRatio)(width)); (0, _ci.setSrc)(previewImgNode, previewImgURL, 'data-src', lazy, src, isSVG, dataSrcAttr); previewImgNode.onload = function () { (0, _ci3.onPreviewImageLoad)(wrapper, previewImgNode, ratio, preserveSize); }; } } imgNode.onload = function () { if (config.onImageLoad && typeof config.onImageLoad === 'function') { config.onImageLoad(imgNode); } (0, _ci3.onImageLoad)(wrapper, previewImgNode, imgNode, ratio, preserveSize, isAdaptive); }; (0, _ci.setSrcset)(imgNode, cloudimageSrcset, 'data-srcset', lazy, src, isSVG, dataSrcAttr); (0, _ci.setSrc)(imgNode, cloudimageUrl, 'data-src', lazy, src, isSVG, dataSrcAttr); } }, { key: 'processBackgroundImage', value: function processBackgroundImage(props) { var imgNode = props.imgNode, isUpdate = props.isUpdate, imgProps = props.imgProps, lazy = props.lazy, isPreview = props.isPreview, containerProps = props.containerProps, isSVG = props.isSVG, cloudimageUrl = props.cloudimageUrl, src = props.src; var params = imgProps.params; var width = containerProps.width; var config = this.config; var dataSrcAttr = config.dataSrcAttr; if (!isUpdate) { if (isPreview) { var previewImgURL = (0, _getPreviewSrc.getPreviewSRC)({ src: src, params: params, config: config, containerProps: containerProps }); var _wrapBackgroundContai = (0, _ci3.wrapBackgroundContainer)(imgNode), _wrapBackgroundContai2 = _slicedToArray(_wrapBackgroundContai, 2), previewBox = _wrapBackgroundContai2[0], contentBox = _wrapBackgroundContai2[1]; (0, _ci3.applyBackgroundStyles)({ imgNode: imgNode, previewBox: previewBox, contentBox: contentBox, lazy: lazy, width: width }); if (lazy) { imgNode.setAttribute('ci-optimized-url', cloudimageUrl); (0, _ci.setBackgroundSrc)(previewBox, previewImgURL, lazy, src, isSVG, dataSrcAttr); } else { (0, _ci3.loadBackgroundImage)(previewImgURL, isPreview, previewBox, cloudimageUrl); } } else { imgNode.className = '' + imgNode.className + (lazy ? ' lazyload' : ''); (0, _ci3.loadBackgroundImage)(cloudimageUrl, false, imgNode, null); } } else { (0, _ci.setBackgroundSrc)(imgNode, cloudimageUrl, lazy, src, isSVG, dataSrcAttr); } } }]); return CIResponsive; }(); var _initialiseProps = function _initialiseProps() { var _this2 = this; this.getBasicInfo = function (imgNode, isUpdate, windowScreenBecomesBigger, type) { var isImage = type === 'image'; var config = _this2.config; var baseURL = config.baseURL, lazyLoading = config.lazyLoading, presets = config.presets, devicePixelRatioList = config.devicePixelRatioList, minLowQualityWidth = config.minLowQualityWidth, imgSelector = config.imgSelector, bgSelector = config.bgSelector; var imgProps = isImage ? (0, _ci.getImageProps)(imgNode, imgSelector) : (0, _ci.getBackgroundImageProps)(imgNode, bgSelector); var params = imgProps.params, imgNodeSRC = imgProps.imgNodeSRC, isLazyCanceled = imgProps.isLazyCanceled, sizes = imgProps.sizes, isAdaptive = imgProps.isAdaptive, preserveSize = imgProps.preserveSize, minWindowWidth = imgProps.minWindowWidth; if (!imgNodeSRC) return; var _getImgSRC = (0, _getImgSrc.getImgSRC)(imgNodeSRC, baseURL), _getImgSRC2 = _slicedToArray(_getImgSRC, 2), src = _getImgSRC2[0], isSVG = _getImgSRC2[1]; var lazy = (0, _ci.isLazy)(lazyLoading, isLazyCanceled, isUpdate); var size = void 0; if (!(0, _isSupportedInBrowser.isSupportedInBrowser)(true)) { if (isImage) { imgNode.src = src; } else { imgNode.style.backgroundImage = 'url(' + src + ')'; } return; } if (window.innerWidth < minWindowWidth && !isImage) { imgNode.style.backgroundImage = 'none'; return; } if (isAdaptive) { size = (0, _getBreakpoint.getBreakpoint)(sizes, presets); if (size) { if (size.params.src) { var _getImgSRC3 = (0, _getImgSrc.getImgSRC)(size.params.src, baseURL); var _getImgSRC4 = _slicedToArray(_getImgSRC3, 2); src = _getImgSRC4[0]; isSVG = _getImgSRC4[1]; } } } else { if (isUpdate && !windowScreenBecomesBigger) return; } var containerProps = (0, _determineContainerProps.determineContainerProps)(_extends({}, imgProps, { size: size, imgNode: imgNode, config: config })); var width = containerProps.width; var isPreview = (0, _isLowQualityPreview.isLowQualityPreview)(isAdaptive, width, isSVG, minLowQualityWidth); var generateURLbyDPR = function generateURLbyDPR(devicePixelRatio) { return (0, _generateUrl.generateURL)({ src: src, params: params, config: config, containerProps: containerProps, devicePixelRatio: devicePixelRatio }); }; var cloudimageUrl = generateURLbyDPR(); var cloudimageSrcset = devicePixelRatioList.map(function (dpr) { return { dpr: dpr.toString(), url: generateURLbyDPR(dpr) }; }); var props = { imgNode: imgNode, isUpdate: isUpdate, imgProps: imgProps, lazy: lazy, isPreview: isPreview, containerProps: containerProps, isSVG: isSVG, cloudimageUrl: cloudimageUrl, src: src, preserveSize: preserveSize, isAdaptive: isAdaptive }; if (isImage) { _this2.processImage(_extends({}, props, { cloudimageUrl: generateURLbyDPR(1), cloudimageSrcset: cloudimageSrcset })); } else { _this2.processBackgroundImage(props); } }; }; exports.default = CIResponsive; /***/ }), /* 72 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getParamsFromURL = void 0; var getParamsFromURL = function getParamsFromURL(url) { var queryIndex = url.indexOf('?'); if (queryIndex === -1) return; return processParams(url.slice(queryIndex + 1)); }; exports.getParamsFromURL = getParamsFromURL; var processParams = function processParams(params) { var resultParams = undefined; try { var temp = params.replace(/(\w+:)|(\w+ :)/g, function (matchedStr) { return '"' + matchedStr.substring(0, matchedStr.length - 1) + '":'; }); resultParams = JSON.parse(temp); } catch (e) {} if (!resultParams) { try { resultParams = JSON.parse('{"' + decodeURI(params.replace(/&/g, "\",\"").replace(/=/g, "\":\"")) + '"}'); } catch (e) {} } return resultParams; }; /***/ }), /* 73 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isLowQualityPreview = void 0; var isLowQualityPreview = function isLowQualityPreview(adaptive, width, svg, minLowQualityWidth) { return adaptive ? width > minLowQualityWidth : width > minLowQualityWidth && !svg; }; exports.isLowQualityPreview = isLowQualityPreview; /***/ }), /* 74 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.determineContainerProps = void 0; var _isCrop = __webpack_require__(36); var _getWidth3 = __webpack_require__(75); var _getHeight = __webpack_require__(76); var _getRatio = __webpack_require__(77); var _constants = __webpack_require__(14); var _getSizeLimit = __webpack_require__(78); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var determineContainerProps = function determineContainerProps(props) { var imgNode = props.imgNode, _props$config = props.config, config = _props$config === void 0 ? {} : _props$config, imgNodeWidth = props.imgNodeWidth, imgNodeHeight = props.imgNodeHeight, imgNodeRatio = props.imgNodeRatio, params = props.params, size = props.size; var ignoreNodeImgSize = config.ignoreNodeImgSize; var ratio = null; var crop = (0, _isCrop.isCrop)(params.func || config.params.func); var exactSize = config.exactSize, limitFactor = config.limitFactor; var _getWidth = (0, _getWidth3.getWidth)({ imgNode: imgNode, config: config, exactSize: exactSize, imgNodeWidth: imgNodeWidth, params: _objectSpread(_objectSpread({}, config.params), params), size: size }), _getWidth2 = _slicedToArray(_getWidth, 2), width = _getWidth2[0], isLimit = _getWidth2[1]; var height = (0, _getHeight.getHeight)({ imgNode: imgNode, config: config, exactSize: exactSize, imgNodeHeight: imgNodeHeight, imgNodeWidth: imgNodeWidth, imgNodeRatio: imgNodeRatio, params: _objectSpread(_objectSpread({}, config.params), params), size: size, width: width }); ratio = (0, _getRatio.getRatio)({ imgNodeRatio: imgNodeRatio, width: width, height: height, size: size, config: config, imgNodeWidth: imgNodeWidth, imgNodeHeight: imgNodeHeight }); var sizes = _constants.DEVICE_PIXEL_RATIO_LIST.map(function (dpr) { var widthWithDPR, heightWithDRP; widthWithDPR = width && width * dpr; widthWithDPR = crop ? widthWithDPR : isLimit ? (0, _getSizeLimit.getSizeLimit)(widthWithDPR, exactSize, limitFactor) : widthWithDPR; heightWithDRP = height && height * dpr; if (!heightWithDRP && widthWithDPR && ratio) { heightWithDRP = Math.floor(widthWithDPR / ratio); } if (!widthWithDPR && heightWithDRP && ratio) { widthWithDPR = Math.floor(heightWithDRP * ratio); } return { width: widthWithDPR, height: heightWithDRP, ratio: ratio }; }); return { sizes: sizes, ratio: ratio, width: width, height: height }; }; exports.determineContainerProps = determineContainerProps; /***/ }), /* 75 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWidth = void 0; var _convertToPx = __webpack_require__(37); var _getParentContainerSize = __webpack_require__(38); /** * Get width for an image. * * Priority: * 1. image node param width * 2. image node image width * 3. image node inline styling * 4. parent node of image computed style width (up to body tag) * * @param {HTMLImageElement} props.imgNode - image node * @param {Number} props.imgNodeWidth - width of image node * @param {String} props.params - params of image node * @return {Array} [with, isLimit] */ var getWidth = function getWidth(props) { var imgNode = props.imgNode, _props$imgNodeWidth = props.imgNodeWidth, imgNodeWidth = _props$imgNodeWidth === void 0 ? null : _props$imgNodeWidth, _props$params = props.params, params = _props$params === void 0 ? {} : _props$params, size = props.size, config = props.config; var ignoreNodeImgSize = config.ignoreNodeImgSize, ignoreStyleImgSize = config.ignoreStyleImgSize, detectImageNodeCSS = config.detectImageNodeCSS; var sizeParamsWidth = size && size.params && (size.params.w || size.params.width); var paramsWidth = params.width || params.w; var imgNodeWidthPX = !ignoreNodeImgSize && imgNodeWidth && (0, _convertToPx.convertToPX)(imgNodeWidth); var imageWidth = !ignoreStyleImgSize && getImageWidth(imgNode, detectImageNodeCSS); var imageContainerWidth = !imageWidth && parseInt((0, _getParentContainerSize.getParentContainerSize)(imgNode), 10); var resultWidth = imageWidth || imageContainerWidth; if (size && size.params) { if (size.params.r) { if (params.width || params.w) { return [paramsWidth]; } if (!ignoreNodeImgSize && imgNodeWidth) { return [imgNodeWidthPX]; } return [resultWidth]; } return [sizeParamsWidth]; } if (paramsWidth) { return [paramsWidth]; } if (!ignoreNodeImgSize && imgNodeWidth) { return [imgNodeWidthPX]; } return [resultWidth, true]; }; /** * Get width for an image. * * * @param {HTMLImageElement} img - image node * @param {Boolean} detectImageNodeCSS - detect width of image node * @return {Number} width of image container */ exports.getWidth = getWidth; var getImageWidth = function getImageWidth(img, detectImageNodeCSS) { var isImageStyleWidthInPX = img && img.style && img.style.width && !(img.style.width.indexOf('%') !== -1); var imageStyleWidth = isImageStyleWidthInPX && img.style.width; var imageWidth = imageStyleWidth && (0, _convertToPx.convertToPX)(imageStyleWidth); var imageCSSWidth = detectImageNodeCSS && getImageNodeCSS(img); return detectImageNodeCSS && imageCSSWidth ? imageCSSWidth : imageWidth && parseInt(imageWidth, 10); }; var getImageNodeCSS = function getImageNodeCSS(img) { var width; var preDisplayValue = img.style.display; img.style.display = 'inline-block'; width = img.getBoundingClientRect().width; img.style.display = preDisplayValue; return width; }; /***/ }), /* 76 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getImageHeight = exports.getHeight = void 0; var _convertToPx = __webpack_require__(37); var _getParentContainerSize = __webpack_require__(38); var _isCrop = __webpack_require__(36); /** * Get height for an image. * * Priority: * 1. image node param height * 2. image node image height * 3. image node inline styling * 4. parent node of image computed style height (up to body tag) * * @param {HTMLImageElement} props.imgNode - image node * @param {Object} props.config - plugin config * @param {Boolean} props.exactSize - a flag to use exact width/height params * @param {Number} props.imgNodeHeight - height of image node * @param {String} props.params - params of image node * @return {Number} height limit */ var getHeight = function getHeight(props) { var _props$imgNode = props.imgNode, imgNode = _props$imgNode === void 0 ? null : _props$imgNode, _props$config = props.config, config = _props$config === void 0 ? {} : _props$config, _props$imgNodeHeight = props.imgNodeHeight, imgNodeHeight = _props$imgNodeHeight === void 0 ? null : _props$imgNodeHeight, _props$params = props.params, params = _props$params === void 0 ? {} : _props$params, size = props.size, width = props.width; var ignoreNodeImgSize = config.ignoreNodeImgSize, ignoreStyleImgSize = config.ignoreStyleImgSize; var crop = (0, _isCrop.isCrop)(params.func || config.params.func); var sizeParamsHeight = size && size.params && (size.params.h || size.params.height); var paramsRatio = size && size.params && (size.params.ratio || size.params.r); var paramsHeight = params.height || params.h; var imgNodeHeightPX = !ignoreNodeImgSize && imgNodeHeight && (0, _convertToPx.convertToPX)(imgNodeHeight); var imageHeight = !ignoreStyleImgSize && getImageHeight(imgNode); var imageContainerHeight = !imageHeight && parseInt((0, _getParentContainerSize.getParentContainerSize)(imgNode, 'height'), 10); if (size && size.params) { if (paramsRatio && width) { return width / paramsRatio; } return sizeParamsHeight; } if (paramsHeight) { return paramsHeight; } if (!ignoreNodeImgSize && imgNodeHeight) { return imgNodeHeightPX; } if (imageHeight) { return imageHeight; } if (!crop) { return null; } return imageContainerHeight; }; /** * Get height for an image. * * * @param {HTMLImageElement} img - image node * @return {Number|null} height of image container */ exports.getHeight = getHeight; var getImageHeight = function getImageHeight(img) { var isImageStyleHeightInPX = img && img.style && img.style.height && !(img.style.height.indexOf('%') !== -1); var imageStyleHeight = isImageStyleHeightInPX && img.style.height; var imageHeight = (0, _convertToPx.convertToPX)(imageStyleHeight); return imageHeight && parseInt(imageHeight, 10); }; exports.getImageHeight = getImageHeight; /***/ }), /* 77 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRatio = void 0; var getRatio = function getRatio(_ref) { var imgNodeRatio = _ref.imgNodeRatio, width = _ref.width, height = _ref.height, size = _ref.size, config = _ref.config, imgNodeWidth = _ref.imgNodeWidth, imgNodeHeight = _ref.imgNodeHeight; var saveNodeImgRatio = config.saveNodeImgRatio, ignoreNodeImgSize = config.ignoreNodeImgSize; if (size && size.params) { if (size.params.r || size.params.ratio) { return size.params.r || size.params.ratio; } else if ((size.params.w || size.params.width) && (size.params.h || size.params.height)) { return (size.params.w || size.params.width) / (size.params.h || size.params.height); } else { return null; } } if (!ignoreNodeImgSize && imgNodeRatio) { return imgNodeRatio; } else if (saveNodeImgRatio && imgNodeWidth && imgNodeHeight) { return imgNodeWidth / imgNodeHeight; } else if (width && height) { return width / height; } return null; }; exports.getRatio = getRatio; /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSizeLimit = void 0; /** * Get size limit for container/image. * * @param {Number} size - width/height of container/image * @param {Boolean} exactSize - a flag to use exact width/height params * @param {Number} limitFactor - limit factor * @return {Number} size limit */ var getSizeLimit = function getSizeLimit(size, exactSize, limitFactor) { if (exactSize) return Math.ceil(size); if (size <= 25) return 25; if (size <= 50) return 50; return Math.ceil(size / limitFactor) * limitFactor; }; exports.getSizeLimit = getSizeLimit; /***/ }), /* 79 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getImgSRC = void 0; var _isSvg = __webpack_require__(80); var getImgSRC = function getImgSRC(src) { var baseURL = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; var relativeURLPath = isRelativeUrlPath(src); if (src.indexOf('//') === 0) { src = window.location.protocol + src; } if (relativeURLPath) { src = relativeToAbsolutePath(baseURL, src); } return [src, (0, _isSvg.isSVG)(src)]; }; exports.getImgSRC = getImgSRC; var relativeToAbsolutePath = function relativeToAbsolutePath(base, relative) { var root = relative[0] === '/'; var resultBaseURL = getBaseURL(root, base); var stack = resultBaseURL.split('/'); var parts = relative.split('/'); stack.pop(); // remove current file name (or empty string) // (omit if 'base' is the current folder without trailing slash) if (root) { parts.shift(); } for (var i = 0; i < parts.length; i++) { if (parts[i] === '.') continue; if (parts[i] === '..') stack.pop();else stack.push(parts[i]); } return stack.join('/'); }; var getBaseURL = function getBaseURL(root, base) { if (root) { return (base ? extractBaseURLFromString(base) : window.location.origin) + '/'; } else { return base ? base : document.baseURI; } }; var extractBaseURLFromString = function extractBaseURLFromString() { var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; var pathArray = path.split('/'); var protocol = pathArray[0]; var host = pathArray[2]; return protocol + '//' + host; }; var isRelativeUrlPath = function isRelativeUrlPath(src) { if (!src) return false; if (src.indexOf('//') === 0) { src = window.location.protocol + src; } return src.indexOf('http://') !== 0 && src.indexOf('https://') !== 0 && src.indexOf('//') !== 0; }; /***/ }), /* 80 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isSVG = void 0; var isSVG = function isSVG(url) { return url.slice(-4).toLowerCase() === '.svg'; }; exports.isSVG = isSVG; /***/ }), /* 81 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPreviewSRC = void 0; var _generateUrl = __webpack_require__(39); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var getPreviewSRC = function getPreviewSRC(_ref) { var config = _ref.config, containerProps = _ref.containerProps, params = _ref.params, src = _ref.src, devicePixelRatio = _ref.devicePixelRatio; var width = containerProps.width, height = containerProps.height; var previewQualityFactor = config.previewQualityFactor; var previewParams = _objectSpread(_objectSpread({}, params), {}, { ci_info: '' }); var lowQualitySize = getLowQualitySize({ width: width, height: height }, previewQualityFactor); return (0, _generateUrl.generateURL)({ src: src, config: config, params: _objectSpread(_objectSpread({}, previewParams), lowQualitySize), devicePixelRatio: devicePixelRatio }); }; exports.getPreviewSRC = getPreviewSRC; var getLowQualitySize = function getLowQualitySize() { var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var factor = arguments.length > 1 ? arguments[1] : undefined; var width = params.width, height = params.height; width = width ? Math.floor(width / factor) : null; height = height ? Math.floor(height / factor) : null; return { width: width, w: width, height: height, h: height }; }; /***/ }), /* 82 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getBreakpoint = void 0; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } var getBreakpoint = function getBreakpoint(sizes, presets) { var size = getAdaptiveSize(sizes, presets); return _toConsumableArray(size).reverse().find(function (item) { return window.matchMedia(item.media).matches; }); }; exports.getBreakpoint = getBreakpoint; var getAdaptiveSize = function getAdaptiveSize(sizes, presets) { var resultSizes = []; Object.keys(sizes).forEach(function (key) { var customMedia = key.indexOf(':') > -1; var media = customMedia ? key : presets[key]; resultSizes.push({ media: media, params: normalizeSize(sizes[key]) }); }); return resultSizes; }; var normalizeSize = function normalizeSize() { var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _params$w = params.w, w = _params$w === void 0 ? params.width || '' : _params$w, _params$h = params.h, h = _params$h === void 0 ? params.height || '' : _params$h, _params$r = params.r, r = _params$r === void 0 ? params.r : _params$r, _params$src = params.src, src = _params$src === void 0 ? params.src : _params$src; if (w.toString().indexOf('vw') > -1) { var percent = parseFloat(w); w = window.innerWidth * percent / 100; } else { w = parseFloat(w); } if (h.toString().indexOf('vh') > -1) { var _percent = parseFloat(h); h = window.innerHeight * _percent / 100; } else { h = parseFloat(h); } return { w: w, h: h, r: r, src: src }; }; /***/ }), /* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isSupportedInBrowser = void 0; var isSupportedInBrowser = function isSupportedInBrowser(isBlurHash) { var support = true; if (isBlurHash) { try { new window.ImageData(new Uint8ClampedArray([0, 0, 0, 0]), 1, 1); } catch (e) { support = false; } } return Element.prototype.hasOwnProperty('prepend') && support; }; exports.isSupportedInBrowser = isSupportedInBrowser; /***/ }), /* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getInitialConfigLowPreview = undefined; var _ci = __webpack_require__(13); var _constants = __webpack_require__(14); var getInitialConfigLowPreview = exports.getInitialConfigLowPreview = function getInitialConfigLowPreview(config) { var _config$imgSelector = config.imgSelector, imgSelector = _config$imgSelector === undefined ? 'ci-src' : _config$imgSelector, _config$bgSelector = config.bgSelector, bgSelector = _config$bgSelector === undefined ? 'ci-bg-url' : _config$bgSelector, _config$token = config.token, token = _config$token === undefined ? '' : _config$token, _config$domain = config.domain, domain = _config$domain === undefined ? 'cloudimg.io' : _config$domain, _config$lazyLoading = config.lazyLoading, lazyLoading = _config$lazyLoading === undefined ? false : _config$lazyLoading, _config$imgLoadingAni = config.imgLoadingAnimation, imgLoadingAnimation = _config$imgLoadingAni === undefined ? true : _config$imgLoadingAni, _config$placeholderBa = config.placeholderBackground, placeholderBackground = _config$placeholderBa === undefined ? '#f4f4f4' : _config$placeholderBa, baseUrl = config.baseUrl, baseURL = config.baseURL, ratio = config.ratio, presets = config.presets, _config$params = config.params, params = _config$params === undefined ? 'org_if_sml=1' : _config$params, _config$init = config.init, init = _config$init === undefined ? true : _config$init, _config$exactSize = config.exactSize, exactSize = _config$exactSize === undefined ? false : _config$exactSize, _config$doNotReplaceU = config.doNotReplaceURL, doNotReplaceURL = _config$doNotReplaceU === undefined ? false : _config$doNotReplaceU, _config$limitFactor = config.limitFactor, limitFactor = _config$limitFactor === undefined ? 100 : _config$limitFactor, _config$ignoreNodeImg = config.ignoreNodeImgSize, ignoreNodeImgSize = _config$ignoreNodeImg === undefined ? false : _config$ignoreNodeImg, _config$ignoreStyleIm = config.ignoreStyleImgSize, ignoreStyleImgSize = _config$ignoreStyleIm === undefined ? false : _config$ignoreStyleIm, _config$destroyNodeIm = config.destroyNodeImgSize, destroyNodeImgSize = _config$destroyNodeIm === undefined ? false : _config$destroyNodeIm, _config$saveNodeImgRa = config.saveNodeImgRatio, saveNodeImgRatio = _config$saveNodeImgRa === undefined ? false : _config$saveNodeImgRa, _config$detectImageNo = config.detectImageNodeCSS, detectImageNodeCSS = _config$detectImageNo === undefined ? false : _config$detectImageNo, _config$processOnlyWi = config.processOnlyWidth, processOnlyWidth = _config$processOnlyWi === undefined ? false : _config$processOnlyWi, _config$devicePixelRa = config.devicePixelRatioList, devicePixelRatioList = _config$devicePixelRa === undefined ? _constants.DEVICE_PIXEL_RATIO_LIST : _config$devicePixelRa, _config$lowQualityPre = config.lowQualityPreview; _config$lowQualityPre = _config$lowQualityPre === undefined ? {} : _config$lowQualityPre; var _config$lowQualityPre2 = _config$lowQualityPre.minImgWidth, minImgWidth = _config$lowQualityPre2 === undefined ? 400 : _config$lowQualityPre2, _config$onImageLoad = config.onImageLoad, onImageLoad = _config$onImageLoad === undefined ? null : _config$onImageLoad; return { imgSelector: imgSelector, bgSelector: bgSelector, token: token, domain: domain, lazyLoading: lazyLoading, imgLoadingAnimation: imgLoadingAnimation, placeholderBackground: placeholderBackground, baseURL: baseUrl || baseURL, ratio: ratio, exactSize: exactSize, presets: presets ? presets : { xs: '(max-width: 575px)', // to 575 PHONE sm: '(min-width: 576px)', // 576 - 767 PHABLET md: '(min-width: 768px)', // 768 - 991 TABLET lg: '(min-width: 992px)', // 992 - 1199 SMALL_LAPTOP_SCREEN xl: '(min-width: 1200px)' // from 1200 USUALSCREEN }, params: (0, _ci.getParams)(params), innerWidth: window.innerWidth, init: init, previewQualityFactor: 10, doNotReplaceURL: doNotReplaceURL, devicePixelRatioList: devicePixelRatioList, limitFactor: limitFactor, minLowQualityWidth: minImgWidth, ignoreNodeImgSize: ignoreNodeImgSize, ignoreStyleImgSize: ignoreStyleImgSize, destroyNodeImgSize: destroyNodeImgSize, saveNodeImgRatio: saveNodeImgRatio, detectImageNodeCSS: detectImageNodeCSS, processOnlyWidth: processOnlyWidth, onImageLoad: onImageLoad //isChrome: /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) }; }; /***/ }), /* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.updateSizeWithPixelRatio = exports.initImageClasses = exports.wrapImage = exports.applyOrUpdateWrapper = exports.loadBackgroundImage = exports.onLazyBeforeUnveil = exports.onPreviewImageLoad = exports.onImageLoad = exports.finishAnimation = exports.setAnimation = exports.applyBackgroundStyles = exports.wrapBackgroundContainer = undefined; var _ci = __webpack_require__(13); var wrapBackgroundContainer = exports.wrapBackgroundContainer = function wrapBackgroundContainer(imgNode) { var previewBox = document.createElement('div'); var contentBox = document.createElement('div'); if (imgNode.children && imgNode.children.length > 0) { wrapAll(contentBox, imgNode.children); } imgNode.prepend(previewBox); return [previewBox, contentBox]; }; var applyBackgroundStyles = exports.applyBackgroundStyles = function applyBackgroundStyles(_ref) { var imgNode = _ref.imgNode, previewBox = _ref.previewBox, contentBox = _ref.contentBox, lazy = _ref.lazy, width = _ref.width; imgNode.style.position = 'relative'; contentBox.style.position = 'relative'; previewBox.className = '' + imgNode.className + (lazy ? ' lazyload' : ''); previewBox.setAttribute('ci-preview', true); previewBox.style.background = 'inherit'; previewBox.style.position = 'absolute'; previewBox.style.left = '0'; previewBox.style.top = '0'; previewBox.style.width = '100%'; previewBox.style.height = '100%'; imgNode.style.transform = 'translateZ(0)'; imgNode.style.overflow = 'hidden'; previewBox.style.transform = 'scale(1.1)'; previewBox.style.filter = 'blur(' + Math.floor(width / 100) + 'px)'; previewBox.style.transition = 'opacity 400ms ease 0ms'; }; var setAnimation = exports.setAnimation = function setAnimation(wrapper, image, parentContainerWidth, isBackground) { if (!isBackground) { if (wrapper) { wrapper.style.transition = 'opacity 400ms ease 0ms'; } image.style.transform = 'scale(1.1)'; image.style.filter = 'blur(' + Math.floor(parentContainerWidth / 100) + 'px)'; } else { image.style.overflow = 'hidden'; (0, _ci.addClass)(image, 'ci-bg-animation'); } }; var finishAnimation = exports.finishAnimation = function finishAnimation(image, isBackground) { if (!isBackground) { var previewImg = image.parentNode.querySelector('img.ci-image-preview'); var previewImgWrapper = previewImg && previewImg.parentNode; if (previewImgWrapper) { previewImgWrapper.style.opacity = 0; } } else { image.style.opacity = '0'; } (0, _ci.addClass)(image, 'ci-image-loaded'); }; var onImageLoad = exports.onImageLoad = function onImageLoad(wrapper, previewImg, imgNode, ratio, preserveSize, isAdaptive) { var width = imgNode.width, height = imgNode.height; wrapper.style.background = 'transparent'; if (!ratio || isAdaptive) { wrapper.style.paddingBottom = preserveSize ? 'none' : 100 / (width / height) + '%'; } finishAnimation(imgNode); }; var onPreviewImageLoad = exports.onPreviewImageLoad = function onPreviewImageLoad(wrapper, previewImg, ratio, preserveSize) { var naturalWidth = previewImg.naturalWidth, naturalHeight = previewImg.naturalHeight; wrapper.style.background = 'transparent'; if (!ratio) { wrapper.style.paddingBottom = preserveSize ? 'none' : 100 / (naturalWidth / naturalHeight) + '%'; } }; var onLazyBeforeUnveil = exports.onLazyBeforeUnveil = function onLazyBeforeUnveil(event) { var bgContainer = event.target; var bg = bgContainer.getAttribute('data-bg'); var isPreview = bgContainer.getAttribute('ci-preview') === 'true'; var ciOptimizedUrl = (isPreview ? bgContainer.parentNode : bgContainer).getAttribute('ci-optimized-url'); loadBackgroundImage(bg, isPreview, bgContainer, ciOptimizedUrl); }; var loadBackgroundImage = exports.loadBackgroundImage = function loadBackgroundImage(bg, isPreview, bgContainer, ciOptimizedUrl) { if (bg) { var optimizedImage = new Image(); if (isPreview) { var previewImage = new Image(); optimizedImage.onload = function () { finishAnimation(bgContainer, true); bgContainer.parentNode.removeAttribute('ci-optimized-url'); bgContainer.removeAttribute('data-bg'); bgContainer.removeAttribute('ci-preview'); }; bgContainer.parentNode.style.backgroundImage = 'url(' + ciOptimizedUrl + ')'; optimizedImage.src = ciOptimizedUrl; previewImage.src = bg; } else { optimizedImage.onload = function () { bgContainer.removeAttribute('data-bg'); bgContainer.removeAttribute('ci-preview'); }; optimizedImage.src = bg; } bgContainer.style.backgroundImage = 'url(' + bg + ')'; } }; var applyOrUpdateWrapper = exports.applyOrUpdateWrapper = function applyOrUpdateWrapper(props) { var isUpdate = props.isUpdate, imgNode = props.imgNode, isPreview = props.isPreview, lazy = props.lazy; var wrapper = void 0, previewImgNode = null, previewWrapper = null; if (!isUpdate) { wrapper = wrapImage(props); if (isPreview) { previewWrapper = document.createElement('div'); previewImgNode = document.createElement('img'); previewImgNode.className = 'ci-image-ratio ci-image-preview' + (lazy ? ' lazyload' : ''); previewWrapper.style.transform = 'translateZ(0)'; previewWrapper.style.zIndex = '1'; previewWrapper.style.height = '100%'; previewWrapper.style.width = '100%'; previewWrapper.style.position = 'absolute'; previewWrapper.style.top = '0'; previewWrapper.style.left = '0'; previewImgNode.alt = 'Low quality preview for ' + (imgNode.alt || (imgNode.src || '').split('.')[0]); previewWrapper.appendChild(previewImgNode); wrapper.insertBefore(previewWrapper, imgNode); (0, _ci.addClass)(wrapper, 'ci-with-preview-image'); } } else { wrapper = (0, _ci.getWrapper)(imgNode); // TODO: remove in next release //if (ratio) { // wrapper.style.paddingBottom = preserveSize ? 'none' : (100 / ratio) + '%'; //} } return { wrapper: wrapper, previewImgNode: previewImgNode, previewWrapper: previewWrapper }; }; var wrapImage = exports.wrapImage = function wrapImage(props) { var imgNode = props.imgNode, ratio = props.ratio, imgNodeWidth = props.imgNodeWidth, imgNodeHeight = props.imgNodeHeight, preserveSize = props.preserveSize, placeholderBackground = props.placeholderBackground; var wrapper = props.wrapper; wrapper = wrapper || document.createElement('div'); (0, _ci.addClass)(wrapper, 'ci-image-wrapper'); wrapper.style.background = placeholderBackground; wrapper.style.display = 'block'; wrapper.style.width = preserveSize ? imgNodeWidth : '100%'; wrapper.style.height = preserveSize ? imgNodeHeight : 'auto'; wrapper.style.overflow = 'hidden'; wrapper.style.position = 'relative'; if (ratio) { wrapper.style.paddingBottom = preserveSize ? 'none' : 100 / ratio + '%'; } if (imgNode.nextSibling) { imgNode.parentNode.insertBefore(wrapper, imgNode.nextSibling); } else { imgNode.parentNode.appendChild(wrapper); } wrapper.appendChild(imgNode); return wrapper; }; var initImageClasses = exports.initImageClasses = function initImageClasses(_ref2) { var imgNode = _ref2.imgNode, lazy = _ref2.lazy; (0, _ci.addClass)(imgNode, 'ci-image'); if (lazy) { (0, _ci.addClass)(imgNode, 'lazyload'); } }; /* * possible size values: 200 | 200x400 * */ var updateSizeWithPixelRatio = exports.updateSizeWithPixelRatio = function updateSizeWithPixelRatio(size, devicePixelRatio) { var splittedSizes = size.toString().split('x'); var result = []; [].forEach.call(splittedSizes, function (size) { size ? result.push(Math.floor(size * ((devicePixelRatio || window.devicePixelRatio).toFixed(1) || 1))) : ''; }); return result.join('x'); }; var wrapAll = function wrapAll(wrapper, elms) { var el = elms.length ? elms[0] : elms; var parent = el.parentNode; var sibling = el.nextSibling; wrapper.appendChild(el); while (elms.length) { wrapper.appendChild(elms[0]); } if (sibling) { parent.insertBefore(wrapper, sibling); } else { parent.appendChild(wrapper); } }; /***/ }), /* 86 */ /***/ (function(module, exports, __webpack_require__) { (function (global, factory) { true ? factory(exports) : undefined; }(this, (function (exports) { 'use strict'; /* eslint-disable no-undefined,no-param-reassign,no-shadow */ /** * Throttle execution of a function. Especially useful for rate limiting * execution of handlers on events like resize and scroll. * * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful. * @param {boolean} [noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the * throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time * after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds, * the internal counter is reset). * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is, * to `callback` when the throttled-function is executed. * @param {boolean} [debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end), * schedule `callback` to execute after `delay` ms. * * @returns {Function} A new, throttled, function. */ function throttle (delay, noTrailing, callback, debounceMode) { /* * After wrapper has stopped being called, this timeout ensures that * `callback` is executed at the proper times in `throttle` and `end` * debounce modes. */ var timeoutID; var cancelled = false; // Keep track of the last time `callback` was executed. var lastExec = 0; // Function to clear existing timeout function clearExistingTimeout() { if (timeoutID) { clearTimeout(timeoutID); } } // Function to cancel next exec function cancel() { clearExistingTimeout(); cancelled = true; } // `noTrailing` defaults to falsy. if (typeof noTrailing !== 'boolean') { debounceMode = callback; callback = noTrailing; noTrailing = undefined; } /* * The `wrapper` function encapsulates all of the throttling / debouncing * functionality and when executed will limit the rate at which `callback` * is executed. */ function wrapper() { for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) { arguments_[_key] = arguments[_key]; } var self = this; var elapsed = Date.now() - lastExec; if (cancelled) { return; } // Execute `callback` and update the `lastExec` timestamp. function exec() { lastExec = Date.now(); callback.apply(self, arguments_); } /* * If `debounceMode` is true (at begin) this is used to clear the flag * to allow future `callback` executions. */ function clear() { timeoutID = undefined; } if (debounceMode && !timeoutID) { /* * Since `wrapper` is being called for the first time and * `debounceMode` is true (at begin), execute `callback`. */ exec(); } clearExistingTimeout(); if (debounceMode === undefined && elapsed > delay) { /* * In throttle mode, if `delay` time has been exceeded, execute * `callback`. */ exec(); } else if (noTrailing !== true) { /* * In trailing throttle mode, since `delay` time has not been * exceeded, schedule `callback` to execute `delay` ms after most * recent execution. * * If `debounceMode` is true (at begin), schedule `clear` to execute * after `delay` ms. * * If `debounceMode` is false (at end), schedule `callback` to * execute after `delay` ms. */ timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay); } } wrapper.cancel = cancel; // Return the wrapper function. return wrapper; } /* eslint-disable no-undefined */ /** * Debounce execution of a function. Debouncing, unlike throttling, * guarantees that a function is only executed a single time, either at the * very beginning of a series of calls, or at the very end. * * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful. * @param {boolean} [atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call. * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset). * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is, * to `callback` when the debounced-function is executed. * * @returns {Function} A new, debounced function. */ function debounce (delay, atBegin, callback) { return callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false); } exports.debounce = debounce; exports.throttle = throttle; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=index.umd.js.map /***/ }), /* 87 */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }) /******/ ]); //# sourceMappingURL=js-cloudimage-responsive.min.js.map