qa-prevention-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/Resource-8ae1a924.js

40 lines
68 KiB
JavaScript

define(["exports","./when-422ea0ae","./Check-741c5f3c","./defaultValue-81eec7ed","./combine-3c023bda","./Math-e73894ab","./RuntimeError-26acdd3b"],(function(e,t,r,n,o,s,i){"use strict";var a=t.createCommonjsModule((function(e,r){!function(n){var o=r&&!r.nodeType&&r,s=e&&!e.nodeType&&e,i="object"==typeof t.commonjsGlobal&&t.commonjsGlobal;i.global!==i&&i.window!==i&&i.self!==i||(n=i);var a,u,c=2147483647,l=36,p=/^xn--/,h=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function v(e){throw new RangeError(f[e])}function y(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function b(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+y((e=e.replace(d,".")).split("."),t).join(".")}function _(e){for(var t,r,n=[],o=0,s=e.length;o<s;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<s?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function w(e){return y(e,(function(e){var t="";return e>65535&&(t+=g((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=g(e)})).join("")}function A(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function q(e,t,r){var n=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;n+=l)e=m(e/35);return m(n+36*e/(e+38))}function k(e){var t,r,n,o,s,i,a,u,p,h,d,f=[],g=e.length,y=0,b=128,_=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&v("not-basic"),f.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<g;){for(s=y,i=1,a=l;o>=g&&v("invalid-input"),((u=(d=e.charCodeAt(o++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:l)>=l||u>m((c-y)/i))&&v("overflow"),y+=u*i,!(u<(p=a<=_?1:a>=_+26?26:a-_));a+=l)i>m(c/(h=l-p))&&v("overflow"),i*=h;_=q(y-s,t=f.length+1,0==s),m(y/t)>c-b&&v("overflow"),b+=m(y/t),y%=t,f.splice(y++,0,b)}return w(f)}function I(e){var t,r,n,o,s,i,a,u,p,h,d,f,y,b,w,k=[];for(f=(e=_(e)).length,t=128,r=0,s=72,i=0;i<f;++i)(d=e[i])<128&&k.push(g(d));for(n=o=k.length,o&&k.push("-");n<f;){for(a=c,i=0;i<f;++i)(d=e[i])>=t&&d<a&&(a=d);for(a-t>m((c-r)/(y=n+1))&&v("overflow"),r+=(a-t)*y,t=a,i=0;i<f;++i)if((d=e[i])<t&&++r>c&&v("overflow"),d==t){for(u=r,p=l;!(u<(h=p<=s?1:p>=s+26?26:p-s));p+=l)w=u-h,b=l-h,k.push(g(A(h+w%b,0))),u=m(w/b);k.push(g(A(u,0))),s=q(r,y,n==o),r=0,++n}++r,++t}return k.join("")}if(a={version:"1.3.2",ucs2:{decode:_,encode:w},decode:k,encode:I,toASCII:function(e){return b(e,(function(e){return h.test(e)?"xn--"+I(e):e}))},toUnicode:function(e){return b(e,(function(e){return p.test(e)?k(e.slice(4).toLowerCase()):e}))}},o&&s)if(e.exports==o)s.exports=a;else for(u in a)a.hasOwnProperty(u)&&(o[u]=a[u]);else n.punycode=a}(t.commonjsGlobal)})),u=t.createCommonjsModule((function(e){
/*!
* URI.js - Mutating URLs
* IPv6 Support
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/var r,n;r=t.commonjsGlobal,n=function(e){var t=e&&e.IPv6;return{best:function(e){var t,r,n=e.toLowerCase().split(":"),o=n.length,s=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[o-1]&&""===n[o-2]&&n.pop(),-1!==n[(o=n.length)-1].indexOf(".")&&(s=7),t=0;t<o&&""!==n[t];t++);if(t<s)for(n.splice(t,1,"0000");n.length<s;)n.splice(t,0,"0000");for(var i=0;i<s;i++){r=n[i].split("");for(var a=0;a<3&&"0"===r[0]&&r.length>1;a++)r.splice(0,1);n[i]=r.join("")}var u=-1,c=0,l=0,p=-1,h=!1;for(i=0;i<s;i++)h?"0"===n[i]?l+=1:(h=!1,l>c&&(u=p,c=l)):"0"===n[i]&&(h=!0,p=i,l=1);l>c&&(u=p,c=l),c>1&&n.splice(u,c,""),o=n.length;var d="";for(""===n[0]&&(d=":"),i=0;i<o&&(d+=n[i],i!==o-1);i++)d+=":";return""===n[o-1]&&(d+=":"),d},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}},e.exports?e.exports=n():r.IPv6=n(r)})),c=t.createCommonjsModule((function(e){
/*!
* URI.js - Mutating URLs
* Second Level Domain (SLD) Support
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/var r,n;r=t.commonjsGlobal,n=function(e){var t=e&&e.SecondLevelDomains,r={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var o=r.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(n+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var n=r.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return null;var o=r.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(n+1,t)+" ")<0?null:e.slice(n+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return r},e.exports?e.exports=n():r.SecondLevelDomains=n(r)})),l=t.createCommonjsModule((function(e){
/*!
* URI.js - Mutating URLs
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/var r,n;r=t.commonjsGlobal,n=function(e,t,r,n){var o=n&&n.URI;function s(e,t){var r=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof s))return r?n?new s(e,t):new s(e):new s;if(void 0===e){if(r)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&r)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}s.version="1.19.11";var i=s.prototype,a=Object.prototype.hasOwnProperty;function u(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function l(e){return"Array"===c(e)}function p(e,t){var r,n,o={};if("RegExp"===c(t))o=null;else if(l(t))for(r=0,n=t.length;r<n;r++)o[t[r]]=!0;else o[t]=!0;for(r=0,n=e.length;r<n;r++)(o&&void 0!==o[e[r]]||!o&&t.test(e[r]))&&(e.splice(r,1),n--,r--);return e}function h(e,t){var r,n;if(l(t)){for(r=0,n=t.length;r<n;r++)if(!h(e,t[r]))return!1;return!0}var o=c(t);for(r=0,n=e.length;r<n;r++)if("RegExp"===o){if("string"==typeof e[r]&&e[r].match(t))return!0}else if(e[r]===t)return!0;return!1}function d(e,t){if(!l(e)||!l(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}function f(e){return e.replace(/^\/+|\/+$/g,"")}function m(e){return escape(e)}function g(e){return encodeURIComponent(e).replace(/[!'()*]/g,m).replace(/\*/g,"%2A")}s._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:s.preventInvalidHostname,duplicateQueryParameters:s.duplicateQueryParameters,escapeQuerySpace:s.escapeQuerySpace}},s.preventInvalidHostname=!1,s.duplicateQueryParameters=!1,s.escapeQuerySpace=!0,s.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,s.idn_expression=/[^a-z0-9\._-]/i,s.punycode_expression=/(xn--)/i,s.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,s.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,s.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,s.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},s.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,s.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},s.hostProtocols=["http","https"],s.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,s.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},s.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return s.domAttributes[t]}},s.encode=g,s.decode=decodeURIComponent,s.iso8859=function(){s.encode=escape,s.decode=unescape},s.unicode=function(){s.encode=g,s.decode=decodeURIComponent},s.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},s.encodeQuery=function(e,t){var r=s.encode(e+"");return void 0===t&&(t=s.escapeQuerySpace),t?r.replace(/%20/g,"+"):r},s.decodeQuery=function(e,t){e+="",void 0===t&&(t=s.escapeQuerySpace);try{return s.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var v,y={encode:"encode",decode:"decode"},b=function(e,t){return function(r){try{return s[t](r+"").replace(s.characters[e][t].expression,(function(r){return s.characters[e][t].map[r]}))}catch(e){return r}}};for(v in y)s[v+"PathSegment"]=b("pathname",y[v]),s[v+"UrnPathSegment"]=b("urnpath",y[v]);var _=function(e,t,r){return function(n){var o;o=r?function(e){return s[t](s[r](e))}:s[t];for(var i=(n+"").split(e),a=0,u=i.length;a<u;a++)i[a]=o(i[a]);return i.join(e)}};function w(e){return function(t,r){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!r),this)}}function A(e,t){return function(r,n){return void 0===r?this._parts[e]||"":(null!==r&&(r+="").charAt(0)===t&&(r=r.substring(1)),this._parts[e]=r,this.build(!n),this)}}s.decodePath=_("/","decodePathSegment"),s.decodeUrnPath=_(":","decodeUrnPathSegment"),s.recodePath=_("/","encodePathSegment","decode"),s.recodeUrnPath=_(":","encodeUrnPathSegment","decode"),s.encodeReserved=b("reserved","encode"),s.parse=function(e,t){var r;return t||(t={preventInvalidHostname:s.preventInvalidHostname}),(r=(e=(e=e.replace(s.leading_whitespace_expression,"")).replace(s.ascii_tab_whitespace,"")).indexOf("#"))>-1&&(t.fragment=e.substring(r+1)||null,e=e.substring(0,r)),(r=e.indexOf("?"))>-1&&(t.query=e.substring(r+1)||null,e=e.substring(0,r)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=s.parseAuthority(e,t)):(r=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,r)||null,t.protocol&&!t.protocol.match(s.protocol_expression)?t.protocol=void 0:"//"===e.substring(r+1,r+3).replace(/\\/g,"/")?(e=e.substring(r+3),e=s.parseAuthority(e,t)):(e=e.substring(r+1),t.urn=!0)),t.path=e,t},s.parseHost=function(e,t){e||(e="");var r,n,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))r=e.indexOf("]"),t.hostname=e.substring(1,r)||null,t.port=e.substring(r+2,o)||null,"/"===t.port&&(t.port=null);else{var i=e.indexOf(":"),a=e.indexOf("/"),u=e.indexOf(":",i+1);-1!==u&&(-1===a||u<a)?(t.hostname=e.substring(0,o)||null,t.port=null):(n=e.substring(0,o).split(":"),t.hostname=n[0]||null,t.port=n[1]||null)}return t.hostname&&"/"!==e.substring(o).charAt(0)&&(o++,e="/"+e),t.preventInvalidHostname&&s.ensureValidHostname(t.hostname,t.protocol),t.port&&s.ensureValidPort(t.port),e.substring(o)||"/"},s.parseAuthority=function(e,t){return e=s.parseUserinfo(e,t),s.parseHost(e,t)},s.parseUserinfo=function(e,t){var r=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var n,o=e.indexOf("/"),i=e.lastIndexOf("@",o>-1?o:e.length-1);return i>-1&&(-1===o||i<o)?(n=e.substring(0,i).split(":"),t.username=n[0]?s.decode(n[0]):null,n.shift(),t.password=n[0]?s.decode(n.join(":")):null,e=r.substring(i+1)):(t.username=null,t.password=null),e},s.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,o,i={},u=e.split("&"),c=u.length,l=0;l<c;l++)r=u[l].split("="),n=s.decodeQuery(r.shift(),t),o=r.length?s.decodeQuery(r.join("="),t):null,"__proto__"!==n&&(a.call(i,n)?("string"!=typeof i[n]&&null!==i[n]||(i[n]=[i[n]]),i[n].push(o)):i[n]=o);return i},s.build=function(e){var t="",r=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",r=!0),t+=s.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&r&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},s.buildHost=function(e){var t="";return e.hostname?(s.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},s.buildAuthority=function(e){return s.buildUserinfo(e)+s.buildHost(e)},s.buildUserinfo=function(e){var t="";return e.username&&(t+=s.encode(e.username)),e.password&&(t+=":"+s.encode(e.password)),t&&(t+="@"),t},s.buildQuery=function(e,t,r){var n,o,i,u,c="";for(o in e)if("__proto__"!==o&&a.call(e,o))if(l(e[o]))for(n={},i=0,u=e[o].length;i<u;i++)void 0!==e[o][i]&&void 0===n[e[o][i]+""]&&(c+="&"+s.buildQueryParameter(o,e[o][i],r),!0!==t&&(n[e[o][i]+""]=!0));else void 0!==e[o]&&(c+="&"+s.buildQueryParameter(o,e[o],r));return c.substring(1)},s.buildQueryParameter=function(e,t,r){return s.encodeQuery(e,r)+(null!==t?"="+s.encodeQuery(t,r):"")},s.addQuery=function(e,t,r){if("object"==typeof t)for(var n in t)a.call(t,n)&&s.addQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=r);"string"==typeof e[t]&&(e[t]=[e[t]]),l(r)||(r=[r]),e[t]=(e[t]||[]).concat(r)}},s.setQuery=function(e,t,r){if("object"==typeof t)for(var n in t)a.call(t,n)&&s.setQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===r?null:r}},s.removeQuery=function(e,t,r){var n,o,i;if(l(t))for(n=0,o=t.length;n<o;n++)e[t[n]]=void 0;else if("RegExp"===c(t))for(i in e)t.test(i)&&(e[i]=void 0);else if("object"==typeof t)for(i in t)a.call(t,i)&&s.removeQuery(e,i,t[i]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===c(r)?!l(e[t])&&r.test(e[t])?e[t]=void 0:e[t]=p(e[t],r):e[t]!==String(r)||l(r)&&1!==r.length?l(e[t])&&(e[t]=p(e[t],r)):e[t]=void 0:e[t]=void 0}},s.hasQuery=function(e,t,r,n){switch(c(t)){case"String":break;case"RegExp":for(var o in e)if(a.call(e,o)&&t.test(o)&&(void 0===r||s.hasQuery(e,o,r)))return!0;return!1;case"Object":for(var i in t)if(a.call(t,i)&&!s.hasQuery(e,i,t[i]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(c(r)){case"Undefined":return t in e;case"Boolean":return r===Boolean(l(e[t])?e[t].length:e[t]);case"Function":return!!r(e[t],t,e);case"Array":return!!l(e[t])&&(n?h:d)(e[t],r);case"RegExp":return l(e[t])?!!n&&h(e[t],r):Boolean(e[t]&&e[t].match(r));case"Number":r=String(r);case"String":return l(e[t])?!!n&&h(e[t],r):e[t]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},s.joinPaths=function(){for(var e=[],t=[],r=0,n=0;n<arguments.length;n++){var o=new s(arguments[n]);e.push(o);for(var i=o.segment(),a=0;a<i.length;a++)"string"==typeof i[a]&&t.push(i[a]),i[a]&&r++}if(!t.length||!r)return new s("");var u=new s("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||u.path("/"+u.path()),u.normalize()},s.commonPath=function(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r)){r--;break}return r<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(r)&&"/"===t.charAt(r)||(r=e.substring(0,r).lastIndexOf("/")),e.substring(0,r+1))},s.withinString=function(e,t,r){r||(r={});var n=r.start||s.findUri.start,o=r.end||s.findUri.end,i=r.trim||s.findUri.trim,a=r.parens||s.findUri.parens,u=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var c=n.exec(e);if(!c)break;var l=c.index;if(r.ignoreHtml){var p=e.slice(Math.max(l-3,0),l);if(p&&u.test(p))continue}for(var h=l+e.slice(l).search(o),d=e.slice(l,h),f=-1;;){var m=a.exec(d);if(!m)break;var g=m.index+m[0].length;f=Math.max(f,g)}if(!((d=f>-1?d.slice(0,f)+d.slice(f).replace(i,""):d.replace(i,"")).length<=c[0].length||r.ignore&&r.ignore.test(d))){var v=t(d,l,h=l+d.length,e);void 0!==v?(v=String(v),e=e.slice(0,l)+v+e.slice(h),n.lastIndex=l+v.length):n.lastIndex=h}}return n.lastIndex=0,e},s.ensureValidHostname=function(t,r){var n=!!t,o=!1;if(!!r&&(o=h(s.hostProtocols,r)),o&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(t&&t.match(s.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(s.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},s.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},s.noConflict=function(e){if(e){var t={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(t.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(t.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=n.SecondLevelDomains.noConflict()),t}return n.URI===this&&(n.URI=o),this},i.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=s.build(this._parts),this._deferred_build=!1),this},i.clone=function(){return new s(this)},i.valueOf=i.toString=function(){return this.build(!1)._string},i.protocol=w("protocol"),i.username=w("username"),i.password=w("password"),i.hostname=w("hostname"),i.port=w("port"),i.query=A("query","?"),i.fragment=A("fragment","#"),i.search=function(e,t){var r=this.query(e,t);return"string"==typeof r&&r.length?"?"+r:r},i.hash=function(e,t){var r=this.fragment(e,t);return"string"==typeof r&&r.length?"#"+r:r},i.pathname=function(e,t){if(void 0===e||!0===e){var r=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?s.decodeUrnPath:s.decodePath)(r):r}return this._parts.urn?this._parts.path=e?s.recodeUrnPath(e):"":this._parts.path=e?s.recodePath(e):"/",this.build(!t),this},i.path=i.pathname,i.href=function(e,t){var r;if(void 0===e)return this.toString();this._string="",this._parts=s._parts();var n=e instanceof s,o="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[s.getDomAttribute(e)]||"",o=!1),!n&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=s.parse(String(e),this._parts);else{if(!n&&!o)throw new TypeError("invalid input");var i=n?e._parts:e;for(r in i)"query"!==r&&a.call(this._parts,r)&&(this._parts[r]=i[r]);i.query&&this.query(i.query,!1)}return this.build(!t),this},i.is=function(e){var t=!1,n=!1,o=!1,i=!1,a=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,n=s.ip4_expression.test(this._parts.hostname),o=s.ip6_expression.test(this._parts.hostname),a=(i=!(t=n||o))&&r&&r.has(this._parts.hostname),u=i&&s.idn_expression.test(this._parts.hostname),c=i&&s.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return i;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var q=i.protocol,k=i.port,I=i.hostname;i.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(s.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return q.call(this,e,t)},i.scheme=i.protocol,i.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),s.ensureValidPort(e))),k.call(this,e,t))},i.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==s.parseHost(e,r))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=r.hostname,this._parts.preventInvalidHostname&&s.ensureValidHostname(e,this._parts.protocol)}return I.call(this,e,t)},i.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=s(e);return this.protocol(n.protocol()).authority(n.authority()).build(!t),this},i.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?s.buildHost(this._parts):"";if("/"!==s.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},i.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?s.buildAuthority(this._parts):"";if("/"!==s.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},i.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=s.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==e[e.length-1]&&(e+="@"),s.parseUserinfo(e,this._parts),this.build(!t),this},i.resource=function(e,t){var r;return void 0===e?this.path()+this.search()+this.hash():(r=s.parse(e),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!t),this)},i.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,n),i=new RegExp("^"+u(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&s.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(i,e),this.build(!t),this},i.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(t).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(s.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},i.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(n+1);return!0!==t&&r&&r.list[o.toLowerCase()]&&r.get(this._parts.hostname)||o}var s;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');s=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(s,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");s=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(s,e)}return this.build(!t),this},i.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return e?s.decodePath(n):n}var o=this._parts.path.length-this.filename().length,i=this._parts.path.substring(0,o),a=new RegExp("^"+u(i));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=s.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},i.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return e?s.decodePathSegment(n):n}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var i=new RegExp(u(this.filename())+"$");return e=s.recodePath(e),this._parts.path=this._parts.path.replace(i,e),o?this.normalizePath(t):this.build(!t),this},i.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,o=this.filename(),i=o.lastIndexOf(".");return-1===i?"":(r=o.substring(i+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",e?s.decodePathSegment(n):n)}"."===e.charAt(0)&&(e=e.substring(1));var a,c=this.suffix();if(c)a=e?new RegExp(u(c)+"$"):new RegExp(u("."+c)+"$");else{if(!e)return this;this._parts.path+="."+s.recodePath(e)}return a&&(e=s.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},i.segment=function(e,t,r){var n=this._parts.urn?":":"/",o=this.path(),s="/"===o.substring(0,1),i=o.split(n);if(void 0!==e&&"number"!=typeof e&&(r=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(s&&i.shift(),e<0&&(e=Math.max(i.length+e,0)),void 0===t)return void 0===e?i:i[e];if(null===e||void 0===i[e])if(l(t)){i=[];for(var a=0,u=t.length;a<u;a++)(t[a].length||i.length&&i[i.length-1].length)&&(i.length&&!i[i.length-1].length&&i.pop(),i.push(f(t[a])))}else(t||"string"==typeof t)&&(t=f(t),""===i[i.length-1]?i[i.length-1]=t:i.push(t));else t?i[e]=f(t):i.splice(e,1);return s&&i.unshift(""),this.path(i.join(n),r)},i.segmentCoded=function(e,t,r){var n,o,i;if("number"!=typeof e&&(r=t,t=e,e=void 0),void 0===t){if(l(n=this.segment(e,t,r)))for(o=0,i=n.length;o<i;o++)n[o]=s.decode(n[o]);else n=void 0!==n?s.decode(n):void 0;return n}if(l(t))for(o=0,i=t.length;o<i;o++)t[o]=s.encode(t[o]);else t="string"==typeof t||t instanceof String?s.encode(t):t;return this.segment(e,t,r)};var x=i.query;return i.query=function(e,t){if(!0===e)return s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var r=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=e.call(this,r);return this._parts.query=s.buildQuery(n||r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=s.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):x.call(this,e,t)},i.setQuery=function(e,t,r){var n=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)n[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var o in e)a.call(e,o)&&(n[o]=e[o])}return this._parts.query=s.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.addQuery=function(e,t,r){var n=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.addQuery(n,e,void 0===t?null:t),this._parts.query=s.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.removeQuery=function(e,t,r){var n=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.removeQuery(n,e,t),this._parts.query=s.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.hasQuery=function(e,t,r){var n=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.hasQuery(n,e,t,r)},i.setSearch=i.setQuery,i.addSearch=i.addQuery,i.removeSearch=i.removeQuery,i.hasSearch=i.hasQuery,i.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},i.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},i.normalizeHostname=function(r){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!r)),this},i.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===s.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},i.normalizePath=function(e){var t,r=this._parts.path;if(!r)return this;if(this._parts.urn)return this._parts.path=s.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var n,o,i="";for("/"!==(r=s.recodePath(r)).charAt(0)&&(t=!0,r="/"+r),"/.."!==r.slice(-3)&&"/."!==r.slice(-2)||(r+="/"),r=r.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(i=r.substring(1).match(/^(\.\.\/)+/)||"")&&(i=i[0]);-1!==(n=r.search(/\/\.\.(\/|$)/));)0!==n?(-1===(o=r.substring(0,n).lastIndexOf("/"))&&(o=n),r=r.substring(0,o)+r.substring(n+3)):r=r.substring(3);return t&&this.is("relative")&&(r=i+r.substring(1)),this._parts.path=r,this.build(!e),this},i.normalizePathname=i.normalizePath,i.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(s.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},i.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},i.normalizeSearch=i.normalizeQuery,i.normalizeHash=i.normalizeFragment,i.iso8859=function(){var e=s.encode,t=s.decode;s.encode=escape,s.decode=decodeURIComponent;try{this.normalize()}finally{s.encode=e,s.decode=t}return this},i.unicode=function(){var e=s.encode,t=s.decode;s.encode=g,s.decode=unescape;try{this.normalize()}finally{s.encode=e,s.decode=t}return this},i.readable=function(){var t=this.clone();t.username("").password("").normalize();var r="";if(t._parts.protocol&&(r+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(r+=e.toUnicode(t._parts.hostname),t._parts.port&&(r+=":"+t._parts.port)):r+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(r+="/"),r+=t.path(!0),t._parts.query){for(var n="",o=0,i=t._parts.query.split("&"),a=i.length;o<a;o++){var u=(i[o]||"").split("=");n+="&"+s.decodeQuery(u[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==u[1]&&(n+="="+s.decodeQuery(u[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}r+="?"+n.substring(1)}return r+=s.decodeQuery(t.hash(),!0)},i.absoluteTo=function(e){var t,r,n,o=this.clone(),i=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof s||(e=new s(e)),o._parts.protocol)return o;if(o._parts.protocol=e._parts.protocol,this._parts.hostname)return o;for(r=0;n=i[r];r++)o._parts[n]=e._parts[n];return o._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),o._parts.path=(t?t+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=e._parts.path,o._parts.query||(o._parts.query=e._parts.query)),o.build(),o},i.relativeTo=function(e){var t,r,n,o,i,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new s(e).normalize(),t=a._parts,r=e._parts,o=a.path(),i=e.path(),"/"!==o.charAt(0))throw new Error("URI is already relative");if("/"!==i.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===r.protocol&&(t.protocol=null),t.username!==r.username||t.password!==r.password)return a.build();if(null!==t.protocol||null!==t.username||null!==t.password)return a.build();if(t.hostname!==r.hostname||t.port!==r.port)return a.build();if(t.hostname=null,t.port=null,o===i)return t.path="",a.build();if(!(n=s.commonPath(o,i)))return a.build();var u=r.path.substring(n.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=u+t.path.substring(n.length)||"./",a.build()},i.equals=function(e){var t,r,n,o,i,u=this.clone(),c=new s(e),p={};if(u.normalize(),c.normalize(),u.toString()===c.toString())return!0;if(n=u.query(),o=c.query(),u.query(""),c.query(""),u.toString()!==c.toString())return!1;if(n.length!==o.length)return!1;for(i in t=s.parseQuery(n,this._parts.escapeQuerySpace),r=s.parseQuery(o,this._parts.escapeQuerySpace),t)if(a.call(t,i)){if(l(t[i])){if(!d(t[i],r[i]))return!1}else if(t[i]!==r[i])return!1;p[i]=!0}for(i in r)if(a.call(r,i)&&!p[i])return!1;return!0},i.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},i.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},i.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},s},e.exports?e.exports=n(a,u,c):r.URI=n(r.punycode,r.IPv6,r.SecondLevelDomains,r)}));function p(e,t){if(null===e||"object"!=typeof e)return e;t=n.defaultValue(t,!1);const r=new e.constructor;for(const n in e)if(e.hasOwnProperty(n)){let o=e[n];t&&(o=p(o,t)),r[n]=o}return r}function h(e,t){let r;return"undefined"!=typeof document&&(r=document),h._implementation(e,t,r)}h._implementation=function(e,t,r){if(!n.defined(t)){if(void 0===r)return e;t=n.defaultValue(r.baseURI,r.location.href)}const o=new l(e);return""!==o.scheme()?o.toString():o.absoluteTo(t).toString()};const d={};function f(e,t,r){n.defined(t)||(t=e.width),n.defined(r)||(r=e.height);let o=d[t];n.defined(o)||(o={},d[t]=o);let s=o[r];if(!n.defined(s)){const e=document.createElement("canvas");e.width=t,e.height=r,s=e.getContext("2d"),s.globalCompositeOperation="copy",o[r]=s}return s.drawImage(e,0,0,t,r),s.getImageData(0,0,t,r).data}const m=/^blob:/i;function g(e){return m.test(e)}let v;function y(e){n.defined(v)||(v=document.createElement("a")),v.href=window.location.href;const t=v.host,r=v.protocol;return v.href=e,v.href=v.href,r!==v.protocol||t!==v.host}const b=/^data:/i;function _(e){return b.test(e)}var w=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5});var A=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function q(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);const t=n.defaultValue(e.throttleByServer,!1),r=n.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=n.defaultValue(e.priority,0),this.throttle=r,this.throttleByServer=t,this.type=n.defaultValue(e.type,A.OTHER),this.serverKey=void 0,this.state=w.UNISSUED,this.deferred=void 0,this.cancelled=!1}function k(e,t,r){this.statusCode=e,this.response=t,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=function(e){const t={};if(!e)return t;const r=e.split("\r\n");for(let e=0;e<r.length;++e){const n=r[e],o=n.indexOf(": ");if(o>0){const e=n.substring(0,o),r=n.substring(o+2);t[e]=r}}return t}(this.responseHeaders))}function I(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function x(e,t){return t-e}function C(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function S(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}q.prototype.cancel=function(){this.cancelled=!0},q.prototype.clone=function(e){return n.defined(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new q(this)},k.prototype.toString=function(){let e="Request has failed.";return n.defined(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e},Object.defineProperties(I.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),I.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);const r=this;return function(){r.removeEventListener(e,t)}},I.prototype.removeEventListener=function(e,t){const r=this._listeners,n=this._scopes;let o=-1;for(let s=0;s<r.length;s++)if(r[s]===e&&n[s]===t){o=s;break}return-1!==o&&(this._insideRaiseEvent?(this._toRemove.push(o),r[o]=void 0,n[o]=void 0):(r.splice(o,1),n.splice(o,1)),!0)},I.prototype.raiseEvent=function(){let e;this._insideRaiseEvent=!0;const t=this._listeners,r=this._scopes;let o=t.length;for(e=0;e<o;e++){const o=t[e];n.defined(o)&&t[e].apply(r[e],arguments)}const s=this._toRemove;if(o=s.length,o>0){for(s.sort(x),e=0;e<o;e++){const n=s[e];t.splice(n,1),r.splice(n,1)}s.length=0}this._insideRaiseEvent=!1},Object.defineProperties(C.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){const t=this._length;if(e<t){const r=this._array;for(let n=e;n<t;++n)r[n]=void 0;this._length=e,r.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}}),C.prototype.reserve=function(e){e=n.defaultValue(e,this._length),this._array.length=e},C.prototype.heapify=function(e){e=n.defaultValue(e,0);const t=this._length,r=this._comparator,o=this._array;let s=-1,i=!0;for(;i;){const n=2*(e+1),a=n-1;s=a<t&&r(o[a],o[e])<0?a:e,n<t&&r(o[n],o[s])<0&&(s=n),s!==e?(S(o,s,e),e=s):i=!1}},C.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},C.prototype.insert=function(e){const t=this._array,r=this._comparator,o=this._maximumLength;let s,i=this._length++;for(i<t.length?t[i]=e:t.push(e);0!==i;){const e=Math.floor((i-1)/2);if(!(r(t[i],t[e])<0))break;S(t,i,e),i=e}return n.defined(o)&&this._length>o&&(s=t[o],this._length=o),s},C.prototype.pop=function(e){if(e=n.defaultValue(e,0),0===this._length)return;const t=this._array,r=t[e];return S(t,e,--this._length),this.heapify(e),t[this._length]=void 0,r};const R={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let E=20;const O=new C({comparator:function(e,t){return e.priority-t.priority}});O.maximumLength=E,O.reserve(E);const P=[];let z={};const T="undefined"!=typeof document?new l(document.location.href):new l,U=new I;function j(){}function Q(e){n.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function F(e){return e.state===w.UNISSUED&&(e.state=w.ISSUED,e.deferred=t.when.defer()),e.deferred.promise}function B(e){const t=F(e);return e.state=w.ACTIVE,P.push(e),++R.numberOfActiveRequests,++R.numberOfActiveRequestsEver,++z[e.serverKey],e.requestFunction().then(function(e){return function(t){if(e.state===w.CANCELLED)return;const r=e.deferred;--R.numberOfActiveRequests,--z[e.serverKey],U.raiseEvent(),e.state=w.RECEIVED,e.deferred=void 0,r.resolve(t)}}(e)).otherwise(function(e){return function(t){e.state!==w.CANCELLED&&(++R.numberOfFailedRequests,--R.numberOfActiveRequests,--z[e.serverKey],U.raiseEvent(t),e.state=w.FAILED,e.deferred.reject(t))}}(e)),t}function D(e){const t=e.state===w.ACTIVE;if(e.state=w.CANCELLED,++R.numberOfCancelledRequests,n.defined(e.deferred)){const t=e.deferred;e.deferred=void 0,t.reject()}t&&(--R.numberOfActiveRequests,--z[e.serverKey],++R.numberOfCancelledActiveRequests),n.defined(e.cancelFunction)&&e.cancelFunction()}j.maximumRequests=50,j.maximumRequestsPerServer=6,j.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},j.throttleRequests=!0,j.debugShowStatistics=!1,j.requestCompletedEvent=U,Object.defineProperties(j,{statistics:{get:function(){return R}},priorityHeapLength:{get:function(){return E},set:function(e){if(e<E)for(;O.length>e;){D(O.pop())}E=e,O.maximumLength=e,O.reserve(e)}}}),j.serverHasOpenSlots=function(e,t){t=n.defaultValue(t,1);const r=n.defaultValue(j.requestsByServer[e],j.maximumRequestsPerServer);return z[e]+t<=r},j.heapHasOpenSlots=function(e){return O.length+e<=E},j.update=function(){let e,t,r=0;const n=P.length;for(e=0;e<n;++e)t=P[e],t.cancelled&&D(t),t.state===w.ACTIVE?r>0&&(P[e-r]=t):++r;P.length-=r;const o=O.internalArray,s=O.length;for(e=0;e<s;++e)Q(o[e]);O.resort();const i=Math.max(j.maximumRequests-P.length,0);let a=0;for(;a<i&&O.length>0;)t=O.pop(),t.cancelled?D(t):!t.throttleByServer||j.serverHasOpenSlots(t.serverKey)?(B(t),++a):D(t);!function(){if(!j.debugShowStatistics)return;0===R.numberOfActiveRequests&&R.lastNumberOfActiveRequests>0&&(R.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${R.numberOfAttemptedRequests}`),R.numberOfAttemptedRequests=0),R.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${R.numberOfCancelledRequests}`),R.numberOfCancelledRequests=0),R.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${R.numberOfCancelledActiveRequests}`),R.numberOfCancelledActiveRequests=0),R.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${R.numberOfFailedRequests}`),R.numberOfFailedRequests=0));R.lastNumberOfActiveRequests=R.numberOfActiveRequests}()},j.getServerKey=function(e){let t=new l(e);""===t.scheme()&&(t=new l(e).absoluteTo(T),t.normalize());let r=t.authority();/:/.test(r)||(r=`${r}:${"https"===t.scheme()?"443":"80"}`);const o=z[r];return n.defined(o)||(z[r]=0),r},j.request=function(e){if(_(e.url)||g(e.url))return U.raiseEvent(),e.state=w.RECEIVED,e.requestFunction();if(++R.numberOfAttemptedRequests,n.defined(e.serverKey)||(e.serverKey=j.getServerKey(e.url)),j.throttleRequests&&e.throttleByServer&&!j.serverHasOpenSlots(e.serverKey))return;if(!j.throttleRequests||!e.throttle)return B(e);if(P.length>=j.maximumRequests)return;Q(e);const t=O.insert(e);if(n.defined(t)){if(t===e)return;D(t)}return F(e)},j.clearForSpecs=function(){for(;O.length>0;){D(O.pop())}const e=P.length;for(let t=0;t<e;++t)D(P[t]);P.length=0,z={},R.numberOfAttemptedRequests=0,R.numberOfActiveRequests=0,R.numberOfCancelledRequests=0,R.numberOfCancelledActiveRequests=0,R.numberOfFailedRequests=0,R.numberOfActiveRequestsEver=0,R.lastNumberOfActiveRequests=0},j.numberOfActiveRequestsByServer=function(e){return z[e]},j.requestHeap=O;const L={};let V={};L.add=function(e,t){const r=`${e.toLowerCase()}:${t}`;n.defined(V[r])||(V[r]=!0)},L.remove=function(e,t){const r=`${e.toLowerCase()}:${t}`;n.defined(V[r])&&delete V[r]},L.contains=function(e){const t=function(e){const t=new l(e);t.normalize();let r=t.authority();if(0!==r.length){if(t.authority(r),-1!==r.indexOf("@")){const e=r.split("@");r=e[1]}if(-1===r.indexOf(":")){let e=t.scheme();if(0===e.length&&(e=window.location.protocol,e=e.substring(0,e.length-1)),"http"===e)r+=":80";else{if("https"!==e)return;r+=":443"}}return r}}(e);return!(!n.defined(t)||!n.defined(V[t]))},L.clear=function(){V={}};const H=function(){try{const e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();function M(e,t,r,o){const s=e.query();if(0===s.length)return{};let i;if(-1===s.indexOf("=")){const e={};e[s]=void 0,i=e}else i=function(e){const t={};if(""===e)return t;const r=e.replace(/\+/g,"%20").split(/[&;]/);for(let e=0,o=r.length;e<o;++e){const o=r[e].split("="),s=decodeURIComponent(o[0]);let i=o[1];i=n.defined(i)?decodeURIComponent(i):"";const a=t[s];"string"==typeof a?t[s]=[a,i]:Array.isArray(a)?a.push(i):t[s]=i}return t}(s);t._queryParameters=r?J(i,t._queryParameters,o):i,e.search("")}function $(e,t){const r=t._queryParameters,o=Object.keys(r);1!==o.length||n.defined(r[o[0]])?e.search(function(e){let t="";for(const r in e)if(e.hasOwnProperty(r)){const n=e[r],o=`${encodeURIComponent(r)}=`;if(Array.isArray(n))for(let e=0,r=n.length;e<r;++e)t+=`${o+encodeURIComponent(n[e])}&`;else t+=`${o+encodeURIComponent(n)}&`}return t=t.slice(0,-1),t}(r)):e.search(o[0])}function N(e,t){return n.defined(e)?n.defined(e.clone)?e.clone():p(e):t}function Y(e){if(e.state===w.ISSUED||e.state===w.ACTIVE)throw new i.RuntimeError("The Resource is already being fetched.");e.state=w.UNISSUED,e.deferred=void 0}function J(e,t,r){if(!r)return o.combine(e,t);const s=p(e,!0);for(const e in t)if(t.hasOwnProperty(e)){let r=s[e];const o=t[e];n.defined(r)?(Array.isArray(r)||(r=s[e]=[r]),s[e]=r.concat(o)):s[e]=Array.isArray(o)?o.slice():o}return s}function X(e){"string"==typeof(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT))&&(e={url:e}),this._url=void 0,this._templateValues=N(e.templateValues,{}),this._queryParameters=N(e.queryParameters,{}),this.headers=N(e.headers,{}),this.request=n.defaultValue(e.request,new q),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=n.defaultValue(e.retryAttempts,0),this._retryCount=0;const t=new l(e.url);M(t,this,!0,!0),t.fragment(""),this._url=t.toString()}let K;function G(e){const r=e.resource,o=e.flipY,s=e.skipColorSpaceConversion,i=e.preferImageBitmap,a=r.request;a.url=r.url,a.requestFunction=function(){let e=!1;r.isDataUri||r.isBlobUri||(e=r.isCrossOriginUrl);const n=t.when.defer();return X._Implementations.createImage(a,e,n,o,s,i),n.promise};const u=j.request(a);if(n.defined(u))return u.otherwise((function(e){return a.state!==w.FAILED?t.when.reject(e):r.retryOnError(e).then((function(n){return n?(a.state=w.UNISSUED,a.deferred=void 0,G({resource:r,flipY:o,skipColorSpaceConversion:s,preferImageBitmap:i})):t.when.reject(e)}))}))}function Z(e,r,o){const s={};s[r]=o,e.setQueryParameters(s);const i=e.request;i.url=e.url,i.requestFunction=function(){const r=t.when.defer();return window[o]=function(e){r.resolve(e);try{delete window[o]}catch(e){window[o]=void 0}},X._Implementations.loadAndExecuteScript(e.url,o,r),r.promise};const a=j.request(i);if(n.defined(a))return a.otherwise((function(n){return i.state!==w.FAILED?t.when.reject(n):e.retryOnError(n).then((function(s){return s?(i.state=w.UNISSUED,i.deferred=void 0,Z(e,r,o)):t.when.reject(n)}))}))}X.createIfNeeded=function(e){return e instanceof X?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new X({url:e})},X.supportsImageBitmapOptions=function(){if(n.defined(K))return K;if("function"!=typeof createImageBitmap)return K=t.when.resolve(!1),K;return K=X.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then((function(e){return t.when.all([createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"}),createImageBitmap(e)])})).then((function(e){const t=f(e[0]),r=f(e[1]);return t[1]!==r[1]})).otherwise((function(){return!1})),K},Object.defineProperties(X,{isBlobSupported:{get:function(){return H}}}),Object.defineProperties(X.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){const t=new l(e);M(t,this,!1),t.fragment(""),this._url=t.toString()}},extension:{get:function(){return function(e){const t=new l(e);t.normalize();let r=t.path(),n=r.lastIndexOf("/");return-1!==n&&(r=r.substr(n+1)),n=r.lastIndexOf("."),r=-1===n?"":r.substr(n+1),r}(this._url)}},isDataUri:{get:function(){return _(this._url)}},isBlobUri:{get:function(){return g(this._url)}},isCrossOriginUrl:{get:function(){return y(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}}),X.prototype.toString=function(){return this.getUrlComponent(!0,!0)},X.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;const r=new l(this._url);e&&$(r,this);let o=r.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");const s=this._templateValues;return o=o.replace(/{(.*?)}/g,(function(e,t){const r=s[t];return n.defined(r)?encodeURIComponent(r):e})),t&&n.defined(this.proxy)&&(o=this.proxy.getURL(o)),o},X.prototype.setQueryParameters=function(e,t){this._queryParameters=t?J(this._queryParameters,e,!1):J(e,this._queryParameters,!1)},X.prototype.appendQueryParameters=function(e){this._queryParameters=J(e,this._queryParameters,!0)},X.prototype.setTemplateValues=function(e,t){this._templateValues=t?o.combine(this._templateValues,e):o.combine(e,this._templateValues)},X.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,n.defined(e.url)){const r=new l(e.url);M(r,t,!0,n.defaultValue(e.preserveQueryParameters,!1)),r.fragment(""),""!==r.scheme()?t._url=r.toString():t._url=r.absoluteTo(new l(h(this._url))).toString()}return n.defined(e.queryParameters)&&(t._queryParameters=o.combine(e.queryParameters,t._queryParameters)),n.defined(e.templateValues)&&(t._templateValues=o.combine(e.templateValues,t.templateValues)),n.defined(e.headers)&&(t.headers=o.combine(e.headers,t.headers)),n.defined(e.proxy)&&(t.proxy=e.proxy),n.defined(e.request)&&(t.request=e.request),n.defined(e.retryCallback)&&(t.retryCallback=e.retryCallback),n.defined(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},X.prototype.retryOnError=function(e){const r=this.retryCallback;if("function"!=typeof r||this._retryCount>=this.retryAttempts)return t.when(!1);const n=this;return t.when(r(this,e)).then((function(e){return++n._retryCount,e}))},X.prototype.clone=function(e){return n.defined(e)||(e=new X({url:this._url})),e._url=this._url,e._queryParameters=p(this._queryParameters),e._templateValues=p(this._templateValues),e.headers=p(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},X.prototype.getBaseUri=function(e){return function(e,t){let r="";const n=e.lastIndexOf("/");return-1!==n&&(r=e.substring(0,n+1)),t?(0!==(e=new l(e)).query().length&&(r+=`?${e.query()}`),0!==e.fragment().length&&(r+=`#${e.fragment()}`),r):r}(this.getUrlComponent(e),e)},X.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e=`${e}/`),e)},X.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},X.fetchArrayBuffer=function(e){return new X(e).fetchArrayBuffer()},X.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},X.fetchBlob=function(e){return new X(e).fetchBlob()},X.prototype.fetchImage=function(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);const r=n.defaultValue(e.preferImageBitmap,!1),o=n.defaultValue(e.preferBlob,!1),s=n.defaultValue(e.flipY,!1),i=n.defaultValue(e.skipColorSpaceConversion,!1);if(Y(this.request),!H||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!o)return G({resource:this,flipY:s,skipColorSpaceConversion:i,preferImageBitmap:r});const a=this.fetchBlob();if(!n.defined(a))return;let u,c,l,p;return X.supportsImageBitmapOptions().then((function(e){return u=e,c=u&&r,a})).then((function(e){if(!n.defined(e))return;if(p=e,c)return X.createImageBitmapFromBlob(e,{flipY:s,premultiplyAlpha:!1,skipColorSpaceConversion:i});const t=window.URL.createObjectURL(e);return l=new X({url:t}),G({resource:l,flipY:s,skipColorSpaceConversion:i,preferImageBitmap:!1})})).then((function(e){if(n.defined(e))return e.blob=p,c||window.URL.revokeObjectURL(l.url),e})).otherwise((function(e){return n.defined(l)&&window.URL.revokeObjectURL(l.url),e.blob=p,t.when.reject(e)}))},X.fetchImage=function(e){return new X(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},X.prototype.fetchText=function(){return this.fetch({responseType:"text"})},X.fetchText=function(e){return new X(e).fetchText()},X.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(n.defined(e))return e.then((function(e){if(n.defined(e))return JSON.parse(e)}))},X.fetchJson=function(e){return new X(e).fetchJson()},X.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},X.fetchXML=function(e){return new X(e).fetchXML()},X.prototype.fetchJsonp=function(e){let t;e=n.defaultValue(e,"callback"),Y(this.request);do{t=`loadJsonp${s.CesiumMath.nextRandomNumber().toString().substring(2,8)}`}while(n.defined(window[t]));return Z(this,e,t)},X.fetchJsonp=function(e){return new X(e).fetchJsonp(e.callbackParameterName)},X.prototype._makeRequest=function(e){const r=this;Y(r.request);const s=r.request;s.url=r.url,s.requestFunction=function(){const i=e.responseType,a=o.combine(e.headers,r.headers),u=e.overrideMimeType,c=e.method,l=e.data,p=t.when.defer(),h=X._Implementations.loadWithXhr(r.url,i,c,l,a,p,u);return n.defined(h)&&n.defined(h.abort)&&(s.cancelFunction=function(){h.abort()}),p.promise};const i=j.request(s);if(n.defined(i))return i.then((function(e){return s.cancelFunction=void 0,e})).otherwise((function(n){return s.cancelFunction=void 0,s.state!==w.FAILED?t.when.reject(n):r.retryOnError(n).then((function(o){return o?(s.state=w.UNISSUED,s.deferred=void 0,r.fetch(e)):t.when.reject(n)}))}))};const W=/^data:(.*?)(;base64)?,(.*)$/;function ee(e,t){const r=decodeURIComponent(t);return e?atob(r):r}function te(e,t){const r=ee(e,t),n=new ArrayBuffer(r.length),o=new Uint8Array(n);for(let e=0;e<r.length;e++)o[e]=r.charCodeAt(e);return n}function re(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}X.prototype.fetch=function(e){return(e=N(e,{})).method="GET",this._makeRequest(e)},X.fetch=function(e){return new X(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},X.prototype.delete=function(e){return(e=N(e,{})).method="DELETE",this._makeRequest(e)},X.delete=function(e){return new X(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},X.prototype.head=function(e){return(e=N(e,{})).method="HEAD",this._makeRequest(e)},X.head=function(e){return new X(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},X.prototype.options=function(e){return(e=N(e,{})).method="OPTIONS",this._makeRequest(e)},X.options=function(e){return new X(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},X.prototype.post=function(e,t){return r.Check.defined("data",e),(t=N(t,{})).method="POST",t.data=e,this._makeRequest(t)},X.post=function(e){return new X(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},X.prototype.put=function(e,t){return r.Check.defined("data",e),(t=N(t,{})).method="PUT",t.data=e,this._makeRequest(t)},X.put=function(e){return new X(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},X.prototype.patch=function(e,t){return r.Check.defined("data",e),(t=N(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},X.patch=function(e){return new X(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},X._Implementations={},X._Implementations.createImage=function(e,r,o,s,a,u){const c=e.url;X.supportsImageBitmapOptions().then((function(l){if(!l||!u)return void function(e,t,r){const n=new Image;n.onload=function(){r.resolve(n)},n.onerror=function(e){r.reject(e)},t&&(L.contains(e)?n.crossOrigin="use-credentials":n.crossOrigin=""),n.src=e}(c,r,o);const p=t.when.defer(),h=X._Implementations.loadWithXhr(c,"blob","GET",void 0,void 0,p,void 0,void 0,void 0);return n.defined(h)&&n.defined(h.abort)&&(e.cancelFunction=function(){h.abort()}),p.promise.then((function(e){if(n.defined(e))return X.createImageBitmapFromBlob(e,{flipY:s,premultiplyAlpha:!1,skipColorSpaceConversion:a});o.reject(new i.RuntimeError(`Successfully retrieved ${c} but it contained no content.`))})).then(o.resolve)})).otherwise(o.reject)},X.createImageBitmapFromBlob=function(e,t){return r.Check.defined("options",t),r.Check.typeOf.bool("options.flipY",t.flipY),r.Check.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),r.Check.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};const ne="undefined"==typeof XMLHttpRequest;X._Implementations.loadWithXhr=function(e,t,r,o,s,a,u){const c=W.exec(e);if(null!==c)return void a.resolve(function(e,t){t=n.defaultValue(t,"");const r=e[1],o=!!e[2],s=e[3];let i,a;switch(t){case"":case"text":return ee(o,s);case"arraybuffer":return te(o,s);case"blob":return i=te(o,s),new Blob([i],{type:r});case"document":return a=new DOMParser,a.parseFromString(ee(o,s),r);case"json":return JSON.parse(ee(o,s))}}(c,t));if(ne)return void function(e,t,r,n,o,s,a){const u=require("url").parse(e),c="https:"===u.protocol?require("https"):require("http"),l=require("zlib"),p={protocol:u.protocol,hostname:u.hostname,port:u.port,path:u.path,query:u.query,method:r,headers:o};c.request(p).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)return void s.reject(new k(e.statusCode,e,e.headers));const r=[];e.on("data",(function(e){r.push(e)})),e.on("end",(function(){const n=Buffer.concat(r);"gzip"===e.headers["content-encoding"]?l.gunzip(n,(function(e,r){e?s.reject(new i.RuntimeError("Error decompressing response.")):s.resolve(re(r,t))})):s.resolve(re(n,t))}))})).on("error",(function(e){s.reject(new k)})).end()}(e,t,r,0,s,a);const l=new XMLHttpRequest;if(L.contains(e)&&(l.withCredentials=!0),l.open(r,e,!0),n.defined(u)&&n.defined(l.overrideMimeType)&&l.overrideMimeType(u),n.defined(s))for(const e in s)s.hasOwnProperty(e)&&l.setRequestHeader(e,s[e]);n.defined(t)&&(l.responseType=t);let p=!1;return"string"==typeof e&&(p=0===e.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),l.onload=function(){if((l.status<200||l.status>=300)&&(!p||0!==l.status))return void a.reject(new k(l.status,l.response,l.getAllResponseHeaders()));const e=l.response,o=l.responseType;if("HEAD"===r||"OPTIONS"===r){const e=l.getAllResponseHeaders().trim().split(/[\r\n]+/),t={};return e.forEach((function(e){const r=e.split(": "),n=r.shift();t[n]=r.join(": ")})),void a.resolve(t)}if(204===l.status)a.resolve();else if(!n.defined(e)||n.defined(t)&&o!==t)if("json"===t&&"string"==typeof e)try{a.resolve(JSON.parse(e))}catch(e){a.reject(e)}else(""===o||"document"===o)&&n.defined(l.responseXML)&&l.responseXML.hasChildNodes()?a.resolve(l.responseXML):""!==o&&"text"!==o||!n.defined(l.responseText)?a.reject(new i.RuntimeError("Invalid XMLHttpRequest response type.")):a.resolve(l.responseText);else a.resolve(e)},l.onerror=function(e){a.reject(new k)},l.send(o),l},X._Implementations.loadAndExecuteScript=function(e,r,n){return function(e){const r=t.when.defer(),n=document.createElement("script");n.async=!0,n.src=e;const o=document.getElementsByTagName("head")[0];return n.onload=function(){n.onload=void 0,o.removeChild(n),r.resolve()},n.onerror=function(e){r.reject(e)},o.appendChild(n),r.promise}(e).otherwise(n.reject)},X._DefaultImplementations={},X._DefaultImplementations.createImage=X._Implementations.createImage,X._DefaultImplementations.loadWithXhr=X._Implementations.loadWithXhr,X._DefaultImplementations.loadAndExecuteScript=X._Implementations.loadAndExecuteScript,X.DEFAULT=Object.freeze(new X({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),e.Event=I,e.Resource=X,e.URI=l,e.clone=p,e.getAbsoluteUri=h,e.isCrossOriginUrl=y}));