diff --git a/.eslintrc b/.eslintrc index d1e6ea0..caa4858 100644 --- a/.eslintrc +++ b/.eslintrc @@ -25,7 +25,8 @@ "space-before-function-paren": ["error", "always"], "quotes": ["error", "single"], "prefer-arrow-callback": "error", - "prefer-object-spread": "error" + "prefer-object-spread": "error", + "flowtype/no-types-missing-file-annotation": "off" }, "overrides": [ { @@ -42,7 +43,12 @@ "plugins": ["@typescript-eslint"], "rules": { "semi": ["error", "never"], - "space-before-function-paren": ["error", "never"], + "space-before-function-paren": ["error", { + "anonymous": "always", + "named": "never", + "asyncArrow": "always" + } + ], "eol-last": "error", "@typescript-eslint/ban-types": "warn", "@typescript-eslint/explicit-module-boundary-types": "off" diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ffc385..52e7592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### Version 5.2.0 (3rd August 2021) +#### Added +- [beta] Smart banners. + +--- + ### Version 5.1.2 (11th June 2021) #### Added - Added Typescript support. diff --git a/README.md b/README.md index 057e20b..1427609 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,13 @@ Our sdk is exposed under all module definitions, so it works under CommonJS and To lazy load the Adjust Web SDK through CDN paste the following snippet into the `` tag: ```html ``` The Adjust Web SDK should be loaded only once per page and it should be initiated once per page load. -When loading the sdk through CDN we suggest using minified version. You can target specific version like `https://cdn.adjust.com/adjust-5.1.2.min.js`, or you can target latest version `https://cdn.adjust.com/adjust-latest.min.js` if you want automatic updates without need to change the target file. The sdk files are cached so they are served as fast as possible, and the cache is refreshed every half an hour. If you want updates immediately make sure to target specific version. +When loading the sdk through CDN we suggest using minified version. You can target specific version like `https://cdn.adjust.com/adjust-5.2.0.min.js`, or you can target latest version `https://cdn.adjust.com/adjust-latest.min.js` if you want automatic updates without need to change the target file. The sdk files are cached so they are served as fast as possible, and the cache is refreshed every half an hour. If you want updates immediately make sure to target specific version. It's also possible to install our sdk through NPM: diff --git a/VERSION b/VERSION index 61fcc87..91ff572 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.1.2 +5.2.0 diff --git a/dist/adjust-latest.d.ts b/dist/adjust-latest.d.ts index b90a01a..6b2d289 100644 --- a/dist/adjust-latest.d.ts +++ b/dist/adjust-latest.d.ts @@ -65,6 +65,8 @@ interface EventParams { partnerParams?: Array; } +type LogLevel = 'none' | 'error' | 'warning' | 'info' | 'verbose' + interface InitOptions { /** Required to initialise SDK instance, please make sure to provide valid app token. */ @@ -128,7 +130,7 @@ interface InitOptions { * - `error` - will print only error message * - `none` - won't print anything */ - logLevel?: 'none' | 'error' | 'warning' | 'info' | 'verbose'; + logLevel?: LogLevel; /** * Optional. Query selector to define html container if you want to see your logs directly on the screen. This could @@ -290,6 +292,38 @@ function gdprForgetMe(): void */ function disableThirdPartySharing(): void +interface SmartBannerOptions { + + /** Web token to initialise Smart Banner */ + webToken: string; + + /** Optional. Logging level used by SDK instance. By default this param is set to `error`. We highly recommend that + * you use `verbose` when testing in order to see precise logs and to make sure integration is done properly. + * Here are more details about each log level: + * - `verbose` - will print detailed messages in case of certain actions + * - `info` - will print only basic info messages, warnings and errors + * - `warning` - will print only warning and error messages + * - `error` - will print only error message + * - `none` - won't print anything + */ + logLevel?: LogLevel; +} + +/** + * Initiate Smart Banner. + * + * This method gets Smart Banner data and creates Smart Banner UI. + * + * @param {SmartBannerOptions} options Options to initiate Smart Banner. + * + * @example + * Adjust.initSmartBanner({ + * webToken: 'YOUR_WEB_TOKEN', + * logLevel: 'verbose' + * }); + */ +function initSmartBanner(options: SmartBannerOptions): void + const Adjust = { initSdk, trackEvent, @@ -304,7 +338,8 @@ const Adjust = { stop, restart, gdprForgetMe, - disableThirdPartySharing + disableThirdPartySharing, + initSmartBanner, } export default Adjust diff --git a/dist/adjust-latest.js b/dist/adjust-latest.js index b2f959d..7f47a59 100644 --- a/dist/adjust-latest.js +++ b/dist/adjust-latest.js @@ -91,23 +91,27 @@ return /******/ (function(modules) { // webpackBootstrap /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 20); +/******/ return __webpack_require__(__webpack_require__.s = 25); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { -var defineProperty = __webpack_require__(2); +var defineProperty = __webpack_require__(1); 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; - }); + + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } + keys.push.apply(keys, symbols); } @@ -135,27 +139,10 @@ function _objectSpread2(target) { } module.exports = _objectSpread2; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), /* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -var arrayWithHoles = __webpack_require__(14); - -var iterableToArrayLimit = __webpack_require__(15); - -var unsupportedIterableToArray = __webpack_require__(7); - -var nonIterableRest = __webpack_require__(16); - -function _slicedToArray(arr, i) { - return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); -} - -module.exports = _slicedToArray; - -/***/ }), -/* 2 */ /***/ (function(module, exports) { function _defineProperty(obj, key, value) { @@ -174,6 +161,26 @@ function _defineProperty(obj, key, value) { } module.exports = _defineProperty; +module.exports["default"] = module.exports, module.exports.__esModule = true; + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayWithHoles = __webpack_require__(15); + +var iterableToArrayLimit = __webpack_require__(16); + +var unsupportedIterableToArray = __webpack_require__(8); + +var nonIterableRest = __webpack_require__(17); + +function _slicedToArray(arr, i) { + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); +} + +module.exports = _slicedToArray; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), /* 3 */ @@ -1239,9 +1246,9 @@ var Promise$1 = function () { /** `finally` will be invoked regardless of the promise's fate just as native try/catch/finally behaves - + Synchronous example: - + ```js findAuthor() { if (Math.random() > 0.5) { @@ -1249,7 +1256,7 @@ var Promise$1 = function () { } return new Author(); } - + try { return findAuthor(); // succeed or fail } catch(error) { @@ -1259,9 +1266,9 @@ var Promise$1 = function () { // doesn't affect the return value } ``` - + Asynchronous example: - + ```js findAuthor().catch(function(reason){ return findOtherAuther(); @@ -1269,7 +1276,7 @@ var Promise$1 = function () { // author was either found, or not }); ``` - + @method finally @param {Function} callback @return {Promise} @@ -1353,10 +1360,48 @@ return Promise$1; //# sourceMappingURL=es6-promise.map -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(12), __webpack_require__(13))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13), __webpack_require__(14))) /***/ }), /* 4 */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(21); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(23)(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +module.exports = _classCallCheck; +module.exports["default"] = module.exports, module.exports.__esModule = true; + +/***/ }), +/* 6 */ /***/ (function(module, exports) { function _defineProperties(target, props) { @@ -1376,42 +1421,32 @@ function _createClass(Constructor, protoProps, staticProps) { } module.exports = _createClass; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 5 */ +/* 7 */ /***/ (function(module, exports, __webpack_require__) { -var arrayWithoutHoles = __webpack_require__(17); +var arrayWithoutHoles = __webpack_require__(18); -var iterableToArray = __webpack_require__(18); +var iterableToArray = __webpack_require__(19); -var unsupportedIterableToArray = __webpack_require__(7); +var unsupportedIterableToArray = __webpack_require__(8); -var nonIterableSpread = __webpack_require__(19); +var nonIterableSpread = __webpack_require__(20); function _toConsumableArray(arr) { return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread(); } module.exports = _toConsumableArray; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 6 */ -/***/ (function(module, exports) { - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -module.exports = _classCallCheck; - -/***/ }), -/* 7 */ +/* 8 */ /***/ (function(module, exports, __webpack_require__) { -var arrayLikeToArray = __webpack_require__(8); +var arrayLikeToArray = __webpack_require__(9); function _unsupportedIterableToArray(o, minLen) { if (!o) return; @@ -1423,9 +1458,10 @@ function _unsupportedIterableToArray(o, minLen) { } module.exports = _unsupportedIterableToArray; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 8 */ +/* 9 */ /***/ (function(module, exports) { function _arrayLikeToArray(arr, len) { @@ -1439,12 +1475,13 @@ function _arrayLikeToArray(arr, len) { } module.exports = _arrayLikeToArray; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 9 */ +/* 10 */ /***/ (function(module, exports, __webpack_require__) { -var objectWithoutPropertiesLoose = __webpack_require__(11); +var objectWithoutPropertiesLoose = __webpack_require__(12); function _objectWithoutProperties(source, excluded) { if (source == null) return {}; @@ -1466,9 +1503,10 @@ function _objectWithoutProperties(source, excluded) { } module.exports = _objectWithoutProperties; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 10 */ +/* 11 */ /***/ (function(module, exports) { function _typeof(obj) { @@ -1478,19 +1516,24 @@ function _typeof(obj) { module.exports = _typeof = function _typeof(obj) { return typeof obj; }; + + module.exports["default"] = module.exports, module.exports.__esModule = true; } else { module.exports = _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + module.exports["default"] = module.exports, module.exports.__esModule = true; } return _typeof(obj); } module.exports = _typeof; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 11 */ +/* 12 */ /***/ (function(module, exports) { function _objectWithoutPropertiesLoose(source, excluded) { @@ -1509,9 +1552,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { } module.exports = _objectWithoutPropertiesLoose; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 12 */ +/* 13 */ /***/ (function(module, exports) { // shim for using process in browser @@ -1701,7 +1745,7 @@ process.umask = function() { return 0; }; /***/ }), -/* 13 */ +/* 14 */ /***/ (function(module, exports) { var g; @@ -1727,7 +1771,7 @@ module.exports = g; /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, exports) { function _arrayWithHoles(arr) { @@ -1735,20 +1779,24 @@ function _arrayWithHoles(arr) { } module.exports = _arrayWithHoles; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 15 */ +/* 16 */ /***/ (function(module, exports) { function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + + if (_i == null) return; var _arr = []; var _n = true; var _d = false; - var _e = undefined; + + var _s, _e; try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; @@ -1768,9 +1816,10 @@ function _iterableToArrayLimit(arr, i) { } module.exports = _iterableToArrayLimit; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, exports) { function _nonIterableRest() { @@ -1778,31 +1827,34 @@ function _nonIterableRest() { } module.exports = _nonIterableRest; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { -var arrayLikeToArray = __webpack_require__(8); +var arrayLikeToArray = __webpack_require__(9); function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return arrayLikeToArray(arr); } module.exports = _arrayWithoutHoles; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports) { function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } module.exports = _iterableToArray; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, exports) { function _nonIterableSpread() { @@ -1810,9 +1862,619 @@ function _nonIterableSpread() { } module.exports = _nonIterableSpread; +module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), -/* 20 */ +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(22)(false); +// imports + + +// module +exports.push([module.i, ".adjust-smart-banner__1Xb2YvQsm_ZuqGpC3GYV1K{height:76px}@media (min-width: 428px){.adjust-smart-banner__1Xb2YvQsm_ZuqGpC3GYV1K{height:0}}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH{position:fixed;left:0;right:0;z-index:10000000}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH.adjust-smart-banner__1gDv13AgIJ63OmoMUWN6vd{top:0}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH.adjust-smart-banner__2Xpm01sHnZNYOOkNk05cAc{bottom:0}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH .adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5{margin:0 auto;max-width:428px;background:white}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH .adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5 .adjust-smart-banner__31MvUOHjvsAEpS_14bUpGT{display:flex;align-items:center;padding:10px 8px 10px 4px}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH .adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5 .adjust-smart-banner__31MvUOHjvsAEpS_14bUpGT .adjust-smart-banner__3PQ7z78EskytjOkrU199hE{width:32px;height:32px;border:none;background:url(\"data:image/svg+xml;utf8, \");background-repeat:no-repeat;background-position:center center;background-size:8px 8px, auto;cursor:pointer}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH .adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5 .adjust-smart-banner__31MvUOHjvsAEpS_14bUpGT .adjust-smart-banner__L_BSzs7rJajVPX4zdt2R6{width:56px;height:56px;overflow:hidden;background-color:#6e7492;border-radius:8px}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH .adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5 .adjust-smart-banner__31MvUOHjvsAEpS_14bUpGT .adjust-smart-banner__L_BSzs7rJajVPX4zdt2R6 .adjust-smart-banner__3Yj45mdOZKIOH2d6Z2UXXa{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:#353a52;font-weight:bold;font-size:23px;font-family:ArialMt,Arial,sans-serif;line-height:32px;background-color:#e0e2ec}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH .adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5 .adjust-smart-banner__31MvUOHjvsAEpS_14bUpGT .adjust-smart-banner__L_BSzs7rJajVPX4zdt2R6 .adjust-smart-banner__4hg0kzTWzWiGjzCDqbktp{width:100%}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH .adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5 .adjust-smart-banner__31MvUOHjvsAEpS_14bUpGT .adjust-smart-banner__3mbKdOA0SmqrfOLvHomXyc{flex:1 1 0%;min-height:0;min-width:0;margin:0 12px}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH .adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5 .adjust-smart-banner__31MvUOHjvsAEpS_14bUpGT .adjust-smart-banner__3DSKm9idx4dze89DWsCMXr{overflow:hidden;text-overflow:ellipsis}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH .adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5 .adjust-smart-banner__31MvUOHjvsAEpS_14bUpGT h4{margin:5px 0 8px;color:#353a52;font-family:Arial-BoldMT,ArialMt,Arial,sans-serif;font-size:12px;font-weight:bold;line-height:16px;white-space:nowrap}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH .adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5 .adjust-smart-banner__31MvUOHjvsAEpS_14bUpGT p{margin:8px 0 7px;color:#353a52;font-family:ArialMt,Arial,sans-serif;font-size:9px;line-height:11px;max-height:22px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH .adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5 .adjust-smart-banner__31MvUOHjvsAEpS_14bUpGT .adjust-smart-banner__3_w6WNex3gOuKV8gztVNoI{color:#6e7492;background:#f9fafc;border:1px solid #cdd0e0;border-radius:4px;border-color:#6e7492;box-shadow:inset 0px -1px 0px 0px #e0e2ec;padding:4px 6.5px;display:inline-block;vertical-align:middle;text-align:center;font-family:ArialMt,Arial,sans-serif;font-size:12px;font-weight:500;line-height:16px;cursor:pointer;text-decoration:none}\n", ""]); + +// exports +exports.locals = { + "bannerContainer": "adjust-smart-banner__1Xb2YvQsm_ZuqGpC3GYV1K", + "banner": "adjust-smart-banner__Dw5N6VeDUP14gIEdMH7SH", + "stickyToTop": "adjust-smart-banner__1gDv13AgIJ63OmoMUWN6vd", + "stickyToBottom": "adjust-smart-banner__2Xpm01sHnZNYOOkNk05cAc", + "bannerBody": "adjust-smart-banner__YV2trFakzl9_mm1H-9Ht5", + "content": "adjust-smart-banner__31MvUOHjvsAEpS_14bUpGT", + "dismiss": "adjust-smart-banner__3PQ7z78EskytjOkrU199hE", + "appIcon": "adjust-smart-banner__L_BSzs7rJajVPX4zdt2R6", + "placeholder": "adjust-smart-banner__3Yj45mdOZKIOH2d6Z2UXXa", + "image": "adjust-smart-banner__4hg0kzTWzWiGjzCDqbktp", + "textContainer": "adjust-smart-banner__3mbKdOA0SmqrfOLvHomXyc", + "bannerText": "adjust-smart-banner__3DSKm9idx4dze89DWsCMXr", + "action": "adjust-smart-banner__3_w6WNex3gOuKV8gztVNoI" +}; + +/***/ }), +/* 22 */ +/***/ (function(module, exports) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +module.exports = function(useSourceMap) { + var list = []; + + // return the list of modules as css string + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item, useSourceMap); + if(item[2]) { + return "@media " + item[2] + "{" + content + "}"; + } else { + return content; + } + }).join(""); + }; + + // import a list of modules into the list + list.i = function(modules, mediaQuery) { + if(typeof modules === "string") + modules = [[null, modules, ""]]; + var alreadyImportedModules = {}; + for(var i = 0; i < this.length; i++) { + var id = this[i][0]; + if(typeof id === "number") + alreadyImportedModules[id] = true; + } + for(i = 0; i < modules.length; i++) { + var item = modules[i]; + // skip already imported module + // this implementation is not 100% perfect for weird media query combinations + // when a module is imported multiple times with different media queries. + // I hope this will never occur (Hey this way we have smaller bundles) + if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { + if(mediaQuery && !item[2]) { + item[2] = mediaQuery; + } else if(mediaQuery) { + item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; + } + list.push(item); + } + } + }; + return list; +}; + +function cssWithMappingToString(item, useSourceMap) { + var content = item[1] || ''; + var cssMapping = item[3]; + if (!cssMapping) { + return content; + } + + if (useSourceMap && typeof btoa === 'function') { + var sourceMapping = toComment(cssMapping); + var sourceURLs = cssMapping.sources.map(function (source) { + return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' + }); + + return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); + } + + return [content].join('\n'); +} + +// Adapted from convert-source-map (MIT) +function toComment(sourceMap) { + // eslint-disable-next-line no-undef + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; + + return '/*# ' + data + ' */'; +} + + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +var stylesInDom = {}; + +var memoize = function (fn) { + var memo; + + return function () { + if (typeof memo === "undefined") memo = fn.apply(this, arguments); + return memo; + }; +}; + +var isOldIE = memoize(function () { + // Test for IE <= 9 as proposed by Browserhacks + // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 + // Tests for existence of standard globals is to allow style-loader + // to operate correctly into non-standard environments + // @see https://github.com/webpack-contrib/style-loader/issues/177 + return window && document && document.all && !window.atob; +}); + +var getTarget = function (target, parent) { + if (parent){ + return parent.querySelector(target); + } + return document.querySelector(target); +}; + +var getElement = (function (fn) { + var memo = {}; + + return function(target, parent) { + // If passing function in options, then use it for resolve "head" element. + // Useful for Shadow Root style i.e + // { + // insertInto: function () { return document.querySelector("#foo").shadowRoot } + // } + if (typeof target === 'function') { + return target(); + } + if (typeof memo[target] === "undefined") { + var styleTarget = getTarget.call(this, target, parent); + // Special case to return head of iframe instead of iframe itself + if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { + try { + // This will throw an exception if access to iframe is blocked + // due to cross-origin restrictions + styleTarget = styleTarget.contentDocument.head; + } catch(e) { + styleTarget = null; + } + } + memo[target] = styleTarget; + } + return memo[target] + }; +})(); + +var singleton = null; +var singletonCounter = 0; +var stylesInsertedAtTop = []; + +var fixUrls = __webpack_require__(24); + +module.exports = function(list, options) { + if (typeof DEBUG !== "undefined" && DEBUG) { + if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); + } + + options = options || {}; + + options.attrs = typeof options.attrs === "object" ? options.attrs : {}; + + // Force single-tag solution on IE6-9, which has a hard limit on the # of