Loading
function(e,t,n){"use strict";var r=n(89738);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,o=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["'"].concat(["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n"," "])),u=["%","/","?",";","#"].concat(l),c=["/","?","#"],d=255,_=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},h={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},E=n(591560);function g(e,t,n){if(e&&"object"==typeof e&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}function A(e){return("string"==typeof e&&(e=g(e)),e instanceof i)?e.format():i.prototype.format.call(e)}function I(e,t){return g(e,!1,!0).resolve(t)}function T(e,t){return e?g(e,!1,!0).resolveObject(t):t}i.prototype.parse=function(e,t,n){if("string"!=typeof e)throw TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),a=-1!==i&&i<e.indexOf("#")?"?":"#",g=e.split(a),A=/\\/g;g[0]=g[0].replace(A,"/");var I=e=g.join(a);if(I=I.trim(),!n&&1===e.split("#").length){var T=o.exec(I);if(T)return this.path=I,this.href=I,this.pathname=T[1],T[2]?(this.search=T[2],t?this.query=E.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var S=s.exec(I);if(S){var y=(S=S[0]).toLowerCase();this.protocol=y,I=I.substr(S.length)}if(n||S||I.match(/^\/\/[^@/]+@[^@/]+/)){var v="//"===I.substr(0,2);v&&!(S&&h[S])&&(I=I.substr(2),this.slashes=!0)}if(!h[S]&&(v||S&&!m[S])){for(var N,C,R=-1,O=0;O<c.length;O++){var b=I.indexOf(c[O]);-1!==b&&(-1===R||b<R)&&(R=b)}-1!==(C=-1===R?I.lastIndexOf("@"):I.lastIndexOf("@",R))&&(N=I.slice(0,C),I=I.slice(C+1),this.auth=decodeURIComponent(N)),R=-1;for(var O=0;O<u.length;O++){var b=I.indexOf(u[O]);-1!==b&&(-1===R||b<R)&&(R=b)}-1===R&&(R=I.length),this.host=I.slice(0,R),I=I.slice(R),this.parseHost(),this.hostname=this.hostname||"";var D="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!D)for(var L=this.hostname.split(/\./),O=0,w=L.length;O<w;O++){var M=L[O];if(M&&!M.match(_)){for(var P="",x=0,k=M.length;x<k;x++)M.charCodeAt(x)>127?P+="x":P+=M[x];if(!P.match(_)){var U=L.slice(0,O),G=L.slice(O+1),F=M.match(f);F&&(U.push(F[1]),G.unshift(F[2])),G.length&&(I="/"+G.join(".")+I),this.hostname=U.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),D||(this.hostname=r.toASCII(this.hostname));var V=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+V,this.href+=this.host,D&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==I[0]&&(I="/"+I))}if(!p[y])for(var O=0,w=l.length;O<w;O++){var H=l[O];if(-1!==I.indexOf(H)){var j=encodeURIComponent(H);j===H&&(j=escape(H)),I=I.split(H).join(j)}}var Y=I.indexOf("#");-1!==Y&&(this.hash=I.substr(Y),I=I.slice(0,Y));var W=I.indexOf("?");if(-1!==W?(this.search=I.substr(W),this.query=I.substr(W+1),t&&(this.query=E.parse(this.query)),I=I.slice(0,W)):t&&(this.search="",this.query={}),I&&(this.pathname=I),m[y]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var V=this.pathname||"",K=this.search||"";this.path=V+K}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":")+"@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,s="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(s=E.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var a=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||m[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+i+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(a=a.replace("#","%23"))+r},i.prototype.resolve=function(e){return this.resolveObject(g(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if("string"==typeof e){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,r=Object.keys(this),s=0;s<r.length;s++){var a=r[s];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var o=Object.keys(e),l=0;l<o.length;l++){var u=o[l];"protocol"!==u&&(n[u]=e[u])}return m[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!m[e.protocol]){for(var c=Object.keys(e),d=0;d<c.length;d++){var _=c[d];n[_]=e[_]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||h[e.protocol])n.pathname=e.pathname;else{for(var f=(e.pathname||"").split("/");f.length&&!(e.host=f.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),n.pathname=f.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var p=n.pathname||"",E=n.search||"";n.path=p+E}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var g=n.pathname&&"/"===n.pathname.charAt(0),A=e.host||e.pathname&&"/"===e.pathname.charAt(0),I=A||g||n.host&&e.pathname,T=I,S=n.pathname&&n.pathname.split("/")||[],f=e.pathname&&e.pathname.split("/")||[],y=n.protocol&&!m[n.protocol];if(y&&(n.hostname="",n.port=null,n.host&&(""===S[0]?S[0]=n.host:S.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===f[0]?f[0]=e.host:f.unshift(e.host)),e.host=null),I=I&&(""===f[0]||""===S[0])),A)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,S=f;else if(f.length)S||(S=[]),S.pop(),S=S.concat(f),n.search=e.search,n.query=e.query;else if(null!=e.search){if(y){n.host=S.shift(),n.hostname=n.host;var v=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");v&&(n.auth=v.shift(),n.hostname=v.shift(),n.host=n.hostname)}return n.search=e.search,n.query=e.query,(null!==n.pathname||null!==n.search)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!S.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var N=S.slice(-1)[0],C=(n.host||e.host||S.length>1)&&("."===N||".."===N)||""===N,R=0,O=S.length;O>=0;O--)"."===(N=S[O])?S.splice(O,1):".."===N?(S.splice(O,1),R++):R&&(S.splice(O,1),R--);if(!I&&!T)for(;R--;)S.unshift("..");I&&""!==S[0]&&(!S[0]||"/"!==S[0].charAt(0))&&S.unshift(""),C&&"/"!==S.join("/").substr(-1)&&S.push("");var b=""===S[0]||S[0]&&"/"===S[0].charAt(0);if(y){n.hostname=b?"":S.length?S.shift():"",n.host=n.hostname;var v=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");v&&(n.auth=v.shift(),n.hostname=v.shift(),n.host=n.hostname)}return(I=I||n.host&&S.length)&&!b&&S.unshift(""),S.length>0?n.pathname=S.join("/"):(n.pathname=null,n.path=null),(null!==n.pathname||null!==n.search)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=g,t.resolve=I,t.resolveObject=T,t.format=A,t.Url=i}