!function(e){"use strict";var t=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){var n=t(e).toLowerCase();return(r="application/font-woff",{woff:r,woff2:r,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[n]||"";var r},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){if(e.toBlob)return new Promise(function(t){e.toBlob(t)});return function(e){return new Promise(function(t){for(var n=window.atob(e.toDataURL().split(",")[1]),r=n.length,o=new Uint8Array(r),i=0;i'+e+""}).then(function(e){return''+e+""}).then(function(e){return"data:image/svg+xml;charset=utf-8,"+e})}(r,n.width||t.width(e),n.height||t.height(e))})}function a(e,n){return c(e,n).then(t.makeImage).then(t.delay(100)).then(function(r){var o=function(e){var r=document.createElement("canvas");if(r.width=n.width||t.width(e),r.height=n.height||t.height(e),n.bgcolor){var o=r.getContext("2d");o.fillStyle=n.bgcolor,o.fillRect(0,0,r.width,r.height)}return r}(e);return o.getContext("2d").drawImage(r,0,0),o})}function s(e,n,r){if(!r&&n&&!n(e))return Promise.resolve();return Promise.resolve(e).then(o).then(function(t){return i(e,t,n)}).then(function(t){return u(e,t)});function o(e){return e instanceof HTMLCanvasElement?t.makeImage(e.toDataURL()):e.cloneNode(!1)}function i(e,n,r){var o=e.childNodes;return 0===o.length?Promise.resolve(n):function(e,t,n){var r=Promise.resolve();return t.forEach(function(t){r=r.then(function(){return s(t,n)}).then(function(t){t&&e.appendChild(t)})}),r}(n,t.asArray(o),r).then(function(){return n});function i(e,t,n){var r=Promise.resolve();return t.forEach(function(t){r=r.then(function(){return s(t,n)}).then(function(t){t&&e.appendChild(t)})}),r}}function u(e,n){return n instanceof Element?Promise.resolve().then(function(){!function(e,n){e.cssText?n.cssText=e.cssText:function(e,n){t.asArray(e).forEach(function(t){n.setProperty(t,e.getPropertyValue(t),e.getPropertyPriority(t))})}(e,n)}(window.getComputedStyle(e),n.style)}).then(function(){[":before",":after"].forEach(function(r){!function(r){var o=window.getComputedStyle(e,r),i=o.getPropertyValue("content");if(""===i||"none"===i)return;var u=t.uid();n.className=n.className+" "+u;var c=document.createElement("style");c.appendChild(function(e,n,r){var o="."+e+":"+n,i=r.cssText?function(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}(r):function(e){return t.asArray(e).map(function(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}).join("; ")+";"}(r);return document.createTextNode(o+"{"+i+"}")}(u,r,o)),n.appendChild(c)}(r)})}).then(function(){e instanceof HTMLTextAreaElement&&(n.innerHTML=e.value);e instanceof HTMLInputElement&&n.setAttribute("value",e.value)}).then(function(){if(!(n instanceof SVGElement))return;if(n.setAttribute("xmlns","http://www.w3.org/2000/svg"),!(n instanceof SVGRectElement))return;["width","height"].forEach(function(e){var t=n.getAttribute(e);t&&n.style.setProperty(e,t)})}).then(function(){return n}):n;function r(){function r(e,n){if(e.cssText)n.cssText=e.cssText;else r(e,n);function r(e,n){t.asArray(e).forEach(function(t){n.setProperty(t,e.getPropertyValue(t),e.getPropertyPriority(t))})}}r(window.getComputedStyle(e),n.style)}function o(){function r(r){var o=window.getComputedStyle(e,r),i=o.getPropertyValue("content");if(i===""||i==="none")return;var u=t.uid();n.className=n.className+" "+u;var c=document.createElement("style");function a(e,n,r){var o="."+e+":"+n,i=r.cssText?u(r):c(r);return document.createTextNode(o+"{"+i+"}");function u(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function c(e){return t.asArray(e).map(n).join("; ")+";";function n(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}c.appendChild(a(u,r,o)),n.appendChild(c)}[":before",":after"].forEach(function(e){r(e)})}function i(){if(e instanceof HTMLTextAreaElement)n.innerHTML=e.value;if(e instanceof HTMLInputElement)n.setAttribute("value",e.value)}function u(){if(!(n instanceof SVGElement))return;if(n.setAttribute("xmlns","http://www.w3.org/2000/svg"),!(n instanceof SVGRectElement))return;["width","height"].forEach(function(e){var t=n.getAttribute(e);if(!t)return;n.style.setProperty(e,t)})}}}function l(e){return r.resolveAll().then(function(t){var n=document.createElement("style");return e.appendChild(n),n.appendChild(document.createTextNode(t)),e})}function f(e){return o.inlineAll(e).then(function(){return e})}"undefined"!=typeof module?module.exports=u:e.domtoimage=u}(this);