Files
svgedit/dist/editor/extensions/ext-imagelib/ext-imagelib.js
2021-02-14 20:17:48 +01:00

11 lines
80 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var check=function(e){return e&&e.Math==Math&&e},t=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof e&&e)||function(){return this}()||Function("return this")(),fails=function(e){try{return!!e()}catch(e){return!0}},r=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i={f:o&&!n.call({1:2},1)?function propertyIsEnumerable(e){var t=o(this,e);return!!t&&t.enumerable}:n},createPropertyDescriptor=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},a={}.toString,classofRaw=function(e){return a.call(e).slice(8,-1)},c="".split,s=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==classofRaw(e)?c.call(e,""):Object(e)}:Object,requireObjectCoercible=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},toIndexedObject=function(e){return s(requireObjectCoercible(e))},isObject=function(e){return"object"==typeof e?null!==e:"function"==typeof e},toPrimitive=function(e,t){if(!isObject(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!isObject(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!isObject(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!isObject(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},u={}.hasOwnProperty,has=function(e,t){return u.call(e,t)},l=t.document,f=isObject(l)&&isObject(l.createElement),documentCreateElement=function(e){return f?l.createElement(e):{}},p=!r&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),h=Object.getOwnPropertyDescriptor,d={f:r?h:function getOwnPropertyDescriptor(e,t){if(e=toIndexedObject(e),t=toPrimitive(t,!0),p)try{return h(e,t)}catch(e){}if(has(e,t))return createPropertyDescriptor(!i.f.call(e,t),e[t])}},anObject=function(e){if(!isObject(e))throw TypeError(String(e)+" is not an object");return e},g=Object.defineProperty,m={f:r?g:function defineProperty(e,t,r){if(anObject(e),t=toPrimitive(t,!0),anObject(r),p)try{return g(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},v=r?function(e,t,r){return m.f(e,t,createPropertyDescriptor(1,r))}:function(e,t,r){return e[t]=r,e},setGlobal=function(e,r){try{v(t,e,r)}catch(n){t[e]=r}return r},y=t["__core-js_shared__"]||setGlobal("__core-js_shared__",{}),b=Function.toString;"function"!=typeof y.inspectSource&&(y.inspectSource=function(e){return b.call(e)});var w,S,x,_=y.inspectSource,E=t.WeakMap,O="function"==typeof E&&/native code/.test(_(E)),k=createCommonjsModule((function(e){(e.exports=function(e,t){return y[e]||(y[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.8.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),j=0,L=Math.random(),uid=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++j+L).toString(36)},A=k("keys"),sharedKey=function(e){return A[e]||(A[e]=uid(e))},I={},P=t.WeakMap;if(O){var R=y.state||(y.state=new P),T=R.get,U=R.has,C=R.set;w=function(e,t){return t.facade=e,C.call(R,e,t),t},S=function(e){return T.call(R,e)||{}},x=function(e){return U.call(R,e)}}else{var M=sharedKey("state");I[M]=!0,w=function(e,t){return t.facade=e,v(e,M,t),t},S=function(e){return has(e,M)?e[M]:{}},x=function(e){return has(e,M)}}var G,N={set:w,get:S,has:x,enforce:function(e){return x(e)?S(e):w(e,{})},getterFor:function(e){return function(t){var r;if(!isObject(t)||(r=S(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}},D=createCommonjsModule((function(e){var r=N.get,n=N.enforce,o=String(String).split("String");(e.exports=function(e,r,i,a){var c,s=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,l=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof r||has(i,"name")||v(i,"name",r),(c=n(i)).source||(c.source=o.join("string"==typeof r?r:""))),e!==t?(s?!l&&e[r]&&(u=!0):delete e[r],u?e[r]=i:v(e,r,i)):u?e[r]=i:setGlobal(r,i)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&r(this).source||_(this)}))})),B=t,aFunction=function(e){return"function"==typeof e?e:void 0},getBuiltIn=function(e,r){return arguments.length<2?aFunction(B[e])||aFunction(t[e]):B[e]&&B[e][r]||t[e]&&t[e][r]},q=Math.ceil,$=Math.floor,toInteger=function(e){return isNaN(e=+e)?0:(e>0?$:q)(e)},z=Math.min,toLength=function(e){return e>0?z(toInteger(e),9007199254740991):0},V=Math.max,W=Math.min,toAbsoluteIndex=function(e,t){var r=toInteger(e);return r<0?V(r+t,0):W(r,t)},createMethod=function(e){return function(t,r,n){var o,i=toIndexedObject(t),a=toLength(i.length),c=toAbsoluteIndex(n,a);if(e&&r!=r){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((e||c in i)&&i[c]===r)return e||c||0;return!e&&-1}},K={includes:createMethod(!0),indexOf:createMethod(!1)},J=K.indexOf,objectKeysInternal=function(e,t){var r,n=toIndexedObject(e),o=0,i=[];for(r in n)!has(I,r)&&has(n,r)&&i.push(r);for(;t.length>o;)has(n,r=t[o++])&&(~J(i,r)||i.push(r));return i},Y=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],H=Y.concat("length","prototype"),X={f:Object.getOwnPropertyNames||function getOwnPropertyNames(e){return objectKeysInternal(e,H)}},Z={f:Object.getOwnPropertySymbols},Q=getBuiltIn("Reflect","ownKeys")||function ownKeys(e){var t=X.f(anObject(e)),r=Z.f;return r?t.concat(r(e)):t},copyConstructorProperties=function(e,t){for(var r=Q(t),n=m.f,o=d.f,i=0;i<r.length;i++){var a=r[i];has(e,a)||n(e,a,o(t,a))}},ee=/#|\.prototype\./,isForced=function(e,t){var r=re[te(e)];return r==oe||r!=ne&&("function"==typeof t?fails(t):!!t)},te=isForced.normalize=function(e){return String(e).replace(ee,".").toLowerCase()},re=isForced.data={},ne=isForced.NATIVE="N",oe=isForced.POLYFILL="P",ie=isForced,ae=d.f,_export=function(e,r){var n,o,i,a,c,s=e.target,u=e.global,l=e.stat;if(n=u?t:l?t[s]||setGlobal(s,{}):(t[s]||{}).prototype)for(o in r){if(a=r[o],i=e.noTargetGet?(c=ae(n,o))&&c.value:n[o],!ie(u?o:s+(l?".":"#")+o,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;copyConstructorProperties(a,i)}(e.sham||i&&i.sham)&&v(a,"sham",!0),D(n,o,a,e)}},ce=!!Object.getOwnPropertySymbols&&!fails((function(){return!String(Symbol())})),se=ce&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ue=Array.isArray||function isArray(e){return"Array"==classofRaw(e)},toObject=function(e){return Object(requireObjectCoercible(e))},le=Object.keys||function keys(e){return objectKeysInternal(e,Y)},fe=r?Object.defineProperties:function defineProperties(e,t){anObject(e);for(var r,n=le(t),o=n.length,i=0;o>i;)m.f(e,r=n[i++],t[r]);return e},pe=getBuiltIn("document","documentElement"),he=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"<script>"+e+"<\/script>"},NullProtoObject=function(){try{G=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;NullProtoObject=G?function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t}(G):((t=documentCreateElement("iframe")).style.display="none",pe.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F);for(var r=Y.length;r--;)delete NullProtoObject.prototype[Y[r]];return NullProtoObject()};I[he]=!0;var de=Object.create||function create(e,t){var r;return null!==e?(EmptyConstructor.prototype=anObject(e),r=new EmptyConstructor,EmptyConstructor.prototype=null,r[he]=e):r=NullProtoObject(),void 0===t?r:fe(r,t)},ge=X.f,me={}.toString,ve="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],ye={f:function getOwnPropertyNames(e){return ve&&"[object Window]"==me.call(e)?function(e){try{return ge(e)}catch(e){return ve.slice()}}(e):ge(toIndexedObject(e))}},be=k("wks"),we=t.Symbol,Se=se?we:we&&we.withoutSetter||uid,wellKnownSymbol=function(e){return has(be,e)||(ce&&has(we,e)?be[e]=we[e]:be[e]=Se("Symbol."+e)),be[e]},xe={f:wellKnownSymbol},_e=m.f,defineWellKnownSymbol=function(e){var t=B.Symbol||(B.Symbol={});has(t,e)||_e(t,e,{value:xe.f(e)})},Ee=m.f,Oe=wellKnownSymbol("toStringTag"),setToStringTag=function(e,t,r){e&&!has(e=r?e:e.prototype,Oe)&&Ee(e,Oe,{configurable:!0,value:t})},aFunction$1=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},functionBindContext=function(e,t,r){if(aFunction$1(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}},ke=wellKnownSymbol("species"),arraySpeciesCreate=function(e,t){var r;return ue(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!ue(r.prototype)?isObject(r)&&null===(r=r[ke])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)},je=[].push,createMethod$1=function(e){var t=1==e,r=2==e,n=3==e,o=4==e,i=6==e,a=7==e,c=5==e||i;return function(u,l,f,p){for(var h,d,g=toObject(u),m=s(g),v=functionBindContext(l,f,3),y=toLength(m.length),b=0,w=p||arraySpeciesCreate,S=t?w(u,y):r||a?w(u,0):void 0;y>b;b++)if((c||b in m)&&(d=v(h=m[b],b,g),e))if(t)S[b]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return b;case 2:je.call(S,h)}else switch(e){case 4:return!1;case 7:je.call(S,h)}return i?-1:n||o?o:S}},Le={forEach:createMethod$1(0),map:createMethod$1(1),filter:createMethod$1(2),some:createMethod$1(3),every:createMethod$1(4),find:createMethod$1(5),findIndex:createMethod$1(6),filterOut:createMethod$1(7)},Ae=Le.forEach,Ie=sharedKey("hidden"),Pe=wellKnownSymbol("toPrimitive"),Re=N.set,Te=N.getterFor("Symbol"),Ue=Object.prototype,Ce=t.Symbol,Fe=getBuiltIn("JSON","stringify"),Me=d.f,Ge=m.f,Ne=ye.f,De=i.f,Be=k("symbols"),qe=k("op-symbols"),$e=k("string-to-symbol-registry"),ze=k("symbol-to-string-registry"),Ve=k("wks"),We=t.QObject,Ke=!We||!We.prototype||!We.prototype.findChild,Je=r&&fails((function(){return 7!=de(Ge({},"a",{get:function(){return Ge(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Me(Ue,t);n&&delete Ue[t],Ge(e,t,r),n&&e!==Ue&&Ge(Ue,t,n)}:Ge,wrap=function(e,t){var n=Be[e]=de(Ce.prototype);return Re(n,{type:"Symbol",tag:e,description:t}),r||(n.description=t),n},Ye=se?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Ce},He=function defineProperty(e,t,r){e===Ue&&He(qe,t,r),anObject(e);var n=toPrimitive(t,!0);return anObject(r),has(Be,n)?(r.enumerable?(has(e,Ie)&&e[Ie][n]&&(e[Ie][n]=!1),r=de(r,{enumerable:createPropertyDescriptor(0,!1)})):(has(e,Ie)||Ge(e,Ie,createPropertyDescriptor(1,{})),e[Ie][n]=!0),Je(e,n,r)):Ge(e,n,r)},Xe=function defineProperties(e,t){anObject(e);var n=toIndexedObject(t),o=le(n).concat(tt(n));return Ae(o,(function(t){r&&!Ze.call(n,t)||He(e,t,n[t])})),e},Ze=function propertyIsEnumerable(e){var t=toPrimitive(e,!0),r=De.call(this,t);return!(this===Ue&&has(Be,t)&&!has(qe,t))&&(!(r||!has(this,t)||!has(Be,t)||has(this,Ie)&&this[Ie][t])||r)},Qe=function getOwnPropertyDescriptor(e,t){var r=toIndexedObject(e),n=toPrimitive(t,!0);if(r!==Ue||!has(Be,n)||has(qe,n)){var o=Me(r,n);return!o||!has(Be,n)||has(r,Ie)&&r[Ie][n]||(o.enumerable=!0),o}},et=function getOwnPropertyNames(e){var t=Ne(toIndexedObject(e)),r=[];return Ae(t,(function(e){has(Be,e)||has(I,e)||r.push(e)})),r},tt=function getOwnPropertySymbols(e){var t=e===Ue,r=Ne(t?qe:toIndexedObject(e)),n=[];return Ae(r,(function(e){!has(Be,e)||t&&!has(Ue,e)||n.push(Be[e])})),n};if(ce||(D((Ce=function Symbol(){if(this instanceof Ce)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=uid(e),setter=function(e){this===Ue&&setter.call(qe,e),has(this,Ie)&&has(this[Ie],t)&&(this[Ie][t]=!1),Je(this,t,createPropertyDescriptor(1,e))};return r&&Ke&&Je(Ue,t,{configurable:!0,set:setter}),wrap(t,e)}).prototype,"toString",(function toString(){return Te(this).tag})),D(Ce,"withoutSetter",(function(e){return wrap(uid(e),e)})),i.f=Ze,m.f=He,d.f=Qe,X.f=ye.f=et,Z.f=tt,xe.f=function(e){return wrap(wellKnownSymbol(e),e)},r&&(Ge(Ce.prototype,"description",{configurable:!0,get:function description(){return Te(this).description}}),D(Ue,"propertyIsEnumerable",Ze,{unsafe:!0}))),_export({global:!0,wrap:!0,forced:!ce,sham:!ce},{Symbol:Ce}),Ae(le(Ve),(function(e){defineWellKnownSymbol(e)})),_export({target:"Symbol",stat:!0,forced:!ce},{for:function(e){var t=String(e);if(has($e,t))return $e[t];var r=Ce(t);return $e[t]=r,ze[r]=t,r},keyFor:function keyFor(e){if(!Ye(e))throw TypeError(e+" is not a symbol");if(has(ze,e))return ze[e]},useSetter:function(){Ke=!0},useSimple:function(){Ke=!1}}),_export({target:"Object",stat:!0,forced:!ce,sham:!r},{create:function create(e,t){return void 0===t?de(e):Xe(de(e),t)},defineProperty:He,defineProperties:Xe,getOwnPropertyDescriptor:Qe}),_export({target:"Object",stat:!0,forced:!ce},{getOwnPropertyNames:et,getOwnPropertySymbols:tt}),_export({target:"Object",stat:!0,forced:fails((function(){Z.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(e){return Z.f(toObject(e))}}),Fe){var rt=!ce||fails((function(){var e=Ce();return"[null]"!=Fe([e])||"{}"!=Fe({a:e})||"{}"!=Fe(Object(e))}));_export({target:"JSON",stat:!0,forced:rt},{stringify:function stringify(e,t,r){for(var n,o=[e],i=1;arguments.length>i;)o.push(arguments[i++]);if(n=t,(isObject(t)||void 0!==e)&&!Ye(e))return ue(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Ye(t))return t}),o[1]=t,Fe.apply(null,o)}})}Ce.prototype[Pe]||v(Ce.prototype,Pe,Ce.prototype.valueOf),setToStringTag(Ce,"Symbol"),I[Ie]=!0;var nt=m.f,ot=t.Symbol;if(r&&"function"==typeof ot&&(!("description"in ot.prototype)||void 0!==ot().description)){var it={},at=function Symbol(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof at?new ot(e):void 0===e?ot():ot(e);return""===e&&(it[t]=!0),t};copyConstructorProperties(at,ot);var ct=at.prototype=ot.prototype;ct.constructor=at;var st=ct.toString,ut="Symbol(test)"==String(ot("test")),lt=/^Symbol\((.*)\)[^)]+$/;nt(ct,"description",{configurable:!0,get:function description(){var e=isObject(this)?this.valueOf():this,t=st.call(e);if(has(it,e))return"";var r=ut?t.slice(7,-1):t.replace(lt,"$1");return""===r?void 0:r}}),_export({global:!0,forced:!0},{Symbol:at})}var ft,pt,createProperty=function(e,t,r){var n=toPrimitive(t);n in e?m.f(e,n,createPropertyDescriptor(0,r)):e[n]=r},ht=getBuiltIn("navigator","userAgent")||"",dt=t.process,gt=dt&&dt.versions,mt=gt&&gt.v8;mt?pt=(ft=mt.split("."))[0]+ft[1]:ht&&(!(ft=ht.match(/Edge\/(\d+)/))||ft[1]>=74)&&(ft=ht.match(/Chrome\/(\d+)/))&&(pt=ft[1]);var vt=pt&&+pt,yt=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(e){return vt>=51||!fails((function(){var t=[];return(t.constructor={})[yt]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},bt=wellKnownSymbol("isConcatSpreadable"),wt=vt>=51||!fails((function(){var e=[];return e[bt]=!1,e.concat()[0]!==e})),St=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(e){if(!isObject(e))return!1;var t=e[bt];return void 0!==t?!!t:ue(e)};_export({target:"Array",proto:!0,forced:!wt||!St},{concat:function concat(e){var t,r,n,o,i,a=toObject(this),c=arraySpeciesCreate(a,0),s=0;for(t=-1,n=arguments.length;t<n;t++)if(isConcatSpreadable(i=-1===t?a:arguments[t])){if(s+(o=toLength(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(r=0;r<o;r++,s++)r in i&&createProperty(c,s,i[r])}else{if(s>=9007199254740991)throw TypeError("Maximum allowed index exceeded");createProperty(c,s++,i)}return c.length=s,c}});var arrayMethodIsStrict=function(e,t){var r=[][e];return!!r&&fails((function(){r.call(null,t||function(){throw 1},1)}))},xt=Object.defineProperty,_t={},thrower=function(e){throw e},arrayMethodUsesToLength=function(e,t){if(has(_t,e))return _t[e];t||(t={});var n=[][e],o=!!has(t,"ACCESSORS")&&t.ACCESSORS,i=has(t,0)?t[0]:thrower,a=has(t,1)?t[1]:void 0;return _t[e]=!!n&&!fails((function(){if(o&&!r)return!0;var e={length:-1};o?xt(e,1,{enumerable:!0,get:thrower}):e[1]=1,n.call(e,i,a)}))},Et=Le.forEach,Ot=arrayMethodIsStrict("forEach"),kt=arrayMethodUsesToLength("forEach"),jt=Ot&&kt?[].forEach:function forEach(e){return Et(this,e,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=jt},{forEach:jt});var Lt=wellKnownSymbol("unscopables"),At=Array.prototype;null==At[Lt]&&m.f(At,Lt,{configurable:!0,value:de(null)});var addToUnscopables=function(e){At[Lt][e]=!0},It=K.includes,Pt=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:!Pt},{includes:function includes(e){return It(this,e,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("includes");var Rt=K.indexOf,Tt=[].indexOf,Ut=!!Tt&&1/[1].indexOf(1,-0)<0,Ct=arrayMethodIsStrict("indexOf"),Ft=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:Ut||!Ct||!Ft},{indexOf:function indexOf(e){return Ut?Tt.apply(this,arguments)||0:Rt(this,e,arguments.length>1?arguments[1]:void 0)}});var Mt,Gt,Nt,Dt={},Bt=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),qt=sharedKey("IE_PROTO"),$t=Object.prototype,zt=Bt?Object.getPrototypeOf:function(e){return e=toObject(e),has(e,qt)?e[qt]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?$t:null},Vt=wellKnownSymbol("iterator"),Wt=!1;[].keys&&("next"in(Nt=[].keys())?(Gt=zt(zt(Nt)))!==Object.prototype&&(Mt=Gt):Wt=!0),(null==Mt||fails((function(){var e={};return Mt[Vt].call(e)!==e})))&&(Mt={}),has(Mt,Vt)||v(Mt,Vt,(function(){return this}));var Kt={IteratorPrototype:Mt,BUGGY_SAFARI_ITERATORS:Wt},Jt=Kt.IteratorPrototype,returnThis$1=function(){return this},createIteratorConstructor=function(e,t,r){var n=t+" Iterator";return e.prototype=de(Jt,{next:createPropertyDescriptor(1,r)}),setToStringTag(e,n,!1),Dt[n]=returnThis$1,e},Yt=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function setPrototypeOf(r,n){return anObject(r),function(e){if(!isObject(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(n),t?e.call(r,n):r.__proto__=n,r}}():void 0),Ht=Kt.IteratorPrototype,Xt=Kt.BUGGY_SAFARI_ITERATORS,Zt=wellKnownSymbol("iterator"),returnThis$2=function(){return this},defineIterator=function(e,t,r,n,o,i,a){createIteratorConstructor(r,t,n);var c,s,u,getIterationMethod=function(e){if(e===o&&d)return d;if(!Xt&&e in p)return p[e];switch(e){case"keys":return function keys(){return new r(this,e)};case"values":return function values(){return new r(this,e)};case"entries":return function entries(){return new r(this,e)}}return function(){return new r(this)}},l=t+" Iterator",f=!1,p=e.prototype,h=p[Zt]||p["@@iterator"]||o&&p[o],d=!Xt&&h||getIterationMethod(o),g="Array"==t&&p.entries||h;if(g&&(c=zt(g.call(new e)),Ht!==Object.prototype&&c.next&&(zt(c)!==Ht&&(Yt?Yt(c,Ht):"function"!=typeof c[Zt]&&v(c,Zt,returnThis$2)),setToStringTag(c,l,!0))),"values"==o&&h&&"values"!==h.name&&(f=!0,d=function values(){return h.call(this)}),p[Zt]!==d&&v(p,Zt,d),Dt[t]=d,o)if(s={values:getIterationMethod("values"),keys:i?d:getIterationMethod("keys"),entries:getIterationMethod("entries")},a)for(u in s)(Xt||f||!(u in p))&&D(p,u,s[u]);else _export({target:t,proto:!0,forced:Xt||f},s);return s},Qt=N.set,er=N.getterFor("Array Iterator"),tr=defineIterator(Array,"Array",(function(e,t){Qt(this,{type:"Array Iterator",target:toIndexedObject(e),index:0,kind:t})}),(function(){var e=er(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");Dt.Arguments=Dt.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries");var rr=Le.map,nr=arrayMethodHasSpeciesSupport("map"),or=arrayMethodUsesToLength("map");_export({target:"Array",proto:!0,forced:!nr||!or},{map:function map(e){return rr(this,e,arguments.length>1?arguments[1]:void 0)}});var ir=m.f,ar=Function.prototype,cr=ar.toString,sr=/^\s*function ([^ (]*)/;r&&!("name"in ar)&&ir(ar,"name",{configurable:!0,get:function(){try{return cr.call(this).match(sr)[1]}catch(e){return""}}});var ur=Object.assign,lr=Object.defineProperty,fr=!ur||fails((function(){if(r&&1!==ur({b:1},ur(lr({},"a",{enumerable:!0,get:function(){lr(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach((function(e){t[e]=e})),7!=ur({},e)[n]||le(ur({},t)).join("")!=o}))?function assign(e,t){for(var n=toObject(e),o=arguments.length,a=1,c=Z.f,u=i.f;o>a;)for(var l,f=s(arguments[a++]),p=c?le(f).concat(c(f)):le(f),h=p.length,d=0;h>d;)l=p[d++],r&&!u.call(f,l)||(n[l]=f[l]);return n}:ur;_export({target:"Object",stat:!0,forced:Object.assign!==fr},{assign:fr});var pr={};pr[wellKnownSymbol("toStringTag")]="z";var hr="[object z]"===String(pr),dr=wellKnownSymbol("toStringTag"),gr="Arguments"==classofRaw(function(){return arguments}()),mr=hr?classofRaw:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),dr))?r:gr?classofRaw(t):"Object"==(n=classofRaw(t))&&"function"==typeof t.callee?"Arguments":n},vr=hr?{}.toString:function toString(){return"[object "+mr(this)+"]"};hr||D(Object.prototype,"toString",vr,{unsafe:!0});var yr=t.Promise,redefineAll=function(e,t,r){for(var n in t)D(e,n,t[n],r);return e},br=wellKnownSymbol("species"),anInstance=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e},wr=wellKnownSymbol("iterator"),Sr=Array.prototype,isArrayIteratorMethod=function(e){return void 0!==e&&(Dt.Array===e||Sr[wr]===e)},xr=wellKnownSymbol("iterator"),getIteratorMethod=function(e){if(null!=e)return e[xr]||e["@@iterator"]||Dt[mr(e)]},iteratorClose=function(e){var t=e.return;if(void 0!==t)return anObject(t.call(e)).value},Result=function(e,t){this.stopped=e,this.result=t},iterate=function(e,t,r){var n,o,i,a,c,s,u,l=r&&r.that,f=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),d=functionBindContext(t,l,1+f+h),stop=function(e){return n&&iteratorClose(n),new Result(!0,e)},callFn=function(e){return f?(anObject(e),h?d(e[0],e[1],stop):d(e[0],e[1])):h?d(e,stop):d(e)};if(p)n=e;else{if("function"!=typeof(o=getIteratorMethod(e)))throw TypeError("Target is not iterable");if(isArrayIteratorMethod(o)){for(i=0,a=toLength(e.length);a>i;i++)if((c=callFn(e[i]))&&c instanceof Result)return c;return new Result(!1)}n=o.call(e)}for(s=n.next;!(u=s.call(n)).done;){try{c=callFn(u.value)}catch(e){throw iteratorClose(n),e}if("object"==typeof c&&c&&c instanceof Result)return c}return new Result(!1)},_r=wellKnownSymbol("iterator"),Er=!1;try{var Or=0,kr={next:function(){return{done:!!Or++}},return:function(){Er=!0}};kr[_r]=function(){return this},Array.from(kr,(function(){throw 2}))}catch(e){}var jr,Lr,Ar,Ir=wellKnownSymbol("species"),Pr=/(iphone|ipod|ipad).*applewebkit/i.test(ht),Rr="process"==classofRaw(t.process),Tr=t.location,Ur=t.setImmediate,Cr=t.clearImmediate,Fr=t.process,Mr=t.MessageChannel,Gr=t.Dispatch,Nr=0,Dr={},run=function(e){if(Dr.hasOwnProperty(e)){var t=Dr[e];delete Dr[e],t()}},runner=function(e){return function(){run(e)}},listener=function(e){run(e.data)},post=function(e){t.postMessage(e+"",Tr.protocol+"//"+Tr.host)};Ur&&Cr||(Ur=function setImmediate(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return Dr[++Nr]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},jr(Nr),Nr},Cr=function clearImmediate(e){delete Dr[e]},Rr?jr=function(e){Fr.nextTick(runner(e))}:Gr&&Gr.now?jr=function(e){Gr.now(runner(e))}:Mr&&!Pr?(Ar=(Lr=new Mr).port2,Lr.port1.onmessage=listener,jr=functionBindContext(Ar.postMessage,Ar,1)):t.addEventListener&&"function"==typeof postMessage&&!t.importScripts&&Tr&&"file:"!==Tr.protocol&&!fails(post)?(jr=post,t.addEventListener("message",listener,!1)):jr="onreadystatechange"in documentCreateElement("script")?function(e){pe.appendChild(documentCreateElement("script")).onreadystatechange=function(){pe.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)});var Br,qr,$r,zr,Vr,Wr,Kr,Jr,Yr={set:Ur,clear:Cr},Hr=/web0s(?!.*chrome)/i.test(ht),Xr=d.f,Zr=Yr.set,Qr=t.MutationObserver||t.WebKitMutationObserver,en=t.document,tn=t.process,rn=t.Promise,nn=Xr(t,"queueMicrotask"),on=nn&&nn.value;on||(Br=function(){var e,t;for(Rr&&(e=tn.domain)&&e.exit();qr;){t=qr.fn,qr=qr.next;try{t()}catch(e){throw qr?zr():$r=void 0,e}}$r=void 0,e&&e.enter()},Pr||Rr||Hr||!Qr||!en?rn&&rn.resolve?(Kr=rn.resolve(void 0),Jr=Kr.then,zr=function(){Jr.call(Kr,Br)}):zr=Rr?function(){tn.nextTick(Br)}:function(){Zr.call(t,Br)}:(Vr=!0,Wr=en.createTextNode(""),new Qr(Br).observe(Wr,{characterData:!0}),zr=function(){Wr.data=Vr=!Vr}));var an,cn,sn,un,ln=on||function(e){var t={fn:e,next:void 0};$r&&($r.next=t),qr||(qr=t,zr()),$r=t},PromiseCapability=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=aFunction$1(t),this.reject=aFunction$1(r)},fn={f:function(e){return new PromiseCapability(e)}},promiseResolve=function(e,t){if(anObject(e),isObject(t)&&t.constructor===e)return t;var r=fn.f(e);return(0,r.resolve)(t),r.promise},perform=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},pn=Yr.set,hn=wellKnownSymbol("species"),dn="Promise",gn=N.get,mn=N.set,vn=N.getterFor(dn),yn=yr,bn=t.TypeError,wn=t.document,Sn=t.process,xn=getBuiltIn("fetch"),_n=fn.f,En=_n,On=!!(wn&&wn.createEvent&&t.dispatchEvent),kn="function"==typeof PromiseRejectionEvent,jn=ie(dn,(function(){if(!(_(yn)!==String(yn))){if(66===vt)return!0;if(!Rr&&!kn)return!0}if(vt>=51&&/native code/.test(yn))return!1;var e=yn.resolve(1),FakePromise=function(e){e((function(){}),(function(){}))};return(e.constructor={})[hn]=FakePromise,!(e.then((function(){}))instanceof FakePromise)})),Ln=jn||!function(e,t){if(!t&&!Er)return!1;var r=!1;try{var n={};n[_r]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}((function(e){yn.all(e).catch((function(){}))})),isThenable=function(e){var t;return!(!isObject(e)||"function"!=typeof(t=e.then))&&t},notify$1=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;ln((function(){for(var n=e.value,o=1==e.state,i=0;r.length>i;){var a,c,s,u=r[i++],l=o?u.ok:u.fail,f=u.resolve,p=u.reject,h=u.domain;try{l?(o||(2===e.rejection&&onHandleUnhandled(e),e.rejection=1),!0===l?a=n:(h&&h.enter(),a=l(n),h&&(h.exit(),s=!0)),a===u.promise?p(bn("Promise-chain cycle")):(c=isThenable(a))?c.call(a,f,p):f(a)):p(n)}catch(e){h&&!s&&h.exit(),p(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&onUnhandled(e)}))}},dispatchEvent=function(e,r,n){var o,i;On?((o=wn.createEvent("Event")).promise=r,o.reason=n,o.initEvent(e,!1,!0),t.dispatchEvent(o)):o={promise:r,reason:n},!kn&&(i=t["on"+e])?i(o):"unhandledrejection"===e&&function(e,r){var n=t.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,r))}("Unhandled promise rejection",n)},onUnhandled=function(e){pn.call(t,(function(){var t,r=e.facade,n=e.value;if(isUnhandled(e)&&(t=perform((function(){Rr?Sn.emit("unhandledRejection",n,r):dispatchEvent("unhandledrejection",r,n)})),e.rejection=Rr||isUnhandled(e)?2:1,t.error))throw t.value}))},isUnhandled=function(e){return 1!==e.rejection&&!e.parent},onHandleUnhandled=function(e){pn.call(t,(function(){var t=e.facade;Rr?Sn.emit("rejectionHandled",t):dispatchEvent("rejectionhandled",t,e.value)}))},bind=function(e,t,r){return function(n){e(t,n,r)}},internalReject=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,notify$1(e,!0))},internalResolve=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw bn("Promise can't be resolved itself");var n=isThenable(t);n?ln((function(){var r={done:!1};try{n.call(t,bind(internalResolve,r,e),bind(internalReject,r,e))}catch(t){internalReject(r,t,e)}})):(e.value=t,e.state=1,notify$1(e,!1))}catch(t){internalReject({done:!1},t,e)}}};jn&&(yn=function Promise(e){anInstance(this,yn,dn),aFunction$1(e),an.call(this);var t=gn(this);try{e(bind(internalResolve,t),bind(internalReject,t))}catch(e){internalReject(t,e)}},(an=function Promise(e){mn(this,{type:dn,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=redefineAll(yn.prototype,{then:function then(e,t){var r,n,o,i=vn(this),a=_n((r=yn,void 0===(o=anObject(this).constructor)||null==(n=anObject(o)[Ir])?r:aFunction$1(n)));return a.ok="function"!=typeof e||e,a.fail="function"==typeof t&&t,a.domain=Rr?Sn.domain:void 0,i.parent=!0,i.reactions.push(a),0!=i.state&&notify$1(i,!1),a.promise},catch:function(e){return this.then(void 0,e)}}),cn=function(){var e=new an,t=gn(e);this.promise=e,this.resolve=bind(internalResolve,t),this.reject=bind(internalReject,t)},fn.f=_n=function(e){return e===yn||e===sn?new cn(e):En(e)},"function"==typeof yr&&(un=yr.prototype.then,D(yr.prototype,"then",(function then(e,t){var r=this;return new yn((function(e,t){un.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof xn&&_export({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(e){return promiseResolve(yn,xn.apply(t,arguments))}}))),_export({global:!0,wrap:!0,forced:jn},{Promise:yn}),setToStringTag(yn,dn,!1),function(e){var t=getBuiltIn(e),n=m.f;r&&t&&!t[br]&&n(t,br,{configurable:!0,get:function(){return this}})}(dn),sn=getBuiltIn(dn),_export({target:dn,stat:!0,forced:jn},{reject:function reject(e){var t=_n(this);return t.reject.call(void 0,e),t.promise}}),_export({target:dn,stat:!0,forced:jn},{resolve:function resolve(e){return promiseResolve(this,e)}}),_export({target:dn,stat:!0,forced:Ln},{all:function all(e){var t=this,r=_n(t),n=r.resolve,o=r.reject,i=perform((function(){var r=aFunction$1(t.resolve),i=[],a=0,c=1;iterate(e,(function(e){var s=a++,u=!1;i.push(void 0),c++,r.call(t,e).then((function(e){u||(u=!0,i[s]=e,--c||n(i))}),o)})),--c||n(i)}));return i.error&&o(i.value),r.promise},race:function race(e){var t=this,r=_n(t),n=r.reject,o=perform((function(){var o=aFunction$1(t.resolve);iterate(e,(function(e){o.call(t,e).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var regexpFlags=function(){var e=anObject(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function RE(e,t){return RegExp(e,t)}var An,In,Pn={UNSUPPORTED_Y:fails((function(){var e=RE("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:fails((function(){var e=RE("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},Rn=RegExp.prototype.exec,Tn=String.prototype.replace,Un=Rn,Cn=(An=/a/,In=/b*/g,Rn.call(An,"a"),Rn.call(In,"a"),0!==An.lastIndex||0!==In.lastIndex),Fn=Pn.UNSUPPORTED_Y||Pn.BROKEN_CARET,Mn=void 0!==/()??/.exec("")[1];(Cn||Mn||Fn)&&(Un=function exec(e){var t,r,n,o,i=this,a=Fn&&i.sticky,c=regexpFlags.call(i),s=i.source,u=0,l=e;return a&&(-1===(c=c.replace("y","")).indexOf("g")&&(c+="g"),l=String(e).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(s="(?: "+s+")",l=" "+l,u++),r=new RegExp("^(?:"+s+")",c)),Mn&&(r=new RegExp("^"+s+"$(?!\\s)",c)),Cn&&(t=i.lastIndex),n=Rn.call(a?r:i,l),a?n?(n.input=n.input.slice(u),n[0]=n[0].slice(u),n.index=i.lastIndex,i.lastIndex+=n[0].length):i.lastIndex=0:Cn&&n&&(i.lastIndex=i.global?n.index+n[0].length:t),Mn&&n&&n.length>1&&Tn.call(n[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)})),n});var Gn=Un;_export({target:"RegExp",proto:!0,forced:/./.exec!==Gn},{exec:Gn});var Nn=wellKnownSymbol("match"),notARegexp=function(e){if(function(e){var t;return isObject(e)&&(void 0!==(t=e[Nn])?!!t:"RegExp"==classofRaw(e))}(e))throw TypeError("The method doesn't accept regular expressions");return e},Dn=wellKnownSymbol("match"),correctIsRegexpLogic=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[Dn]=!1,"/./"[e](t)}catch(e){}}return!1};_export({target:"String",proto:!0,forced:!correctIsRegexpLogic("includes")},{includes:function includes(e){return!!~String(requireObjectCoercible(this)).indexOf(notARegexp(e),arguments.length>1?arguments[1]:void 0)}});var createMethod$2=function(e){return function(t,r){var n,o,i=String(requireObjectCoercible(t)),a=toInteger(r),c=i.length;return a<0||a>=c?e?"":void 0:(n=i.charCodeAt(a))<55296||n>56319||a+1===c||(o=i.charCodeAt(a+1))<56320||o>57343?e?i.charAt(a):n:e?i.slice(a,a+2):o-56320+(n-55296<<10)+65536}},Bn={codeAt:createMethod$2(!1),charAt:createMethod$2(!0)},qn=Bn.charAt,$n=N.set,zn=N.getterFor("String Iterator");defineIterator(String,"String",(function(e){$n(this,{type:"String Iterator",string:String(e),index:0})}),(function next(){var e,t=zn(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=qn(r,n),t.index+=e.length,{value:e,done:!1})}));var Vn=wellKnownSymbol("species"),Wn=!fails((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),Kn="$0"==="a".replace(/./,"$0"),Jn=wellKnownSymbol("replace"),Yn=!!/./[Jn]&&""===/./[Jn]("a","$0"),Hn=!fails((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),Xn=Bn.charAt,advanceStringIndex=function(e,t,r){return t+(r?Xn(e,t).length:1)},Zn=Math.floor,Qn="".replace,eo=/\$([$&'`]|\d\d?|<[^>]*>)/g,to=/\$([$&'`]|\d\d?)/g,getSubstitution=function(e,t,r,n,o,i){var a=r+e.length,c=n.length,s=to;return void 0!==o&&(o=toObject(o),s=eo),Qn.call(i,s,(function(i,s){var u;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(a);case"<":u=o[s.slice(1,-1)];break;default:var l=+s;if(0===l)return i;if(l>c){var f=Zn(l/10);return 0===f?i:f<=c?void 0===n[f-1]?s.charAt(1):n[f-1]+s.charAt(1):i}u=n[l-1]}return void 0===u?"":u}))},regexpExecAbstract=function(e,t){var r=e.exec;if("function"==typeof r){var n=r.call(e,t);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==classofRaw(e))throw TypeError("RegExp#exec called on incompatible receiver");return Gn.call(e,t)},ro=Math.max,no=Math.min;!function(e,t,r,n){var o=wellKnownSymbol(e),i=!fails((function(){var t={};return t[o]=function(){return 7},7!=""[e](t)})),a=i&&!fails((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[Vn]=function(){return r},r.flags="",r[o]=/./[o]),r.exec=function(){return t=!0,null},r[o](""),!t}));if(!i||!a||"replace"===e&&(!Wn||!Kn||Yn)||"split"===e&&!Hn){var c=/./[o],s=r(o,""[e],(function(e,t,r,n,o){return t.exec===Gn?i&&!o?{done:!0,value:c.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}}),{REPLACE_KEEPS_$0:Kn,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Yn}),u=s[0],l=s[1];D(String.prototype,e,u),D(RegExp.prototype,o,2==t?function(e,t){return l.call(e,this,t)}:function(e){return l.call(e,this)})}n&&v(RegExp.prototype[o],"sham",!0)}("replace",2,(function(e,t,r,n){var o=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=n.REPLACE_KEEPS_$0,a=o?"$":"$0";return[function replace(r,n){var o=requireObjectCoercible(this),i=null==r?void 0:r[e];return void 0!==i?i.call(r,o,n):t.call(String(o),r,n)},function(e,n){if(!o&&i||"string"==typeof n&&-1===n.indexOf(a)){var c=r(t,e,this,n);if(c.done)return c.value}var s=anObject(e),u=String(this),l="function"==typeof n;l||(n=String(n));var f=s.global;if(f){var p=s.unicode;s.lastIndex=0}for(var h=[];;){var d=regexpExecAbstract(s,u);if(null===d)break;if(h.push(d),!f)break;""===String(d[0])&&(s.lastIndex=advanceStringIndex(u,toLength(s.lastIndex),p))}for(var g,m="",v=0,y=0;y<h.length;y++){d=h[y];for(var b=String(d[0]),w=ro(no(toInteger(d.index),u.length),0),S=[],x=1;x<d.length;x++)S.push(void 0===(g=d[x])?g:String(g));var _=d.groups;if(l){var E=[b].concat(S,w,u);void 0!==_&&E.push(_);var O=String(n.apply(void 0,E))}else O=getSubstitution(b,u,w,S,_,n);w>=v&&(m+=u.slice(v,w)+O,v=w+b.length)}return m+u.slice(v)}]}));var oo,io=d.f,ao="".startsWith,co=Math.min,so=correctIsRegexpLogic("startsWith"),uo=!(so||(oo=io(String.prototype,"startsWith"),!oo||oo.writable));_export({target:"String",proto:!0,forced:!uo&&!so},{startsWith:function startsWith(e){var t=String(requireObjectCoercible(this));notARegexp(e);var r=toLength(co(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return ao?ao.call(t,n,r):t.slice(r,r+n.length)===n}});var lo={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var fo in lo){var po=t[fo],ho=po&&po.prototype;if(ho&&ho.forEach!==jt)try{v(ho,"forEach",jt)}catch(e){ho.forEach=jt}}var go=wellKnownSymbol("iterator"),mo=wellKnownSymbol("toStringTag"),vo=tr.values;for(var yo in lo){var bo=t[yo],wo=bo&&bo.prototype;if(wo){if(wo[go]!==vo)try{v(wo,go,vo)}catch(e){wo[go]=vo}if(wo[mo]||v(wo,mo,yo),lo[yo])for(var So in tr)if(wo[So]!==tr[So])try{v(wo,So,tr[So])}catch(e){wo[So]=tr[So]}}}var xo=wellKnownSymbol("iterator"),_o=!fails((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[xo]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),callWithSafeIterationClosing=function(e,t,r,n){try{return n?t(anObject(r)[0],r[1]):t(r)}catch(t){throw iteratorClose(e),t}},Eo=function from(e){var t,r,n,o,i,a,c=toObject(e),s="function"==typeof this?this:Array,u=arguments.length,l=u>1?arguments[1]:void 0,f=void 0!==l,p=getIteratorMethod(c),h=0;if(f&&(l=functionBindContext(l,u>2?arguments[2]:void 0,2)),null==p||s==Array&&isArrayIteratorMethod(p))for(r=new s(t=toLength(c.length));t>h;h++)a=f?l(c[h],h):c[h],createProperty(r,h,a);else for(i=(o=p.call(c)).next,r=new s;!(n=i.call(o)).done;h++)a=f?callWithSafeIterationClosing(o,l,[n.value,h],!0):n.value,createProperty(r,h,a);return r.length=h,r},Oo=/[^\0-\u007E]/,ko=/[.\u3002\uFF0E\uFF61]/g,jo="Overflow: input needs wider integers to process",Lo=Math.floor,Ao=String.fromCharCode,digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var n=0;for(e=r?Lo(e/700):e>>1,e+=Lo(e/t);e>455;n+=36)e=Lo(e/35);return Lo(n+36*e/(e+38))},encode=function(e){var t,r,n=[],o=(e=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=e.charCodeAt(r++);if(o>=55296&&o<=56319&&r<n){var i=e.charCodeAt(r++);56320==(64512&i)?t.push(((1023&o)<<10)+(1023&i)+65536):(t.push(o),r--)}else t.push(o)}return t}(e)).length,i=128,a=0,c=72;for(t=0;t<e.length;t++)(r=e[t])<128&&n.push(Ao(r));var s=n.length,u=s;for(s&&n.push("-");u<o;){var l=2147483647;for(t=0;t<e.length;t++)(r=e[t])>=i&&r<l&&(l=r);var f=u+1;if(l-i>Lo((2147483647-a)/f))throw RangeError(jo);for(a+=(l-i)*f,i=l,t=0;t<e.length;t++){if((r=e[t])<i&&++a>2147483647)throw RangeError(jo);if(r==i){for(var p=a,h=36;;h+=36){var d=h<=c?1:h>=c+26?26:h-c;if(p<d)break;var g=p-d,m=36-d;n.push(Ao(digitToBasic(d+g%m))),p=Lo(g/m)}n.push(Ao(digitToBasic(p))),c=adapt(a,f,u==s),a=0,++u}}++a,++i}return n.join("")},getIterator=function(e){var t=getIteratorMethod(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return anObject(t.call(e))},Io=getBuiltIn("fetch"),Po=getBuiltIn("Headers"),Ro=wellKnownSymbol("iterator"),To=N.set,Uo=N.getterFor("URLSearchParams"),Co=N.getterFor("URLSearchParamsIterator"),Fo=/\+/g,Mo=Array(4),percentSequence=function(e){return Mo[e-1]||(Mo[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(e){try{return decodeURIComponent(e)}catch(t){return e}},deserialize=function(e){var t=e.replace(Fo," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=t.replace(percentSequence(r--),percentDecode);return t}},Go=/[!'()~]|%20/g,No={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return No[e]},serialize=function(e){return encodeURIComponent(e).replace(Go,replacer)},parseSearchParams=function(e,t){if(t)for(var r,n,o=t.split("&"),i=0;i<o.length;)(r=o[i++]).length&&(n=r.split("="),e.push({key:deserialize(n.shift()),value:deserialize(n.join("="))}))},updateSearchParams=function(e){this.entries.length=0,parseSearchParams(this.entries,e)},validateArgumentsLength=function(e,t){if(e<t)throw TypeError("Not enough arguments")},Do=createIteratorConstructor((function Iterator(e,t){To(this,{type:"URLSearchParamsIterator",iterator:getIterator(Uo(e).entries),kind:t})}),"Iterator",(function next(){var e=Co(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r})),Bo=function URLSearchParams(){anInstance(this,Bo,"URLSearchParams");var e,t,r,n,o,i,a,c,s,u=arguments.length>0?arguments[0]:void 0,l=this,f=[];if(To(l,{type:"URLSearchParams",entries:f,updateURL:function(){},updateSearchParams:updateSearchParams}),void 0!==u)if(isObject(u))if("function"==typeof(e=getIteratorMethod(u)))for(r=(t=e.call(u)).next;!(n=r.call(t)).done;){if((a=(i=(o=getIterator(anObject(n.value))).next).call(o)).done||(c=i.call(o)).done||!i.call(o).done)throw TypeError("Expected sequence with length 2");f.push({key:a.value+"",value:c.value+""})}else for(s in u)has(u,s)&&f.push({key:s,value:u[s]+""});else parseSearchParams(f,"string"==typeof u?"?"===u.charAt(0)?u.slice(1):u:u+"")},qo=Bo.prototype;redefineAll(qo,{append:function append(e,t){validateArgumentsLength(arguments.length,2);var r=Uo(this);r.entries.push({key:e+"",value:t+""}),r.updateURL()},delete:function(e){validateArgumentsLength(arguments.length,1);for(var t=Uo(this),r=t.entries,n=e+"",o=0;o<r.length;)r[o].key===n?r.splice(o,1):o++;t.updateURL()},get:function get(e){validateArgumentsLength(arguments.length,1);for(var t=Uo(this).entries,r=e+"",n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function getAll(e){validateArgumentsLength(arguments.length,1);for(var t=Uo(this).entries,r=e+"",n=[],o=0;o<t.length;o++)t[o].key===r&&n.push(t[o].value);return n},has:function has(e){validateArgumentsLength(arguments.length,1);for(var t=Uo(this).entries,r=e+"",n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function set(e,t){validateArgumentsLength(arguments.length,1);for(var r,n=Uo(this),o=n.entries,i=!1,a=e+"",c=t+"",s=0;s<o.length;s++)(r=o[s]).key===a&&(i?o.splice(s--,1):(i=!0,r.value=c));i||o.push({key:a,value:c}),n.updateURL()},sort:function sort(){var e,t,r,n=Uo(this),o=n.entries,i=o.slice();for(o.length=0,r=0;r<i.length;r++){for(e=i[r],t=0;t<r;t++)if(o[t].key>e.key){o.splice(t,0,e);break}t===r&&o.push(e)}n.updateURL()},forEach:function forEach(e){for(var t,r=Uo(this).entries,n=functionBindContext(e,arguments.length>1?arguments[1]:void 0,3),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function keys(){return new Do(this,"keys")},values:function values(){return new Do(this,"values")},entries:function entries(){return new Do(this,"entries")}},{enumerable:!0}),D(qo,Ro,qo.entries),D(qo,"toString",(function toString(){for(var e,t=Uo(this).entries,r=[],n=0;n<t.length;)e=t[n++],r.push(serialize(e.key)+"="+serialize(e.value));return r.join("&")}),{enumerable:!0}),setToStringTag(Bo,"URLSearchParams"),_export({global:!0,forced:!_o},{URLSearchParams:Bo}),_o||"function"!=typeof Io||"function"!=typeof Po||_export({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(e){var t,r,n,o=[e];return arguments.length>1&&(isObject(t=arguments[1])&&(r=t.body,"URLSearchParams"===mr(r)&&((n=t.headers?new Po(t.headers):new Po).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=de(t,{body:createPropertyDescriptor(0,String(r)),headers:createPropertyDescriptor(0,n)}))),o.push(t)),Io.apply(this,o)}});var $o,zo={URLSearchParams:Bo,getState:Uo},Vo=Bn.codeAt,Wo=t.URL,Ko=zo.URLSearchParams,Jo=zo.getState,Yo=N.set,Ho=N.getterFor("URL"),Xo=Math.floor,Zo=Math.pow,Qo=/[A-Za-z]/,ei=/[\d+-.A-Za-z]/,ti=/\d/,ri=/^(0x|0X)/,ni=/^[0-7]+$/,oi=/^\d+$/,ii=/^[\dA-Fa-f]+$/,ai=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,ci=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,si=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,ui=/[\u0009\u000A\u000D]/g,parseHost=function(e,t){var r,n,o;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(r=parseIPv6(t.slice(1,-1))))return"Invalid host";e.host=r}else if(isSpecial(e)){if(t=function(e){var t,r,n=[],o=e.toLowerCase().replace(ko,".").split(".");for(t=0;t<o.length;t++)r=o[t],n.push(Oo.test(r)?"xn--"+encode(r):r);return n.join(".")}(t),ai.test(t))return"Invalid host";if(null===(r=parseIPv4(t)))return"Invalid host";e.host=r}else{if(ci.test(t))return"Invalid host";for(r="",n=Eo(t),o=0;o<n.length;o++)r+=percentEncode(n[o],li);e.host=r}},parseIPv4=function(e){var t,r,n,o,i,a,c,s=e.split(".");if(s.length&&""==s[s.length-1]&&s.pop(),(t=s.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(o=s[n]))return e;if(i=10,o.length>1&&"0"==o.charAt(0)&&(i=ri.test(o)?16:8,o=o.slice(8==i?1:2)),""===o)a=0;else{if(!(10==i?oi:8==i?ni:ii).test(o))return e;a=parseInt(o,i)}r.push(a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=Zo(256,5-t))return null}else if(a>255)return null;for(c=r.pop(),n=0;n<r.length;n++)c+=r[n]*Zo(256,3-n);return c},parseIPv6=function(e){var t,r,n,o,i,a,c,s=[0,0,0,0,0,0,0,0],u=0,l=null,f=0,char=function(){return e.charAt(f)};if(":"==char()){if(":"!=e.charAt(1))return;f+=2,l=++u}for(;char();){if(8==u)return;if(":"!=char()){for(t=r=0;r<4&&ii.test(char());)t=16*t+parseInt(char(),16),f++,r++;if("."==char()){if(0==r)return;if(f-=r,u>6)return;for(n=0;char();){if(o=null,n>0){if(!("."==char()&&n<4))return;f++}if(!ti.test(char()))return;for(;ti.test(char());){if(i=parseInt(char(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;f++}s[u]=256*s[u]+o,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==char()){if(f++,!char())return}else if(char())return;s[u++]=t}else{if(null!==l)return;f++,l=++u}}if(null!==l)for(a=u-l,u=7;0!=u&&a>0;)c=s[u],s[u--]=s[l+a-1],s[l+--a]=c;else if(8!=u)return;return s},serializeHost=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=Xo(e/256);return t.join(".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(t=n,r=o),t}(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}return e},li={},fi=fr({},li,{" ":1,'"':1,"<":1,">":1,"`":1}),pi=fr({},fi,{"#":1,"?":1,"{":1,"}":1}),hi=fr({},pi,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var r=Vo(e,0);return r>32&&r<127&&!has(t,e)?e:encodeURIComponent(e)},di={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isSpecial=function(e){return has(di,e.scheme)},includesCredentials=function(e){return""!=e.username||""!=e.password},cannotHaveUsernamePasswordPort=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},isWindowsDriveLetter=function(e,t){var r;return 2==e.length&&Qo.test(e.charAt(0))&&(":"==(r=e.charAt(1))||!t&&"|"==r)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},shortenURLsPath=function(e){var t=e.path,r=t.length;!r||"file"==e.scheme&&1==r&&isWindowsDriveLetter(t[0],!0)||t.pop()},isSingleDot=function(e){return"."===e||"%2e"===e.toLowerCase()},gi={},mi={},vi={},yi={},bi={},wi={},Si={},xi={},_i={},Ei={},Oi={},ki={},ji={},Li={},Ai={},Ii={},Pi={},Ri={},Ti={},Ui={},Ci={},parseURL=function(e,t,r,n){var o,i,a,c,s,u=r||gi,l=0,f="",p=!1,h=!1,d=!1;for(r||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(si,"")),t=t.replace(ui,""),o=Eo(t);l<=o.length;){switch(i=o[l],u){case gi:if(!i||!Qo.test(i)){if(r)return"Invalid scheme";u=vi;continue}f+=i.toLowerCase(),u=mi;break;case mi:if(i&&(ei.test(i)||"+"==i||"-"==i||"."==i))f+=i.toLowerCase();else{if(":"!=i){if(r)return"Invalid scheme";f="",u=vi,l=0;continue}if(r&&(isSpecial(e)!=has(di,f)||"file"==f&&(includesCredentials(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=f,r)return void(isSpecial(e)&&di[e.scheme]==e.port&&(e.port=null));f="","file"==e.scheme?u=Li:isSpecial(e)&&n&&n.scheme==e.scheme?u=yi:isSpecial(e)?u=xi:"/"==o[l+1]?(u=bi,l++):(e.cannotBeABaseURL=!0,e.path.push(""),u=Ti)}break;case vi:if(!n||n.cannotBeABaseURL&&"#"!=i)return"Invalid scheme";if(n.cannotBeABaseURL&&"#"==i){e.scheme=n.scheme,e.path=n.path.slice(),e.query=n.query,e.fragment="",e.cannotBeABaseURL=!0,u=Ci;break}u="file"==n.scheme?Li:wi;continue;case yi:if("/"!=i||"/"!=o[l+1]){u=wi;continue}u=_i,l++;break;case bi:if("/"==i){u=Ei;break}u=Ri;continue;case wi:if(e.scheme=n.scheme,i==$o)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query;else if("/"==i||"\\"==i&&isSpecial(e))u=Si;else if("?"==i)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query="",u=Ui;else{if("#"!=i){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.path.pop(),u=Ri;continue}e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query,e.fragment="",u=Ci}break;case Si:if(!isSpecial(e)||"/"!=i&&"\\"!=i){if("/"!=i){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,u=Ri;continue}u=Ei}else u=_i;break;case xi:if(u=_i,"/"!=i||"/"!=f.charAt(l+1))continue;l++;break;case _i:if("/"!=i&&"\\"!=i){u=Ei;continue}break;case Ei:if("@"==i){p&&(f="%40"+f),p=!0,a=Eo(f);for(var g=0;g<a.length;g++){var m=a[g];if(":"!=m||d){var v=percentEncode(m,hi);d?e.password+=v:e.username+=v}else d=!0}f=""}else if(i==$o||"/"==i||"?"==i||"#"==i||"\\"==i&&isSpecial(e)){if(p&&""==f)return"Invalid authority";l-=Eo(f).length+1,f="",u=Oi}else f+=i;break;case Oi:case ki:if(r&&"file"==e.scheme){u=Ii;continue}if(":"!=i||h){if(i==$o||"/"==i||"?"==i||"#"==i||"\\"==i&&isSpecial(e)){if(isSpecial(e)&&""==f)return"Invalid host";if(r&&""==f&&(includesCredentials(e)||null!==e.port))return;if(c=parseHost(e,f))return c;if(f="",u=Pi,r)return;continue}"["==i?h=!0:"]"==i&&(h=!1),f+=i}else{if(""==f)return"Invalid host";if(c=parseHost(e,f))return c;if(f="",u=ji,r==ki)return}break;case ji:if(!ti.test(i)){if(i==$o||"/"==i||"?"==i||"#"==i||"\\"==i&&isSpecial(e)||r){if(""!=f){var y=parseInt(f,10);if(y>65535)return"Invalid port";e.port=isSpecial(e)&&y===di[e.scheme]?null:y,f=""}if(r)return;u=Pi;continue}return"Invalid port"}f+=i;break;case Li:if(e.scheme="file","/"==i||"\\"==i)u=Ai;else{if(!n||"file"!=n.scheme){u=Ri;continue}if(i==$o)e.host=n.host,e.path=n.path.slice(),e.query=n.query;else if("?"==i)e.host=n.host,e.path=n.path.slice(),e.query="",u=Ui;else{if("#"!=i){startsWithWindowsDriveLetter(o.slice(l).join(""))||(e.host=n.host,e.path=n.path.slice(),shortenURLsPath(e)),u=Ri;continue}e.host=n.host,e.path=n.path.slice(),e.query=n.query,e.fragment="",u=Ci}}break;case Ai:if("/"==i||"\\"==i){u=Ii;break}n&&"file"==n.scheme&&!startsWithWindowsDriveLetter(o.slice(l).join(""))&&(isWindowsDriveLetter(n.path[0],!0)?e.path.push(n.path[0]):e.host=n.host),u=Ri;continue;case Ii:if(i==$o||"/"==i||"\\"==i||"?"==i||"#"==i){if(!r&&isWindowsDriveLetter(f))u=Ri;else if(""==f){if(e.host="",r)return;u=Pi}else{if(c=parseHost(e,f))return c;if("localhost"==e.host&&(e.host=""),r)return;f="",u=Pi}continue}f+=i;break;case Pi:if(isSpecial(e)){if(u=Ri,"/"!=i&&"\\"!=i)continue}else if(r||"?"!=i)if(r||"#"!=i){if(i!=$o&&(u=Ri,"/"!=i))continue}else e.fragment="",u=Ci;else e.query="",u=Ui;break;case Ri:if(i==$o||"/"==i||"\\"==i&&isSpecial(e)||!r&&("?"==i||"#"==i)){if(".."===(s=(s=f).toLowerCase())||"%2e."===s||".%2e"===s||"%2e%2e"===s?(shortenURLsPath(e),"/"==i||"\\"==i&&isSpecial(e)||e.path.push("")):isSingleDot(f)?"/"==i||"\\"==i&&isSpecial(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&isWindowsDriveLetter(f)&&(e.host&&(e.host=""),f=f.charAt(0)+":"),e.path.push(f)),f="","file"==e.scheme&&(i==$o||"?"==i||"#"==i))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==i?(e.query="",u=Ui):"#"==i&&(e.fragment="",u=Ci)}else f+=percentEncode(i,pi);break;case Ti:"?"==i?(e.query="",u=Ui):"#"==i?(e.fragment="",u=Ci):i!=$o&&(e.path[0]+=percentEncode(i,li));break;case Ui:r||"#"!=i?i!=$o&&("'"==i&&isSpecial(e)?e.query+="%27":e.query+="#"==i?"%23":percentEncode(i,li)):(e.fragment="",u=Ci);break;case Ci:i!=$o&&(e.fragment+=percentEncode(i,fi))}l++}},Fi=function URL(e){var t,n,o=anInstance(this,Fi,"URL"),i=arguments.length>1?arguments[1]:void 0,a=String(e),c=Yo(o,{type:"URL"});if(void 0!==i)if(i instanceof Fi)t=Ho(i);else if(n=parseURL(t={},String(i)))throw TypeError(n);if(n=parseURL(c,a,null,t))throw TypeError(n);var s=c.searchParams=new Ko,u=Jo(s);u.updateSearchParams(c.query),u.updateURL=function(){c.query=String(s)||null},r||(o.href=serializeURL.call(o),o.origin=getOrigin.call(o),o.protocol=getProtocol.call(o),o.username=getUsername.call(o),o.password=getPassword.call(o),o.host=getHost.call(o),o.hostname=getHostname.call(o),o.port=getPort.call(o),o.pathname=getPathname.call(o),o.search=getSearch.call(o),o.searchParams=getSearchParams.call(o),o.hash=getHash.call(o))},Mi=Fi.prototype,serializeURL=function(){var e=Ho(this),t=e.scheme,r=e.username,n=e.password,o=e.host,i=e.port,a=e.path,c=e.query,s=e.fragment,u=t+":";return null!==o?(u+="//",includesCredentials(e)&&(u+=r+(n?":"+n:"")+"@"),u+=serializeHost(o),null!==i&&(u+=":"+i)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==c&&(u+="?"+c),null!==s&&(u+="#"+s),u},getOrigin=function(){var e=Ho(this),t=e.scheme,r=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&isSpecial(e)?t+"://"+serializeHost(e.host)+(null!==r?":"+r:""):"null"},getProtocol=function(){return Ho(this).scheme+":"},getUsername=function(){return Ho(this).username},getPassword=function(){return Ho(this).password},getHost=function(){var e=Ho(this),t=e.host,r=e.port;return null===t?"":null===r?serializeHost(t):serializeHost(t)+":"+r},getHostname=function(){var e=Ho(this).host;return null===e?"":serializeHost(e)},getPort=function(){var e=Ho(this).port;return null===e?"":String(e)},getPathname=function(){var e=Ho(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},getSearch=function(){var e=Ho(this).query;return e?"?"+e:""},getSearchParams=function(){return Ho(this).searchParams},getHash=function(){var e=Ho(this).fragment;return e?"#"+e:""},accessorDescriptor=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(r&&fe(Mi,{href:accessorDescriptor(serializeURL,(function(e){var t=Ho(this),r=String(e),n=parseURL(t,r);if(n)throw TypeError(n);Jo(t.searchParams).updateSearchParams(t.query)})),origin:accessorDescriptor(getOrigin),protocol:accessorDescriptor(getProtocol,(function(e){var t=Ho(this);parseURL(t,String(e)+":",gi)})),username:accessorDescriptor(getUsername,(function(e){var t=Ho(this),r=Eo(String(e));if(!cannotHaveUsernamePasswordPort(t)){t.username="";for(var n=0;n<r.length;n++)t.username+=percentEncode(r[n],hi)}})),password:accessorDescriptor(getPassword,(function(e){var t=Ho(this),r=Eo(String(e));if(!cannotHaveUsernamePasswordPort(t)){t.password="";for(var n=0;n<r.length;n++)t.password+=percentEncode(r[n],hi)}})),host:accessorDescriptor(getHost,(function(e){var t=Ho(this);t.cannotBeABaseURL||parseURL(t,String(e),Oi)})),hostname:accessorDescriptor(getHostname,(function(e){var t=Ho(this);t.cannotBeABaseURL||parseURL(t,String(e),ki)})),port:accessorDescriptor(getPort,(function(e){var t=Ho(this);cannotHaveUsernamePasswordPort(t)||(""==(e=String(e))?t.port=null:parseURL(t,e,ji))})),pathname:accessorDescriptor(getPathname,(function(e){var t=Ho(this);t.cannotBeABaseURL||(t.path=[],parseURL(t,e+"",Pi))})),search:accessorDescriptor(getSearch,(function(e){var t=Ho(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",parseURL(t,e,Ui)),Jo(t.searchParams).updateSearchParams(t.query)})),searchParams:accessorDescriptor(getSearchParams),hash:accessorDescriptor(getHash,(function(e){var t=Ho(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",parseURL(t,e,Ci)):t.fragment=null}))}),D(Mi,"toJSON",(function toJSON(){return serializeURL.call(this)}),{enumerable:!0}),D(Mi,"toString",(function toString(){return serializeURL.call(this)}),{enumerable:!0}),Wo){var Gi=Wo.createObjectURL,Ni=Wo.revokeObjectURL;Gi&&D(Fi,"createObjectURL",(function createObjectURL(e){return Gi.apply(Wo,arguments)})),Ni&&D(Fi,"revokeObjectURL",(function revokeObjectURL(e){return Ni.apply(Wo,arguments)}))}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function _next(e){asyncGeneratorStep(i,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}setToStringTag(Fi,"URL"),_export({global:!0,forced:!_o,sham:!r},{URL:Fi}),defineWellKnownSymbol("asyncIterator"),defineWellKnownSymbol("iterator"),defineWellKnownSymbol("toStringTag");var Di=[].reverse,Bi=[1,2];_export({target:"Array",proto:!0,forced:String(Bi)===String(Bi.reverse())},{reverse:function reverse(){return ue(this)&&(this.length=this.length),Di.call(this)}});var qi=arrayMethodHasSpeciesSupport("slice"),$i=arrayMethodUsesToLength("slice",{ACCESSORS:!0,0:0,1:2}),zi=wellKnownSymbol("species"),Vi=[].slice,Wi=Math.max;_export({target:"Array",proto:!0,forced:!qi||!$i},{slice:function slice(e,t){var r,n,o,i=toIndexedObject(this),a=toLength(i.length),c=toAbsoluteIndex(e,a),s=toAbsoluteIndex(void 0===t?a:t,a);if(ue(i)&&("function"!=typeof(r=i.constructor)||r!==Array&&!ue(r.prototype)?isObject(r)&&null===(r=r[zi])&&(r=void 0):r=void 0,r===Array||void 0===r))return Vi.call(i,c,s);for(n=new(void 0===r?Array:r)(Wi(s-c,0)),o=0;c<s;c++,o++)c in i&&createProperty(n,o,i[c]);return n.length=o,n}}),setToStringTag(t.JSON,"JSON",!0),setToStringTag(Math,"Math",!0);var Ki=fails((function(){zt(1)}));_export({target:"Object",stat:!0,forced:Ki,sham:!Bt},{getPrototypeOf:function getPrototypeOf(e){return zt(toObject(e))}}),_export({target:"Object",stat:!0},{setPrototypeOf:Yt});var Ji=RegExp.prototype,Yi=Ji.toString,Hi=fails((function(){return"/a/b"!=Yi.call({source:"a",flags:"b"})})),Xi="toString"!=Yi.name;function __variableDynamicImportRuntime0__(e){switch(e){case"./locale/de.js":return Promise.resolve().then((function(){return ea}));case"./locale/en.js":return Promise.resolve().then((function(){return ta}));case"./locale/fr.js":return Promise.resolve().then((function(){return ra}));case"./locale/pl.js":return Promise.resolve().then((function(){return na}));case"./locale/pt-BR.js":return Promise.resolve().then((function(){return oa}));case"./locale/ro.js":return Promise.resolve().then((function(){return ia}));case"./locale/sk.js":return Promise.resolve().then((function(){return aa}));case"./locale/sl.js":return Promise.resolve().then((function(){return ca}));case"./locale/zh-CN.js":return Promise.resolve().then((function(){return sa}));default:return Promise.reject(new Error("Unknown variable dynamic import: "+e))}}
/**
* @file ext-imagelib.js
*
* @license MIT
*
* @copyright 2010 Alexis Deveria
*
*/(Hi||Xi)&&D(RegExp.prototype,"toString",(function toString(){var e=anObject(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in Ji)?regexpFlags.call(e):r)}),{unsafe:!0}),createCommonjsModule((function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function define(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{define({},"")}catch(e){define=function define(e,t,r){return e[t]=r}}function wrap(e,t,r,n){var o=t&&t.prototype instanceof Generator?t:Generator,i=Object.create(o.prototype),a=new Context(n||[]);return i._invoke=function makeInvokeMethod(e,t,r){var n=s;return function invoke(o,i){if(n===l)throw new Error("Generator is already running");if(n===f){if("throw"===o)throw i;return doneResult()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=maybeInvokeDelegate(a,r);if(c){if(c===p)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===s)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=l;var h=tryCatch(e,t,r);if("normal"===h.type){if(n=r.done?f:u,h.arg===p)continue;return{value:h.arg,done:r.done}}"throw"===h.type&&(n=f,r.method="throw",r.arg=h.arg)}}}(e,r,a),i}function tryCatch(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=wrap;var s="suspendedStart",u="suspendedYield",l="executing",f="completed",p={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var h={};h[i]=function(){return this};var d=Object.getPrototypeOf,g=d&&d(d(values([])));g&&g!==r&&n.call(g,i)&&(h=g);var m=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(h);function defineIteratorMethods(e){["next","throw","return"].forEach((function(t){define(e,t,(function(e){return this._invoke(t,e)}))}))}function AsyncIterator(e,t){var r;this._invoke=function enqueue(o,i){function callInvokeWithMethodAndArg(){return new t((function(r,a){!function invoke(r,o,i,a){var c=tryCatch(e[r],e,o);if("throw"!==c.type){var s=c.arg,u=s.value;return u&&"object"===_typeof(u)&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){invoke("next",e,i,a)}),(function(e){invoke("throw",e,i,a)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return invoke("throw",e,i,a)}))}a(c.arg)}(o,i,r,a)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=tryCatch(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function pushTryEntry(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return a.next=a}}return{next:doneResult}}function doneResult(){return{value:t,done:!0}}return GeneratorFunction.prototype=m.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunction.displayName=define(GeneratorFunctionPrototype,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,c,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[a]=function(){return this},e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},defineIteratorMethods(m),define(m,c,"Generator"),m[i]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function next(){for(;t.length;){var r=t.pop();if(r in e)return next.value=r,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function complete(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function finish(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),p}},catch:function _catch(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));var Zi=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function _callee(e){var t;return regeneratorRuntime.wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,__variableDynamicImportRuntime0__("./locale/".concat(encodeURIComponent(e),".js"));case 3:t=r.sent,r.next=12;break;case 6:return r.prev=6,r.t0=r.catch(0),console.error("Missing translation (".concat(e,") - using 'en'")),r.next=11,Promise.resolve().then((function(){return ta}));case 11:t=r.sent;case 12:return r.abrupt("return",t.default);case 13:case"end":return r.stop()}}),_callee,null,[[0,6]])})));return function loadExtensionTranslation(t){return e.apply(this,arguments)}}(),Qi={name:"imagelib",init:function init(e){var t=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee3(){var r,n,o,i,a,c,s,u,l,f,p,h,d,g,m,v,y,b,w,S,x;return regeneratorRuntime.wrap((function _callee3$(_){for(;;)switch(_.prev=_.next){case 0:return S=function _showBrowser(){var e=r("#imgbrowse");if(e.length)r("#imgbrowse_holder").show();else{r("<div id=imgbrowse_holder><div id=imgbrowse class=toolbar_button></div></div>").insertAfter("#svg_docprops"),e=r("#imgbrowse");var t=a.select_lib,n=r("<ul id=imglib_opts>").appendTo(e),o=r('<iframe src="javascript:0"/>').prependTo(e).hide().wrap("<div id=lib_framewrap>"),i=r("<h1>").prependTo(e).text(t).css({position:"absolute",top:0,left:0,width:"100%"}),s=r("<button>"+c.common.cancel+"</button>").appendTo(e).on("click touchend",(function(){r("#imgbrowse_holder").hide()})).css({position:"absolute",top:5,right:-10}),u=r("<span>").css({position:"absolute",top:5,left:10}).appendTo(e),l=r("<button hidden>"+a.show_list+"</button>").appendTo(u).on("click touchend",(function(){o.attr("src","about:blank").hide(),n.show(),i.text(t),l.hide()})).css({"margin-right":5}).hide();r("<select><option value=s>"+a.import_single+"</option><option value=m>"+a.import_multi+"</option><option value=o>"+a.open+"</option></select>").appendTo(u).change((function(){switch(h=r(this).val()){case"s":case"o":w(!1);break;case"m":w(!0)}})).css({"margin-top":10}),s.prepend(r.getSvgIcon("cancel",!0)),l.prepend(r.getSvgIcon("tool_imagelib",!0)),a.imgLibs.forEach((function(e){var t=e.name,a=e.url,c=e.description;r("<li>").appendTo(n).text(t).on("click touchend",(function(){o.attr("src",a).show(),i.text(t),n.hide(),l.show()})).append("<span>".concat(c,"</span>"))}))}},w=function _toggleMulti(e){r("#lib_framewrap, #imglib_opts").css({right:e?200:10}),m||(m=r("<div id=imglib_preview>").css({position:"absolute",top:45,right:10,width:180,bottom:45,background:"#fff",overflow:"auto"}).insertAfter("#lib_framewrap"),v=r("<button disabled>Import selected</button>").appendTo("#imgbrowse").on("click touchend",(function(){r.each(d,(function(e){var t=this[0],r=this[1];"svg"===t?s.importSvgString(r):f(r),s.moveSelectedElements(20*e,20*e,!1)})),m.empty(),d=[],r("#imgbrowse_holder").hide()})).css({position:"absolute",bottom:10,right:-10})),m.toggle(e),v.toggle(e)},b=function _onMessage3(){return(b=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(e){var t,a,y,b,w,S,x,_,E,O,k,j,L,A,I,P,R;return regeneratorRuntime.wrap((function _callee2$(T){for(;;)switch(T.prev=T.next){case 0:if(t=e.origin,(a=e.data)&&["string","object"].includes(_typeof(a))){T.next=3;break}return T.abrupt("return");case 3:if(T.prev=3,"imagelib"===(a="object"===_typeof(a)?a:JSON.parse(a)).namespace){T.next=7;break}return T.abrupt("return");case 7:if(u.includes("*")||u.includes(t)){T.next=10;break}return console.log("Origin ".concat(t," not whitelisted for posting to ").concat(window.origin)),T.abrupt("return");case 10:if(S="href"in a,(w="name"in a)||!g){T.next=15;break}return g=!1,T.abrupt("return");case 15:S&&(y=a.href,a=a.data),r("#dialog_box").hide(),b=w?"meta":a.charAt(0),T.next=28;break;case 20:if(T.prev=20,T.t0=T.catch(3),"string"!=typeof a){T.next=28;break}if("{"===(x=a.charAt(0))||!g){T.next=27;break}return g=!1,T.abrupt("return");case 27:"|"===x&&(_=a.indexOf("|",1),y=a.substr(1,_-1),a=a.substr(_+1),b=a.charAt(0));case 28:T.t1=b,T.next="meta"===T.t1?31:"<"===T.t1?47:"d"===T.t1?49:60;break;case 31:if(g=!1,p[(O=a).id]=O,L=O.name||"file",A=c.notification.retrieving.replace("%s",L),"m"===h){T.next=43;break}return T.next=39,r.process_cancel(A);case 39:g=!0,r("#dialog_box").hide(),T.next=46;break;case 43:E=r("<div>").text(A).data("id",O.id),m.append(E),O.entry=E;case 46:return T.abrupt("return");case 47:return k=!0,T.abrupt("break",62);case 49:if(!a.startsWith("data:image/svg+xml")){T.next=57;break}return"data:image/svg+xml;base64,",I=a.substring("data:image/svg+xml;base64,".length),a=n(I),k=!0,T.abrupt("break",62);case 57:if(!a.startsWith("data:image/")){T.next=60;break}return j=!0,T.abrupt("break",62);case 60:return"m"!==h?l():p[y].entry.remove(),T.abrupt("return");case 62:T.t2=h,T.next="s"===T.t2?65:"m"===T.t2?68:"o"===T.t2?72:83;break;case 65:return k?s.importSvgString(a):j&&f(a),l(),T.abrupt("break",83);case 68:return d.push([k?"svg":"img",a]),O=p[y],k?(O&&O.name?P=O.name:(R=(new DOMParser).parseFromString(o(a),"text/xml").documentElement,P=r(R).children("title").first().text()||"(SVG #"+a.length+")"),O?m.children().each((function(){r(this).data("id")===y&&(O.preview_url?r(this).html(r("<span>").append(r("<img>").attr("src",O.preview_url),P)):r(this).text(P),v.removeAttr("disabled"))})):(m.append(r("<div>").text(P)),v.removeAttr("disabled"))):(O&&O.preview_url?(P=O.name||"",E=r("<span>").append(r("<img>").attr("src",O.preview_url),P)):E=r("<img>").attr("src",a),O?m.children().each((function(){r(this).data("id")===y&&(r(this).html(E),v.removeAttr("disabled"))})):(m.append(r("<div>").append(E)),v.removeAttr("disabled"))),T.abrupt("break",83);case 72:if(k){T.next=74;break}return T.abrupt("break",83);case 74:return l(),T.next=77,i.openPrep();case 77:if(T.sent){T.next=80;break}return T.abrupt("return");case 80:return s.clear(),s.setSvgString(a),T.abrupt("break",83);case 83:case"end":return T.stop()}}),_callee2,null,[[3,20]])})))).apply(this,arguments)},y=function _onMessage2(e){return b.apply(this,arguments)},f=function _importImage(e){var t=s.addSVGElementFromJson({element:"image",attr:{x:0,y:0,width:0,height:0,id:s.getNextId(),style:"pointer-events:inherit"}});s.clearSelection(),s.addToSelection([t]),s.setImageURL(e)},l=function _closeBrowser(){r("#imgbrowse_holder").hide(),document.activeElement.blur()},r=e.$,n=e.decode64,o=e.dropXMLInternalSubset,i=t,_.next=10,Zi(i.curPrefs.lang);case 10:return a=_.sent,c=i.uiStrings,s=i.canvas,u=a.imgLibs.map((function(e){var t=e.url;try{return new URL(t).origin}catch(e){return location.origin}})),p={},h="s",d=[],g=!1,window.addEventListener("message",y,!0),x=[{id:"tool_imagelib",type:"app_menu",icon:"imagelib.png",position:4,events:{mouseup:S}}],_.abrupt("return",{svgicons:"ext-imagelib.xml",buttons:a.buttons.map((function(e,t){return Object.assign(x[t],e)})),callback:function callback(){r("<style>").text("#imgbrowse_holder {position: absolute;top: 0;left: 0;width: 100%;height: 100%;background-color: rgba(0, 0, 0, .5);z-index: 5;}#imgbrowse {position: absolute;top: 25px;left: 25px;right: 25px;bottom: 25px;min-width: 300px;min-height: 200px;background: #B0B0B0;border: 1px outset #777;}#imgbrowse h1 {font-size: 20px;margin: .4em;text-align: center;}#lib_framewrap,#imgbrowse > ul {position: absolute;top: 45px;left: 10px;right: 10px;bottom: 10px;background: white;margin: 0;padding: 0;}#imgbrowse > ul {overflow: auto;}#imgbrowse > div {border: 1px solid #666;}#imglib_preview > div {padding: 5px;font-size: 12px;}#imglib_preview img {display: block;margin: 0 auto;max-height: 100px;}#imgbrowse li {list-style: none;padding: .5em;background: #E8E8E8;border-bottom: 1px solid #B0B0B0;line-height: 1.2em;font-style: sans-serif;}#imgbrowse li > span {color: #666;font-size: 15px;display: block;}#imgbrowse li:hover {background: #FFC;cursor: pointer;}#imgbrowse iframe {width: 100%;height: 100%;border: 0;}").appendTo("head")}});case 20:case"end":return _.stop()}}),_callee3)})))()}},ea=Object.freeze({__proto__:null,default:{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Bilder-Bibliothek"}],imgLibs:[{name:"Demo library (local)",url:"extensions/ext-imagelib/index.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]}}),ta=Object.freeze({__proto__:null,default:{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Image library"}],imgLibs:[{name:"Demo library (local)",url:"extensions/ext-imagelib/index.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]}}),ra=Object.freeze({__proto__:null,default:{select_lib:"Choisir une bibliothèque d'images",show_list:"show_list",import_single:"import_single",import_multi:"import_multi",open:"open",buttons:[{title:"Bibliothèque d'images"}],imgLibs:[{name:"Demo library (local)",url:"extensions/ext-imagelib/index.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]}}),na=Object.freeze({__proto__:null,default:{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Biblioteka obrazów"}],imgLibs:[{name:"Demo library (local)",url:"extensions/ext-imagelib/index.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]}}),oa=Object.freeze({__proto__:null,default:{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Biblioteca de Imagens"}],imgLibs:[{name:"Demo library (local)",url:"extensions/ext-imagelib/index.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]}}),ia=Object.freeze({__proto__:null,default:{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Bibliotecă de Imagini"}],imgLibs:[{name:"Demo library (local)",url:"extensions/ext-imagelib/index.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]}}),aa=Object.freeze({__proto__:null,default:{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Knižnica obrázkov"}],imgLibs:[{name:"Demo library (local)",url:"extensions/ext-imagelib/index.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]}}),ca=Object.freeze({__proto__:null,default:{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Knjižnica slik"}],imgLibs:[{name:"Demo library (local)",url:"extensions/ext-imagelib/index.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]}}),sa=Object.freeze({__proto__:null,default:{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"图像库"}],imgLibs:[{name:"Demo library (local)",url:"extensions/ext-imagelib/index.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]}});export default Qi;
//# sourceMappingURL=ext-imagelib.js.map