@carbon/charts-vue 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11254,8 +11254,8 @@ Selection.prototype = selection_selection.prototype = {
11254
11254
  // EXTERNAL MODULE: /home/runner/work/carbon-charts/carbon-charts/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
11255
11255
  var ResizeObserver_es = __webpack_require__("2da1");
11256
11256
 
11257
- // EXTERNAL MODULE: /home/runner/work/carbon-charts/carbon-charts/node_modules/dom-to-image/src/dom-to-image.js
11258
- var dom_to_image = __webpack_require__("eeea");
11257
+ // EXTERNAL MODULE: ./node_modules/@carbon/charts/services/essentials/dom-to-image.js
11258
+ var dom_to_image = __webpack_require__("b1b0");
11259
11259
  var dom_to_image_default = /*#__PURE__*/__webpack_require__.n(dom_to_image);
11260
11260
 
11261
11261
  // CONCATENATED MODULE: ./node_modules/@carbon/charts/services/essentials/dom-utils.js
@@ -49436,6 +49436,732 @@ module.exports = [
49436
49436
  ];
49437
49437
 
49438
49438
 
49439
+ /***/ }),
49440
+
49441
+ /***/ "b1b0":
49442
+ /***/ (function(module, exports, __webpack_require__) {
49443
+
49444
+ /**
49445
+ The MIT License (MIT)
49446
+
49447
+ Copyright 2015 Anatolii Saienko
49448
+ https://github.com/tsayen
49449
+
49450
+ Copyright 2012 Paul Bakaus
49451
+ http://paulbakaus.com/
49452
+
49453
+ Permission is hereby granted, free of charge, to any person obtaining
49454
+ a copy of this software and associated documentation files (the
49455
+ "Software"), to deal in the Software without restriction, including
49456
+ without limitation the rights to use, copy, modify, merge, publish,
49457
+ distribute, sublicense, and/or sell copies of the Software, and to
49458
+ permit persons to whom the Software is furnished to do so, subject to
49459
+ the following conditions:
49460
+
49461
+ The above copyright notice and this permission notice shall be
49462
+ included in all copies or substantial portions of the Software.
49463
+
49464
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
49465
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
49466
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
49467
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
49468
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
49469
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
49470
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49471
+ */
49472
+ (function (global) {
49473
+ 'use strict';
49474
+ var util = newUtil();
49475
+ var inliner = newInliner();
49476
+ var fontFaces = newFontFaces();
49477
+ var images = newImages();
49478
+ // Default impl options
49479
+ var defaultOptions = {
49480
+ // Default is to fail on error, no placeholder
49481
+ imagePlaceholder: undefined,
49482
+ // Default cache bust is false, it will use the cache
49483
+ cacheBust: false,
49484
+ };
49485
+ var domtoimage = {
49486
+ toSvg: toSvg,
49487
+ toPng: toPng,
49488
+ toJpeg: toJpeg,
49489
+ toBlob: toBlob,
49490
+ toPixelData: toPixelData,
49491
+ impl: {
49492
+ fontFaces: fontFaces,
49493
+ images: images,
49494
+ util: util,
49495
+ inliner: inliner,
49496
+ options: {},
49497
+ },
49498
+ };
49499
+ if (true)
49500
+ module.exports = domtoimage;
49501
+ else
49502
+ {}
49503
+ /**
49504
+ * @param {Node} node - The DOM Node object to render
49505
+ * @param {Object} options - Rendering options
49506
+ * @param {Function} options.filter - Should return true if passed node should be included in the output
49507
+ * (excluding node means excluding it's children as well). Not called on the root node.
49508
+ * @param {String} options.bgcolor - color for the background, any valid CSS color value.
49509
+ * @param {Number} options.width - width to be applied to node before rendering.
49510
+ * @param {Number} options.height - height to be applied to node before rendering.
49511
+ * @param {Object} options.style - an object whose properties to be copied to node's style before rendering.
49512
+ * @param {Number} options.quality - a Number between 0 and 1 indicating image quality (applicable to JPEG only),
49513
+ defaults to 1.0.
49514
+ * @param {String} options.imagePlaceholder - dataURL to use as a placeholder for failed images, default behaviour is to fail fast on images we can't fetch
49515
+ * @param {Boolean} options.cacheBust - set to true to cache bust by appending the time to the request url
49516
+ * @return {Promise} - A promise that is fulfilled with a SVG image data URL
49517
+ * */
49518
+ function toSvg(node, options) {
49519
+ options = options || {};
49520
+ copyOptions(options);
49521
+ return Promise.resolve(node)
49522
+ .then(function (node) {
49523
+ return cloneNode(node, options.filter, true);
49524
+ })
49525
+ .then(embedFonts)
49526
+ .then(inlineImages)
49527
+ .then(applyOptions)
49528
+ .then(function (clone) {
49529
+ return makeSvgDataUri(clone, options.width || util.width(node), options.height || util.height(node));
49530
+ });
49531
+ function applyOptions(clone) {
49532
+ if (options.bgcolor)
49533
+ clone.style.backgroundColor = options.bgcolor;
49534
+ if (options.width)
49535
+ clone.style.width = options.width + 'px';
49536
+ if (options.height)
49537
+ clone.style.height = options.height + 'px';
49538
+ if (options.style)
49539
+ Object.keys(options.style).forEach(function (property) {
49540
+ clone.style[property] = options.style[property];
49541
+ });
49542
+ return clone;
49543
+ }
49544
+ }
49545
+ /**
49546
+ * @param {Node} node - The DOM Node object to render
49547
+ * @param {Object} options - Rendering options, @see {@link toSvg}
49548
+ * @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
49549
+ * */
49550
+ function toPixelData(node, options) {
49551
+ return draw(node, options || {}).then(function (canvas) {
49552
+ return canvas
49553
+ .getContext('2d')
49554
+ .getImageData(0, 0, util.width(node), util.height(node)).data;
49555
+ });
49556
+ }
49557
+ /**
49558
+ * @param {Node} node - The DOM Node object to render
49559
+ * @param {Object} options - Rendering options, @see {@link toSvg}
49560
+ * @return {Promise} - A promise that is fulfilled with a PNG image data URL
49561
+ * */
49562
+ function toPng(node, options) {
49563
+ return draw(node, options || {}).then(function (canvas) {
49564
+ return canvas.toDataURL();
49565
+ });
49566
+ }
49567
+ /**
49568
+ * @param {Node} node - The DOM Node object to render
49569
+ * @param {Object} options - Rendering options, @see {@link toSvg}
49570
+ * @return {Promise} - A promise that is fulfilled with a JPEG image data URL
49571
+ * */
49572
+ function toJpeg(node, options) {
49573
+ options = options || {};
49574
+ return draw(node, options).then(function (canvas) {
49575
+ return canvas.toDataURL('image/jpeg', options.quality || 1.0);
49576
+ });
49577
+ }
49578
+ /**
49579
+ * @param {Node} node - The DOM Node object to render
49580
+ * @param {Object} options - Rendering options, @see {@link toSvg}
49581
+ * @return {Promise} - A promise that is fulfilled with a PNG image blob
49582
+ * */
49583
+ function toBlob(node, options) {
49584
+ return draw(node, options || {}).then(util.canvasToBlob);
49585
+ }
49586
+ function copyOptions(options) {
49587
+ // Copy options to impl options for use in impl
49588
+ if (typeof options.imagePlaceholder === 'undefined') {
49589
+ domtoimage.impl.options.imagePlaceholder =
49590
+ defaultOptions.imagePlaceholder;
49591
+ }
49592
+ else {
49593
+ domtoimage.impl.options.imagePlaceholder = options.imagePlaceholder;
49594
+ }
49595
+ if (typeof options.cacheBust === 'undefined') {
49596
+ domtoimage.impl.options.cacheBust = defaultOptions.cacheBust;
49597
+ }
49598
+ else {
49599
+ domtoimage.impl.options.cacheBust = options.cacheBust;
49600
+ }
49601
+ }
49602
+ function draw(domNode, options) {
49603
+ return toSvg(domNode, options)
49604
+ .then(util.makeImage)
49605
+ .then(util.delay(100))
49606
+ .then(function (image) {
49607
+ var canvas = newCanvas(domNode);
49608
+ canvas.getContext('2d').drawImage(image, 0, 0);
49609
+ return canvas;
49610
+ });
49611
+ function newCanvas(domNode) {
49612
+ var canvas = document.createElement('canvas');
49613
+ canvas.width = options.width || util.width(domNode);
49614
+ canvas.height = options.height || util.height(domNode);
49615
+ if (options.bgcolor) {
49616
+ var ctx = canvas.getContext('2d');
49617
+ ctx.fillStyle = options.bgcolor;
49618
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
49619
+ }
49620
+ return canvas;
49621
+ }
49622
+ }
49623
+ function cloneNode(node, filter, root) {
49624
+ if (!root && filter && !filter(node))
49625
+ return Promise.resolve();
49626
+ return Promise.resolve(node)
49627
+ .then(makeNodeCopy)
49628
+ .then(function (clone) {
49629
+ return cloneChildren(node, clone, filter);
49630
+ })
49631
+ .then(function (clone) {
49632
+ return processClone(node, clone);
49633
+ });
49634
+ function makeNodeCopy(node) {
49635
+ if (node instanceof HTMLCanvasElement)
49636
+ return util.makeImage(node.toDataURL());
49637
+ return node.cloneNode(false);
49638
+ }
49639
+ function cloneChildren(original, clone, filter) {
49640
+ var children = original.childNodes;
49641
+ if (children.length === 0)
49642
+ return Promise.resolve(clone);
49643
+ return cloneChildrenInOrder(clone, util.asArray(children), filter).then(function () {
49644
+ return clone;
49645
+ });
49646
+ function cloneChildrenInOrder(parent, children, filter) {
49647
+ var done = Promise.resolve();
49648
+ children.forEach(function (child) {
49649
+ done = done
49650
+ .then(function () {
49651
+ return cloneNode(child, filter);
49652
+ })
49653
+ .then(function (childClone) {
49654
+ if (childClone)
49655
+ parent.appendChild(childClone);
49656
+ });
49657
+ });
49658
+ return done;
49659
+ }
49660
+ }
49661
+ function processClone(original, clone) {
49662
+ if (!(clone instanceof Element))
49663
+ return clone;
49664
+ return Promise.resolve()
49665
+ .then(cloneStyle)
49666
+ .then(clonePseudoElements)
49667
+ .then(copyUserInput)
49668
+ .then(fixSvg)
49669
+ .then(function () {
49670
+ return clone;
49671
+ });
49672
+ function cloneStyle() {
49673
+ copyStyle(window.getComputedStyle(original), clone.style);
49674
+ function copyStyle(source, target) {
49675
+ if (source.cssText)
49676
+ target.cssText = source.cssText;
49677
+ else
49678
+ copyProperties(source, target);
49679
+ function copyProperties(source, target) {
49680
+ util.asArray(source).forEach(function (name) {
49681
+ target.setProperty(name, source.getPropertyValue(name), source.getPropertyPriority(name));
49682
+ });
49683
+ }
49684
+ }
49685
+ }
49686
+ function clonePseudoElements() {
49687
+ [':before', ':after'].forEach(function (element) {
49688
+ clonePseudoElement(element);
49689
+ });
49690
+ function clonePseudoElement(element) {
49691
+ var style = window.getComputedStyle(original, element);
49692
+ var content = style.getPropertyValue('content');
49693
+ if (content === '' || content === 'none')
49694
+ return;
49695
+ var className = util.uid();
49696
+ clone.className = clone.className + ' ' + className;
49697
+ var styleElement = document.createElement('style');
49698
+ styleElement.appendChild(formatPseudoElementStyle(className, element, style));
49699
+ clone.appendChild(styleElement);
49700
+ function formatPseudoElementStyle(className, element, style) {
49701
+ var selector = '.' + className + ':' + element;
49702
+ var cssText = style.cssText
49703
+ ? formatCssText(style)
49704
+ : formatCssProperties(style);
49705
+ return document.createTextNode(selector + '{' + cssText + '}');
49706
+ function formatCssText(style) {
49707
+ var content = style.getPropertyValue('content');
49708
+ return style.cssText + ' content: ' + content + ';';
49709
+ }
49710
+ function formatCssProperties(style) {
49711
+ return (util
49712
+ .asArray(style)
49713
+ .map(formatProperty)
49714
+ .join('; ') + ';');
49715
+ function formatProperty(name) {
49716
+ return (name +
49717
+ ': ' +
49718
+ style.getPropertyValue(name) +
49719
+ (style.getPropertyPriority(name)
49720
+ ? ' !important'
49721
+ : ''));
49722
+ }
49723
+ }
49724
+ }
49725
+ }
49726
+ }
49727
+ function copyUserInput() {
49728
+ if (original instanceof HTMLTextAreaElement)
49729
+ clone.innerHTML = original.value;
49730
+ if (original instanceof HTMLInputElement)
49731
+ clone.setAttribute('value', original.value);
49732
+ }
49733
+ function fixSvg() {
49734
+ if (!(clone instanceof SVGElement))
49735
+ return;
49736
+ clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
49737
+ if (!(clone instanceof SVGRectElement))
49738
+ return;
49739
+ ['width', 'height'].forEach(function (attribute) {
49740
+ var value = clone.getAttribute(attribute);
49741
+ if (!value)
49742
+ return;
49743
+ clone.style.setProperty(attribute, value);
49744
+ });
49745
+ }
49746
+ }
49747
+ }
49748
+ function embedFonts(node) {
49749
+ return fontFaces.resolveAll().then(function (cssText) {
49750
+ var styleNode = document.createElement('style');
49751
+ node.appendChild(styleNode);
49752
+ styleNode.appendChild(document.createTextNode(cssText));
49753
+ return node;
49754
+ });
49755
+ }
49756
+ function inlineImages(node) {
49757
+ return images.inlineAll(node).then(function () {
49758
+ return node;
49759
+ });
49760
+ }
49761
+ function makeSvgDataUri(node, width, height) {
49762
+ return Promise.resolve(node)
49763
+ .then(function (node) {
49764
+ node.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
49765
+ return new XMLSerializer().serializeToString(node);
49766
+ })
49767
+ .then(util.escapeXhtml)
49768
+ .then(function (xhtml) {
49769
+ return ('<foreignObject x="0" y="0" width="100%" height="100%">' +
49770
+ xhtml +
49771
+ '</foreignObject>');
49772
+ })
49773
+ .then(function (foreignObject) {
49774
+ return ('<svg xmlns="http://www.w3.org/2000/svg" width="' +
49775
+ width +
49776
+ '" height="' +
49777
+ height +
49778
+ '">' +
49779
+ foreignObject +
49780
+ '</svg>');
49781
+ })
49782
+ .then(function (svg) {
49783
+ return 'data:image/svg+xml;charset=utf-8,' + svg;
49784
+ });
49785
+ }
49786
+ function newUtil() {
49787
+ return {
49788
+ escape: escape,
49789
+ parseExtension: parseExtension,
49790
+ mimeType: mimeType,
49791
+ dataAsUrl: dataAsUrl,
49792
+ isDataUrl: isDataUrl,
49793
+ canvasToBlob: canvasToBlob,
49794
+ resolveUrl: resolveUrl,
49795
+ getAndEncode: getAndEncode,
49796
+ uid: uid(),
49797
+ delay: delay,
49798
+ asArray: asArray,
49799
+ escapeXhtml: escapeXhtml,
49800
+ makeImage: makeImage,
49801
+ width: width,
49802
+ height: height,
49803
+ };
49804
+ function mimes() {
49805
+ /*
49806
+ * Only WOFF and EOT mime types for fonts are 'real'
49807
+ * see http://www.iana.org/assignments/media-types/media-types.xhtml
49808
+ */
49809
+ var WOFF = 'application/font-woff';
49810
+ var JPEG = 'image/jpeg';
49811
+ return {
49812
+ woff: WOFF,
49813
+ woff2: WOFF,
49814
+ ttf: 'application/font-truetype',
49815
+ eot: 'application/vnd.ms-fontobject',
49816
+ png: 'image/png',
49817
+ jpg: JPEG,
49818
+ jpeg: JPEG,
49819
+ gif: 'image/gif',
49820
+ tiff: 'image/tiff',
49821
+ svg: 'image/svg+xml',
49822
+ };
49823
+ }
49824
+ function parseExtension(url) {
49825
+ var match = /\.([^\.\/]*?)$/g.exec(url);
49826
+ if (match)
49827
+ return match[1];
49828
+ else
49829
+ return '';
49830
+ }
49831
+ function mimeType(url) {
49832
+ var extension = parseExtension(url).toLowerCase();
49833
+ return mimes()[extension] || '';
49834
+ }
49835
+ function isDataUrl(url) {
49836
+ return url.search(/^(data:)/) !== -1;
49837
+ }
49838
+ function toBlob(canvas) {
49839
+ return new Promise(function (resolve) {
49840
+ var binaryString = window.atob(canvas.toDataURL().split(',')[1]);
49841
+ var length = binaryString.length;
49842
+ var binaryArray = new Uint8Array(length);
49843
+ for (var i = 0; i < length; i++)
49844
+ binaryArray[i] = binaryString.charCodeAt(i);
49845
+ resolve(new Blob([binaryArray], {
49846
+ type: 'image/png',
49847
+ }));
49848
+ });
49849
+ }
49850
+ function canvasToBlob(canvas) {
49851
+ if (canvas.toBlob)
49852
+ return new Promise(function (resolve) {
49853
+ canvas.toBlob(resolve);
49854
+ });
49855
+ return toBlob(canvas);
49856
+ }
49857
+ function resolveUrl(url, baseUrl) {
49858
+ var doc = document.implementation.createHTMLDocument();
49859
+ var base = doc.createElement('base');
49860
+ doc.head.appendChild(base);
49861
+ var a = doc.createElement('a');
49862
+ doc.body.appendChild(a);
49863
+ base.href = baseUrl;
49864
+ a.href = url;
49865
+ return a.href;
49866
+ }
49867
+ function uid() {
49868
+ var index = 0;
49869
+ return function () {
49870
+ return 'u' + fourRandomChars() + index++;
49871
+ function fourRandomChars() {
49872
+ /* see http://stackoverflow.com/a/6248722/2519373 */
49873
+ return ('0000' +
49874
+ ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);
49875
+ }
49876
+ };
49877
+ }
49878
+ function makeImage(uri) {
49879
+ return new Promise(function (resolve, reject) {
49880
+ var image = new Image();
49881
+ image.onload = function () {
49882
+ resolve(image);
49883
+ };
49884
+ image.onerror = reject;
49885
+ image.src = uri;
49886
+ });
49887
+ }
49888
+ function getAndEncode(url) {
49889
+ var TIMEOUT = 30000;
49890
+ if (domtoimage.impl.options.cacheBust) {
49891
+ // Cache bypass so we dont have CORS issues with cached images
49892
+ // Source: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
49893
+ url += (/\?/.test(url) ? '&' : '?') + new Date().getTime();
49894
+ }
49895
+ return new Promise(function (resolve) {
49896
+ var request = new XMLHttpRequest();
49897
+ request.onreadystatechange = done;
49898
+ request.ontimeout = timeout;
49899
+ request.responseType = 'blob';
49900
+ request.timeout = TIMEOUT;
49901
+ request.open('GET', url, true);
49902
+ request.send();
49903
+ var placeholder;
49904
+ if (domtoimage.impl.options.imagePlaceholder) {
49905
+ var split = domtoimage.impl.options.imagePlaceholder.split(/,/);
49906
+ if (split && split[1]) {
49907
+ placeholder = split[1];
49908
+ }
49909
+ }
49910
+ function done() {
49911
+ if (request.readyState !== 4)
49912
+ return;
49913
+ if (request.status !== 200) {
49914
+ if (placeholder) {
49915
+ resolve(placeholder);
49916
+ }
49917
+ else {
49918
+ fail('cannot fetch resource: ' +
49919
+ url +
49920
+ ', status: ' +
49921
+ request.status);
49922
+ }
49923
+ return;
49924
+ }
49925
+ var encoder = new FileReader();
49926
+ encoder.onloadend = function () {
49927
+ var content = encoder.result.split(/,/)[1];
49928
+ resolve(content);
49929
+ };
49930
+ encoder.readAsDataURL(request.response);
49931
+ }
49932
+ function timeout() {
49933
+ if (placeholder) {
49934
+ resolve(placeholder);
49935
+ }
49936
+ else {
49937
+ fail('timeout of ' +
49938
+ TIMEOUT +
49939
+ 'ms occured while fetching resource: ' +
49940
+ url);
49941
+ }
49942
+ }
49943
+ function fail(message) {
49944
+ console.error(message);
49945
+ resolve('');
49946
+ }
49947
+ });
49948
+ }
49949
+ function dataAsUrl(content, type) {
49950
+ return 'data:' + type + ';base64,' + content;
49951
+ }
49952
+ function escape(string) {
49953
+ return string.replace(/([.*+?^${}()|\[\]\/\\])/g, '\\$1');
49954
+ }
49955
+ function delay(ms) {
49956
+ return function (arg) {
49957
+ return new Promise(function (resolve) {
49958
+ setTimeout(function () {
49959
+ resolve(arg);
49960
+ }, ms);
49961
+ });
49962
+ };
49963
+ }
49964
+ function asArray(arrayLike) {
49965
+ var array = [];
49966
+ var length = arrayLike.length;
49967
+ for (var i = 0; i < length; i++)
49968
+ array.push(arrayLike[i]);
49969
+ return array;
49970
+ }
49971
+ function escapeXhtml(string) {
49972
+ return string.replace(/#/g, '%23').replace(/\n/g, '%0A');
49973
+ }
49974
+ function width(node) {
49975
+ var leftBorder = px(node, 'border-left-width');
49976
+ var rightBorder = px(node, 'border-right-width');
49977
+ return node.scrollWidth + leftBorder + rightBorder;
49978
+ }
49979
+ function height(node) {
49980
+ var topBorder = px(node, 'border-top-width');
49981
+ var bottomBorder = px(node, 'border-bottom-width');
49982
+ return node.scrollHeight + topBorder + bottomBorder;
49983
+ }
49984
+ function px(node, styleProperty) {
49985
+ var value = window
49986
+ .getComputedStyle(node)
49987
+ .getPropertyValue(styleProperty);
49988
+ return parseFloat(value.replace('px', ''));
49989
+ }
49990
+ }
49991
+ function newInliner() {
49992
+ var URL_REGEX = /url\(['"]?([^'"]+?)['"]?\)/g;
49993
+ return {
49994
+ inlineAll: inlineAll,
49995
+ shouldProcess: shouldProcess,
49996
+ impl: {
49997
+ readUrls: readUrls,
49998
+ inline: inline,
49999
+ },
50000
+ };
50001
+ function shouldProcess(string) {
50002
+ return string.search(URL_REGEX) !== -1;
50003
+ }
50004
+ function readUrls(string) {
50005
+ var result = [];
50006
+ var match;
50007
+ while ((match = URL_REGEX.exec(string)) !== null) {
50008
+ result.push(match[1]);
50009
+ }
50010
+ return result.filter(function (url) {
50011
+ return !util.isDataUrl(url);
50012
+ });
50013
+ }
50014
+ function inline(string, url, baseUrl, get) {
50015
+ return Promise.resolve(url)
50016
+ .then(function (url) {
50017
+ return baseUrl ? util.resolveUrl(url, baseUrl) : url;
50018
+ })
50019
+ .then(get || util.getAndEncode)
50020
+ .then(function (data) {
50021
+ return util.dataAsUrl(data, util.mimeType(url));
50022
+ })
50023
+ .then(function (dataUrl) {
50024
+ return string.replace(urlAsRegex(url), '$1' + dataUrl + '$3');
50025
+ });
50026
+ function urlAsRegex(url) {
50027
+ return new RegExp('(url\\([\'"]?)(' + util.escape(url) + ')([\'"]?\\))', 'g');
50028
+ }
50029
+ }
50030
+ function inlineAll(string, baseUrl, get) {
50031
+ if (nothingToInline())
50032
+ return Promise.resolve(string);
50033
+ return Promise.resolve(string)
50034
+ .then(readUrls)
50035
+ .then(function (urls) {
50036
+ var done = Promise.resolve(string);
50037
+ urls.forEach(function (url) {
50038
+ done = done.then(function (string) {
50039
+ return inline(string, url, baseUrl, get);
50040
+ });
50041
+ });
50042
+ return done;
50043
+ });
50044
+ function nothingToInline() {
50045
+ return !shouldProcess(string);
50046
+ }
50047
+ }
50048
+ }
50049
+ function newFontFaces() {
50050
+ return {
50051
+ resolveAll: resolveAll,
50052
+ impl: {
50053
+ readAll: readAll,
50054
+ },
50055
+ };
50056
+ function resolveAll() {
50057
+ return readAll(document)
50058
+ .then(function (webFonts) {
50059
+ return Promise.all(webFonts.map(function (webFont) {
50060
+ return webFont.resolve();
50061
+ }));
50062
+ })
50063
+ .then(function (cssStrings) {
50064
+ return cssStrings.join('\n');
50065
+ });
50066
+ }
50067
+ function readAll() {
50068
+ return Promise.resolve(util.asArray(document.styleSheets))
50069
+ .then(getCssRules)
50070
+ .then(selectWebFontRules)
50071
+ .then(function (rules) {
50072
+ return rules.map(newWebFont);
50073
+ });
50074
+ function selectWebFontRules(cssRules) {
50075
+ return cssRules
50076
+ .filter(function (rule) {
50077
+ return rule.type === CSSRule.FONT_FACE_RULE;
50078
+ })
50079
+ .filter(function (rule) {
50080
+ return inliner.shouldProcess(rule.style.getPropertyValue('src'));
50081
+ });
50082
+ }
50083
+ function getCssRules(styleSheets) {
50084
+ var cssRules = [];
50085
+ styleSheets.forEach(function (sheet) {
50086
+ try {
50087
+ util.asArray(sheet.cssRules || []).forEach(cssRules.push.bind(cssRules));
50088
+ }
50089
+ catch (e) {
50090
+ console.log('Error while reading CSS rules from ' + sheet.href, e.toString());
50091
+ }
50092
+ });
50093
+ return cssRules;
50094
+ }
50095
+ function newWebFont(webFontRule) {
50096
+ return {
50097
+ resolve: function resolve() {
50098
+ var baseUrl = (webFontRule.parentStyleSheet || {}).href;
50099
+ return inliner.inlineAll(webFontRule.cssText, baseUrl);
50100
+ },
50101
+ src: function () {
50102
+ return webFontRule.style.getPropertyValue('src');
50103
+ },
50104
+ };
50105
+ }
50106
+ }
50107
+ }
50108
+ function newImages() {
50109
+ return {
50110
+ inlineAll: inlineAll,
50111
+ impl: {
50112
+ newImage: newImage,
50113
+ },
50114
+ };
50115
+ function newImage(element) {
50116
+ return {
50117
+ inline: inline,
50118
+ };
50119
+ function inline(get) {
50120
+ if (util.isDataUrl(element.src))
50121
+ return Promise.resolve();
50122
+ return Promise.resolve(element.src)
50123
+ .then(get || util.getAndEncode)
50124
+ .then(function (data) {
50125
+ return util.dataAsUrl(data, util.mimeType(element.src));
50126
+ })
50127
+ .then(function (dataUrl) {
50128
+ return new Promise(function (resolve, reject) {
50129
+ element.onload = resolve;
50130
+ element.onerror = reject;
50131
+ element.src = dataUrl;
50132
+ });
50133
+ });
50134
+ }
50135
+ }
50136
+ function inlineAll(node) {
50137
+ if (!(node instanceof Element))
50138
+ return Promise.resolve(node);
50139
+ return inlineBackground(node).then(function () {
50140
+ if (node instanceof HTMLImageElement)
50141
+ return newImage(node).inline();
50142
+ else
50143
+ return Promise.all(util.asArray(node.childNodes).map(function (child) {
50144
+ return inlineAll(child);
50145
+ }));
50146
+ });
50147
+ function inlineBackground(node) {
50148
+ var background = node.style.getPropertyValue('background');
50149
+ if (!background)
50150
+ return Promise.resolve(node);
50151
+ return inliner
50152
+ .inlineAll(background)
50153
+ .then(function (inlined) {
50154
+ node.style.setProperty('background', inlined, node.style.getPropertyPriority('background'));
50155
+ })
50156
+ .then(function () {
50157
+ return node;
50158
+ });
50159
+ }
50160
+ }
50161
+ }
50162
+ })(this);
50163
+ //# sourceMappingURL=../../../src/services/essentials/dom-to-image.js.map
50164
+
49439
50165
  /***/ }),
49440
50166
 
49441
50167
  /***/ "b489":
@@ -50303,1039 +51029,263 @@ $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymb
50303
51029
  });
50304
51030
 
50305
51031
  // `JSON.stringify` method behavior with symbols
50306
- // https://tc39.github.io/ecma262/#sec-json.stringify
50307
- if ($stringify) {
50308
- var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
50309
- var symbol = $Symbol();
50310
- // MS Edge converts symbol values to JSON as {}
50311
- return $stringify([symbol]) != '[null]'
50312
- // WebKit converts symbol values to JSON as null
50313
- || $stringify({ a: symbol }) != '{}'
50314
- // V8 throws on boxed symbols
50315
- || $stringify(Object(symbol)) != '{}';
50316
- });
50317
-
50318
- $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
50319
- // eslint-disable-next-line no-unused-vars
50320
- stringify: function stringify(it, replacer, space) {
50321
- var args = [it];
50322
- var index = 1;
50323
- var $replacer;
50324
- while (arguments.length > index) args.push(arguments[index++]);
50325
- $replacer = replacer;
50326
- if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
50327
- if (!isArray(replacer)) replacer = function (key, value) {
50328
- if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
50329
- if (!isSymbol(value)) return value;
50330
- };
50331
- args[1] = replacer;
50332
- return $stringify.apply(null, args);
50333
- }
50334
- });
50335
- }
50336
-
50337
- // `Symbol.prototype[@@toPrimitive]` method
50338
- // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
50339
- if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
50340
- createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
50341
- }
50342
- // `Symbol.prototype[@@toStringTag]` property
50343
- // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
50344
- setToStringTag($Symbol, SYMBOL);
50345
-
50346
- hiddenKeys[HIDDEN] = true;
50347
-
50348
-
50349
- /***/ }),
50350
-
50351
- /***/ "d6f0":
50352
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
50353
-
50354
- "use strict";
50355
- /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7f0d");
50356
-
50357
-
50358
- /** Detect free variable `exports`. */
50359
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
50360
-
50361
- /** Detect free variable `module`. */
50362
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
50363
-
50364
- /** Detect the popular CommonJS extension `module.exports`. */
50365
- var moduleExports = freeModule && freeModule.exports === freeExports;
50366
-
50367
- /** Built-in value references. */
50368
- var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].Buffer : undefined,
50369
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
50370
-
50371
- /**
50372
- * Creates a clone of `buffer`.
50373
- *
50374
- * @private
50375
- * @param {Buffer} buffer The buffer to clone.
50376
- * @param {boolean} [isDeep] Specify a deep clone.
50377
- * @returns {Buffer} Returns the cloned buffer.
50378
- */
50379
- function cloneBuffer(buffer, isDeep) {
50380
- if (isDeep) {
50381
- return buffer.slice();
50382
- }
50383
- var length = buffer.length,
50384
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
50385
-
50386
- buffer.copy(result);
50387
- return result;
50388
- }
50389
-
50390
- /* harmony default export */ __webpack_exports__["a"] = (cloneBuffer);
50391
-
50392
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("7326")(module)))
50393
-
50394
- /***/ }),
50395
-
50396
- /***/ "da06":
50397
- /***/ (function(module, exports, __webpack_require__) {
50398
-
50399
- var TO_STRING_TAG_SUPPORT = __webpack_require__("3cec");
50400
- var classofRaw = __webpack_require__("6a61");
50401
- var wellKnownSymbol = __webpack_require__("7d53");
50402
-
50403
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
50404
- // ES3 wrong here
50405
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
50406
-
50407
- // fallback for IE11 Script Access Denied error
50408
- var tryGet = function (it, key) {
50409
- try {
50410
- return it[key];
50411
- } catch (error) { /* empty */ }
50412
- };
50413
-
50414
- // getting tag from ES6+ `Object.prototype.toString`
50415
- module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
50416
- var O, tag, result;
50417
- return it === undefined ? 'Undefined' : it === null ? 'Null'
50418
- // @@toStringTag case
50419
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
50420
- // builtinTag case
50421
- : CORRECT_ARGUMENTS ? classofRaw(O)
50422
- // ES3 arguments fallback
50423
- : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
50424
- };
50425
-
50426
-
50427
- /***/ }),
50428
-
50429
- /***/ "df6f":
50430
- /***/ (function(module, exports, __webpack_require__) {
50431
-
50432
- var store = __webpack_require__("c607");
50433
-
50434
- var functionToString = Function.toString;
50435
-
50436
- // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
50437
- if (typeof store.inspectSource != 'function') {
50438
- store.inspectSource = function (it) {
50439
- return functionToString.call(it);
50440
- };
50441
- }
50442
-
50443
- module.exports = store.inspectSource;
50444
-
50445
-
50446
- /***/ }),
50447
-
50448
- /***/ "e129":
50449
- /***/ (function(module, exports, __webpack_require__) {
50450
-
50451
- "use strict";
50452
-
50453
- var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
50454
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
50455
-
50456
- // Nashorn ~ JDK8 bug
50457
- var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
50458
-
50459
- // `Object.prototype.propertyIsEnumerable` method implementation
50460
- // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
50461
- exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
50462
- var descriptor = getOwnPropertyDescriptor(this, V);
50463
- return !!descriptor && descriptor.enumerable;
50464
- } : nativePropertyIsEnumerable;
50465
-
50466
-
50467
- /***/ }),
50468
-
50469
- /***/ "e7a0":
50470
- /***/ (function(module, exports, __webpack_require__) {
50471
-
50472
- var fails = __webpack_require__("72df");
50473
-
50474
- module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
50475
- // Chrome 38 Symbol has incorrect toString conversion
50476
- // eslint-disable-next-line no-undef
50477
- return !String(Symbol());
50478
- });
50479
-
50480
-
50481
- /***/ }),
50482
-
50483
- /***/ "ebac":
50484
- /***/ (function(module, exports, __webpack_require__) {
50485
-
50486
- var fails = __webpack_require__("72df");
50487
-
50488
- var replacement = /#|\.prototype\./;
50489
-
50490
- var isForced = function (feature, detection) {
50491
- var value = data[normalize(feature)];
50492
- return value == POLYFILL ? true
50493
- : value == NATIVE ? false
50494
- : typeof detection == 'function' ? fails(detection)
50495
- : !!detection;
50496
- };
50497
-
50498
- var normalize = isForced.normalize = function (string) {
50499
- return String(string).replace(replacement, '.').toLowerCase();
50500
- };
50501
-
50502
- var data = isForced.data = {};
50503
- var NATIVE = isForced.NATIVE = 'N';
50504
- var POLYFILL = isForced.POLYFILL = 'P';
50505
-
50506
- module.exports = isForced;
50507
-
50508
-
50509
- /***/ }),
50510
-
50511
- /***/ "ed2b":
50512
- /***/ (function(module, exports, __webpack_require__) {
50513
-
50514
- var wellKnownSymbol = __webpack_require__("7d53");
50515
- var create = __webpack_require__("82e8");
50516
- var definePropertyModule = __webpack_require__("abdf");
50517
-
50518
- var UNSCOPABLES = wellKnownSymbol('unscopables');
50519
- var ArrayPrototype = Array.prototype;
50520
-
50521
- // Array.prototype[@@unscopables]
50522
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
50523
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
50524
- definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
50525
- configurable: true,
50526
- value: create(null)
50527
- });
50528
- }
50529
-
50530
- // add a key to Array.prototype[@@unscopables]
50531
- module.exports = function (key) {
50532
- ArrayPrototype[UNSCOPABLES][key] = true;
50533
- };
50534
-
50535
-
50536
- /***/ }),
50537
-
50538
- /***/ "ee58":
50539
- /***/ (function(module, exports, __webpack_require__) {
50540
-
50541
- var toIndexedObject = __webpack_require__("378c");
50542
- var nativeGetOwnPropertyNames = __webpack_require__("65d0").f;
50543
-
50544
- var toString = {}.toString;
50545
-
50546
- var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
50547
- ? Object.getOwnPropertyNames(window) : [];
50548
-
50549
- var getWindowNames = function (it) {
50550
- try {
50551
- return nativeGetOwnPropertyNames(it);
50552
- } catch (error) {
50553
- return windowNames.slice();
50554
- }
50555
- };
50556
-
50557
- // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
50558
- module.exports.f = function getOwnPropertyNames(it) {
50559
- return windowNames && toString.call(it) == '[object Window]'
50560
- ? getWindowNames(it)
50561
- : nativeGetOwnPropertyNames(toIndexedObject(it));
50562
- };
50563
-
50564
-
50565
- /***/ }),
50566
-
50567
- /***/ "eeea":
50568
- /***/ (function(module, exports, __webpack_require__) {
50569
-
50570
- (function (global) {
50571
- 'use strict';
50572
-
50573
- var util = newUtil();
50574
- var inliner = newInliner();
50575
- var fontFaces = newFontFaces();
50576
- var images = newImages();
50577
-
50578
- // Default impl options
50579
- var defaultOptions = {
50580
- // Default is to fail on error, no placeholder
50581
- imagePlaceholder: undefined,
50582
- // Default cache bust is false, it will use the cache
50583
- cacheBust: false
50584
- };
50585
-
50586
- var domtoimage = {
50587
- toSvg: toSvg,
50588
- toPng: toPng,
50589
- toJpeg: toJpeg,
50590
- toBlob: toBlob,
50591
- toPixelData: toPixelData,
50592
- impl: {
50593
- fontFaces: fontFaces,
50594
- images: images,
50595
- util: util,
50596
- inliner: inliner,
50597
- options: {}
50598
- }
50599
- };
50600
-
50601
- if (true)
50602
- module.exports = domtoimage;
50603
- else
50604
- {}
50605
-
50606
-
50607
- /**
50608
- * @param {Node} node - The DOM Node object to render
50609
- * @param {Object} options - Rendering options
50610
- * @param {Function} options.filter - Should return true if passed node should be included in the output
50611
- * (excluding node means excluding it's children as well). Not called on the root node.
50612
- * @param {String} options.bgcolor - color for the background, any valid CSS color value.
50613
- * @param {Number} options.width - width to be applied to node before rendering.
50614
- * @param {Number} options.height - height to be applied to node before rendering.
50615
- * @param {Object} options.style - an object whose properties to be copied to node's style before rendering.
50616
- * @param {Number} options.quality - a Number between 0 and 1 indicating image quality (applicable to JPEG only),
50617
- defaults to 1.0.
50618
- * @param {String} options.imagePlaceholder - dataURL to use as a placeholder for failed images, default behaviour is to fail fast on images we can't fetch
50619
- * @param {Boolean} options.cacheBust - set to true to cache bust by appending the time to the request url
50620
- * @return {Promise} - A promise that is fulfilled with a SVG image data URL
50621
- * */
50622
- function toSvg(node, options) {
50623
- options = options || {};
50624
- copyOptions(options);
50625
- return Promise.resolve(node)
50626
- .then(function (node) {
50627
- return cloneNode(node, options.filter, true);
50628
- })
50629
- .then(embedFonts)
50630
- .then(inlineImages)
50631
- .then(applyOptions)
50632
- .then(function (clone) {
50633
- return makeSvgDataUri(clone,
50634
- options.width || util.width(node),
50635
- options.height || util.height(node)
50636
- );
50637
- });
50638
-
50639
- function applyOptions(clone) {
50640
- if (options.bgcolor) clone.style.backgroundColor = options.bgcolor;
50641
-
50642
- if (options.width) clone.style.width = options.width + 'px';
50643
- if (options.height) clone.style.height = options.height + 'px';
50644
-
50645
- if (options.style)
50646
- Object.keys(options.style).forEach(function (property) {
50647
- clone.style[property] = options.style[property];
50648
- });
50649
-
50650
- return clone;
50651
- }
50652
- }
50653
-
50654
- /**
50655
- * @param {Node} node - The DOM Node object to render
50656
- * @param {Object} options - Rendering options, @see {@link toSvg}
50657
- * @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
50658
- * */
50659
- function toPixelData(node, options) {
50660
- return draw(node, options || {})
50661
- .then(function (canvas) {
50662
- return canvas.getContext('2d').getImageData(
50663
- 0,
50664
- 0,
50665
- util.width(node),
50666
- util.height(node)
50667
- ).data;
50668
- });
50669
- }
50670
-
50671
- /**
50672
- * @param {Node} node - The DOM Node object to render
50673
- * @param {Object} options - Rendering options, @see {@link toSvg}
50674
- * @return {Promise} - A promise that is fulfilled with a PNG image data URL
50675
- * */
50676
- function toPng(node, options) {
50677
- return draw(node, options || {})
50678
- .then(function (canvas) {
50679
- return canvas.toDataURL();
50680
- });
50681
- }
50682
-
50683
- /**
50684
- * @param {Node} node - The DOM Node object to render
50685
- * @param {Object} options - Rendering options, @see {@link toSvg}
50686
- * @return {Promise} - A promise that is fulfilled with a JPEG image data URL
50687
- * */
50688
- function toJpeg(node, options) {
50689
- options = options || {};
50690
- return draw(node, options)
50691
- .then(function (canvas) {
50692
- return canvas.toDataURL('image/jpeg', options.quality || 1.0);
50693
- });
50694
- }
50695
-
50696
- /**
50697
- * @param {Node} node - The DOM Node object to render
50698
- * @param {Object} options - Rendering options, @see {@link toSvg}
50699
- * @return {Promise} - A promise that is fulfilled with a PNG image blob
50700
- * */
50701
- function toBlob(node, options) {
50702
- return draw(node, options || {})
50703
- .then(util.canvasToBlob);
50704
- }
50705
-
50706
- function copyOptions(options) {
50707
- // Copy options to impl options for use in impl
50708
- if(typeof(options.imagePlaceholder) === 'undefined') {
50709
- domtoimage.impl.options.imagePlaceholder = defaultOptions.imagePlaceholder;
50710
- } else {
50711
- domtoimage.impl.options.imagePlaceholder = options.imagePlaceholder;
50712
- }
50713
-
50714
- if(typeof(options.cacheBust) === 'undefined') {
50715
- domtoimage.impl.options.cacheBust = defaultOptions.cacheBust;
50716
- } else {
50717
- domtoimage.impl.options.cacheBust = options.cacheBust;
50718
- }
50719
- }
50720
-
50721
- function draw(domNode, options) {
50722
- return toSvg(domNode, options)
50723
- .then(util.makeImage)
50724
- .then(util.delay(100))
50725
- .then(function (image) {
50726
- var canvas = newCanvas(domNode);
50727
- canvas.getContext('2d').drawImage(image, 0, 0);
50728
- return canvas;
50729
- });
50730
-
50731
- function newCanvas(domNode) {
50732
- var canvas = document.createElement('canvas');
50733
- canvas.width = options.width || util.width(domNode);
50734
- canvas.height = options.height || util.height(domNode);
50735
-
50736
- if (options.bgcolor) {
50737
- var ctx = canvas.getContext('2d');
50738
- ctx.fillStyle = options.bgcolor;
50739
- ctx.fillRect(0, 0, canvas.width, canvas.height);
50740
- }
50741
-
50742
- return canvas;
50743
- }
50744
- }
50745
-
50746
- function cloneNode(node, filter, root) {
50747
- if (!root && filter && !filter(node)) return Promise.resolve();
50748
-
50749
- return Promise.resolve(node)
50750
- .then(makeNodeCopy)
50751
- .then(function (clone) {
50752
- return cloneChildren(node, clone, filter);
50753
- })
50754
- .then(function (clone) {
50755
- return processClone(node, clone);
50756
- });
50757
-
50758
- function makeNodeCopy(node) {
50759
- if (node instanceof HTMLCanvasElement) return util.makeImage(node.toDataURL());
50760
- return node.cloneNode(false);
50761
- }
50762
-
50763
- function cloneChildren(original, clone, filter) {
50764
- var children = original.childNodes;
50765
- if (children.length === 0) return Promise.resolve(clone);
50766
-
50767
- return cloneChildrenInOrder(clone, util.asArray(children), filter)
50768
- .then(function () {
50769
- return clone;
50770
- });
50771
-
50772
- function cloneChildrenInOrder(parent, children, filter) {
50773
- var done = Promise.resolve();
50774
- children.forEach(function (child) {
50775
- done = done
50776
- .then(function () {
50777
- return cloneNode(child, filter);
50778
- })
50779
- .then(function (childClone) {
50780
- if (childClone) parent.appendChild(childClone);
50781
- });
50782
- });
50783
- return done;
50784
- }
50785
- }
50786
-
50787
- function processClone(original, clone) {
50788
- if (!(clone instanceof Element)) return clone;
50789
-
50790
- return Promise.resolve()
50791
- .then(cloneStyle)
50792
- .then(clonePseudoElements)
50793
- .then(copyUserInput)
50794
- .then(fixSvg)
50795
- .then(function () {
50796
- return clone;
50797
- });
50798
-
50799
- function cloneStyle() {
50800
- copyStyle(window.getComputedStyle(original), clone.style);
50801
-
50802
- function copyStyle(source, target) {
50803
- if (source.cssText) target.cssText = source.cssText;
50804
- else copyProperties(source, target);
50805
-
50806
- function copyProperties(source, target) {
50807
- util.asArray(source).forEach(function (name) {
50808
- target.setProperty(
50809
- name,
50810
- source.getPropertyValue(name),
50811
- source.getPropertyPriority(name)
50812
- );
50813
- });
50814
- }
50815
- }
50816
- }
50817
-
50818
- function clonePseudoElements() {
50819
- [':before', ':after'].forEach(function (element) {
50820
- clonePseudoElement(element);
50821
- });
50822
-
50823
- function clonePseudoElement(element) {
50824
- var style = window.getComputedStyle(original, element);
50825
- var content = style.getPropertyValue('content');
50826
-
50827
- if (content === '' || content === 'none') return;
50828
-
50829
- var className = util.uid();
50830
- clone.className = clone.className + ' ' + className;
50831
- var styleElement = document.createElement('style');
50832
- styleElement.appendChild(formatPseudoElementStyle(className, element, style));
50833
- clone.appendChild(styleElement);
50834
-
50835
- function formatPseudoElementStyle(className, element, style) {
50836
- var selector = '.' + className + ':' + element;
50837
- var cssText = style.cssText ? formatCssText(style) : formatCssProperties(style);
50838
- return document.createTextNode(selector + '{' + cssText + '}');
50839
-
50840
- function formatCssText(style) {
50841
- var content = style.getPropertyValue('content');
50842
- return style.cssText + ' content: ' + content + ';';
50843
- }
50844
-
50845
- function formatCssProperties(style) {
50846
-
50847
- return util.asArray(style)
50848
- .map(formatProperty)
50849
- .join('; ') + ';';
50850
-
50851
- function formatProperty(name) {
50852
- return name + ': ' +
50853
- style.getPropertyValue(name) +
50854
- (style.getPropertyPriority(name) ? ' !important' : '');
50855
- }
50856
- }
50857
- }
50858
- }
50859
- }
51032
+ // https://tc39.github.io/ecma262/#sec-json.stringify
51033
+ if ($stringify) {
51034
+ var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
51035
+ var symbol = $Symbol();
51036
+ // MS Edge converts symbol values to JSON as {}
51037
+ return $stringify([symbol]) != '[null]'
51038
+ // WebKit converts symbol values to JSON as null
51039
+ || $stringify({ a: symbol }) != '{}'
51040
+ // V8 throws on boxed symbols
51041
+ || $stringify(Object(symbol)) != '{}';
51042
+ });
50860
51043
 
50861
- function copyUserInput() {
50862
- if (original instanceof HTMLTextAreaElement) clone.innerHTML = original.value;
50863
- if (original instanceof HTMLInputElement) clone.setAttribute("value", original.value);
50864
- }
51044
+ $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
51045
+ // eslint-disable-next-line no-unused-vars
51046
+ stringify: function stringify(it, replacer, space) {
51047
+ var args = [it];
51048
+ var index = 1;
51049
+ var $replacer;
51050
+ while (arguments.length > index) args.push(arguments[index++]);
51051
+ $replacer = replacer;
51052
+ if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
51053
+ if (!isArray(replacer)) replacer = function (key, value) {
51054
+ if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
51055
+ if (!isSymbol(value)) return value;
51056
+ };
51057
+ args[1] = replacer;
51058
+ return $stringify.apply(null, args);
51059
+ }
51060
+ });
51061
+ }
50865
51062
 
50866
- function fixSvg() {
50867
- if (!(clone instanceof SVGElement)) return;
50868
- clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
51063
+ // `Symbol.prototype[@@toPrimitive]` method
51064
+ // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
51065
+ if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
51066
+ createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
51067
+ }
51068
+ // `Symbol.prototype[@@toStringTag]` property
51069
+ // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
51070
+ setToStringTag($Symbol, SYMBOL);
50869
51071
 
50870
- if (!(clone instanceof SVGRectElement)) return;
50871
- ['width', 'height'].forEach(function (attribute) {
50872
- var value = clone.getAttribute(attribute);
50873
- if (!value) return;
51072
+ hiddenKeys[HIDDEN] = true;
50874
51073
 
50875
- clone.style.setProperty(attribute, value);
50876
- });
50877
- }
50878
- }
50879
- }
50880
51074
 
50881
- function embedFonts(node) {
50882
- return fontFaces.resolveAll()
50883
- .then(function (cssText) {
50884
- var styleNode = document.createElement('style');
50885
- node.appendChild(styleNode);
50886
- styleNode.appendChild(document.createTextNode(cssText));
50887
- return node;
50888
- });
50889
- }
51075
+ /***/ }),
50890
51076
 
50891
- function inlineImages(node) {
50892
- return images.inlineAll(node)
50893
- .then(function () {
50894
- return node;
50895
- });
50896
- }
51077
+ /***/ "d6f0":
51078
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
50897
51079
 
50898
- function makeSvgDataUri(node, width, height) {
50899
- return Promise.resolve(node)
50900
- .then(function (node) {
50901
- node.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
50902
- return new XMLSerializer().serializeToString(node);
50903
- })
50904
- .then(util.escapeXhtml)
50905
- .then(function (xhtml) {
50906
- return '<foreignObject x="0" y="0" width="100%" height="100%">' + xhtml + '</foreignObject>';
50907
- })
50908
- .then(function (foreignObject) {
50909
- return '<svg xmlns="http://www.w3.org/2000/svg" width="' + width + '" height="' + height + '">' +
50910
- foreignObject + '</svg>';
50911
- })
50912
- .then(function (svg) {
50913
- return 'data:image/svg+xml;charset=utf-8,' + svg;
50914
- });
50915
- }
51080
+ "use strict";
51081
+ /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7f0d");
50916
51082
 
50917
- function newUtil() {
50918
- return {
50919
- escape: escape,
50920
- parseExtension: parseExtension,
50921
- mimeType: mimeType,
50922
- dataAsUrl: dataAsUrl,
50923
- isDataUrl: isDataUrl,
50924
- canvasToBlob: canvasToBlob,
50925
- resolveUrl: resolveUrl,
50926
- getAndEncode: getAndEncode,
50927
- uid: uid(),
50928
- delay: delay,
50929
- asArray: asArray,
50930
- escapeXhtml: escapeXhtml,
50931
- makeImage: makeImage,
50932
- width: width,
50933
- height: height
50934
- };
50935
51083
 
50936
- function mimes() {
50937
- /*
50938
- * Only WOFF and EOT mime types for fonts are 'real'
50939
- * see http://www.iana.org/assignments/media-types/media-types.xhtml
50940
- */
50941
- var WOFF = 'application/font-woff';
50942
- var JPEG = 'image/jpeg';
51084
+ /** Detect free variable `exports`. */
51085
+ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
50943
51086
 
50944
- return {
50945
- 'woff': WOFF,
50946
- 'woff2': WOFF,
50947
- 'ttf': 'application/font-truetype',
50948
- 'eot': 'application/vnd.ms-fontobject',
50949
- 'png': 'image/png',
50950
- 'jpg': JPEG,
50951
- 'jpeg': JPEG,
50952
- 'gif': 'image/gif',
50953
- 'tiff': 'image/tiff',
50954
- 'svg': 'image/svg+xml'
50955
- };
50956
- }
51087
+ /** Detect free variable `module`. */
51088
+ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
50957
51089
 
50958
- function parseExtension(url) {
50959
- var match = /\.([^\.\/]*?)$/g.exec(url);
50960
- if (match) return match[1];
50961
- else return '';
50962
- }
51090
+ /** Detect the popular CommonJS extension `module.exports`. */
51091
+ var moduleExports = freeModule && freeModule.exports === freeExports;
50963
51092
 
50964
- function mimeType(url) {
50965
- var extension = parseExtension(url).toLowerCase();
50966
- return mimes()[extension] || '';
50967
- }
51093
+ /** Built-in value references. */
51094
+ var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].Buffer : undefined,
51095
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
50968
51096
 
50969
- function isDataUrl(url) {
50970
- return url.search(/^(data:)/) !== -1;
50971
- }
51097
+ /**
51098
+ * Creates a clone of `buffer`.
51099
+ *
51100
+ * @private
51101
+ * @param {Buffer} buffer The buffer to clone.
51102
+ * @param {boolean} [isDeep] Specify a deep clone.
51103
+ * @returns {Buffer} Returns the cloned buffer.
51104
+ */
51105
+ function cloneBuffer(buffer, isDeep) {
51106
+ if (isDeep) {
51107
+ return buffer.slice();
51108
+ }
51109
+ var length = buffer.length,
51110
+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
50972
51111
 
50973
- function toBlob(canvas) {
50974
- return new Promise(function (resolve) {
50975
- var binaryString = window.atob(canvas.toDataURL().split(',')[1]);
50976
- var length = binaryString.length;
50977
- var binaryArray = new Uint8Array(length);
51112
+ buffer.copy(result);
51113
+ return result;
51114
+ }
50978
51115
 
50979
- for (var i = 0; i < length; i++)
50980
- binaryArray[i] = binaryString.charCodeAt(i);
51116
+ /* harmony default export */ __webpack_exports__["a"] = (cloneBuffer);
50981
51117
 
50982
- resolve(new Blob([binaryArray], {
50983
- type: 'image/png'
50984
- }));
50985
- });
50986
- }
51118
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("7326")(module)))
50987
51119
 
50988
- function canvasToBlob(canvas) {
50989
- if (canvas.toBlob)
50990
- return new Promise(function (resolve) {
50991
- canvas.toBlob(resolve);
50992
- });
51120
+ /***/ }),
50993
51121
 
50994
- return toBlob(canvas);
50995
- }
51122
+ /***/ "da06":
51123
+ /***/ (function(module, exports, __webpack_require__) {
50996
51124
 
50997
- function resolveUrl(url, baseUrl) {
50998
- var doc = document.implementation.createHTMLDocument();
50999
- var base = doc.createElement('base');
51000
- doc.head.appendChild(base);
51001
- var a = doc.createElement('a');
51002
- doc.body.appendChild(a);
51003
- base.href = baseUrl;
51004
- a.href = url;
51005
- return a.href;
51006
- }
51125
+ var TO_STRING_TAG_SUPPORT = __webpack_require__("3cec");
51126
+ var classofRaw = __webpack_require__("6a61");
51127
+ var wellKnownSymbol = __webpack_require__("7d53");
51007
51128
 
51008
- function uid() {
51009
- var index = 0;
51129
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
51130
+ // ES3 wrong here
51131
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
51010
51132
 
51011
- return function () {
51012
- return 'u' + fourRandomChars() + index++;
51133
+ // fallback for IE11 Script Access Denied error
51134
+ var tryGet = function (it, key) {
51135
+ try {
51136
+ return it[key];
51137
+ } catch (error) { /* empty */ }
51138
+ };
51013
51139
 
51014
- function fourRandomChars() {
51015
- /* see http://stackoverflow.com/a/6248722/2519373 */
51016
- return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);
51017
- }
51018
- };
51019
- }
51140
+ // getting tag from ES6+ `Object.prototype.toString`
51141
+ module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
51142
+ var O, tag, result;
51143
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
51144
+ // @@toStringTag case
51145
+ : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
51146
+ // builtinTag case
51147
+ : CORRECT_ARGUMENTS ? classofRaw(O)
51148
+ // ES3 arguments fallback
51149
+ : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
51150
+ };
51020
51151
 
51021
- function makeImage(uri) {
51022
- return new Promise(function (resolve, reject) {
51023
- var image = new Image();
51024
- image.onload = function () {
51025
- resolve(image);
51026
- };
51027
- image.onerror = reject;
51028
- image.src = uri;
51029
- });
51030
- }
51031
51152
 
51032
- function getAndEncode(url) {
51033
- var TIMEOUT = 30000;
51034
- if(domtoimage.impl.options.cacheBust) {
51035
- // Cache bypass so we dont have CORS issues with cached images
51036
- // Source: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
51037
- url += ((/\?/).test(url) ? "&" : "?") + (new Date()).getTime();
51038
- }
51153
+ /***/ }),
51039
51154
 
51040
- return new Promise(function (resolve) {
51041
- var request = new XMLHttpRequest();
51155
+ /***/ "df6f":
51156
+ /***/ (function(module, exports, __webpack_require__) {
51042
51157
 
51043
- request.onreadystatechange = done;
51044
- request.ontimeout = timeout;
51045
- request.responseType = 'blob';
51046
- request.timeout = TIMEOUT;
51047
- request.open('GET', url, true);
51048
- request.send();
51158
+ var store = __webpack_require__("c607");
51049
51159
 
51050
- var placeholder;
51051
- if(domtoimage.impl.options.imagePlaceholder) {
51052
- var split = domtoimage.impl.options.imagePlaceholder.split(/,/);
51053
- if(split && split[1]) {
51054
- placeholder = split[1];
51055
- }
51056
- }
51160
+ var functionToString = Function.toString;
51057
51161
 
51058
- function done() {
51059
- if (request.readyState !== 4) return;
51162
+ // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
51163
+ if (typeof store.inspectSource != 'function') {
51164
+ store.inspectSource = function (it) {
51165
+ return functionToString.call(it);
51166
+ };
51167
+ }
51060
51168
 
51061
- if (request.status !== 200) {
51062
- if(placeholder) {
51063
- resolve(placeholder);
51064
- } else {
51065
- fail('cannot fetch resource: ' + url + ', status: ' + request.status);
51066
- }
51169
+ module.exports = store.inspectSource;
51067
51170
 
51068
- return;
51069
- }
51070
51171
 
51071
- var encoder = new FileReader();
51072
- encoder.onloadend = function () {
51073
- var content = encoder.result.split(/,/)[1];
51074
- resolve(content);
51075
- };
51076
- encoder.readAsDataURL(request.response);
51077
- }
51172
+ /***/ }),
51078
51173
 
51079
- function timeout() {
51080
- if(placeholder) {
51081
- resolve(placeholder);
51082
- } else {
51083
- fail('timeout of ' + TIMEOUT + 'ms occured while fetching resource: ' + url);
51084
- }
51085
- }
51174
+ /***/ "e129":
51175
+ /***/ (function(module, exports, __webpack_require__) {
51086
51176
 
51087
- function fail(message) {
51088
- console.error(message);
51089
- resolve('');
51090
- }
51091
- });
51092
- }
51177
+ "use strict";
51093
51178
 
51094
- function dataAsUrl(content, type) {
51095
- return 'data:' + type + ';base64,' + content;
51096
- }
51179
+ var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
51180
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
51097
51181
 
51098
- function escape(string) {
51099
- return string.replace(/([.*+?^${}()|\[\]\/\\])/g, '\\$1');
51100
- }
51182
+ // Nashorn ~ JDK8 bug
51183
+ var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
51101
51184
 
51102
- function delay(ms) {
51103
- return function (arg) {
51104
- return new Promise(function (resolve) {
51105
- setTimeout(function () {
51106
- resolve(arg);
51107
- }, ms);
51108
- });
51109
- };
51110
- }
51185
+ // `Object.prototype.propertyIsEnumerable` method implementation
51186
+ // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
51187
+ exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
51188
+ var descriptor = getOwnPropertyDescriptor(this, V);
51189
+ return !!descriptor && descriptor.enumerable;
51190
+ } : nativePropertyIsEnumerable;
51111
51191
 
51112
- function asArray(arrayLike) {
51113
- var array = [];
51114
- var length = arrayLike.length;
51115
- for (var i = 0; i < length; i++) array.push(arrayLike[i]);
51116
- return array;
51117
- }
51118
51192
 
51119
- function escapeXhtml(string) {
51120
- return string.replace(/#/g, '%23').replace(/\n/g, '%0A');
51121
- }
51193
+ /***/ }),
51122
51194
 
51123
- function width(node) {
51124
- var leftBorder = px(node, 'border-left-width');
51125
- var rightBorder = px(node, 'border-right-width');
51126
- return node.scrollWidth + leftBorder + rightBorder;
51127
- }
51195
+ /***/ "e7a0":
51196
+ /***/ (function(module, exports, __webpack_require__) {
51128
51197
 
51129
- function height(node) {
51130
- var topBorder = px(node, 'border-top-width');
51131
- var bottomBorder = px(node, 'border-bottom-width');
51132
- return node.scrollHeight + topBorder + bottomBorder;
51133
- }
51198
+ var fails = __webpack_require__("72df");
51134
51199
 
51135
- function px(node, styleProperty) {
51136
- var value = window.getComputedStyle(node).getPropertyValue(styleProperty);
51137
- return parseFloat(value.replace('px', ''));
51138
- }
51139
- }
51200
+ module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
51201
+ // Chrome 38 Symbol has incorrect toString conversion
51202
+ // eslint-disable-next-line no-undef
51203
+ return !String(Symbol());
51204
+ });
51140
51205
 
51141
- function newInliner() {
51142
- var URL_REGEX = /url\(['"]?([^'"]+?)['"]?\)/g;
51143
51206
 
51144
- return {
51145
- inlineAll: inlineAll,
51146
- shouldProcess: shouldProcess,
51147
- impl: {
51148
- readUrls: readUrls,
51149
- inline: inline
51150
- }
51151
- };
51207
+ /***/ }),
51152
51208
 
51153
- function shouldProcess(string) {
51154
- return string.search(URL_REGEX) !== -1;
51155
- }
51209
+ /***/ "ebac":
51210
+ /***/ (function(module, exports, __webpack_require__) {
51156
51211
 
51157
- function readUrls(string) {
51158
- var result = [];
51159
- var match;
51160
- while ((match = URL_REGEX.exec(string)) !== null) {
51161
- result.push(match[1]);
51162
- }
51163
- return result.filter(function (url) {
51164
- return !util.isDataUrl(url);
51165
- });
51166
- }
51212
+ var fails = __webpack_require__("72df");
51167
51213
 
51168
- function inline(string, url, baseUrl, get) {
51169
- return Promise.resolve(url)
51170
- .then(function (url) {
51171
- return baseUrl ? util.resolveUrl(url, baseUrl) : url;
51172
- })
51173
- .then(get || util.getAndEncode)
51174
- .then(function (data) {
51175
- return util.dataAsUrl(data, util.mimeType(url));
51176
- })
51177
- .then(function (dataUrl) {
51178
- return string.replace(urlAsRegex(url), '$1' + dataUrl + '$3');
51179
- });
51214
+ var replacement = /#|\.prototype\./;
51180
51215
 
51181
- function urlAsRegex(url) {
51182
- return new RegExp('(url\\([\'"]?)(' + util.escape(url) + ')([\'"]?\\))', 'g');
51183
- }
51184
- }
51216
+ var isForced = function (feature, detection) {
51217
+ var value = data[normalize(feature)];
51218
+ return value == POLYFILL ? true
51219
+ : value == NATIVE ? false
51220
+ : typeof detection == 'function' ? fails(detection)
51221
+ : !!detection;
51222
+ };
51185
51223
 
51186
- function inlineAll(string, baseUrl, get) {
51187
- if (nothingToInline()) return Promise.resolve(string);
51224
+ var normalize = isForced.normalize = function (string) {
51225
+ return String(string).replace(replacement, '.').toLowerCase();
51226
+ };
51188
51227
 
51189
- return Promise.resolve(string)
51190
- .then(readUrls)
51191
- .then(function (urls) {
51192
- var done = Promise.resolve(string);
51193
- urls.forEach(function (url) {
51194
- done = done.then(function (string) {
51195
- return inline(string, url, baseUrl, get);
51196
- });
51197
- });
51198
- return done;
51199
- });
51228
+ var data = isForced.data = {};
51229
+ var NATIVE = isForced.NATIVE = 'N';
51230
+ var POLYFILL = isForced.POLYFILL = 'P';
51200
51231
 
51201
- function nothingToInline() {
51202
- return !shouldProcess(string);
51203
- }
51204
- }
51205
- }
51232
+ module.exports = isForced;
51206
51233
 
51207
- function newFontFaces() {
51208
- return {
51209
- resolveAll: resolveAll,
51210
- impl: {
51211
- readAll: readAll
51212
- }
51213
- };
51214
51234
 
51215
- function resolveAll() {
51216
- return readAll(document)
51217
- .then(function (webFonts) {
51218
- return Promise.all(
51219
- webFonts.map(function (webFont) {
51220
- return webFont.resolve();
51221
- })
51222
- );
51223
- })
51224
- .then(function (cssStrings) {
51225
- return cssStrings.join('\n');
51226
- });
51227
- }
51235
+ /***/ }),
51228
51236
 
51229
- function readAll() {
51230
- return Promise.resolve(util.asArray(document.styleSheets))
51231
- .then(getCssRules)
51232
- .then(selectWebFontRules)
51233
- .then(function (rules) {
51234
- return rules.map(newWebFont);
51235
- });
51237
+ /***/ "ed2b":
51238
+ /***/ (function(module, exports, __webpack_require__) {
51236
51239
 
51237
- function selectWebFontRules(cssRules) {
51238
- return cssRules
51239
- .filter(function (rule) {
51240
- return rule.type === CSSRule.FONT_FACE_RULE;
51241
- })
51242
- .filter(function (rule) {
51243
- return inliner.shouldProcess(rule.style.getPropertyValue('src'));
51244
- });
51245
- }
51240
+ var wellKnownSymbol = __webpack_require__("7d53");
51241
+ var create = __webpack_require__("82e8");
51242
+ var definePropertyModule = __webpack_require__("abdf");
51246
51243
 
51247
- function getCssRules(styleSheets) {
51248
- var cssRules = [];
51249
- styleSheets.forEach(function (sheet) {
51250
- try {
51251
- util.asArray(sheet.cssRules || []).forEach(cssRules.push.bind(cssRules));
51252
- } catch (e) {
51253
- console.log('Error while reading CSS rules from ' + sheet.href, e.toString());
51254
- }
51255
- });
51256
- return cssRules;
51257
- }
51244
+ var UNSCOPABLES = wellKnownSymbol('unscopables');
51245
+ var ArrayPrototype = Array.prototype;
51258
51246
 
51259
- function newWebFont(webFontRule) {
51260
- return {
51261
- resolve: function resolve() {
51262
- var baseUrl = (webFontRule.parentStyleSheet || {}).href;
51263
- return inliner.inlineAll(webFontRule.cssText, baseUrl);
51264
- },
51265
- src: function () {
51266
- return webFontRule.style.getPropertyValue('src');
51267
- }
51268
- };
51269
- }
51270
- }
51271
- }
51247
+ // Array.prototype[@@unscopables]
51248
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
51249
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
51250
+ definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
51251
+ configurable: true,
51252
+ value: create(null)
51253
+ });
51254
+ }
51272
51255
 
51273
- function newImages() {
51274
- return {
51275
- inlineAll: inlineAll,
51276
- impl: {
51277
- newImage: newImage
51278
- }
51279
- };
51256
+ // add a key to Array.prototype[@@unscopables]
51257
+ module.exports = function (key) {
51258
+ ArrayPrototype[UNSCOPABLES][key] = true;
51259
+ };
51280
51260
 
51281
- function newImage(element) {
51282
- return {
51283
- inline: inline
51284
- };
51285
51261
 
51286
- function inline(get) {
51287
- if (util.isDataUrl(element.src)) return Promise.resolve();
51262
+ /***/ }),
51288
51263
 
51289
- return Promise.resolve(element.src)
51290
- .then(get || util.getAndEncode)
51291
- .then(function (data) {
51292
- return util.dataAsUrl(data, util.mimeType(element.src));
51293
- })
51294
- .then(function (dataUrl) {
51295
- return new Promise(function (resolve, reject) {
51296
- element.onload = resolve;
51297
- element.onerror = reject;
51298
- element.src = dataUrl;
51299
- });
51300
- });
51301
- }
51302
- }
51264
+ /***/ "ee58":
51265
+ /***/ (function(module, exports, __webpack_require__) {
51303
51266
 
51304
- function inlineAll(node) {
51305
- if (!(node instanceof Element)) return Promise.resolve(node);
51267
+ var toIndexedObject = __webpack_require__("378c");
51268
+ var nativeGetOwnPropertyNames = __webpack_require__("65d0").f;
51306
51269
 
51307
- return inlineBackground(node)
51308
- .then(function () {
51309
- if (node instanceof HTMLImageElement)
51310
- return newImage(node).inline();
51311
- else
51312
- return Promise.all(
51313
- util.asArray(node.childNodes).map(function (child) {
51314
- return inlineAll(child);
51315
- })
51316
- );
51317
- });
51270
+ var toString = {}.toString;
51318
51271
 
51319
- function inlineBackground(node) {
51320
- var background = node.style.getPropertyValue('background');
51272
+ var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
51273
+ ? Object.getOwnPropertyNames(window) : [];
51321
51274
 
51322
- if (!background) return Promise.resolve(node);
51275
+ var getWindowNames = function (it) {
51276
+ try {
51277
+ return nativeGetOwnPropertyNames(it);
51278
+ } catch (error) {
51279
+ return windowNames.slice();
51280
+ }
51281
+ };
51323
51282
 
51324
- return inliner.inlineAll(background)
51325
- .then(function (inlined) {
51326
- node.style.setProperty(
51327
- 'background',
51328
- inlined,
51329
- node.style.getPropertyPriority('background')
51330
- );
51331
- })
51332
- .then(function () {
51333
- return node;
51334
- });
51335
- }
51336
- }
51337
- }
51338
- })(this);
51283
+ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
51284
+ module.exports.f = function getOwnPropertyNames(it) {
51285
+ return windowNames && toString.call(it) == '[object Window]'
51286
+ ? getWindowNames(it)
51287
+ : nativeGetOwnPropertyNames(toIndexedObject(it));
51288
+ };
51339
51289
 
51340
51290
 
51341
51291
  /***/ }),