|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-f67c2c70"],{"00b4":function(t,e,i){"use strict";i("ac1f");var n=i("23e7"),o=i("da84"),s=i("c65b"),r=i("e330"),a=i("1626"),h=i("861d"),c=function(){var t=!1,e=/[ac]/;return e.exec=function(){return t=!0,/./.exec.apply(this,arguments)},!0===e.test("abc")&&t}(),l=o.Error,u=r(/./.test);n({target:"RegExp",proto:!0,forced:!c},{test:function(t){var e=this.exec;if(!a(e))return u(this,t);var i=s(e,this,t);if(null!==i&&!h(i))throw new l("RegExp exec method returned something other than an Object or null");return!!i}})},"0d3b":function(t,e,i){var n=i("d039"),o=i("b622"),s=i("c430"),r=o("iterator");t.exports=!n((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,i="";return t.pathname="c%20d",e.forEach((function(t,n){e["delete"]("b"),i+=n+t})),s&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[r]||"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"!==i||"x"!==new URL("http://x",void 0).host}))},"2b3d":function(t,e,i){"use strict";i("3ca3");var n,o=i("23e7"),s=i("83ab"),r=i("0d3b"),a=i("da84"),h=i("0366"),c=i("e330"),l=i("37e8").f,u=i("6eeb"),d=i("19aa"),f=i("1a2d"),p=i("60da"),m=i("4df4"),g=i("4dae"),v=i("6547").codeAt,b=i("5fb2"),w=i("577e"),y=i("d44e"),R=i("d6d6"),z=i("9861"),A=i("69f3"),S=A.set,x=A.getterFor("URL"),M=z.URLSearchParams,O=z.getState,j=a.URL,C=a.TypeError,E=a.parseInt,k=Math.floor,P=Math.pow,B=c("".charAt),L=c(/./.exec),W=c([].join),H=c(1..toString),T=c([].pop),D=c([].push),U=c("".replace),I=c([].shift),$=c("".split),F=c("".slice),N=c("".toLowerCase),X=c([].unshift),Y="Invalid authority",q="Invalid scheme",V="Invalid host",Z="Invalid port",_=/[a-z]/i,Q=/[\d+-.a-z]/i,G=/\d/,J=/^0x/i,K=/^[0-7]+$/,tt=/^\d+$/,et=/^[\da-f]+$/i,it=/[\0\t\n\r #%/:<>?@[\\\]^|]/,nt=/[\0\t\n\r #/:<>?@[\\\]^|]/,ot=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,st=/[\t\n\r]/g,rt=function(t){var e,i,n,o,s,r,a,h=$(t,".");if(h.length&&""==h[h.length-1]&&h.length--,e=h.length,e>4)return t;for(i=[],n=0;n<e;n++){if(o=h[n],""==o)return t;if(s=10,o.length>1&&"0"==B(o,0)&&(s=L(J,o)?16:8,o=F(o,8==s?1:2)),""===o)r=0;else{if(!L(10==s?tt:8==s?K:et,o))return t;r=E(o,s)}D(i,r)}for(n=0;n<e;n++)if(r=i[n],n==e-1){if(r>=P(256,5-e))return null}else if(r>255)return null;for(a=T(i),n=0;n<i.length;n++)a+=i[n]*P(256,3-n);return a},at=function(t){var e,i,n,o,s,r,a,h=[0,0,0,0,0,0,0,0],c=0,l=null,u=0,d=function(){return B(t,u)};if(":"==d()){if(":"!=B(t,1))return;u+=2,c++,l=c}while(d()){if(8==c)return;if(":"!=d()){e=i=0;while(i<4&&L(et,d()))e=16*e+E(d(),16),u++,i++;if("."==d()){if(0==i)return;if(u-=i,c>6)return;n=0;while(d()){if(o=null,n>0){if(!("."==d()&&n<4))return;u++}if(!L(G,d()))return;while(L(G,d())){if(s=E(d(),10),null===o)o=s;else{if(0==o)return;o=10*o+s}if(o>255)return;u++}h[c]=256*h[c]+o,n++,2!=n&&4!=n||c++}if(4!=n)return;break}if(":"==d()){if(u++,!d())return}else if(d())return;h[c++]=e}else{if(null!==l)return;u++,c++,l=c}}if(null!==l){r=c-l,c=7;while(0!=c&&r>0)a=h[c],h[c--]=h[l+r-1],h[l+--r]=a}else if(8!=c)return;return h},ht=function(t){for(var e=null,i=1,n=null,o=0,s=0;s<8;s++)0!==t[s]?(o>i&&(e=n,i=o),n=null,o=0):(null===n&&(n=s),++o);return o>i&&(e=n,i=o),e},ct=function(t){var e,i,n,o;if("number"==typeof t){for(e=[],i=0;i<4;i++)X(e,t%256),t=k(t/256);return W(e,".")}if("object"==typeof t){for(e="",n=ht(t),i=0;i<8;i++)o&&0===t[i]||(o&&(o=!1),n===i?(e+=i?":":"::",o=!0):(e+=H(t[i],16),i<7&&(e+=":")));return"["+e+"]"}return t},lt={},ut=p({},lt,{" ":1,'"':1,"<":1,">":1,"`":1}),dt=p({},ut,{"#":1,"?":1,"{":1,"}":1}),ft=p({},dt,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),pt=function(t,e){var i=v(t,0);return i>32&&i<127&&!f(e,t)?t:encodeURIComponent(t)},mt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},gt=function(t,e){var i;return 2==t.length&&L(_,B(t,0))&&(":"==(i=B(t,1))||!e&&"|"==i)},vt=function(t){var e;return t.length>1&>(F(t,0,2))&&(2==t.length||"/"===(e=B(t,2))||"\\"===e||"?"===e||"#"===e)},bt=function(t){return"."===t||"%2e"===N(t)},wt=function(t){return t=N(t),".."===t||"%2e."===t||".%2e"===t||"%2e%2e"===t},yt={},Rt={},zt={},At={},St={},xt={},Mt={},Ot={},jt={},Ct={},Et={},kt={},Pt={},Bt={},Lt={},Wt={},Ht={},Tt={},Dt={},Ut={},It={},$t=function(t,e,i){var n,o,s,r=w(t);if(e){if(o=this.parse(r),o)throw C(o);this.searchParams=null}else{if(void 0!==i&&(n=new $t(i,!0)),o=this.parse(r,null,n),o)throw C(o);s=O(new M),s.bindURL(this),this.searchParams=s}};$t.prototype={type:"URL",parse:function(t,e,i){var o,s,r,a,h=this,c=e||yt,l=0,u="",d=!1,p=!1,v=!1;t=w(t),e||(h.scheme="",h.username="",h.password="",h.host=null,h.port=null,h.path=[],h.query=null,h.fragment=null,h.cannotBeABaseURL=!1,t=U(t,ot,"")),t=U(t,st,""),o=m(t);while(l<=o.length){switch(s=o[l],c){case yt:if(!s||!L(_,s)){if(e)return q;c=zt;continue}u+=N(s),c=Rt;break;case Rt:if(s&&(L(Q,s)||"+"==s||"-"==s||"."==s))u+=N(s);else{if(":"!=s){if(e)return q;u="",c=zt,l=0;continue}if(e&&(h.isSpecial()!=f(mt,u)||"file"==u&&(h.includesCredentials()||null!==h.port)||"file"==h.scheme&&!h.host))return;if(h.scheme=u,e)return void(h.isSpecial()&&mt[h.scheme]==h.port&&(h.port=null));u="","file"==h.scheme?c=Bt:h.isSpecial()&&i&&i.scheme==h.scheme?c=At:h.isSpecial()?c=Ot:"/"==o[l+1]?(c=St,l++):(h.cannotBeABaseURL=!0,D(h.path,""),c=Dt)}break;case zt:if(!i||i.cannotBeABaseURL&&"#"!=s)return q;if(i.cannotBeABaseURL&&"#"==s){h.scheme=i.scheme,h.path=g(i.path),h.query=i.query,h.fragment="",h.cannotBeABaseURL=!0,c=It;break}c="file"==i.scheme?Bt:xt;continue;case At:if("/"!=s||"/"!=o[l+1]){c=xt;continue}c=jt,l++;break;case St:if("/"==s){c=Ct;break}c=Tt;continue;case xt:if(h.scheme=i.scheme,s==n)h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=g(i.path),h.query=i.query;else if("/"==s||"\\"==s&&h.isSpecial())c=Mt;else if("?"==s)h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=g(i.path),h.query="",c=Ut;else{if("#"!=s){h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=g(i.path),h.path.length--,c=Tt;continue}h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=g(i.path),h.query=i.query,h.fragment="",c=It}break;case Mt:if(!h.isSpecial()||"/"!=s&&"\\"!=s){if("/"!=s){h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,c=Tt;continue}c=Ct}else c=jt;break;case Ot:if(c=jt,"/"!=s||"/"!=B(u,l+1))continue;l++;break;case jt:if("/"!=s&&"\\"!=s){c=Ct;continue}break;case Ct:if("@"==s){d&&(u="%40"+u),d=!0,r=m(u);for(var b=0;b<r.length;b++){var y=r[b];if(":"!=y||v){var R=pt(y,ft);v?h.password+=R:h.username+=R}else v=!0}u=""}else if(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&h.isSpecial()){if(d&&""==u)return Y;l-=m(u).length+1,u="",c=Et}else u+=s;break;case Et:case kt:if(e&&"file"==h.scheme){c=Wt;continue}if(":"!=s||p){if(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&h.isSpecial()){if(h.isSpecial()&&""==u)return V;if(e&&""==u&&(h.includesCredentials()||null!==h.port))return;if(a=h.parseHost(u),a)return a;if(u="",c=Ht,e)return;continue}"["==s?p=!0:"]"==s&&(p=!1),u+=s}else{if(""==u)return V;if(a=h.parseHost(u),a)return a;if(u="",c=Pt,e==kt)return}break;case Pt:if(!L(G,s)){if(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&h.isSpecial()||e){if(""!=u){var z=E(u,10);if(z>65535)return Z;h.port=h.isSpecial()&&z===mt[h.scheme]?null:z,u=""}if(e)return;c=Ht;continue}return Z}u+=s;break;case Bt:if(h.scheme="file","/"==s||"\\"==s)c=Lt;else{if(!i||"file"!=i.scheme){c=Tt;continue}if(s==n)h.host=i.host,h.path=g(i.path),h.query=i.query;else if("?"==s)h.host=i.host,h.path=g(i.path),h.query="",c=Ut;else{if("#"!=s){vt(W(g(o,l),""))||(h.host=i.host,h.path=g(i.path),h.shortenPath()),c=Tt;continue}h.host=i.host,h.path=g(i.path),h.query=i.query,h.fragment="",c=It}}break;case Lt:if("/"==s||"\\"==s){c=Wt;break}i&&"file"==i.scheme&&!vt(W(g(o,l),""))&&(gt(i.path[0],!0)?D(h.path,i.path[0]):h.host=i.host),c=Tt;continue;case Wt:if(s==n||"/"==s||"\\"==s||"?"==s||"#"==s){if(!e&>(u))c=Tt;else if(""==u){if(h.host="",e)return;c=Ht}else{if(a=h.parseHost(u),a)return a;if("localhost"==h.host&&(h.host=""),e)return;u="",c=Ht}continue}u+=s;break;case Ht:if(h.isSpecial()){if(c=Tt,"/"!=s&&"\\"!=s)continue}else if(e||"?"!=s)if(e||"#"!=s){if(s!=n&&(c=Tt,"/"!=s))continue}else h.fragment="",c=It;else h.query="",c=Ut;break;case Tt:if(s==n||"/"==s||"\\"==s&&h.isSpecial()||!e&&("?"==s||"#"==s)){if(wt(u)?(h.shortenPath(),"/"==s||"\\"==s&&h.isSpecial()||D(h.path,"")):bt(u)?"/"==s||"\\"==s&&h.isSpecial()||D(h.path,""):("file"==h.scheme&&!h.path.length&>(u)&&(h.host&&(h.host=""),u=B(u,0)+":"),D(h.path,u)),u="","file"==h.scheme&&(s==n||"?"==s||"#"==s))while(h.path.length>1&&""===h.path[0])I(h.path);"?"==s?(h.query="",c=Ut):"#"==s&&(h.fragment="",c=It)}else u+=pt(s,dt);break;case Dt:"?"==s?(h.query="",c=Ut):"#"==s?(h.fragment="",c=It):s!=n&&(h.path[0]+=pt(s,lt));break;case Ut:e||"#"!=s?s!=n&&("'"==s&&h.isSpecial()?h.query+="%27":h.query+="#"==s?"%23":pt(s,lt)):(h.fragment="",c=It);break;case It:s!=n&&(h.fragment+=pt(s,ut));break}l++}},parseHost:function(t){var e,i,n;if("["==B(t,0)){if("]"!=B(t,t.length-1))return V;if(e=at(F(t,1,-1)),!e)return V;this.host=e}else if(this.isSpecial()){if(t=b(t),L(it,t))return V;if(e=rt(t),null===e)return V;this.host=e}else{if(L(nt,t))return V;for(e="",i=m(t),n=0;n<i.length;n++)e+=pt(i[n],lt);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return f(mt,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"==this.scheme&&1==e&>(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,i=t.username,n=t.password,o=t.host,s=t.port,r=t.path,a=t.query,h=t.fragment,c=e+":";return null!==o?(c+="//",t.includesCredentials()&&(c+=i+(n?":"+n:"")+"@"),c+=ct(o),null!==s&&(c+=":"+s)):"file"==e&&(c+="//"),c+=t.cannotBeABaseURL?r[0]:r.length?"/"+W(r,"/"):"",null!==a&&(c+="?"+a),null!==h&&(c+="#"+h),c},setHref:function(t){var e=this.parse(t);if(e)throw C(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"==t)try{return new Ft(t.path[0]).origin}catch(i){return"null"}return"file"!=t&&this.isSpecial()?t+"://"+ct(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(w(t)+":",yt)},getUsername:function(){return this.username},setUsername:function(t){var e=m(w(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<e.length;i++)this.username+=pt(e[i],ft)}},getPassword:function(){return this.password},setPassword:function(t){var e=m(w(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<e.length;i++)this.password+=pt(e[i],ft)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?ct(t):ct(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Et)},getHostname:function(){var t=this.host;return null===t?"":ct(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,kt)},getPort:function(){var t=this.port;return null===t?"":w(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(t=w(t),""==t?this.port=null:this.parse(t,Pt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+W(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,Ht))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){t=w(t),""==t?this.query=null:("?"==B(t,0)&&(t=F(t,1)),this.query="",this.parse(t,Ut)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){t=w(t),""!=t?("#"==B(t,0)&&(t=F(t,1)),this.fragment="",this.parse(t,It)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Ft=function(t){var e=d(this,Nt),i=R(arguments.length,1)>1?arguments[1]:void 0,n=S(e,new $t(t,!1,i));s||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},Nt=Ft.prototype,Xt=function(t,e){return{get:function(){return x(this)[t]()},set:e&&function(t){return x(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&l(Nt,{href:Xt("serialize","setHref"),origin:Xt("getOrigin"),protocol:Xt("getProtocol","setProtocol"),username:Xt("getUsername","setUsername"),password:Xt("getPassword","setPassword"),host:Xt("getHost","setHost"),hostname:Xt("getHostname","setHostname"),port:Xt("getPort","setPort"),pathname:Xt("getPathname","setPathname"),search:Xt("getSearch","setSearch"),searchParams:Xt("getSearchParams"),hash:Xt("getHash","setHash")}),u(Nt,"toJSON",(function(){return x(this).serialize()}),{enumerable:!0}),u(Nt,"toString",(function(){return x(this).serialize()}),{enumerable:!0}),j){var Yt=j.createObjectURL,qt=j.revokeObjectURL;Yt&&u(Ft,"createObjectURL",h(Yt,j)),qt&&u(Ft,"revokeObjectURL",h(qt,j))}y(Ft,"URL"),o({global:!0,forced:!r,sham:!s},{URL:Ft})},"4df4":function(t,e,i){"use strict";var n=i("da84"),o=i("0366"),s=i("c65b"),r=i("7b0b"),a=i("9bdd"),h=i("e95a"),c=i("68ee"),l=i("07fa"),u=i("8418"),d=i("9a1f"),f=i("35a1"),p=n.Array;t.exports=function(t){var e=r(t),i=c(this),n=arguments.length,m=n>1?arguments[1]:void 0,g=void 0!==m;g&&(m=o(m,n>2?arguments[2]:void 0));var v,b,w,y,R,z,A=f(e),S=0;if(!A||this==p&&h(A))for(v=l(e),b=i?new this(v):p(v);v>S;S++)z=g?m(e[S],S):e[S],u(b,S,z);else for(y=d(e,A),R=y.next,b=i?new this:[];!(w=s(R,y)).done;S++)z=g?a(y,m,[w.value,S],!0):w.value,u(b,S,z);return b.length=S,b}},"5fb2":function(t,e,i){"use strict";var n=i("da84"),o=i("e330"),s=2147483647,r=36,a=1,h=26,c=38,l=700,u=72,d=128,f="-",p=/[^\0-\u007E]/,m=/[.\u3002\uFF0E\uFF61]/g,g="Overflow: input needs wider integers to process",v=r-a,b=n.RangeError,w=o(m.exec),y=Math.floor,R=String.fromCharCode,z=o("".charCodeAt),A=o([].join),S=o([].push),x=o("".replace),M=o("".split),O=o("".toLowerCase),j=function(t){var e=[],i=0,n=t.length;while(i<n){var o=z(t,i++);if(o>=55296&&o<=56319&&i<n){var s=z(t,i++);56320==(64512&s)?S(e,((1023&o)<<10)+(1023&s)+65536):(S(e,o),i--)}else S(e,o)}return e},C=function(t){return t+22+75*(t<26)},E=function(t,e,i){var n=0;t=i?y(t/l):t>>1,t+=y(t/e);while(t>v*h>>1)t=y(t/v),n+=r;return y(n+(v+1)*t/(t+c))},k=function(t){var e=[];t=j(t);var i,n,o=t.length,c=d,l=0,p=u;for(i=0;i<t.length;i++)n=t[i],n<128&&S(e,R(n));var m=e.length,v=m;m&&S(e,f);while(v<o){var w=s;for(i=0;i<t.length;i++)n=t[i],n>=c&&n<w&&(w=n);var z=v+1;if(w-c>y((s-l)/z))throw b(g);for(l+=(w-c)*z,c=w,i=0;i<t.length;i++){if(n=t[i],n<c&&++l>s)throw b(g);if(n==c){var x=l,M=r;while(1){var O=M<=p?a:M>=p+h?h:M-p;if(x<O)break;var k=x-O,P=r-O;S(e,R(C(O+k%P))),x=y(k/P),M+=r}S(e,R(C(x))),p=E(l,z,v==m),l=0,v++}}l++,c++}return A(e,"")};t.exports=function(t){var e,i,n=[],o=M(x(O(t),m,"."),".");for(e=0;e<o.length;e++)i=o[e],S(n,w(p,i)?"xn--"+k(i):i);return A(n,".")}},"94e0":function(t,e,i){"use strict";i.d(e,"a",(function(){return ae}));var n=i("7a23");function o(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function s(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function a(t,e){if(null==t)return{};var i,n,o=function(t,e){if(null==t)return{};var i,n,o={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function h(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var l,u,d,f=(l=function(t){
|
|
|
***************************************************************************** */};function b(t,e){var i,n;return t&&e?(i=""+t+e[0].toUpperCase()+e.slice(1),n=t+"-"+e):(i=t||e,n=t||e),{name:i,classname:n}}function w(t){return/^blob:/.test(t)}function y(t){return w(t)||function(t){return/^data:/.test(t)}(t)}function R(t){return!!(t&&t.constructor&&t.call&&t.apply)}function z(t){return void 0===t}function A(t){return"object"==typeof t&&null!==t}function S(t,e,i){var n={};return A(t)?(Object.keys(e).forEach((function(o){z(t[o])?n[o]=e[o]:A(e[o])?A(t[o])?n[o]=S(t[o],e[o],i[o]):n[o]=t[o]?e[o]:i[o]:!0===e[o]||!1===e[o]?n[o]=Boolean(t[o]):n[o]=t[o]})),n):t?e:i}function x(t){var e=Number(t);return Number.isNaN(e)?t:e}function M(t){return typeof("number"==t||function(t){return"object"==typeof t&&null!==t}(t)&&"[object Number]"==toString.call(t))&&!O(t)}function O(t){return t!=t}function j(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}var C=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.type="manipulateImage",this.move=t,this.scale=e},E=function(t,e){void 0===e&&(e={}),this.type="resize",this.directions=t,this.params=e},k=function(t){this.type="move",this.directions=t},P=function(){function t(t,e,i,n,o){this.type="drag",this.nativeEvent=t,this.position=i,this.previousPosition=n,this.element=e,this.anchor=o}return t.prototype.shift=function(){var t=this,e=t.element,i=t.anchor,n=t.position;if(e){var o=e.getBoundingClientRect(),s=o.left,r=o.top;return{left:n.left-s-i.left,top:n.top-r-i.top}}return{left:0,top:0}},t}(),B={name:"DraggableElement",props:{classname:{type:String}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&1===t.touches.length&&(this.touches=h(t.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),t.touches.length&&this.initAnchor(this.touches.reduce((function(e,i){return{clientX:e.clientX+i.clientX/t.touches.length,clientY:e.clientY+i.clientY/t.touches.length}}),{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.draggable.getBoundingClientRect(),i=e.left,n=e.right,o=e.bottom,s=e.top;this.anchor={left:t.clientX-i,top:t.clientY-s,bottom:o-t.clientY,right:n-t.clientX}},processMove:function(t,e){var i=h(e);if(this.touches.length){if(1===this.touches.length&&1===i.length){var n=this.$refs.draggable;this.$emit("drag",new P(t,n,{left:i[0].clientX,top:i[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=i}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}},emits:["drag","drag-end","leave","enter"],render:function(t,e,i,o,s,r){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{ref:"draggable",class:i.classname,onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onMouseover:e[3]||(e[3]=function(){return r.onMouseOver&&r.onMouseOver.apply(r,arguments)}),onMouseleave:e[4]||(e[4]=function(){return r.onMouseLeave&&r.onMouseLeave.apply(r,arguments)})},[Object(n["renderSlot"])(t.$slots,"default")],34)}},L=p("vue-handler-wrapper"),W={name:"HandlerWrapper",components:{DraggableElement:B},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){var t;if(this.horizontalPosition||this.verticalPosition){var e,i=b(this.horizontalPosition,this.verticalPosition);t=L((r(e={},i.classname,!0),r(e,"disabled",this.disabled),e))}else t=L({disabled:this.disabled});return{root:t,draggable:L("draggable")}}},emits:["leave","enter","drag","drag-end"],render:function(t,e,i,o,s,r){var a=Object(n["resolveComponent"])("DraggableElement");return Object(n["openBlock"])(),Object(n["createBlock"])("div",{class:r.classes.root},[Object(n["createVNode"])(a,{class:r.classes.draggable,onDrag:e[1]||(e[1]=function(e){return t.$emit("drag",e)}),onDragEnd:e[2]||(e[2]=function(e){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(e){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(e){return t.$emit("enter")})},{default:Object(n["withCtx"])((function(){return[Object(n["renderSlot"])(t.$slots,"default")]})),_:3},8,["class"])],2)}},H=p("vue-line-wrapper"),T={name:"LineWrapper",components:{DraggableElement:B},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var t;return H((r(t={},this.position,!0),r(t,"disabled",this.disabled),t))}},emits:["leave","enter","drag","drag-end"],render:function(t,e,i,o,s,r){var a=Object(n["resolveComponent"])("DraggableElement");return Object(n["openBlock"])(),Object(n["createBlock"])(a,{class:r.classname,onDrag:e[1]||(e[1]=function(e){return t.$emit("drag",e)}),onDragEnd:e[2]||(e[2]=function(e){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(e){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(e){return t.$emit("enter")})},{default:Object(n["withCtx"])((function(){return[Object(n["renderSlot"])(t.$slots,"default")]})),_:3},8,["class"])}},D=["left","right","top","bottom"],U=["left","right"],I=["top","bottom"],$=["left","top"],F=["fill-area","fit-area","stencil","none"],N={left:0,top:0,width:0,height:0};function X(t,e,i){return!(i=i||["width","height","left","top"]).some((function(i){return t[i]!==e[i]}))}function Y(t){return{left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height}}function q(t,e){return{left:t.left-e.left,top:t.top-e.top}}function V(t){return{left:t.left+t.width/2,top:t.top+t.height/2}}function Z(t,e){var i={left:0,top:0,right:0,bottom:0};return D.forEach((function(n){var o=e[n],s=Y(t)[n];i[n]=void 0!==o&&void 0!==s?"left"===n||"top"===n?Math.max(0,o-s):Math.max(0,s-o):0})),i}function _(t,e){return{left:t.left-e.left,top:t.top-e.top,width:t.width+e.left+e.right,height:t.height+e.top+e.bottom}}function Q(t){return{left:-t.left,top:-t.top}}function G(t,e){return v(v({},t),{left:t.left+e.left,top:t.top+e.top})}function J(t,e,i,n){if(1!==e){if(i){var o=V(t);return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2+(i.left-o.left)*(n||1-e),top:t.top+t.height*(1-e)/2+(i.top-o.top)*(n||1-e)}}return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2,top:t.top+t.height*(1-e)/2}}return t}function K(t){return t.width/t.height}function tt(t,e){return Math.min(void 0!==e.right&&void 0!==e.left?(e.right-e.left)/t.width:1/0,void 0!==e.bottom&&void 0!==e.top?(e.bottom-e.top)/t.height:1/0)}function et(t,e){var i={left:0,top:0},n=Z(t,e);return n.left&&n.left>0?i.left=n.left:n.right&&n.right>0&&(i.left=-n.right),n.top&&n.top>0?i.top=n.top:n.bottom&&n.bottom>0&&(i.top=-n.bottom),i}function it(t,e){var i;return e.minimum&&t<e.minimum?i=e.minimum:e.maximum&&t>e.maximum&&(i=e.maximum),i}function nt(t,e){var i=K(t),n=K(e);return e.width<1/0&&e.height<1/0?i>n?{width:e.width,height:e.width/i}:{width:e.height*i,height:e.height}:e.width<1/0?{width:e.width,height:e.width/i}:e.height<1/0?{width:e.height*i,height:e.height}:t}function ot(t,e){var i=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(i))+Math.abs(t.height*Math.sin(i)),height:Math.abs(t.width*Math.sin(i))+Math.abs(t.height*Math.cos(i))}}function st(t,e){var i=e*Math.PI/180;return{left:t.left*Math.cos(i)-t.top*Math.sin(i),top:t.left*Math.sin(i)+t.top*Math.cos(i)}}function rt(t,e){var i=Z(at(t,e),e);return i.left+i.right+i.top+i.bottom?i.left+i.right>i.top+i.bottom?Math.min((t.width+i.left+i.right)/t.width,tt(t,e)):Math.min((t.height+i.top+i.bottom)/t.height,tt(t,e)):1}function at(t,e,i){void 0===i&&(i=!1);var n=et(t,e);return G(t,i?Q(n):n)}function ht(t){return{width:void 0!==t.right&&void 0!==t.left?t.right-t.left:1/0,height:void 0!==t.bottom&&void 0!==t.top?t.bottom-t.top:1/0}}function ct(t,e){return v(v({},t),{minWidth:Math.min(e.width,t.minWidth),minHeight:Math.min(e.height,t.minHeight),maxWidth:Math.min(e.width,t.maxWidth),maxHeight:Math.min(e.height,t.maxHeight)})}function lt(t,e,i){void 0===i&&(i=!0);var n={};return D.forEach((function(o){var s=t[o],r=e[o];void 0!==s&&void 0!==r?n[o]="left"===o||"top"===o?i?Math.max(s,r):Math.min(s,r):i?Math.min(s,r):Math.max(s,r):void 0!==r?n[o]=r:void 0!==s&&(n[o]=s)})),n}function ut(t,e){return lt(t,e,!0)}function dt(t){var e=t.size,i=t.aspectRatio,n=t.ignoreMinimum,o=t.sizeRestrictions;return Boolean((e.correctRatio||K(e)>=i.minimum&&K(e)<=i.maximum)&&e.height<=o.maxHeight&&e.width<=o.maxWidth&&e.width&&e.height&&(n||e.height>=o.minHeight&&e.width>=o.minWidth))}function ft(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function pt(t){var e=t.width,i=t.height,n=t.sizeRestrictions,o={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},s={width:Math.max(n.minWidth,Math.min(n.maxWidth,e)),height:Math.max(n.minHeight,Math.min(n.maxHeight,i))};function r(t,s){return void 0===s&&(s=!1),t.reduce((function(t,r){return dt({size:r,aspectRatio:o,sizeRestrictions:n,ignoreMinimum:s})&&(!t||ft(r,{width:e,height:i})<ft(t,{width:e,height:i}))?r:t}),null)}var a=[];o&&[o.minimum,o.maximum].forEach((function(t){t&&a.push({width:s.width,height:s.width/t,correctRatio:!0},{width:s.height*t,height:s.height,correctRatio:!0})})),dt({size:s,aspectRatio:o,sizeRestrictions:n})&&a.push(s);var h=r(a)||r(a,!0);return h&&{width:h.width,height:h.height}}function mt(t){var e=t.event,i=t.coordinates,n=t.positionRestrictions,o=void 0===n?{}:n,s=G(i,e.directions);return G(s,et(s,o))}function gt(t){var e=t.coordinates,i=t.transform,n=t.imageSize,o=t.sizeRestrictions,s=t.positionRestrictions,r=t.aspectRatio,a=t.visibleArea,h=function(t,e){return mt({coordinates:t,positionRestrictions:s,event:new k({left:e.left-t.left,top:e.top-t.top})})},c=v({},e);return(Array.isArray(i)?i:[i]).forEach((function(t){var e={};z((e="function"==typeof t?t({coordinates:c,imageSize:n,visibleArea:a}):t).width)&&z(e.height)||(c=function(t,e){var i=v(v(v({},t),pt({width:e.width,height:e.height,sizeRestrictions:o,aspectRatio:r})),{left:0,top:0});return h(i,{left:t.left,top:t.top})}(c,v(v({},c),e))),z(e.left)&&z(e.top)||(c=h(c,v(v({},c),e)))})),c}function vt(t){t.event;var e=t.getAreaRestrictions,i=t.boundaries,n=t.coordinates,o=t.visibleArea;t.aspectRatio;var s=t.stencilSize,r=t.sizeRestrictions,a=t.positionRestrictions;t.stencilReference;var h,c,l,u=v({},n),d=v({},o),f=v({},s);h=K(f),c=K(u),void 0===l&&(l=.001),(0===h||0===c?Math.abs(c-h)<l:Math.abs(c/h)<1+l&&Math.abs(c/h)>1-l)||(u=v(v({},u),pt({sizeRestrictions:r,width:u.width,height:u.height,aspectRatio:{minimum:K(f),maximum:K(f)}})));var p=rt(d=J(d,u.width*i.width/(d.width*f.width)),e({visibleArea:d,type:"resize"}));return 1!==p&&(d=J(d,p),u=J(u,p)),d=at(d=G(d,q(V(u),V(d))),e({visibleArea:d,type:"move"})),{coordinates:u=at(u,ut(Y(d),a)),visibleArea:d}}function bt(t){var e=t.event,i=t.getAreaRestrictions,n=t.boundaries,o=t.coordinates,s=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var r=t.positionRestrictions;t.stencilReference;var a=v({},o),h=v({},s);if(o&&s&&"manipulateImage"!==e.type){var c={width:0,height:0};h.width,n.width,K(n)>K(a)?(c.height=.8*n.height,c.width=c.height*K(a)):(c.width=.8*n.width,c.height=c.width*K(a));var l=rt(h=J(h,a.width*n.width/(h.width*c.width)),i({visibleArea:h,type:"resize"}));h=J(h,l),1!==l&&(c.height/=l,c.width/=l),h=at(h=G(h,q(V(a),V(h))),i({visibleArea:h,type:"move"})),a=at(a,ut(Y(h),r))}return{coordinates:a,visibleArea:h}}function wt(t){var e=t.event,i=t.coordinates,n=t.visibleArea,o=t.getAreaRestrictions,s=v({},n),r=v({},i);if("setCoordinates"===e.type){var a=Math.max(0,r.width-s.width),h=Math.max(0,r.height-s.height);a>h?s=J(s,Math.min(r.width/s.width,tt(s,o({visibleArea:s,type:"resize"})))):h>a&&(s=J(s,Math.min(r.height/s.height,tt(s,o({visibleArea:s,type:"resize"}))))),s=at(s=G(s,Q(et(r,Y(s)))),o({visibleArea:s,type:"move"}))}return{visibleArea:s,coordinates:r}}function yt(t){var e=t.imageSize,i=t.visibleArea,n=t.coordinates,o=i||e;return{left:(i?i.left:0)+o.width/2-n.width/2,top:(i?i.top:0)+o.height/2-n.height/2}}function Rt(t){var e=t.imageSize,i=t.visibleArea,n=t.aspectRatio,o=t.sizeRestrictions,s=i||e,r=Math.min(n.maximum||1/0,Math.max(n.minimum||0,K(s))),a=s.width<s.height?{width:.8*s.width,height:.8*s.width/r}:{height:.8*s.height,width:.8*s.height*r};return pt(v(v({},a),{aspectRatio:n,sizeRestrictions:o}))}function zt(t){var e,i,n=t.imageSize,o=t.visibleArea,s=t.boundaries,r=t.aspectRatio,a=t.sizeRestrictions,h=t.stencilSize,c=o||n;return K(c)>K(s)?i=(e=h.height*c.height/s.height)*K(h):e=(i=h.width*c.width/s.width)/K(h),pt({width:i,height:e,aspectRatio:r,sizeRestrictions:a})}function At(t){var e=t.getAreaRestrictions,i=t.coordinates,n=t.imageSize,o=K(t.boundaries);if(i){var s={height:Math.max(i.height,n.height),width:Math.max(i.width,n.width)},r=nt({width:K(s)>o?s.width:s.height*o,height:K(s)>o?s.width/o:s.height},ht(e())),a={left:i.left+i.width/2-r.width/2,top:i.top+i.height/2-r.height/2,width:r.width,height:r.height},h=Z(i,Y(v({left:0,top:0},n))),c={};return!h.left&&!h.right&&a.width<=n.width&&(c.left=0,c.right=n.width),!h.top&&!h.bottom&&a.height<=n.height&&(c.top=0,c.bottom=n.height),at(a,c)}var l=K(n);return r={height:l>o?n.height:n.width/o,width:l>o?n.height*o:n.width},{left:n.width/2-r.width/2,top:n.height/2-r.height/2,width:r.width,height:r.height}}function St(t,e){return lt(t,Y(e))}function xt(t){var e=t.event,i=t.coordinates,n=t.visibleArea,o=t.sizeRestrictions,s=t.getAreaRestrictions,r=t.positionRestrictions,a=t.adjustStencil,h=e.scale,c=e.move,l=v({},n),u=v({},i),d=1,f=1,p=h.factor&&Math.abs(h.factor-1)>.001;l=G(l,{left:c.left||0,top:c.top||0});var m={stencil:{minimum:Math.max(o.minWidth?o.minWidth/u.width:0,o.minHeight?o.minHeight/u.height:0),maximum:Math.min(o.maxWidth?o.maxWidth/u.width:1/0,o.maxHeight?o.maxHeight/u.height:1/0,tt(u,r))},area:{maximum:tt(l,s({visibleArea:l,type:"resize"}))}};h.factor&&p&&(h.factor<1?(f=Math.max(h.factor,m.stencil.minimum))>1&&(f=1):h.factor>1&&(f=Math.min(h.factor,Math.min(m.area.maximum,m.stencil.maximum)))<1&&(f=1)),f&&(l=J(l,f,h.center));var g=i.left-n.left,b=n.width+n.left-(i.width+i.left),w=i.top-n.top,y=n.height+n.top-(i.height+i.top);return l=at(l=G(l,et(l,{left:void 0!==r.left?r.left-g*f:void 0,top:void 0!==r.top?r.top-w*f:void 0,bottom:void 0!==r.bottom?r.bottom+y*f:void 0,right:void 0!==r.right?r.right+b*f:void 0})),s({visibleArea:l,type:"move"})),u.width=u.width*f,u.height=u.height*f,u.left=l.left+g*f,u.top=l.top+w*f,u=at(u,ut(Y(l),r)),h.factor&&p&&a&&(h.factor>1?d=Math.min(m.area.maximum,h.factor)/f:h.factor<1&&(d=Math.max(u.height/l.height,u.width/l.width,h.factor/f)),1!==d&&(l=G(l=at(l=J(l,d,h.factor>1?h.center:V(u)),s({visibleArea:l,type:"move"})),Q(et(u,Y(l)))))),{coordinates:u,visibleArea:l}}function Mt(t){var e=t.aspectRatio,i=t.getAreaRestrictions,n=t.coordinates,o=t.visibleArea,s=t.sizeRestrictions,r=t.positionRestrictions,a=t.imageSize,h=t.previousImageSize,c=t.angle,l=v({},n),u=v({},o),d=st(V(v({left:0,top:0},h)),c);return(l=v(v({},pt({sizeRestrictions:s,aspectRatio:e,width:l.width,height:l.height})),st(V(l),c))).left-=d.left-a.width/2+l.width/2,l.top-=d.top-a.height/2+l.height/2,u=J(u,rt(u,i({visibleArea:u,type:"resize"}))),{coordinates:l=at(l,r),visibleArea:u=at(u=G(u,q(V(l),V(n))),i({visibleArea:u,type:"move"}))}}function Ot(t){var e=t.flip,i=t.previousFlip,n=t.rotate;t.aspectRatio;var o=t.getAreaRestrictions,s=t.coordinates,r=t.visibleArea,a=t.imageSize,h=v({},s),c=v({},r),l=i.horizontal!==e.horizontal,u=i.vertical!==e.vertical;if(l||u){var d=st({left:a.width/2,top:a.height/2},-n),f=st(V(h),-n),p=st({left:l?d.left-(f.left-d.left):f.left,top:u?d.top-(f.top-d.top):f.top},n);h=G(h,q(p,V(h))),f=st(V(c),-n),c=at(c=G(c,q(p=st({left:l?d.left-(f.left-d.left):f.left,top:u?d.top-(f.top-d.top):f.top},n),V(c))),o({visibleArea:c,type:"move"}))}return{coordinates:h,visibleArea:c}}function jt(t){var e=t.directions,i=t.coordinates,n=t.positionRestrictions,o=void 0===n?{}:n,s=t.sizeRestrictions,r=t.preserveRatio,a=t.compensate,h=v({},e),c=_(i,h).width,l=_(i,h).height;c<0&&(h.left<0&&h.right<0?(h.left=-(i.width-s.minWidth)/(h.left/h.right),h.right=-(i.width-s.minWidth)/(h.right/h.left)):h.left<0?h.left=-(i.width-s.minWidth):h.right<0&&(h.right=-(i.width-s.minWidth))),l<0&&(h.top<0&&h.bottom<0?(h.top=-(i.height-s.minHeight)/(h.top/h.bottom),h.bottom=-(i.height-s.minHeight)/(h.bottom/h.top)):h.top<0?h.top=-(i.height-s.minHeight):h.bottom<0&&(h.bottom=-(i.height-s.minHeight)));var u=Z(_(i,h),o);a&&(u.left&&u.left>0&&0===u.right?(h.right+=u.left,h.left-=u.left):u.right&&u.right>0&&0===u.left&&(h.left+=u.right,h.right-=u.right),u.top&&u.top>0&&0===u.bottom?(h.bottom+=u.top,h.top-=u.top):u.bottom&&u.bottom>0&&0===u.top&&(h.top+=u.bottom,h.bottom-=u.bottom),u=Z(_(i,h),o));var d={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(D.forEach((function(t){var e=u[t];e&&h[t]&&(d[t]=Math.max(0,1-e/h[t]))})),r){var f=Math.min.apply(null,D.map((function(t){return d[t]})));f!==1/0&&D.forEach((function(t){h[t]*=f}))}else D.forEach((function(t){d[t]!==1/0&&(h[t]*=d[t])}));if(c=_(i,h).width,l=_(i,h).height,h.right+h.left&&(c>s.maxWidth?d.width=(s.maxWidth-i.width)/(h.right+h.left):c<s.minWidth&&(d.width=(s.minWidth-i.width)/(h.right+h.left))),h.bottom+h.top&&(l>s.maxHeight?d.height=(s.maxHeight-i.height)/(h.bottom+h.top):l<s.minHeight&&(d.height=(s.minHeight-i.height)/(h.bottom+h.top))),r){var p=Math.min(d.width,d.height);p!==1/0&&D.forEach((function(t){h[t]*=p}))}else d.width!==1/0&&U.forEach((function(t){h[t]*=d.width})),d.height!==1/0&&I.forEach((function(t){h[t]*=d.height}));return h}function Ct(t,e,i){return 0==e&&0==i?t/2:0==e?0:0==i?t:t*Math.abs(e/(e+i))}var Et=p("vue-simple-handler"),kt=p("vue-simple-handler-wrapper"),Pt={name:"SimpleHandler",components:{HandlerWrapper:W},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var t,e=(r(t={},this.horizontalPosition,Boolean(this.horizontalPosition)),r(t,this.verticalPosition,Boolean(this.verticalPosition)),r(t,"".concat(this.horizontalPosition,"-").concat(this.verticalPosition),Boolean(this.verticalPosition&&this.horizontalPosition)),r(t,"hover",this.hover),t);return{default:f(Et(e),this.defaultClass,this.hover&&this.hoverClass),wrapper:f(kt(e),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"],render:function(t,e,i,o,s,r){var a=Object(n["resolveComponent"])("HandlerWrapper");return Object(n["openBlock"])(),Object(n["createBlock"])(a,{class:r.classes.wrapper,"vertical-position":i.verticalPosition,"horizontal-position":i.horizontalPosition,disabled:i.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])("div",{class:r.classes.default},null,2)]})),_:1},8,["class","vertical-position","horizontal-position","disabled","onDrag","onDragEnd","onEnter","onLeave"])}},Bt=p("vue-simple-line"),Lt=p("vue-simple-line-wrapper"),Wt={name:"SimpleLine",components:{LineWrapper:T},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:f(Bt(r({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:f(Lt(r({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"],render:function(t,e,i,o,s,r){var a=Object(n["resolveComponent"])("LineWrapper");return Object(n["openBlock"])(),Object(n["createBlock"])(a,{class:r.classes.wrapper,position:i.position,disabled:i.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])("div",{class:r.classes.root},null,2)]})),_:1},8,["class","position","disabled","onDrag","onDragEnd","onEnter","onLeave"])}},Ht=p("vue-bounding-box"),Tt=["east","west",null],Dt=["south","north",null],Ut={name:"BoundingBox",props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return Pt}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return Wt}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var t=[];return Tt.forEach((function(e){Dt.forEach((function(i){if(e!==i){var n=b(e,i),o=n.name,s=n.classname;t.push({name:o,classname:s,verticalDirection:i,horizontalDirection:e})}}))})),{points:t}},computed:{style:function(){var t={};return this.width&&this.height&&(t.width="".concat(this.width,"px"),t.height="".concat(this.height,"px"),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction))),t},classes:function(){var t=this.handlersClasses,e=this.handlersWrappersClasses,i=this.linesClasses,n=this.linesWrappersClasses;return{root:Ht(),handlers:t,handlersWrappers:e,lines:i,linesWrappers:n}},lineNodes:function(){var t=this,e=[];return this.points.forEach((function(i){i.horizontalDirection&&i.verticalDirection||!t.lines[i.name]||e.push({name:i.name,component:t.linesComponent,class:f(t.classes.lines.default,t.classes.lines[i.name],!t.resizable&&t.classes.lines.disabled),wrapperClass:f(t.classes.linesWrappers.default,t.classes.linesWrappers[i.name],!t.resizable&&t.classes.linesWrappers.disabled),hoverClass:t.classes.lines.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection,disabled:!t.resizable})})),e},handlerNodes:function(){var t=this,e=[],i=this.width,n=this.height;return this.points.forEach((function(o){if(t.handlers[o.name]){var s={name:o.name,component:t.handlersComponent,class:f(t.classes.handlers.default,t.classes.handlers[o.name]),wrapperClass:f(t.classes.handlersWrappers.default,t.classes.handlersWrappers[o.name]),hoverClass:t.classes.handlers.hover,verticalDirection:o.verticalDirection,horizontalDirection:o.horizontalDirection,disabled:!t.resizable};if(i&&n){var a=o.horizontalDirection,h=o.verticalDirection,c="east"===a?i:"west"===a?0:i/2,l="south"===h?n:"north"===h?0:n/2;s.wrapperClass=Ht("handler"),s.wrapperStyle={transform:"translate(".concat(c,"px, ").concat(l,"px)")},t.transitions&&t.transitions.enabled&&(s.wrapperStyle.transition="".concat(t.transitions.time,"ms ").concat(t.transitions.timingFunction))}else s.wrapperClass=Ht("handler",r({},o.classname,!0));e.push(s)}})),e}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onEnd:function(){this.$emit("resize-end")},onHandlerDrag:function(t,e,i){var n,o=t.shift(),s=o.left,r=o.top,a={left:0,right:0,top:0,bottom:0};"west"===e?a.left-=s:"east"===e&&(a.right+=s),"north"===i?a.top-=r:"south"===i&&(a.bottom+=r),!i&&e?n="width":i&&!e&&(n="height"),this.resizable&&this.$emit("resize",new E(a,{allowedDirections:{left:"west"===e||!e,right:"east"===e||!e,bottom:"south"===i||!i,top:"north"===i||!i},preserveAspectRatio:t.nativeEvent&&t.nativeEvent.shiftKey,respectDirection:n}))}},emits:["resize","resize-end"],render:function(t,e,i,o,s,r){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{ref:"box",class:r.classes.root,style:r.style},[Object(n["renderSlot"])(t.$slots,"default"),Object(n["createVNode"])("div",null,[(Object(n["openBlock"])(!0),Object(n["createBlock"])(n["Fragment"],null,Object(n["renderList"])(r.lineNodes,(function(t){return Object(n["openBlock"])(),Object(n["createBlock"])(Object(n["resolveDynamicComponent"])(t.component),{key:t.name,"default-class":t.class,"hover-class":t.hoverClass,"wrapper-class":t.wrapperClass,position:t.name,disabled:t.disabled,onDrag:function(e){return r.onHandlerDrag(e,t.horizontalDirection,t.verticalDirection)},onDragEnd:e[1]||(e[1]=function(t){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","position","disabled","onDrag"])})),128))]),(Object(n["openBlock"])(!0),Object(n["createBlock"])(n["Fragment"],null,Object(n["renderList"])(r.handlerNodes,(function(t){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{key:t.name,style:t.wrapperStyle,class:t.wrapperClass},[(Object(n["openBlock"])(),Object(n["createBlock"])(Object(n["resolveDynamicComponent"])(t.component),{"default-class":t.class,"hover-class":t.hoverClass,"wrapper-class":t.wrapperClass,"horizontal-position":t.horizontalDirection,"vertical-position":t.verticalDirection,disabled:t.disabled,onDrag:function(e){return r.onHandlerDrag(e,t.horizontalDirection,t.verticalDirection)},onDragEnd:e[2]||(e[2]=function(t){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","horizontal-position","vertical-position","disabled","onDrag"]))],6)})),128))],6)}},It=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.type="manipulateImage",this.move=t,this.scale=e},$t=function(t){this.type="move",this.directions=t},Ft=p("vue-draggable-area"),Nt={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:Ft()}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1},methods:{onTouchStart:function(t){if(t.cancelable){var e=this.movable&&1===t.touches.length;e&&(this.touches=h(t.touches)),(this.touchStarted||e)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){this.touches.length>=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):j({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable&&0===t.button){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.container.getBoundingClientRect(),i=e.left,n=e.top;this.anchor={x:t.clientX-i,y:t.clientY-n}},processMove:function(t,e){var i=h(e);if(this.touches.length){var n=this.$refs.container.getBoundingClientRect(),o=n.left,s=n.top;1===this.touches.length&&1===i.length&&this.$emit("move",new $t({left:i[0].clientX-(o+this.anchor.x),top:i[0].clientY-(s+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}},emits:["move","move-end"]};function Xt(t){var e,i;return{rotate:t.rotate||0,flip:{horizontal:(null===(e=null==t?void 0:t.flip)||void 0===e?void 0:e.horizontal)||!1,vertical:(null===(i=null==t?void 0:t.flip)||void 0===i?void 0:i.vertical)||!1}}}function Yt(t){return new Promise((function(e,i){try{if(t)if(/^data:/i.test(t))e(function(t){t=t.replace(/^data:([^;]+);base64,/gim,"");for(var e=atob(t),i=e.length,n=new ArrayBuffer(i),o=new Uint8Array(n),s=0;s<i;s++)o[s]=e.charCodeAt(s);return n}(t));else if(/^blob:/i.test(t)){var n=new FileReader;n.onload=function(t){e(t.target.result)},s=t,r=function(t){n.readAsArrayBuffer(t)},(a=new XMLHttpRequest).open("GET",s,!0),a.responseType="blob",a.onload=function(){200!=this.status&&0!==this.status||r(this.response)},a.send()}else{var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&(200===o.status||0===o.status?e(o.response):i("Warning: could not load an image to parse its orientation"),o=null)},o.onprogress=function(){"image/jpeg"!==o.getResponseHeader("content-type")&&o.abort()},o.withCredentials=!1,o.open("GET",t,!0),o.responseType="arraybuffer",o.send(null)}else i("Error: the image is empty")}catch(t){i(t)}var s,r,a}))}function qt(t){var e=t.rotate,i=t.flip,n=t.scaleX,o=t.scaleY,s="";return s+=" rotate("+e+"deg) ",s+=" scaleX("+n*(i.horizontal?-1:1)+") ",s+" scaleY("+o*(i.vertical?-1:1)+") "}function Vt(t){try{var e,i=new DataView(t),n=void 0,o=void 0,s=void 0,r=void 0;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var a=i.byteLength,h=2;h+1<a;){if(255===i.getUint8(h)&&225===i.getUint8(h+1)){s=h;break}h++}if(s&&(n=s+10,"Exif"===function(t,e,i){var n,o="";for(n=e,i+=e;n<i;n++)o+=String.fromCharCode(t.getUint8(n));return o}(i,s+4,4))){var c=i.getUint16(n);if(((o=18761===c)||19789===c)&&42===i.getUint16(n+2,o)){var l=i.getUint32(n+4,o);l>=8&&(r=n+l)}}if(r)for(var u=i.getUint16(r,o),d=0;d<u;d++)if(h=r+12*d+2,274===i.getUint16(h,o)){h+=8,e=i.getUint16(h,o),i.setUint16(h,1,o);break}return e}catch(t){return null}}Nt.render=function(t,e,i,o,s,r){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)})},[Object(n["renderSlot"])(t.$slots,"default")],544)};var Zt=p("vue-preview-result"),_t={name:"PreviewResult",props:{image:{type:Object},transitions:{type:Object},stencilCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}},imageClass:{type:String}},computed:{classes:function(){return{root:Zt(),wrapper:Zt("wrapper"),imageWrapper:Zt("image-wrapper"),image:f(Zt("image"),this.imageClass)}},wrapperStyle:function(){var t={width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"calc(50% - ".concat(this.stencilCoordinates.width/2,"px)"),top:"calc(50% - ".concat(this.stencilCoordinates.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){var t=this.image.transforms,e=ot({width:this.image.width,height:this.image.height},t.rotate),i={width:"".concat(this.image.width,"px"),height:"".concat(this.image.height,"px"),left:"0px",top:"0px"},n={left:(this.image.width-e.width)*t.scaleX/2,top:(this.image.height-e.height)*t.scaleY/2},o={left:(1-t.scaleX)*this.image.width/2,top:(1-t.scaleY)*this.image.height/2};return i.transform="translate(\n\t\t\t\t".concat(-this.stencilCoordinates.left-t.translateX-n.left-o.left,"px,").concat(-this.stencilCoordinates.top-t.translateY-n.top-o.top,"px) ")+qt(t),this.transitions&&this.transitions.enabled&&(i.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),i}}};function Qt(t,e){var i=e.getBoundingClientRect(),n=i.left,o=i.top,s={left:0,top:0},r=0;return t.forEach((function(e){s.left+=(e.clientX-n)/t.length,s.top+=(e.clientY-o)/t.length})),t.forEach((function(t){r+=j({x:s.left,y:s.top},{x:t.clientX-n,y:t.clientY-o})})),{centerMass:s,spread:r,count:t.length}}_t.render=function(t,e,i,o,s,r){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{class:r.classes.root},[Object(n["createVNode"])("div",{ref:"wrapper",class:r.classes.wrapper,style:r.wrapperStyle},[Object(n["createVNode"])("img",{ref:"image",src:i.image.src,class:r.classes.image,style:r.imageStyle},null,14,["src"])],6)],2)};var Gt={props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=g(this.processEnd),this.touches=[]},methods:{processMove:function(t,e){if(this.touches.length){if(1===this.touches.length&&1===e.length)this.$emit("move",new It({left:this.touches[0].clientX-e[0].clientX,top:this.touches[0].clientY-e[0].clientY}));else if(this.touches.length>1&&this.touchResize){var i=Qt(e,this.$refs.container),n=this.oldGeometricProperties;n.count===i.count&&n.count>1&&this.$emit("resize",new It({left:n.centerMass.left-i.centerMass.left,top:n.centerMass.top-i.centerMass.top},{factor:n.spread/i.spread,center:i.centerMass})),this.oldGeometricProperties=i}this.touches=e}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(t){return this.eventsFilter?!1!==this.eventsFilter(t,this.transforming):(t.preventDefault(),t.stopPropagation(),!0)},onTouchStart:function(t){if(t.cancelable&&(this.touchMove||this.touchResize&&t.touches.length>1)&&this.processEvent(t)){var e=this.$refs.container,i=e.getBoundingClientRect(),n=i.left,o=i.top,s=i.bottom,r=i.right;this.touches=h(t.touches).filter((function(t){return t.clientX>n&&t.clientX<r&&t.clientY>o&&t.clientY<s})),this.oldGeometricProperties=Qt(this.touches,e)}},onTouchEnd:function(t){0===t.touches.length&&(this.touches=[],this.processEnd())},onTouchMove:function(t){var e=this;if(this.touches.length){var i=h(t.touches).filter((function(t){return!t.identifier||e.touches.find((function(e){return e.identifier===t.identifier}))}));this.processEvent(t)&&(this.processMove(t,i),this.processStart())}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&1===t.buttons&&this.processEvent(t)){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.processStart()}},onMouseMove:function(t){this.touches.length&&this.processEvent(t)&&this.processMove(t,[{clientX:t.clientX,clientY:t.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(t){if(this.wheelResize&&this.processEvent(t)){var e=this.$refs.container.getBoundingClientRect(),i=e.left,n=e.top,o=1+this.wheelResize.ratio*(r=t.deltaY||t.detail||t.wheelDelta,0===(a=+r)||O(a)?a:a>0?1:-1),s={left:t.clientX-i,top:t.clientY-n};this.$emit("resize",new It({},{factor:o,center:s})),this.touches.length||this.debouncedProcessEnd()}var r,a}},emits:["resize","move","transform-end"],render:function(t,e,i,o,s,r){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onWheel:e[3]||(e[3]=function(){return r.onWheel&&r.onWheel.apply(r,arguments)})},[Object(n["renderSlot"])(t.$slots,"default")],544)}},Jt={components:{TransformableImage:Gt},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:["resize","move"],render:function(t,e,i,o,s,r){var a=Object(n["resolveComponent"])("transformable-image");return Object(n["openBlock"])(),Object(n["createBlock"])(a,{"touch-move":i.touchMove,"touch-resize":i.touchResize,"mouse-move":i.mouseMove,"wheel-resize":i.wheelResize,onMove:e[1]||(e[1]=function(e){return t.$emit("move",e)}),onResize:e[2]||(e[2]=function(e){return t.$emit("resize",e)})},{default:Object(n["withCtx"])((function(){return[Object(n["renderSlot"])(t.$slots,"default")]})),_:3},8,["touch-move","touch-resize","mouse-move","wheel-resize"])}},Kt=p("vue-preview"),te={props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:Kt({fill:this.fill}),wrapper:Kt("wrapper"),imageWrapper:Kt("image-wrapper"),image:f(Kt("image"),this.imageClass)}},style:function(){if(this.fill)return{};var t={};return this.width&&(t.width="".concat(this.size.width,"px")),this.height&&(t.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},wrapperStyle:function(){var t={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){if(this.coordinates&&this.image){var t=this.coordinates.width/this.size.width,e=s(s({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),i=this.imageSize.width,n=this.imageSize.height,o=ot({width:i,height:n},e.rotate),r={width:"".concat(i,"px"),height:"".concat(n,"px"),left:"0px",top:"0px"},a={rotate:{left:(i-o.width)*e.scaleX/2,top:(n-o.height)*e.scaleY/2},scale:{left:(1-e.scaleX)*i/2,top:(1-e.scaleY)*n/2}};return r.transform="translate(\n\t\t\t\t".concat(-this.coordinates.left/t-a.rotate.left-a.scale.left,"px,").concat(-this.coordinates.top/t-a.rotate.top-a.scale.top,"px) ")+qt(e),this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",(function(){t.refreshImage()})),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}},render:function(t,e,i,o,s,r){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{ref:"root",class:r.classes.root,style:r.style},[Object(n["createVNode"])("div",{ref:"wrapper",class:r.classes.wrapper,style:r.wrapperStyle},[Object(n["withDirectives"])(Object(n["createVNode"])("img",{ref:"image",src:i.image&&i.image.src,class:r.classes.image,style:r.imageStyle},null,14,["src"]),[[n["vShow"],i.image&&i.image.src]])],6)],6)}},ee={components:{Preview:te},inheritAttrs:!1,render:function(t,e,i,o,s,r){var a=Object(n["resolveComponent"])("preview");return Object(n["openBlock"])(),Object(n["createBlock"])(a,Object(n["mergeProps"])(t.$attrs,{fill:!0}),null,16)}},ie=p("vue-rectangle-stencil"),ne={name:"RectangleStencil",components:{StencilPreview:ee,BoundingBox:Ut,DraggableArea:Nt},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return Pt}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return Wt}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:f(ie({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:f(ie("preview"),this.previewClass),boundingBox:f(ie("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,i=t.width,n=t.left,o=t.top,s={width:"".concat(i,"px"),height:"".concat(e,"px"),transform:"translate(".concat(n,"px, ").concat(o,"px)")};return this.transitions&&this.transitions.enabled&&(s.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),s}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"],render:function(t,e,i,o,s,r){var a=Object(n["resolveComponent"])("stencil-preview"),h=Object(n["resolveComponent"])("draggable-area"),c=Object(n["resolveComponent"])("bounding-box");return Object(n["openBlock"])(),Object(n["createBlock"])("div",{class:r.classes.stencil,style:r.style},[Object(n["createVNode"])(c,{width:i.stencilCoordinates.width,height:i.stencilCoordinates.height,transitions:i.transitions,class:r.classes.boundingBox,handlers:i.handlers,"handlers-component":i.handlersComponent,"handlers-classes":i.handlersClasses,"handlers-wrappers-classes":i.handlersWrappersClasses,lines:i.lines,"lines-component":i.linesComponent,"lines-classes":i.linesClasses,"lines-wrappers-classes":i.linesWrappersClasses,resizable:i.resizable,onResize:r.onResize,onResizeEnd:r.onResizeEnd},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(h,{movable:i.movable,onMove:r.onMove,onMoveEnd:r.onMoveEnd},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(a,{image:i.image,coordinates:i.coordinates,width:i.stencilCoordinates.width,height:i.stencilCoordinates.height,class:r.classes.preview,transitions:i.transitions},null,8,["image","coordinates","width","height","class","transitions"])]})),_:1},8,["movable","onMove","onMoveEnd"])]})),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)}},oe=p("vue-circle-stencil"),se=(Boolean,Boolean,["transitions"]),re=p("vue-advanced-cropper"),ae={name:"Cropper",components:{BackgroundWrapper:Jt},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return ne}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Jt}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return-1!==F.indexOf(t)}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return!("string"==typeof t&&"fill"!==t&&"fit"!==t)}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var e=t.event,i=t.coordinates,n=t.aspectRatio,o=t.positionRestrictions,s=t.sizeRestrictions,r=v(v({},i),{right:i.left+i.width,bottom:i.top+i.height}),a=e.params||{},h=v({},e.directions),c=a.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};s.widthFrozen&&(h.left=0,h.right=0),s.heightFrozen&&(h.top=0,h.bottom=0),D.forEach((function(t){c[t]||(h[t]=0)}));var l=_(r,h=jt({coordinates:r,directions:h,sizeRestrictions:s,positionRestrictions:o})).width,u=_(r,h).height,d=a.preserveRatio?K(r):it(l/u,n);if(d){var f=a.respectDirection;if(f||(f=r.width>=r.height||1===d?"width":"height"),"width"===f){var p=l/d-r.height;if(c.top&&c.bottom){var m=h.top,g=h.bottom;h.bottom=Ct(p,g,m),h.top=Ct(p,m,g)}else c.bottom?h.bottom=p:c.top?h.top=p:c.right?h.right=0:c.left&&(h.left=0)}else if("height"===f){var b=r.width-u*d;if(c.left&&c.right){var w=h.left,y=h.right;h.left=-Ct(b,w,y),h.right=-Ct(b,y,w)}else c.left?h.left=-b:c.right?h.right=-b:c.top?h.top=0:c.bottom&&(h.bottom=0)}h=jt({directions:h,coordinates:r,sizeRestrictions:s,positionRestrictions:o,preserveRatio:!0,compensate:a.compensate})}return l=_(r,h).width,u=_(r,h).height,(d=a.preserveRatio?K(r):it(l/u,n))&&Math.abs(d-l/u)>.001&&D.forEach((function(t){c[t]||(h[t]=0)})),mt({event:new k({left:-h.left,top:-h.top}),coordinates:{width:i.width+h.right+h.left,height:i.height+h.top+h.bottom,left:i.left,top:i.top},positionRestrictions:o})}},moveAlgorithm:{type:Function,default:mt},initStretcher:{type:Function,default:function(t){var e=t.stretcher,i=t.imageSize,n=K(i);e.style.width=i.width+"px",e.style.height=e.clientWidth/n+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,i=t.coordinates,n=t.aspectRatio,o=t.sizeRestrictions,s=t.positionRestrictions,r=v(v({},i),pt({width:i.width,height:i.height,aspectRatio:n,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,o.minHeight),minWidth:Math.min(e.width,o.minWidth)}}));return at(r=G(r,q(V(i),V(r))),ut(Y(e),s))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,i=t.boundaries,n=t.getAreaRestrictions,o=t.coordinates,s=v({},e);s.height=s.width/K(i),s.top+=(e.height-s.height)/2,(o.height-s.height>0||o.width-s.width>0)&&(s=J(s,Math.max(o.height/s.height,o.width/s.width)));var r=Q(et(o,Y(s=J(s,rt(s,n({visibleArea:s,type:"resize"}))))));return s.width<o.width&&(r.left=0),s.height<o.height&&(r.top=0),at(s=G(s,r),n({visibleArea:s,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.visibleArea,i=t.boundaries,n=t.imageSize,o=t.imageRestriction,s=t.type,r={};return"fill-area"===o?r={left:0,top:0,right:n.width,bottom:n.height}:"fit-area"===o&&(K(i)>K(n)?(r={top:0,bottom:n.height},e&&"move"===s&&(e.width>n.width?(r.left=-(e.width-n.width)/2,r.right=n.width-r.left):(r.left=0,r.right=n.width))):(r={left:0,right:n.width},e&&"move"===s&&(e.height>n.height?(r.top=-(e.height-n.height)/2,r.bottom=n.height-r.top):(r.top=0,r.bottom=n.height)))),r}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.imageSize,i={};return"none"!==t.imageRestriction&&(i={left:0,top:0,right:e.width,bottom:e.height}),i}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:s({},N)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=function(t){return t*Math.PI/180}(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return Boolean(this.visibleArea&&this.imageLoaded)},settings:function(){var t=S(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:S(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:z(this.minWidth)?0:x(this.minWidth),minHeight:z(this.minHeight)?0:x(this.minHeight),maxWidth:z(this.maxWidth)?1/0:x(this.maxWidth),maxHeight:z(this.maxHeight)?1/0:x(this.maxHeight)});if(t=function(t){var e=t.areaRestrictions,i=t.sizeRestrictions;t.imageSize;var n=t.boundaries,o=t.positionRestrictions;t.imageRestriction;var s=v(v({},i),{minWidth:void 0!==i.minWidth?i.minWidth:0,minHeight:void 0!==i.minHeight?i.minHeight:0,maxWidth:void 0!==i.maxWidth?i.maxWidth:1/0,maxHeight:void 0!==i.maxHeight?i.maxHeight:1/0});void 0!==o.left&&void 0!==o.right&&(s.maxWidth=Math.min(s.maxWidth,o.right-o.left)),void 0!==o.bottom&&void 0!==o.top&&(s.maxHeight=Math.min(s.maxHeight,o.bottom-o.top));var r=ht(e),a=nt(n,r);return r.width<1/0&&(!s.maxWidth||s.maxWidth>a.width)&&(s.maxWidth=Math.min(s.maxWidth,a.width)),r.height<1/0&&(!s.maxHeight||s.maxHeight>a.height)&&(s.maxHeight=Math.min(s.maxHeight,a.height)),s.minWidth>s.maxWidth&&(s.minWidth=s.maxWidth,s.widthFrozen=!0),s.minHeight>s.maxHeight&&(s.minHeight=s.maxHeight,s.heightFrozen=!0),s}({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),i=ht(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,i.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,i.height*e.height/this.boundaries.height),t.maxWidth<t.minWidth&&(t.minWidth=t.maxWidth),t.maxHeight<t.minHeight&&(t.minHeight=t.maxHeight)}return t}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:re(),image:f(re("image"),this.imageClass),stencil:re("stencil"),boundaries:f(re("boundaries"),this.boundariesClass),stretcher:f(re("stretcher")),background:f(re("background"),this.backgroundClass),foreground:f(re("foreground"),this.foregroundClass),imageWrapper:f(re("image-wrapper")),cropperWrapper:f(re("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var t=this.coordinates,e=t.width,i=t.height,n=t.left,o=t.top;return{width:e/this.coefficient,height:i/this.coefficient,left:(n-this.visibleArea.left)/this.coefficient,top:(o-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var t={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(t.opacity="0"),t},imageStyle:function(){var t=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},e={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},i={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},n=s(s({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),o={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e.left-i.left-this.imageTransforms.translateX,"px, ").concat(-e.top-i.top-this.imageTransforms.translateY,"px)")+qt(n)};return this.transitionsOptions.enabled&&(o.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),o}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick((function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()}))},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find((function(i){return t[i]!==e[i]}))&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=g(this.update,this.debounce),this.debouncedDisableTransitions=g(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src)},methods:{getResult:function(){var t=this.initialized?this.prepareResult(s({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:s({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var i=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?s({},this.visibleArea):null,imageTransforms:e,get canvas(){return i.canvas?i.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?s({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.transitions,o=void 0===n||n;this.onManipulateImage(new C({},{factor:1/t,center:e}),{normalize:!1,transitions:o})},move:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.transitions,o=void 0===n||n;this.onManipulateImage(new C({left:t||0,top:e||0}),{normalize:!1,transitions:o})},setCoordinates:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.autoZoom,o=void 0===n||n,s=i.transitions,r=void 0===s||s;this.$nextTick((function(){e.imageLoaded?(e.transitionsActive||(r&&e.enableTransitions(),e.coordinates=e.applyTransform(t),o&&e.runAutoZoom("setCoordinates"),r&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t}))},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)return this.initialized?this.updateVisibleArea().then((function(){t.onChange()})):this.resetVisibleArea().then((function(){t.onChange()}))},reset:function(){var t=this;return this.resetVisibleArea().then((function(){t.onChange()}))},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick((function(){t(),e.awaiting=!1})))},prepareResult:function(t){return this.roundResult?function(t){var e=t.coordinates,i=t.sizeRestrictions,n=t.positionRestrictions,o={width:Math.round(e.width),height:Math.round(e.height),left:Math.round(e.left),top:Math.round(e.top)};return o.width>i.maxWidth?o.width=Math.floor(e.width):o.width<i.minWidth&&(o.width=Math.ceil(e.width)),o.height>i.maxHeight?o.height=Math.floor(e.height):o.height<i.minHeight&&(o.height=Math.ceil(e.height)),at(o,n)}(s(s({},this.getPublicProperties()),{},{positionRestrictions:St(this.positionRestrictions,this.visibleArea),coordinates:t})):t},processAutoZoom:function(t,e,i,n){var o=this.autoZoomAlgorithm;o||(o=this.stencilSize?vt:this.autoZoom?bt:wt);var r=o({event:{type:t,params:n},visibleArea:e,coordinates:i,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return s(s({},r),{},{changed:!X(r.visibleArea,e)||!X(r.coordinates,i)})},runAutoZoom:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.transitions,n=void 0!==i&&i,o=a(e,se),s=this.processAutoZoom(t,this.visibleArea,this.coordinates,o),r=s.visibleArea,h=s.coordinates,c=s.changed;n&&c&&this.enableTransitions(),this.visibleArea=r,this.coordinates=h,n&&c&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return function(t){var e=t.event,i=t.visibleArea,n=t.coefficient;if("manipulateImage"===e.type)return v(v({},e),{move:{left:e.move&&e.move.left?n*e.move.left:0,top:e.move&&e.move.top?n*e.move.top:0},scale:{factor:e.scale&&e.scale.factor?e.scale.factor:1,center:e.scale&&e.scale.center?{left:e.scale.center.left*n+i.left,top:e.scale.center.top*n+i.top}:null}});if("resize"===e.type){var o=v(v({},e),{directions:v({},e.directions)});return D.forEach((function(t){o.directions[t]*=n})),o}if("move"===e.type){var s=v(v({},e),{directions:v({},e.directions)});return $.forEach((function(t){s.directions[t]*=n})),s}return e}(s(s({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,i=0!==this.imageTransforms.rotate||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?function(t,e,i){var n=i.rotate,o=i.flip,s={width:e.naturalWidth,height:e.naturalHeight},r=ot(s,n),a=t.getContext("2d");t.height=r.height,t.width=r.width,a.save();var h=st(V(v({left:0,top:0},s)),n);return a.translate(-(h.left-r.width/2),-(h.top-r.height/2)),a.rotate(n*Math.PI/180),a.translate(o.horizontal?s.width:0,o.vertical?s.height:0),a.scale(o.horizontal?-1:1,o.vertical?-1:1),a.drawImage(e,0,0,s.width,s.height),a.restore(),t}(this.$refs.sourceCanvas,e,this.imageTransforms):e,n=s({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),o=function(t){return t.find((function(t){return e=t,!Number.isNaN(parseFloat(e))&&isFinite(e);var e}))},r=pt({sizeRestrictions:{minWidth:o([n.width,n.minWidth])||0,minHeight:o([n.height,n.minHeight])||0,maxWidth:o([n.width,n.maxWidth])||1/0,maxHeight:o([n.height,n.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(n.maxArea&&r.width*r.height>n.maxArea){var a=Math.sqrt(n.maxArea/(r.width*r.height));r={width:Math.round(a*r.width),height:Math.round(a*r.height)}}return function(t,e,i,n,o){t.width=n?n.width:i.width,t.height=n?n.height:i.height;var s=t.getContext("2d");s.clearRect(0,0,t.width,t.height),o&&(o.imageSmoothingEnabled&&(s.imageSmoothingEnabled=o.imageSmoothingEnabled),o.imageSmoothingQuality&&(s.imageSmoothingQuality=o.imageSmoothingQuality),o.fillColor&&(s.fillStyle=o.fillColor,s.fillRect(0,0,t.width,t.height),s.save())),s.drawImage(e,i.left,i.top,i.width,i.height,0,0,t.width,t.height)}(t,i,this.coordinates,r,n),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.visibleArea&&e?ct(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,n=this.visibleArea&&e?St(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return gt({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:i,positionRestrictions:n,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?zt:Rt);var i=this.sizeRestrictions;i.minWidth,i.minHeight,i.maxWidth,i.maxHeight;var n=R(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,o=this.defaultPosition||yt,r=[n,function(e){var i=e.coordinates;return s({},R(o)?o({coordinates:i,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&r.push.apply(r,h(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(r,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout((function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}}),this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,e=this.$refs.stretcher,i=this.$refs.cropper;return this.initStretcher({cropper:i,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then((function(){var e={cropper:i,imageSize:t.imageSize};if(R(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(e):"fit"===t.defaultBoundaries?t.boundaries=function(t){var e=t.cropper,i=t.imageSize,n=e.clientHeight,o=e.clientWidth,s=n,r=i.width*n/i.height;return r>o&&(r=o,s=i.height*o/i.width),{width:r,height:s}}(e):t.boundaries=function(t){var e=t.cropper;return{width:e.clientWidth,height:e.clientHeight}}(e),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")}))},resetVisibleArea:function(){var t=this;return this.updateBoundaries().then((function(){"visible-area"!==t.priority&&(t.visibleArea=null,t.resetCoordinates());var e,i,n,o,s,r,a=t.defaultVisibleArea||At;t.visibleArea=R(a)?a({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:"visible-area"!==t.priority?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions},i=e.visibleArea,n=e.boundaries,o=e.getAreaRestrictions,s=v({},i),r=K(n),s.width/s.height!==r&&(s.height=s.width/r),at(s,o({visibleArea:s,type:"move"}))),"visible-area"===t.priority?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")})).catch((function(){t.visibleArea=null}))},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then((function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")})).catch((function(){t.visibleArea=null}))},onChange:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if(function(t){if(y(t))return!1;var e=window.location,i=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(t)||[],n={protocol:i[1]||"",host:i[2]||"",port:i[3]||""},o=function(t){return t.port||("http"===(t.protocol||e.protocol)?80:433)};return!(!n.protocol&&!n.host&&!n.port||Boolean(n.protocol&&n.protocol==e.protocol&&n.host&&n.host==e.host&&n.host&&o(n)==o(e)))}(this.src)){var i=z(this.crossOrigin)?this.canvas:this.crossOrigin;!0===i&&(i="anonymous"),this.imageAttributes.crossOrigin=i||null}if(this.checkOrientation){var n=(t=this.src,new Promise((function(e){Yt(t).then((function(i){var n=Vt(i);e(i?{source:t,arrayBuffer:i,orientation:n}:{source:t,arrayBuffer:null,orientation:null})})).catch((function(i){console.warn(i),e({source:t,arrayBuffer:null,orientation:null})}))})));setTimeout((function(){n.then(e.onParseImage)}),this.transitionTime)}else setTimeout((function(){e.onParseImage({source:e.src})}),this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,e=this.$refs.image;e&&!this.imageLoaded&&(this.imageAttributes.height=e.naturalHeight,this.imageAttributes.width=e.naturalWidth,this.imageLoaded=!0,this.reset().then((function(){t.$emit("ready"),t.onChange(!1)})))},onParseImage:function(t){var e=this,i=t.source,n=t.arrayBuffer,o=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,n&&o&&o>1?w(i)||!y(i)?(this.imageAttributes.src=URL.createObjectURL(new Blob([n])),this.imageAttributes.revoke=!0):this.imageAttributes.src=function(t){for(var e=[],i=new Uint8Array(t);i.length>0;){var n=i.subarray(0,8192);e.push(String.fromCharCode.apply(null,Array.from?Array.from(n):n.slice())),i=i.subarray(8192)}return"data:image/jpeg;base64,"+btoa(e.join(""))}(n):this.imageAttributes.src=i,R(this.defaultTransforms)?this.appliedImageTransforms=Xt(this.defaultTransforms()):A(this.defaultTransforms)?this.appliedImageTransforms=Xt(this.defaultTransforms):this.appliedImageTransforms=function(t){var e=Xt({});if(t)switch(t){case 2:e.flip.horizontal=!0;break;case 3:e.rotate=-180;break;case 4:e.flip.vertical=!0;break;case 5:e.rotate=90,e.flip.vertical=!0;break;case 6:e.rotate=90;break;case 7:e.rotate=90,e.flip.horizontal=!0;break;case 8:e.rotate=-90}return e}(o),this.$nextTick((function(){var t=e.$refs.image;t&&t.complete&&(function(t){return Boolean(t.naturalWidth)}(t)?e.onSuccessLoadImage():e.onFailLoadImage())}))},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender((function(){e.coordinates=e.moveAlgorithm(s(s({},e.getPublicProperties()),{},{positionRestrictions:St(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()}))},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender((function(){var i=e.sizeRestrictions,n=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(s(s({},e.getPublicProperties()),{},{positionRestrictions:St(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(i.maxWidth,e.visibleArea.width),maxHeight:Math.min(i.maxHeight,e.visibleArea.height),minWidth:Math.max(i.minWidth,n),minHeight:Math.max(i.minHeight,n)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1}))},onManipulateImage:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.transitionsOptions.enabled){var i=e.transitions,n=void 0!==i&&i,o=e.normalize,r=void 0===o||o;n&&this.enableTransitions();var a=xt(s(s({},this.getPublicProperties()),{},{event:r?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),h=a.visibleArea,c=a.coordinates;this.visibleArea=h,this.coordinates=c,this.runAutoZoom("manipulateImage"),this.onChange(),n&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.visibleArea,i=t.type,n=void 0===i?"move":i;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:n})},getAspectRatio:function(t){var e,i,n=this.stencilProps,o=n.aspectRatio,s=n.minAspectRatio,r=n.maxAspectRatio;if(this.$refs.stencil.aspectRatios){var a=this.$refs.stencil.aspectRatios();e=a.minimum,i=a.maximum}if(z(e)&&(e=z(o)?s:o),z(i)&&(i=z(o)?r:o),!t&&(z(e)||z(i))){var h=this.getStencilSize(),c=h?K(h):null;z(e)&&(e=M(c)?c:void 0),z(i)&&(i=M(c)?c:void 0)}return{minimum:e,maximum:i}},getStencilSize:function(){if(this.stencilSize)return t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},e=t.boundaries,i=t.stencilSize,n=t.aspectRatio,it(K(o=R(i)?i({boundaries:e,aspectRatio:n}):i),n)&&(o=pt({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:n.minimum,maximum:n.maximum}})),(o.width>e.width||o.height>e.height)&&(o=pt({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:K(o),maximum:K(o)}})),o;var t,e,i,n,o},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return s({},N)},flip:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.transitions,o=void 0===n||n;if(!this.transitionsActive){o&&this.enableTransitions();var r=s({},this.imageTransforms.flip),a=Ot({flip:{horizontal:t?!r.horizontal:r.horizontal,vertical:e?!r.vertical:r.vertical},previousFlip:r,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),h=a.visibleArea,c=a.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=h,this.coordinates=c,this.onChange(),o&&this.debouncedDisableTransitions()}},rotate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.transitions,n=void 0===i||i;if(!this.transitionsActive){n&&this.enableTransitions();var o=s({},this.imageSize);this.appliedImageTransforms.rotate+=t;var r=Mt({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:o,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=r.visibleArea,h=r.coordinates,c=this.processAutoZoom("rotateImage",a,h);a=c.visibleArea,h=c.coordinates,this.visibleArea=a,this.coordinates=h,this.onChange(),n&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},he={key:0,ref:"canvas",style:{display:"none"}},ce={key:1,ref:"sourceCanvas",style:{display:"none"}};ae.render=function(t,e,i,o,s,r){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{ref:"cropper",class:r.classes.cropper},[Object(n["createVNode"])("div",{ref:"stretcher",class:r.classes.stretcher},null,2),Object(n["createVNode"])("div",{class:r.classes.boundaries,style:r.boundariesStyle},[(Object(n["openBlock"])(),Object(n["createBlock"])(Object(n["resolveDynamicComponent"])(i.backgroundWrapperComponent),{class:r.classes.cropperWrapper,"wheel-resize":r.settings.resizeImage.wheel,"touch-resize":r.settings.resizeImage.touch,"touch-move":r.settings.moveImage.touch,"mouse-move":r.settings.moveImage.mouse,onMove:r.onManipulateImage,onResize:r.onManipulateImage},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])("div",{class:r.classes.background,style:r.boundariesStyle},null,6),Object(n["createVNode"])("div",{class:r.classes.imageWrapper},[Object(n["createVNode"])("img",{ref:"image",crossorigin:s.imageAttributes.crossOrigin,src:s.imageAttributes.src,class:r.classes.image,style:r.imageStyle,onMousedown:e[1]||(e[1]=Object(n["withModifiers"])((function(){}),["prevent"]))},null,46,["crossorigin","src"])],2),Object(n["createVNode"])("div",{class:r.classes.foreground,style:r.boundariesStyle},null,6),Object(n["withDirectives"])((Object(n["openBlock"])(),Object(n["createBlock"])(Object(n["resolveDynamicComponent"])(i.stencilComponent),Object(n["mergeProps"])({ref:"stencil",image:r.image,coordinates:s.coordinates,"stencil-coordinates":r.stencilCoordinates,transitions:r.transitionsOptions},i.stencilProps,{onResize:r.onResize,onResizeEnd:r.onResizeEnd,onMove:r.onMove,onMoveEnd:r.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[n["vShow"],s.imageLoaded]]),i.canvas?(Object(n["openBlock"])(),Object(n["createBlock"])("canvas",he,null,512)):Object(n["createCommentVNode"])("",!0),i.canvas?(Object(n["openBlock"])(),Object(n["createBlock"])("canvas",ce,null,512)):Object(n["createCommentVNode"])("",!0)]})),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)}},9861:function(t,e,i){"use strict";i("e260");var n=i("23e7"),o=i("da84"),s=i("d066"),r=i("c65b"),a=i("e330"),h=i("0d3b"),c=i("6eeb"),l=i("e2cc"),u=i("d44e"),d=i("9ed3"),f=i("69f3"),p=i("19aa"),m=i("1626"),g=i("1a2d"),v=i("0366"),b=i("f5df"),w=i("825a"),y=i("861d"),R=i("577e"),z=i("7c73"),A=i("5c6c"),S=i("9a1f"),x=i("35a1"),M=i("d6d6"),O=i("b622"),j=i("addb"),C=O("iterator"),E="URLSearchParams",k=E+"Iterator",P=f.set,B=f.getterFor(E),L=f.getterFor(k),W=s("fetch"),H=s("Request"),T=s("Headers"),D=H&&H.prototype,U=T&&T.prototype,I=o.RegExp,$=o.TypeError,F=o.decodeURIComponent,N=o.encodeURIComponent,X=a("".charAt),Y=a([].join),q=a([].push),V=a("".replace),Z=a([].shift),_=a([].splice),Q=a("".split),G=a("".slice),J=/\+/g,K=Array(4),tt=function(t){return K[t-1]||(K[t-1]=I("((?:%[\\da-f]{2}){"+t+"})","gi"))},et=function(t){try{return F(t)}catch(e){return t}},it=function(t){var e=V(t,J," "),i=4;try{return F(e)}catch(n){while(i)e=V(e,tt(i--),et);return e}},nt=/[!'()~]|%20/g,ot={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},st=function(t){return ot[t]},rt=function(t){return V(N(t),nt,st)},at=d((function(t,e){P(this,{type:k,iterator:S(B(t).entries),kind:e})}),"Iterator",(function(){var t=L(this),e=t.kind,i=t.iterator.next(),n=i.value;return i.done||(i.value="keys"===e?n.key:"values"===e?n.value:[n.key,n.value]),i}),!0),ht=function(t){this.entries=[],this.url=null,void 0!==t&&(y(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===X(t,0)?G(t,1):t:R(t)))};ht.prototype={type:E,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,i,n,o,s,a,h,c=x(t);if(c){e=S(t,c),i=e.next;while(!(n=r(i,e)).done){if(o=S(w(n.value)),s=o.next,(a=r(s,o)).done||(h=r(s,o)).done||!r(s,o).done)throw $("Expected sequence with length 2");q(this.entries,{key:R(a.value),value:R(h.value)})}}else for(var l in t)g(t,l)&&q(this.entries,{key:l,value:R(t[l])})},parseQuery:function(t){if(t){var e,i,n=Q(t,"&"),o=0;while(o<n.length)e=n[o++],e.length&&(i=Q(e,"="),q(this.entries,{key:it(Z(i)),value:it(Y(i,"="))}))}},serialize:function(){var t,e=this.entries,i=[],n=0;while(n<e.length)t=e[n++],q(i,rt(t.key)+"="+rt(t.value));return Y(i,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ct=function(){p(this,lt);var t=arguments.length>0?arguments[0]:void 0;P(this,new ht(t))},lt=ct.prototype;if(l(lt,{append:function(t,e){M(arguments.length,2);var i=B(this);q(i.entries,{key:R(t),value:R(e)}),i.updateURL()},delete:function(t){M(arguments.length,1);var e=B(this),i=e.entries,n=R(t),o=0;while(o<i.length)i[o].key===n?_(i,o,1):o++;e.updateURL()},get:function(t){M(arguments.length,1);for(var e=B(this).entries,i=R(t),n=0;n<e.length;n++)if(e[n].key===i)return e[n].value;return null},getAll:function(t){M(arguments.length,1);for(var e=B(this).entries,i=R(t),n=[],o=0;o<e.length;o++)e[o].key===i&&q(n,e[o].value);return n},has:function(t){M(arguments.length,1);var e=B(this).entries,i=R(t),n=0;while(n<e.length)if(e[n++].key===i)return!0;return!1},set:function(t,e){M(arguments.length,1);for(var i,n=B(this),o=n.entries,s=!1,r=R(t),a=R(e),h=0;h<o.length;h++)i=o[h],i.key===r&&(s?_(o,h--,1):(s=!0,i.value=a));s||q(o,{key:r,value:a}),n.updateURL()},sort:function(){var t=B(this);j(t.entries,(function(t,e){return t.key>e.key?1:-1})),t.updateURL()},forEach:function(t){var e,i=B(this).entries,n=v(t,arguments.length>1?arguments[1]:void 0),o=0;while(o<i.length)e=i[o++],n(e.value,e.key,this)},keys:function(){return new at(this,"keys")},values:function(){return new at(this,"values")},entries:function(){return new at(this,"entries")}},{enumerable:!0}),c(lt,C,lt.entries,{name:"entries"}),c(lt,"toString",(function(){return B(this).serialize()}),{enumerable:!0}),u(ct,E),n({global:!0,forced:!h},{URLSearchParams:ct}),!h&&m(T)){var ut=a(U.has),dt=a(U.set),ft=function(t){if(y(t)){var e,i=t.body;if(b(i)===E)return e=t.headers?new T(t.headers):new T,ut(e,"content-type")||dt(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),z(t,{body:A(0,R(i)),headers:A(0,e)})}return t};if(m(W)&&n({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return W(t,arguments.length>1?ft(arguments[1]):{})}}),m(H)){var pt=function(t){return p(this,D),new H(t,arguments.length>1?ft(arguments[1]):{})};D.constructor=pt,pt.prototype=D,n({global:!0,forced:!0},{Request:pt})}}t.exports={URLSearchParams:ct,getState:B}},"9bdd":function(t,e,i){var n=i("825a"),o=i("2a62");t.exports=function(t,e,i,s){try{return s?e(n(i)[0],i[1]):e(i)}catch(r){o(t,"throw",r)}}},addb:function(t,e,i){var n=i("4dae"),o=Math.floor,s=function(t,e){var i=t.length,h=o(i/2);return i<8?r(t,e):a(t,s(n(t,0,h),e),s(n(t,h),e),e)},r=function(t,e){var i,n,o=t.length,s=1;while(s<o){n=s,i=t[s];while(n&&e(t[n-1],i)>0)t[n]=t[--n];n!==s++&&(t[n]=i)}return t},a=function(t,e,i,n){var o=e.length,s=i.length,r=0,a=0;while(r<o||a<s)t[r+a]=r<o&&a<s?n(e[r],i[a])<=0?e[r++]:i[a++]:r<o?e[r++]:i[a++];return t};t.exports=s},f7aa:function(t,e,i){}}]);
|