@gby/deep-copy
Version:
deep-copy 深拷贝,可对任意数据进行深度拷贝,包括 函数 function、正则 RegExp、Map、Set、Date、Array、URL 等等;支持含循环引用对象的拷贝,并且不会丢失成员的引用关系 和 类型信息,支持扩展,可根据数据类型定制拷贝逻辑,也可指定拷贝深度;所以,通过它可实现对任意类型的数据进行任意想要的拷贝
31 lines (26 loc) • 39.7 kB
JavaScript
var deepCopy=function(t){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function e(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(t){switch(t){case void 0:return"undefined";case null:return"null"}let e=typeof t;switch(e){case"function":return t.name;case"string":return t;default:return e}}function n(t){switch(t.constructor.name){case"Map":var e=Array.from(t);break;case"Array":e=t;break;default:e=Object.entries(t)}return e}function o(t){let e=function(t){return n(t).reduce((function(t,e){let n=e[0],o=e[1];return(Array.isArray(n)?n:[n]).forEach((function(e){t.push(["string"==typeof e?e:r(e),o])})),t}),[])}(t);return Object.fromEntries(e)}var i=function(t){try{return!!t()}catch(t){return!0}},u={}.toString,c=function(t){return u.call(t).slice(8,-1)},a="".split,f=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==c(t)?a.call(t,""):Object(t)}:Object,l=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},s=function(t){return f(l(t))},p={},v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(t){var e={exports:{}};return t(e,e.exports),e.exports}var h=function(t){return t&&t.Math==Math&&t},d=h("object"==typeof globalThis&&globalThis)||h("object"==typeof window&&window)||h("object"==typeof self&&self)||h("object"==typeof v&&v)||function(){return this}()||Function("return this")(),g=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),m=function(t){return"object"==typeof t?null!==t:"function"==typeof t},b=d.document,w=m(b)&&m(b.createElement),O=function(t){return w?b.createElement(t):{}},S=!g&&!i((function(){return 7!=Object.defineProperty(O("div"),"a",{get:function(){return 7}}).a})),j=function(t){if(!m(t))throw TypeError(String(t)+" is not an object");return t},A=function(t,e){if(!m(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!m(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!m(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!m(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},P=Object.defineProperty,T={f:g?P:function(t,e,r){if(j(t),e=A(e,!0),j(r),S)try{return P(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}},E=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},C=g?function(t,e,r){return T.f(t,e,E(1,r))}:function(t,e,r){return t[e]=r,t},x="__core-js_shared__",M=d[x]||function(t,e){try{C(d,t,e)}catch(r){d[t]=e}return e}(x,{}),F=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return F.call(t)});var _,k,I,L=M.inspectSource,D=d.WeakMap,R="function"==typeof D&&/native code/.test(L(D)),N={}.hasOwnProperty,G=function(t,e){return N.call(t,e)},V=y((function(t){(t.exports=function(t,e){return M[t]||(M[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.8.3",mode:"pure",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),B=0,J=Math.random(),$=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++B+J).toString(36)},z=V("keys"),U=function(t){return z[t]||(z[t]=$(t))},W={},H=d.WeakMap;if(R){var Y=M.state||(M.state=new H),q=Y.get,Z=Y.has,K=Y.set;_=function(t,e){return e.facade=t,K.call(Y,t,e),e},k=function(t){return q.call(Y,t)||{}},I=function(t){return Z.call(Y,t)}}else{var Q=U("state");W[Q]=!0,_=function(t,e){return e.facade=t,C(t,Q,e),e},k=function(t){return G(t,Q)?t[Q]:{}},I=function(t){return G(t,Q)}}var X,tt,et,rt={set:_,get:k,has:I,enforce:function(t){return I(t)?k(t):_(t,{})},getterFor:function(t){return function(e){var r;if(!m(e)||(r=k(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},nt={}.propertyIsEnumerable,ot=Object.getOwnPropertyDescriptor,it={f:ot&&!nt.call({1:2},1)?function(t){var e=ot(this,t);return!!e&&e.enumerable}:nt},ut=Object.getOwnPropertyDescriptor,ct={f:g?ut:function(t,e){if(t=s(t),e=A(e,!0),S)try{return ut(t,e)}catch(t){}if(G(t,e))return E(!it.f.call(t,e),t[e])}},at=/#|\.prototype\./,ft=function(t,e){var r=st[lt(t)];return r==vt||r!=pt&&("function"==typeof e?i(e):!!e)},lt=ft.normalize=function(t){return String(t).replace(at,".").toLowerCase()},st=ft.data={},pt=ft.NATIVE="N",vt=ft.POLYFILL="P",yt=ft,ht={},dt=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},gt=function(t,e,r){if(dt(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,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}},mt=ct.f,bt=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},wt=function(t,e){var r,n,o,i,u,c,a,f,l=t.target,s=t.global,p=t.stat,v=t.proto,y=s?d:p?d[l]:(d[l]||{}).prototype,h=s?ht:ht[l]||(ht[l]={}),g=h.prototype;for(o in e)r=!yt(s?o:l+(p?".":"#")+o,t.forced)&&y&&G(y,o),u=h[o],r&&(c=t.noTargetGet?(f=mt(y,o))&&f.value:y[o]),i=r&&c?c:e[o],r&&typeof u==typeof i||(a=t.bind&&r?gt(i,d):t.wrap&&r?bt(i):v&&"function"==typeof i?gt(Function.call,i):i,(t.sham||i&&i.sham||u&&u.sham)&&C(a,"sham",!0),h[o]=a,v&&(G(ht,n=l+"Prototype")||C(ht,n,{}),ht[n][o]=i,t.real&&g&&!g[o]&&C(g,o,i)))},Ot=function(t){return Object(l(t))},St=!i((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),jt=U("IE_PROTO"),At=Object.prototype,Pt=St?Object.getPrototypeOf:function(t){return t=Ot(t),G(t,jt)?t[jt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?At:null},Tt=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),Et=Tt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ct=V("wks"),xt=d.Symbol,Mt=Et?xt:xt&&xt.withoutSetter||$,Ft=function(t){return G(Ct,t)||(Tt&&G(xt,t)?Ct[t]=xt[t]:Ct[t]=Mt("Symbol."+t)),Ct[t]},_t=Ft("iterator"),kt=!1;[].keys&&("next"in(et=[].keys())?(tt=Pt(Pt(et)))!==Object.prototype&&(X=tt):kt=!0);var It=null==X||i((function(){var t={};return X[_t].call(t)!==t}));It&&(X={}),It&&!G(X,_t)&&C(X,_t,(function(){return this}));var Lt,Dt={IteratorPrototype:X,BUGGY_SAFARI_ITERATORS:kt},Rt=Math.ceil,Nt=Math.floor,Gt=function(t){return isNaN(t=+t)?0:(t>0?Nt:Rt)(t)},Vt=Math.min,Bt=function(t){return t>0?Vt(Gt(t),9007199254740991):0},Jt=Math.max,$t=Math.min,zt=function(t,e){var r=Gt(t);return r<0?Jt(r+e,0):$t(r,e)},Ut=function(t){return function(e,r,n){var o,i=s(e),u=Bt(i.length),c=zt(n,u);if(t&&r!=r){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===r)return t||c||0;return!t&&-1}},Wt={includes:Ut(!0),indexOf:Ut(!1)},Ht=Wt.indexOf,Yt=function(t,e){var r,n=s(t),o=0,i=[];for(r in n)!G(W,r)&&G(n,r)&&i.push(r);for(;e.length>o;)G(n,r=e[o++])&&(~Ht(i,r)||i.push(r));return i},qt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Zt=Object.keys||function(t){return Yt(t,qt)},Kt=g?Object.defineProperties:function(t,e){j(t);for(var r,n=Zt(e),o=n.length,i=0;o>i;)T.f(t,r=n[i++],e[r]);return t},Qt=function(t){return"function"==typeof t?t:void 0},Xt=function(t,e){return arguments.length<2?Qt(ht[t])||Qt(d[t]):ht[t]&&ht[t][e]||d[t]&&d[t][e]},te=Xt("document","documentElement"),ee=U("IE_PROTO"),re=function(){},ne=function(t){return"<script>"+t+"</"+"script>"},oe=function(){try{Lt=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;oe=Lt?function(t){t.write(ne("")),t.close();var e=t.parentWindow.Object;return t=null,e}(Lt):((e=O("iframe")).style.display="none",te.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(ne("document.F=Object")),t.close(),t.F);for(var r=qt.length;r--;)delete oe.prototype[qt[r]];return oe()};W[ee]=!0;var ie=Object.create||function(t,e){var r;return null!==t?(re.prototype=j(t),r=new re,re.prototype=null,r[ee]=t):r=oe(),void 0===e?r:Kt(r,e)},ue={};ue[Ft("toStringTag")]="z";var ce="[object z]"===String(ue),ae=Ft("toStringTag"),fe="Arguments"==c(function(){return arguments}()),le=ce?c:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ae))?r:fe?c(e):"Object"==(n=c(e))&&"function"==typeof e.callee?"Arguments":n},se=ce?{}.toString:function(){return"[object "+le(this)+"]"},pe=T.f,ve=Ft("toStringTag"),ye=function(t,e,r,n){if(t){var o=r?t:t.prototype;G(o,ve)||pe(o,ve,{configurable:!0,value:e}),n&&!ce&&C(o,"toString",se)}},he=Dt.IteratorPrototype,de=function(){return this},ge=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return j(r),function(t){if(!m(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),me=function(t,e,r,n){n&&n.enumerable?t[e]=r:C(t,e,r)},be=Dt.IteratorPrototype,we=Dt.BUGGY_SAFARI_ITERATORS,Oe=Ft("iterator"),Se="keys",je="values",Ae="entries",Pe=function(){return this},Te=function(t,e,r,n,o,i,u){!function(t,e,r){var n=e+" Iterator";t.prototype=ie(he,{next:E(1,r)}),ye(t,n,!1,!0),p[n]=de}(r,e,n);var c,a,f,l=function(t){if(t===o&&d)return d;if(!we&&t in y)return y[t];switch(t){case Se:case je:case Ae:return function(){return new r(this,t)}}return function(){return new r(this)}},s=e+" Iterator",v=!1,y=t.prototype,h=y[Oe]||y["@@iterator"]||o&&y[o],d=!we&&h||l(o),g="Array"==e&&y.entries||h;if(g&&(c=Pt(g.call(new t)),be!==Object.prototype&&c.next&&(ye(c,s,!0,!0),p[s]=Pe)),o==je&&h&&h.name!==je&&(v=!0,d=function(){return h.call(this)}),u&&y[Oe]!==d&&C(y,Oe,d),p[e]=d,o)if(a={values:l(je),keys:i?d:l(Se),entries:l(Ae)},u)for(f in a)(we||v||!(f in y))&&me(y,f,a[f]);else wt({target:e,proto:!0,forced:we||v},a);return a},Ee="Array Iterator",Ce=rt.set,xe=rt.getterFor(Ee);Te(Array,"Array",(function(t,e){Ce(this,{type:Ee,target:s(t),index:0,kind:e})}),(function(){var t=xe(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),p.Arguments=p.Array;var Me=Ft("toStringTag");for(var Fe in{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}){var _e=d[Fe],ke=_e&&_e.prototype;ke&&le(ke)!==Me&&C(ke,Me,Fe),p[Fe]=p.Array}var Ie=function(t){return function(e,r){var n,o,i=String(l(e)),u=Gt(r),c=i.length;return u<0||u>=c?t?"":void 0:(n=i.charCodeAt(u))<55296||n>56319||u+1===c||(o=i.charCodeAt(u+1))<56320||o>57343?t?i.charAt(u):n:t?i.slice(u,u+2):o-56320+(n-55296<<10)+65536}},Le={codeAt:Ie(!1),charAt:Ie(!0)}.charAt,De="String Iterator",Re=rt.set,Ne=rt.getterFor(De);Te(String,"String",(function(t){Re(this,{type:De,string:String(t),index:0})}),(function(){var t,e=Ne(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=Le(r,n),e.index+=t.length,{value:t,done:!1})}));var Ge,Ve,Be=Ft("iterator"),Je=function(t){if(null!=t)return t[Be]||t["@@iterator"]||p[le(t)]},$e=Array.isArray||function(t){return"Array"==c(t)},ze=function(t,e,r){var n=A(e);n in t?T.f(t,n,E(0,r)):t[n]=r},Ue=Ft("species"),We=function(t,e){var r;return $e(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!$e(r.prototype)?m(r)&&null===(r=r[Ue])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===e?0:e)},He=Xt("navigator","userAgent")||"",Ye=d.process,qe=Ye&&Ye.versions,Ze=qe&&qe.v8;Ze?Ve=(Ge=Ze.split("."))[0]+Ge[1]:He&&(!(Ge=He.match(/Edge\/(\d+)/))||Ge[1]>=74)&&(Ge=He.match(/Chrome\/(\d+)/))&&(Ve=Ge[1]);var Ke=Ve&&+Ve,Qe=Ft("species"),Xe=function(t){return Ke>=51||!i((function(){var e=[];return(e.constructor={})[Qe]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},tr=Ft("isConcatSpreadable"),er=9007199254740991,rr="Maximum allowed index exceeded",nr=Ke>=51||!i((function(){var t=[];return t[tr]=!1,t.concat()[0]!==t})),or=Xe("concat"),ir=function(t){if(!m(t))return!1;var e=t[tr];return void 0!==e?!!e:$e(t)};wt({target:"Array",proto:!0,forced:!nr||!or},{concat:function(t){var e,r,n,o,i,u=Ot(this),c=We(u,0),a=0;for(e=-1,n=arguments.length;e<n;e++)if(ir(i=-1===e?u:arguments[e])){if(a+(o=Bt(i.length))>er)throw TypeError(rr);for(r=0;r<o;r++,a++)r in i&&ze(c,a,i[r])}else{if(a>=er)throw TypeError(rr);ze(c,a++,i)}return c.length=a,c}});var ur=qt.concat("length","prototype"),cr={f:Object.getOwnPropertyNames||function(t){return Yt(t,ur)}},ar=cr.f,fr={}.toString,lr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],sr={f:function(t){return lr&&"[object Window]"==fr.call(t)?function(t){try{return ar(t)}catch(t){return lr.slice()}}(t):ar(s(t))}},pr={f:Object.getOwnPropertySymbols},vr={f:Ft},yr=T.f,hr=function(t){var e=ht.Symbol||(ht.Symbol={});G(e,t)||yr(e,t,{value:vr.f(t)})},dr=[].push,gr=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,u=7==t,c=5==t||i;return function(a,l,s,p){for(var v,y,h=Ot(a),d=f(h),g=gt(l,s,3),m=Bt(d.length),b=0,w=p||We,O=e?w(a,m):r||u?w(a,0):void 0;m>b;b++)if((c||b in d)&&(y=g(v=d[b],b,h),t))if(e)O[b]=y;else if(y)switch(t){case 3:return!0;case 5:return v;case 6:return b;case 2:dr.call(O,v)}else switch(t){case 4:return!1;case 7:dr.call(O,v)}return i?-1:n||o?o:O}},mr={forEach:gr(0),map:gr(1),filter:gr(2),some:gr(3),every:gr(4),find:gr(5),findIndex:gr(6),filterOut:gr(7)},br=mr.forEach,wr=U("hidden"),Or="Symbol",Sr=Ft("toPrimitive"),jr=rt.set,Ar=rt.getterFor(Or),Pr=Object.prototype,Tr=d.Symbol,Er=Xt("JSON","stringify"),Cr=ct.f,xr=T.f,Mr=sr.f,Fr=it.f,_r=V("symbols"),kr=V("op-symbols"),Ir=V("string-to-symbol-registry"),Lr=V("symbol-to-string-registry"),Dr=V("wks"),Rr=d.QObject,Nr=!Rr||!Rr.prototype||!Rr.prototype.findChild,Gr=g&&i((function(){return 7!=ie(xr({},"a",{get:function(){return xr(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=Cr(Pr,e);n&&delete Pr[e],xr(t,e,r),n&&t!==Pr&&xr(Pr,e,n)}:xr,Vr=function(t,e){var r=_r[t]=ie(Tr.prototype);return jr(r,{type:Or,tag:t,description:e}),g||(r.description=e),r},Br=Et?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof Tr},Jr=function(t,e,r){t===Pr&&Jr(kr,e,r),j(t);var n=A(e,!0);return j(r),G(_r,n)?(r.enumerable?(G(t,wr)&&t[wr][n]&&(t[wr][n]=!1),r=ie(r,{enumerable:E(0,!1)})):(G(t,wr)||xr(t,wr,E(1,{})),t[wr][n]=!0),Gr(t,n,r)):xr(t,n,r)},$r=function(t,e){j(t);var r=s(e),n=Zt(r).concat(Hr(r));return br(n,(function(e){g&&!zr.call(r,e)||Jr(t,e,r[e])})),t},zr=function(t){var e=A(t,!0),r=Fr.call(this,e);return!(this===Pr&&G(_r,e)&&!G(kr,e))&&(!(r||!G(this,e)||!G(_r,e)||G(this,wr)&&this[wr][e])||r)},Ur=function(t,e){var r=s(t),n=A(e,!0);if(r!==Pr||!G(_r,n)||G(kr,n)){var o=Cr(r,n);return!o||!G(_r,n)||G(r,wr)&&r[wr][n]||(o.enumerable=!0),o}},Wr=function(t){var e=Mr(s(t)),r=[];return br(e,(function(t){G(_r,t)||G(W,t)||r.push(t)})),r},Hr=function(t){var e=t===Pr,r=Mr(e?kr:s(t)),n=[];return br(r,(function(t){!G(_r,t)||e&&!G(Pr,t)||n.push(_r[t])})),n};if(Tt||(me((Tr=function(){if(this instanceof Tr)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=$(t),r=function(t){this===Pr&&r.call(kr,t),G(this,wr)&&G(this[wr],e)&&(this[wr][e]=!1),Gr(this,e,E(1,t))};return g&&Nr&&Gr(Pr,e,{configurable:!0,set:r}),Vr(e,t)}).prototype,"toString",(function(){return Ar(this).tag})),me(Tr,"withoutSetter",(function(t){return Vr($(t),t)})),it.f=zr,T.f=Jr,ct.f=Ur,cr.f=sr.f=Wr,pr.f=Hr,vr.f=function(t){return Vr(Ft(t),t)},g&&xr(Tr.prototype,"description",{configurable:!0,get:function(){return Ar(this).description}})),wt({global:!0,wrap:!0,forced:!Tt,sham:!Tt},{Symbol:Tr}),br(Zt(Dr),(function(t){hr(t)})),wt({target:Or,stat:!0,forced:!Tt},{for:function(t){var e=String(t);if(G(Ir,e))return Ir[e];var r=Tr(e);return Ir[e]=r,Lr[r]=e,r},keyFor:function(t){if(!Br(t))throw TypeError(t+" is not a symbol");if(G(Lr,t))return Lr[t]},useSetter:function(){Nr=!0},useSimple:function(){Nr=!1}}),wt({target:"Object",stat:!0,forced:!Tt,sham:!g},{create:function(t,e){return void 0===e?ie(t):$r(ie(t),e)},defineProperty:Jr,defineProperties:$r,getOwnPropertyDescriptor:Ur}),wt({target:"Object",stat:!0,forced:!Tt},{getOwnPropertyNames:Wr,getOwnPropertySymbols:Hr}),wt({target:"Object",stat:!0,forced:i((function(){pr.f(1)}))},{getOwnPropertySymbols:function(t){return pr.f(Ot(t))}}),Er){var Yr=!Tt||i((function(){var t=Tr();return"[null]"!=Er([t])||"{}"!=Er({a:t})||"{}"!=Er(Object(t))}));wt({target:"JSON",stat:!0,forced:Yr},{stringify:function(t,e,r){for(var n,o=[t],i=1;arguments.length>i;)o.push(arguments[i++]);if(n=e,(m(e)||void 0!==t)&&!Br(t))return $e(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Br(e))return e}),o[1]=e,Er.apply(null,o)}})}Tr.prototype[Sr]||C(Tr.prototype,Sr,Tr.prototype.valueOf),ye(Tr,Or),W[wr]=!0,hr("asyncIterator"),hr("hasInstance"),hr("isConcatSpreadable"),hr("iterator"),hr("match"),hr("matchAll"),hr("replace"),hr("search"),hr("species"),hr("split"),hr("toPrimitive"),hr("toStringTag"),hr("unscopables"),ye(d.JSON,"JSON",!0);var qr=function(t){var e=t.return;if(void 0!==e)return j(e.call(t)).value},Zr=function(t,e,r,n){try{return n?e(j(r)[0],r[1]):e(r)}catch(e){throw qr(t),e}},Kr=Ft("iterator"),Qr=Array.prototype,Xr=function(t){return void 0!==t&&(p.Array===t||Qr[Kr]===t)},tn=Ft("iterator"),en=!1;try{var rn=0,nn={next:function(){return{done:!!rn++}},return:function(){en=!0}};nn[tn]=function(){return this},Array.from(nn,(function(){throw 2}))}catch(t){}var on=function(t,e){if(!e&&!en)return!1;var r=!1;try{var n={};n[tn]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},un=!on((function(t){Array.from(t)}));wt({target:"Array",stat:!0,forced:un},{from:function(t){var e,r,n,o,i,u,c=Ot(t),a="function"==typeof this?this:Array,f=arguments.length,l=f>1?arguments[1]:void 0,s=void 0!==l,p=Je(c),v=0;if(s&&(l=gt(l,f>2?arguments[2]:void 0,2)),null==p||a==Array&&Xr(p))for(r=new a(e=Bt(c.length));e>v;v++)u=s?l(c[v],v):c[v],ze(r,v,u);else for(i=(o=p.call(c)).next,r=new a;!(n=i.call(o)).done;v++)u=s?Zr(o,l,[n.value,v],!0):n.value,ze(r,v,u);return r.length=v,r}}),ht.Array.from;var cn=Object.defineProperty,an={},fn=function(t){throw t},ln=function(t,e){if(G(an,t))return an[t];e||(e={});var r=[][t],n=!!G(e,"ACCESSORS")&&e.ACCESSORS,o=G(e,0)?e[0]:fn,u=G(e,1)?e[1]:void 0;return an[t]=!!r&&!i((function(){if(n&&!g)return!0;var t={length:-1};n?cn(t,1,{enumerable:!0,get:fn}):t[1]=1,r.call(t,o,u)}))},sn=Xe("slice"),pn=ln("slice",{ACCESSORS:!0,0:0,1:2}),vn=Ft("species"),yn=[].slice,hn=Math.max;wt({target:"Array",proto:!0,forced:!sn||!pn},{slice:function(t,e){var r,n,o,i=s(this),u=Bt(i.length),c=zt(t,u),a=zt(void 0===e?u:e,u);if($e(i)&&("function"!=typeof(r=i.constructor)||r!==Array&&!$e(r.prototype)?m(r)&&null===(r=r[vn])&&(r=void 0):r=void 0,r===Array||void 0===r))return yn.call(i,c,a);for(n=new(void 0===r?Array:r)(hn(a-c,0)),o=0;c<a;c++,o++)c in i&&ze(n,o,i[c]);return n.length=o,n}});var dn=function(t){return ht[t+"Prototype"]};dn("Array").slice;var gn=i((function(){Zt(1)}));wt({target:"Object",stat:!0,forced:gn},{keys:function(t){return Zt(Ot(t))}}),ht.Object.keys;var mn=function(t,e){var r=[][t];return!!r&&i((function(){r.call(null,e||function(){throw 1},1)}))},bn=mr.forEach,wn=mn("forEach"),On=ln("forEach"),Sn=wn&&On?[].forEach:function(t){return bn(this,t,arguments.length>1?arguments[1]:void 0)};wt({target:"Array",proto:!0,forced:[].forEach!=Sn},{forEach:Sn}),dn("Array").forEach;var jn=function(t){return function(e,r,n,o){dt(r);var i=Ot(e),u=f(i),c=Bt(i.length),a=t?c-1:0,l=t?-1:1;if(n<2)for(;;){if(a in u){o=u[a],a+=l;break}if(a+=l,t?a<0:c<=a)throw TypeError("Reduce of empty array with no initial value")}for(;t?a>=0:c>a;a+=l)a in u&&(o=r(o,u[a],a,i));return o}},An={left:jn(!1),right:jn(!0)},Pn="process"==c(d.process),Tn=An.left,En=mn("reduce"),Cn=ln("reduce",{1:0});wt({target:"Array",proto:!0,forced:!En||!Cn||!Pn&&Ke>79&&Ke<83},{reduce:function(t){return Tn(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}}),dn("Array").reduce,wt({target:"Array",stat:!0},{isArray:$e}),ht.Array.isArray;var xn=function(t,e){this.stopped=t,this.result=e},Mn=function(t,e,r){var n,o,i,u,c,a,f,l=r&&r.that,s=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_ITERATOR),v=!(!r||!r.INTERRUPTED),y=gt(e,l,1+s+v),h=function(t){return n&&qr(n),new xn(!0,t)},d=function(t){return s?(j(t),v?y(t[0],t[1],h):y(t[0],t[1])):v?y(t,h):y(t)};if(p)n=t;else{if("function"!=typeof(o=Je(t)))throw TypeError("Target is not iterable");if(Xr(o)){for(i=0,u=Bt(t.length);u>i;i++)if((c=d(t[i]))&&c instanceof xn)return c;return new xn(!1)}n=o.call(t)}for(a=n.next;!(f=a.call(n)).done;){try{c=d(f.value)}catch(t){throw qr(n),t}if("object"==typeof c&&c&&c instanceof xn)return c}return new xn(!1)},Fn=function(t,e){var r=this;if(!(r instanceof Fn))return new Fn(t,e);ge&&(r=ge(new Error(void 0),Pt(r))),void 0!==e&&C(r,"message",String(e));var n=[];return Mn(t,n.push,{that:n}),C(r,"errors",n),r};Fn.prototype=ie(Error.prototype,{constructor:E(5,Fn),message:E(5,""),name:E(5,"AggregateError")}),wt({global:!0},{AggregateError:Fn});var _n,kn,In,Ln=d.Promise,Dn=Ft("species"),Rn=Ft("species"),Nn=function(t,e){var r,n=j(t).constructor;return void 0===n||null==(r=j(n)[Rn])?e:dt(r)},Gn=/(iphone|ipod|ipad).*applewebkit/i.test(He),Vn=d.location,Bn=d.setImmediate,Jn=d.clearImmediate,$n=d.process,zn=d.MessageChannel,Un=d.Dispatch,Wn=0,Hn={},Yn="onreadystatechange",qn=function(t){if(Hn.hasOwnProperty(t)){var e=Hn[t];delete Hn[t],e()}},Zn=function(t){return function(){qn(t)}},Kn=function(t){qn(t.data)},Qn=function(t){d.postMessage(t+"",Vn.protocol+"//"+Vn.host)};Bn&&Jn||(Bn=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return Hn[++Wn]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},_n(Wn),Wn},Jn=function(t){delete Hn[t]},Pn?_n=function(t){$n.nextTick(Zn(t))}:Un&&Un.now?_n=function(t){Un.now(Zn(t))}:zn&&!Gn?(In=(kn=new zn).port2,kn.port1.onmessage=Kn,_n=gt(In.postMessage,In,1)):d.addEventListener&&"function"==typeof postMessage&&!d.importScripts&&Vn&&"file:"!==Vn.protocol&&!i(Qn)?(_n=Qn,d.addEventListener("message",Kn,!1)):_n=Yn in O("script")?function(t){te.appendChild(O("script")).onreadystatechange=function(){te.removeChild(this),qn(t)}}:function(t){setTimeout(Zn(t),0)});var Xn,to,eo,ro,no,oo,io,uo,co={set:Bn,clear:Jn},ao=/web0s(?!.*chrome)/i.test(He),fo=ct.f,lo=co.set,so=d.MutationObserver||d.WebKitMutationObserver,po=d.document,vo=d.process,yo=d.Promise,ho=fo(d,"queueMicrotask"),go=ho&&ho.value;go||(Xn=function(){var t,e;for(Pn&&(t=vo.domain)&&t.exit();to;){e=to.fn,to=to.next;try{e()}catch(t){throw to?ro():eo=void 0,t}}eo=void 0,t&&t.enter()},Gn||Pn||ao||!so||!po?yo&&yo.resolve?(io=yo.resolve(void 0),uo=io.then,ro=function(){uo.call(io,Xn)}):ro=Pn?function(){vo.nextTick(Xn)}:function(){lo.call(d,Xn)}:(no=!0,oo=po.createTextNode(""),new so(Xn).observe(oo,{characterData:!0}),ro=function(){oo.data=no=!no}));var mo=go||function(t){var e={fn:t,next:void 0};eo&&(eo.next=e),to||(to=e,ro()),eo=e},bo=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=dt(e),this.reject=dt(r)},wo={f:function(t){return new bo(t)}},Oo=function(t,e){if(j(t),m(e)&&e.constructor===t)return e;var r=wo.f(t);return(0,r.resolve)(e),r.promise},So=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},jo=co.set,Ao=Ft("species"),Po="Promise",To=rt.get,Eo=rt.set,Co=rt.getterFor(Po),xo=Ln,Mo=d.TypeError,Fo=d.document,_o=d.process;Xt("fetch");var ko,Io,Lo,Do=wo.f,Ro=Do,No=!!(Fo&&Fo.createEvent&&d.dispatchEvent),Go="function"==typeof PromiseRejectionEvent,Vo="unhandledrejection",Bo=yt(Po,(function(){if(!(L(xo)!==String(xo))){if(66===Ke)return!0;if(!Pn&&!Go)return!0}if(!xo.prototype.finally)return!0;if(Ke>=51&&/native code/.test(xo))return!1;var t=xo.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[Ao]=e,!(t.then((function(){}))instanceof e)})),Jo=Bo||!on((function(t){xo.all(t).catch((function(){}))})),$o=function(t){var e;return!(!m(t)||"function"!=typeof(e=t.then))&&e},zo=function(t,e){if(!t.notified){t.notified=!0;var r=t.reactions;mo((function(){for(var n=t.value,o=1==t.state,i=0;r.length>i;){var u,c,a,f=r[i++],l=o?f.ok:f.fail,s=f.resolve,p=f.reject,v=f.domain;try{l?(o||(2===t.rejection&&Yo(t),t.rejection=1),!0===l?u=n:(v&&v.enter(),u=l(n),v&&(v.exit(),a=!0)),u===f.promise?p(Mo("Promise-chain cycle")):(c=$o(u))?c.call(u,s,p):s(u)):p(n)}catch(t){v&&!a&&v.exit(),p(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&Wo(t)}))}},Uo=function(t,e,r){var n,o;No?((n=Fo.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),d.dispatchEvent(n)):n={promise:e,reason:r},!Go&&(o=d["on"+t])?o(n):t===Vo&&function(t,e){var r=d.console;r&&r.error&&(1===arguments.length?r.error(t):r.error(t,e))}("Unhandled promise rejection",r)},Wo=function(t){jo.call(d,(function(){var e,r=t.facade,n=t.value;if(Ho(t)&&(e=So((function(){Pn?_o.emit("unhandledRejection",n,r):Uo(Vo,r,n)})),t.rejection=Pn||Ho(t)?2:1,e.error))throw e.value}))},Ho=function(t){return 1!==t.rejection&&!t.parent},Yo=function(t){jo.call(d,(function(){var e=t.facade;Pn?_o.emit("rejectionHandled",e):Uo("rejectionhandled",e,t.value)}))},qo=function(t,e,r){return function(n){t(e,n,r)}},Zo=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,zo(t,!0))},Ko=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw Mo("Promise can't be resolved itself");var n=$o(e);n?mo((function(){var r={done:!1};try{n.call(e,qo(Ko,r,t),qo(Zo,r,t))}catch(e){Zo(r,e,t)}})):(t.value=e,t.state=1,zo(t,!1))}catch(e){Zo({done:!1},e,t)}}};Bo&&(xo=function(t){!function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}(this,xo,Po),dt(t),ko.call(this);var e=To(this);try{t(qo(Ko,e),qo(Zo,e))}catch(t){Zo(e,t)}},(ko=function(t){Eo(this,{type:Po,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,r){for(var n in e)r&&r.unsafe&&t[n]?t[n]=e[n]:me(t,n,e[n],r);return t}(xo.prototype,{then:function(t,e){var r=Co(this),n=Do(Nn(this,xo));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=Pn?_o.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&zo(r,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),Io=function(){var t=new ko,e=To(t);this.promise=t,this.resolve=qo(Ko,e),this.reject=qo(Zo,e)},wo.f=Do=function(t){return t===xo||t===Lo?new Io(t):Ro(t)}),wt({global:!0,wrap:!0,forced:Bo},{Promise:xo}),ye(xo,Po,!1,!0),function(t){var e=Xt(t),r=T.f;g&&e&&!e[Dn]&&r(e,Dn,{configurable:!0,get:function(){return this}})}(Po),Lo=Xt(Po),wt({target:Po,stat:!0,forced:Bo},{reject:function(t){var e=Do(this);return e.reject.call(void 0,t),e.promise}}),wt({target:Po,stat:!0,forced:!0},{resolve:function(t){return Oo(this===Lo?xo:this,t)}}),wt({target:Po,stat:!0,forced:Jo},{all:function(t){var e=this,r=Do(e),n=r.resolve,o=r.reject,i=So((function(){var r=dt(e.resolve),i=[],u=0,c=1;Mn(t,(function(t){var a=u++,f=!1;i.push(void 0),c++,r.call(e,t).then((function(t){f||(f=!0,i[a]=t,--c||n(i))}),o)})),--c||n(i)}));return i.error&&o(i.value),r.promise},race:function(t){var e=this,r=Do(e),n=r.reject,o=So((function(){var o=dt(e.resolve);Mn(t,(function(t){o.call(e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}}),wt({target:"Promise",stat:!0},{allSettled:function(t){var e=this,r=wo.f(e),n=r.resolve,o=r.reject,i=So((function(){var r=dt(e.resolve),o=[],i=0,u=1;Mn(t,(function(t){var c=i++,a=!1;o.push(void 0),u++,r.call(e,t).then((function(t){a||(a=!0,o[c]={status:"fulfilled",value:t},--u||n(o))}),(function(t){a||(a=!0,o[c]={status:"rejected",reason:t},--u||n(o))}))})),--u||n(o)}));return i.error&&o(i.value),r.promise}});var Qo="No one promise resolved";wt({target:"Promise",stat:!0},{any:function(t){var e=this,r=wo.f(e),n=r.resolve,o=r.reject,i=So((function(){var r=dt(e.resolve),i=[],u=0,c=1,a=!1;Mn(t,(function(t){var f=u++,l=!1;i.push(void 0),c++,r.call(e,t).then((function(t){l||a||(a=!0,n(t))}),(function(t){l||a||(l=!0,i[f]=t,--c||o(new(Xt("AggregateError"))(i,Qo)))}))})),--c||o(new(Xt("AggregateError"))(i,Qo))}));return i.error&&o(i.value),r.promise}});var Xo=!!Ln&&i((function(){Ln.prototype.finally.call({then:function(){}},(function(){}))}));wt({target:"Promise",proto:!0,real:!0,forced:Xo},{finally:function(t){var e=Nn(this,Xt("Promise")),r="function"==typeof t;return this.then(r?function(r){return Oo(e,t()).then((function(){return r}))}:t,r?function(r){return Oo(e,t()).then((function(){throw r}))}:t)}}),wt({target:"Object",stat:!0,forced:!g,sham:!g},{defineProperty:T.f});var ti=y((function(t){var e=ht.Object,r=t.exports=function(t,r,n){return e.defineProperty(t,r,n)};e.defineProperty.sham&&(r.sham=!0)})),ei=Wt.indexOf,ri=[].indexOf,ni=!!ri&&1/[1].indexOf(1,-0)<0,oi=mn("indexOf"),ii=ln("indexOf",{ACCESSORS:!0,1:0});wt({target:"Array",proto:!0,forced:ni||!oi||!ii},{indexOf:function(t){return ni?ri.apply(this,arguments)||0:ei(this,t,arguments.length>1?arguments[1]:void 0)}}),dn("Array").indexOf;var ui=mr.filter,ci=Xe("filter"),ai=ln("filter");wt({target:"Array",proto:!0,forced:!ci||!ai},{filter:function(t){return ui(this,t,arguments.length>1?arguments[1]:void 0)}}),dn("Array").filter,wt({target:"Object",stat:!0,forced:!g,sham:!g},{defineProperties:Kt});var fi=y((function(t){var e=ht.Object,r=t.exports=function(t,r){return e.defineProperties(t,r)};e.defineProperties.sham&&(r.sham=!0)})),li=[].slice,si=/MSIE .\./.test(He),pi=function(t){return function(e,r){var n=arguments.length>2,o=n?li.call(arguments,2):void 0;return t(n?function(){("function"==typeof e?e:Function(e)).apply(this,o)}:e,r)}};wt({global:!0,bind:!0,forced:si},{setTimeout:pi(d.setTimeout),setInterval:pi(d.setInterval)});var vi=ht.setTimeout,yi=Xt("JSON","stringify"),hi=/[\uD800-\uDFFF]/g,di=/^[\uD800-\uDBFF]$/,gi=/^[\uDC00-\uDFFF]$/,mi=function(t,e,r){var n=r.charAt(e-1),o=r.charAt(e+1);return di.test(t)&&!gi.test(o)||gi.test(t)&&!di.test(n)?"\\u"+t.charCodeAt(0).toString(16):t},bi=i((function(){return'"\\udf06\\ud834"'!==yi("\udf06\ud834")||'"\\udead"'!==yi("\udead")}));yi&&wt({target:"JSON",stat:!0,forced:bi},{stringify:function(t,e,r){var n=yi.apply(null,arguments);return"string"==typeof n?n.replace(hi,mi):n}}),ht.JSON||(ht.JSON={stringify:JSON.stringify});var wi={multipleLoop:{configurable:!0,writable:!0,enumerable:!1,value:function(t){var e=this,r=t.loopCall,n=t.complete,o=t.stepComplete,i=t.thisValue,u=t.step,c=t.delay;i&&(i=this);var a={loopCall:function(t,n){return r.call(i,e[t],t,n,e)},total:this.length,step:u,delay:c};return n&&(a.complete=function(t,r,o){return n.call(i,t,r,o,e)}),o&&(a.stepComplete=function(t,r){return o.call(i,t,r,e)}),function(t){var e=t.loopCall,r=t.complete,n=t.stepComplete,o=t.thisValue,i=t.total,u=void 0===i?Number.POSITIVE_INFINITY:i,c=t.step,a=void 0===c?50:c,f=t.delay,l=void 0===f?0:f,s=0,p=0,v=!1;function y(t){t&&(v=t,r&&r.call(o,v,s,p,u))}function h(){var t=s<u;return!t&&r&&r.call(o,!1,s-1,p,u),t}var d=null;return h()&&function t(){p++;for(var r=Math.min(s+a,u);s<r&&!v;)y(e.call(o,s,p,u)),s++;n&&y(n.call(o,s-1,p,u)),h()&&!v&&(d=vi(t,l))}(),function(t){t||(t=!0),clearTimeout(d),y(t)}}(a)}}};fi(Array.prototype,wi);var Oi=[].slice,Si={},ji=function(t,e,r){if(!(e in Si)){for(var n=[],o=0;o<e;o++)n[o]="a["+o+"]";Si[e]=Function("C,a","return new C("+n.join(",")+")")}return Si[e](t,r)},Ai=Function.bind||function(t){var e=dt(this),r=Oi.call(arguments,1),n=function(){var o=r.concat(Oi.call(arguments));return this instanceof n?ji(e,o.length,o):e.apply(t,o)};return m(e.prototype)&&(n.prototype=e.prototype),n};wt({target:"Function",proto:!0},{bind:Ai}),dn("Function").bind,wt({target:"Object",stat:!0,sham:!g},{create:ie});var Pi=ht.Object,Ti=function(t,e){return Pi.create(t,e)};function Ei(t){var e=function(t){return function(t,e,r){var n=Ci,o=xi,i=n.test(t),u=e&&o.test(e);i&&u&&!r&&(t=t.replace(n,"$1"+e+"$4"));if(!i&&u)var c='"use strict"; var '+e+" = "+t+" ; return "+e;else c='"use strict"; return ('+t+")";return new Function(c)()}(t.toString(),t.name,!0)}(t);return e.prototype=Ti(t.prototype),e.prototype.constructor=e,e}var Ci=/(^\s*(async\s+)?function\s*(\s|\*)\s*)[A-Za-z_$]+[\w$]*(\s*\()/,xi=/^[A-Za-z_$]+[\w$]*$/;var Mi=function(){function t(){this._decided=!1,this.listeners=[]}return ti(t.prototype,"decided",{get:function(){return this._decided},enumerable:!1,configurable:!0}),ti(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t,this.resolve()},enumerable:!1,configurable:!0}),t.prototype.resolve=function(){var t,e;this._decided=!0;var r=this.value;try{for(var n=
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.listeners),o=n.next();!o.done;o=n.next()){(0,o.value)(r)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.listeners=[],this.then=function(t){t(this.value)}},t.prototype.then=function(t){this.listeners.push(t)},t.resolve=function(t){var e=new this;return e.value=t,e},t}(),Fi=function(t){return Ei(t)},_i=[[Date,function(t){return new Date(t.getTime())}],[Array,function(t,e){return t.reduce((function(t,r,n){return t.push(void 0),e(r,(function(e){t.splice(n,1,e)}),n),t}),[])}],[Map,function(t,e){var r=new Map;return t.forEach((function(t,n){e(t,(function(t){r.set(n,t)}),n)})),r}],[Set,function(t,r){var n,o,i=new Set,u=0;try{for(var c=e(t),a=c.next();!a.done;a=c.next()){r(a.value,(function(t){i.add(t)}),u),++u}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return i}],[URL,function(t){return new URL(t.href)}],[RegExp,function(t){return new RegExp(t)}],[Function,Fi],["AsyncFunction",Fi],["GeneratorFunction",Fi]],ki="default";function Ii(t){var n,o,i,u,c=t.value,a=t.typeReviverObject,f=t.allOwnProps,l=t.copyFun,s=t.maxDepth,p=t.startDepth,v=t.rawCopyMap,y=t.completeCB,h=t.key,d=t.host,g=y||function(){};if(s<p||!l&&"function"==typeof c||function(t){var e=typeof t;return null==t||"object"!==e&&"function"!==e}(c))return g(c),c;var m=v.get(c);if(m)return m.then(g),m.value;(m=new Mi).then(g),v.set(c,m);var b=p+1;function w(t,e,r,n,o){var i=null==n?c:n;if(o)var u=o.allOwnProps,p=o.depth,y=o.copyFun;return Ii({value:t,typeReviverObject:a,allOwnProps:null==u?f:u,copyFun:null==y?l:y,maxDepth:s,startDepth:null==p?b:p,rawCopyMap:v,completeCB:e,key:r,host:i})}var O=r(function(t){return null!=t&&(r=typeof(e=t),!e||"object"!==r&&"function"!==r)?typeof t:function(t){var e=t;return null!=t&&null==(e=t.constructor)&&(e=typeof t),e}(t);var e,r}(c)),S=a[O];if("function"==typeof S){var j=S.call(c,c,w,{allOwnProps:f,key:h,host:d,type:O,depth:p,copyFun:l});return m.value=j,j}if("function"==typeof c.getCopy){var A=c.getCopy(c,w,{allOwnProps:f,key:h,host:d,type:O,depth:p,copyFun:l});return m.value=A,A}var P=ki,T=a.default;if("function"==typeof T){var E=T.call(c,c,w,{allOwnProps:f,key:h,host:d,type:P,depth:p,copyFun:l});return m.value=E,E}if("function"==typeof c[Symbol.iterator]){var C=[],x=0,M=function(t){var e=x;C.push(void 0),Ii({value:t,typeReviverObject:a,allOwnProps:f,copyFun:l,maxDepth:s,startDepth:b,rawCopyMap:v,completeCB:function(t){C.splice(e,1,t)},key:x,host:c}),++x};try{for(var F=e(c),_=F.next();!_.done;_=F.next()){M(_.value)}}catch(t){n={error:t}}finally{try{_&&!_.done&&(o=F.return)&&o.call(F)}finally{if(n)throw n.error}}return m.value=C,C}var k,I=c.constructor;if("function"==typeof I)try{k=new I}catch(t){k=Object.create(I.prototype)}else k=Object.create(Object.getPrototypeOf(c));if(f)var L=Object.getOwnPropertyNames(c);else L=Object.keys(c);var D=function(t){Ii({value:c[t],typeReviverObject:a,allOwnProps:f,copyFun:l,maxDepth:s,startDepth:b,rawCopyMap:v,completeCB:function(e){var r=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(k,t,r),k[t]=e},key:t,host:c})};try{for(var R=e(L),N=R.next();!N.done;N=R.next()){D(N.value)}}catch(t){i={error:t}}finally{try{N&&!N.done&&(u=R.return)&&u.call(R)}finally{if(i)throw i.error}}return m.value=k,k}function Li(t){function e(t,r,i){if(r)var u=r.maxDepth,c=r.allOwnProps,a=r.copyFun;var f=null==u?1/0:u,l=!!c,s=!!a,p=e.presetTypeCopierMap;return Ii({value:t,typeReviverObject:o(function(...t){return t.reduce((function(t,e){if(e){let r=n(e);return t.concat(r)}return t}),[])}(p.size>0?p:null,i)),allOwnProps:l,copyFun:s,maxDepth:f,startDepth:0,rawCopyMap:new Map})}return Object.defineProperty(e,"presetTypeCopierMap",{configurable:!0,enumerable:!0,get:function(){return this._presetTypeCopierMap||(this._presetTypeCopierMap=new Map),this._presetTypeCopierMap},set:function(t){t instanceof Map&&(this._presetTypeCopierMap=t)}}),t&&(e.presetTypeCopierMap=t),e}var Di=new Map(_i),Ri=Li(new Map(_i));return t.createDeepCopy=Li,t.deepCopy=Ri,t.default=Ri,t.defaultPresetTypeCopierMap=Di,t.isCopyable=function(t){return t&&"function"==typeof t.getCopy},t.typeNameOfDefaultCopier=ki,Object.defineProperty(t,"__esModule",{value:!0}),t}({});