!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).canvg={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var n=function(t){return t&&t.Math==Math&&t},i=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},o=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,c={f:s&&!u.call({1:2},1)?function(t){var e=s(this,t);return!!e&&e.enumerable}:u},l=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},f={}.toString,h=function(t){return f.call(t).slice(8,-1)},p="".split,y=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==h(t)?p.call(t,""):Object(t)}:Object,v=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},g=function(t){return y(v(t))},d=function(t){return"object"==typeof t?null!==t:"function"==typeof t},m=function(t,e){if(!d(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!d(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!d(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!d(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},x={}.hasOwnProperty,b=function(t,e){return x.call(t,e)},w=i.document,S=d(w)&&d(w.createElement),A=function(t){return S?w.createElement(t):{}},k=!o&&!a((function(){return 7!=Object.defineProperty(A("div"),"a",{get:function(){return 7}}).a})),T=Object.getOwnPropertyDescriptor,O={f:o?T:function(t,e){if(t=g(t),e=m(e,!0),k)try{return T(t,e)}catch(t){}if(b(t,e))return l(!c.f.call(t,e),t[e])}},P=/#|\.prototype\./,C=function(t,e){var r=M[E(t)];return r==R||r!=N&&("function"==typeof e?a(e):!!e)},E=C.normalize=function(t){return String(t).replace(P,".").toLowerCase()},M=C.data={},N=C.NATIVE="N",R=C.POLYFILL="P",_=C,D={},V=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},L=function(t,e,r){if(V(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}},I=function(t){if(!d(t))throw TypeError(String(t)+" is not an object");return t},j=Object.defineProperty,z={f:o?j:function(t,e,r){if(I(t),e=m(e,!0),I(r),k)try{return j(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},F=o?function(t,e,r){return z.f(t,e,l(1,r))}:function(t,e,r){return t[e]=r,t},B=O.f,H=function(t){var e=function(e,r,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e},U=function(t,e){var r,n,a,o,u,s,c,l,f=t.target,h=t.global,p=t.stat,y=t.proto,v=h?i:p?i[f]:(i[f]||{}).prototype,g=h?D:D[f]||(D[f]={}),d=g.prototype;for(a in e)r=!_(h?a:f+(p?".":"#")+a,t.forced)&&v&&b(v,a),u=g[a],r&&(s=t.noTargetGet?(l=B(v,a))&&l.value:v[a]),o=r&&s?s:e[a],r&&typeof u==typeof o||(c=t.bind&&r?L(o,i):t.wrap&&r?H(o):y&&"function"==typeof o?L(Function.call,o):o,(t.sham||o&&o.sham||u&&u.sham)&&F(c,"sham",!0),g[a]=c,y&&(b(D,n=f+"Prototype")||F(D,n,{}),D[n][a]=o,t.real&&d&&!d[a]&&F(d,a,o)))},X=Math.ceil,Y=Math.floor,q=function(t){return isNaN(t=+t)?0:(t>0?Y:X)(t)},G=Math.min,Q=function(t){return t>0?G(q(t),9007199254740991):0},W="__core-js_shared__",$=i[W]||function(t,e){try{F(i,t,e)}catch(r){i[t]=e}return e}(W,{}),Z=r((function(t){(t.exports=function(t,e){return $[t]||($[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.4",mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),K=0,J=Math.random(),tt=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++K+J).toString(36)},et=!!Object.getOwnPropertySymbols&&!a((function(){return!String(Symbol())})),rt=et&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,nt=Z("wks"),it=i.Symbol,at=rt?it:it&&it.withoutSetter||tt,ot=function(t){return b(nt,t)||(et&&b(it,t)?nt[t]=it[t]:nt[t]=at("Symbol."+t)),nt[t]},ut=ot("match"),st=function(t){if(function(t){var e;return d(t)&&(void 0!==(e=t[ut])?!!e:"RegExp"==h(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},ct=ot("match"),lt=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[ct]=!1,"/./"[t](e)}catch(t){}}return!1},ft="".startsWith,ht=Math.min,pt=lt("startsWith");U({target:"String",proto:!0,forced:!pt},{startsWith:function(t){var e=String(v(this));st(t);var r=Q(ht(arguments.length>1?arguments[1]:void 0,e.length)),n=String(t);return ft?ft.call(e,n,r):e.slice(r,r+n.length)===n}});var yt=function(t){return D[t+"Prototype"]},vt=yt("String").startsWith,gt=String.prototype,dt=function(t){var e=t.startsWith;return"string"==typeof t||t===gt||t instanceof String&&e===gt.startsWith?vt:e},mt="\t\n\v\f\r                 \u2028\u2029\ufeff",xt="["+mt+"]",bt=RegExp("^"+xt+xt+"*"),wt=RegExp(xt+xt+"*$"),St=function(t){return function(e){var r=String(v(e));return 1&t&&(r=r.replace(bt,"")),2&t&&(r=r.replace(wt,"")),r}},At={start:St(1),end:St(2),trim:St(3)},kt=At.trim,Tt=i.parseFloat,Ot=1/Tt(mt+"-0")!=-1/0?function(t){var e=kt(String(t)),r=Tt(e);return 0===r&&"-"==e.charAt(0)?-0:r}:Tt;U({global:!0,forced:parseFloat!=Ot},{parseFloat:Ot});var Pt,Ct,Et=D.parseFloat,Mt=function(t){return Object(v(t))},Nt=Array.isArray||function(t){return"Array"==h(t)},Rt=ot("species"),_t=function(t,e){var r;return Nt(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!Nt(r.prototype)?d(r)&&null===(r=r[Rt])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===e?0:e)},Dt=[].push,Vt=function(t){var e=1==t,r=2==t,n=3==t,i=4==t,a=6==t,o=5==t||a;return function(u,s,c,l){for(var f,h,p=Mt(u),v=y(p),g=L(s,c,3),d=Q(v.length),m=0,x=l||_t,b=e?x(u,d):r?x(u,0):void 0;d>m;m++)if((o||m in v)&&(h=g(f=v[m],m,p),t))if(e)b[m]=h;else if(h)switch(t){case 3:return!0;case 5:return f;case 6:return m;case 2:Dt.call(b,f)}else if(i)return!1;return a?-1:n||i?i:b}},Lt={forEach:Vt(0),map:Vt(1),filter:Vt(2),some:Vt(3),every:Vt(4),find:Vt(5),findIndex:Vt(6)},It=function(t){return"function"==typeof t?t:void 0},jt=function(t,e){return arguments.length<2?It(D[t])||It(i[t]):D[t]&&D[t][e]||i[t]&&i[t][e]},zt=jt("navigator","userAgent")||"",Ft=i.process,Bt=Ft&&Ft.versions,Ht=Bt&&Bt.v8;Ht?Ct=(Pt=Ht.split("."))[0]+Pt[1]:zt&&(!(Pt=zt.match(/Edge\/(\d+)/))||Pt[1]>=74)&&(Pt=zt.match(/Chrome\/(\d+)/))&&(Ct=Pt[1]);var Ut=Ct&&+Ct,Xt=ot("species"),Yt=function(t){return Ut>=51||!a((function(){var e=[];return(e.constructor={})[Xt]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},qt=Object.defineProperty,Gt={},Qt=function(t){throw t},Wt=function(t,e){if(b(Gt,t))return Gt[t];e||(e={});var r=[][t],n=!!b(e,"ACCESSORS")&&e.ACCESSORS,i=b(e,0)?e[0]:Qt,u=b(e,1)?e[1]:void 0;return Gt[t]=!!r&&!a((function(){if(n&&!o)return!0;var t={length:-1};n?qt(t,1,{enumerable:!0,get:Qt}):t[1]=1,r.call(t,i,u)}))},$t=Lt.map,Zt=Yt("map"),Kt=Wt("map");U({target:"Array",proto:!0,forced:!Zt||!Kt},{map:function(t){return $t(this,t,arguments.length>1?arguments[1]:void 0)}});var Jt=yt("Array").map,te=Array.prototype,ee=function(t){var e=t.map;return t===te||t instanceof Array&&e===te.map?Jt:e};function re(t){return t.replace(/(?!\u3000)\s+/gm," ")}function ne(t){return t.replace(/^[\n \t]+/,"")}function ie(t){return t.replace(/[\n \t]+$/,"")}function ae(t){var e=(t||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return ee(e).call(e,Et)}var oe=/^[A-Z-]+$/;function ue(t){return oe.test(t)?t.toLowerCase():t}function se(t){var e=t.match(/url\(('([^']+)'|"([^"]+)"|([^'"\)]+))\)/)||[];return e[2]||e[3]||e[4]}function ce(t){if(!dt(t).call(t,"rgb"))return t;var e=3;return t.replace(/\d+(\.\d+)?/g,(function(t,r){return e--&&r?String(Math.round(Et(t))):t}))}U({target:"Array",stat:!0},{isArray:Nt});var le=D.Array.isArray,fe=le;var he=function(t){if(fe(t))return t},pe={},ye=Function.toString;"function"!=typeof $.inspectSource&&($.inspectSource=function(t){return ye.call(t)});var ve,ge,de,me=$.inspectSource,xe=i.WeakMap,be="function"==typeof xe&&/native code/.test(me(xe)),we=Z("keys"),Se=function(t){return we[t]||(we[t]=tt(t))},Ae={},ke=i.WeakMap;if(be){var Te=new ke,Oe=Te.get,Pe=Te.has,Ce=Te.set;ve=function(t,e){return Ce.call(Te,t,e),e},ge=function(t){return Oe.call(Te,t)||{}},de=function(t){return Pe.call(Te,t)}}else{var Ee=Se("state");Ae[Ee]=!0,ve=function(t,e){return F(t,Ee,e),e},ge=function(t){return b(t,Ee)?t[Ee]:{}},de=function(t){return b(t,Ee)}}var Me,Ne,Re,_e={set:ve,get:ge,has:de,enforce:function(t){return de(t)?ge(t):ve(t,{})},getterFor:function(t){return function(e){var r;if(!d(e)||(r=ge(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},De=!a((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Ve=Se("IE_PROTO"),Le=Object.prototype,Ie=De?Object.getPrototypeOf:function(t){return t=Mt(t),b(t,Ve)?t[Ve]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Le:null},je=(ot("iterator"),!1);[].keys&&("next"in(Re=[].keys())?(Ne=Ie(Ie(Re)))!==Object.prototype&&(Me=Ne):je=!0),null==Me&&(Me={});var ze,Fe={IteratorPrototype:Me,BUGGY_SAFARI_ITERATORS:je},Be=Math.max,He=Math.min,Ue=function(t,e){var r=q(t);return r<0?Be(r+e,0):He(r,e)},Xe=function(t){return function(e,r,n){var i,a=g(e),o=Q(a.length),u=Ue(n,o);if(t&&r!=r){for(;o>u;)if((i=a[u++])!=i)return!0}else for(;o>u;u++)if((t||u in a)&&a[u]===r)return t||u||0;return!t&&-1}},Ye={includes:Xe(!0),indexOf:Xe(!1)},qe=Ye.indexOf,Ge=function(t,e){var r,n=g(t),i=0,a=[];for(r in n)!b(Ae,r)&&b(n,r)&&a.push(r);for(;e.length>i;)b(n,r=e[i++])&&(~qe(a,r)||a.push(r));return a},Qe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],We=Object.keys||function(t){return Ge(t,Qe)},$e=o?Object.defineProperties:function(t,e){I(t);for(var r,n=We(e),i=n.length,a=0;i>a;)z.f(t,r=n[a++],e[r]);return t},Ze=jt("document","documentElement"),Ke=Se("IE_PROTO"),Je=function(){},tr=function(t){return"