@mapcatch/util 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/catchUtil.min.esm.js +16761 -0
- package/dist/catchUtil.min.js +282 -0
- package/package.json +2 -2
- package/src/exif/parse_image.js +2 -2
- package/src/util.js +3 -3
- package/.eslintrc.js +0 -53
- package/.prettierrc +0 -4
- package/docs/Catolog.md +0 -24
- package/docs/Util.md +0 -170
- package/vite.config.js +0 -52
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
(function(Dr,li){typeof exports=="object"&&typeof module<"u"?li(exports):typeof define=="function"&&define.amd?define(["exports"],li):(Dr=typeof globalThis<"u"?globalThis:Dr||self,li(Dr.catchUtil={}))})(this,function(Dr){"use strict";const li={imageHasData(t){return!!t.exifdata},getStringFromDB(t,n,i){for(var o="",s=n;s<n+i;s++)o+=String.fromCharCode(t.getUint8(s));return o},xml2Object(t){try{var n={};if(t.children.length>0)for(var i=0;i<t.children.length;i++){var o=t.children.item(i),s=o.attributes;for(var f in s){var u=s[f],d=u.nodeName,v=u.nodeValue;d!==void 0&&(n[d]=v)}var M=o.nodeName;if(typeof n[M]>"u")n[M]=this.xml2json(o);else{if(typeof n[M].push>"u"){var B=n[M];n[M]=[],n[M].push(B)}n[M].push(this.xml2json(o))}}else n=t.textContent;return n}catch(p){console.log(p.message)}},xml2json(t){var n={};if(t.nodeType==1){if(t.attributes.length>0){n["@attributes"]={};for(var i=0;i<t.attributes.length;i++){var o=t.attributes.item(i);n["@attributes"][o.nodeName]=o.nodeValue}}}else if(t.nodeType==3)return t.nodeValue;if(t.hasChildNodes())for(var s=0;s<t.childNodes.length;s++){var f=t.childNodes.item(s),u=f.nodeName;if(n[u]==null)n[u]=this.xml2json(f);else{if(n[u].push==null){var d=n[u];n[u]=[],n[u].push(d)}n[u].push(this.xml2json(f))}}return n},objectURLToBlob(t,n){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="blob",i.onload=function(o){(this.status==200||this.status===0)&&n(this.response)},i.send()},base64ToArrayBuffer(t,n){n=n||t.match(/^data\:([^\;]+)\;base64,/mi)[1]||"",t=t.replace(/^data\:([^\;]+)\;base64,/gmi,"");for(var i=atob(t),o=i.length,s=new ArrayBuffer(o),f=new Uint8Array(s),u=0;u<o;u++)f[u]=i.charCodeAt(u);return s}},x_={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},b_={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"},ks={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}},w_={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"};var S_=!1;const A_=function(t,n){return(self.Image&&t instanceof self.Image||self.HTMLImageElement&&t instanceof self.HTMLImageElement)&&!t.complete?(n(null,new Error("\u4E0D\u652F\u6301\u7684\u683C\u5F0F")),!1):(li.imageHasData(t)?n&&n(t):T_(t,n),!0)};function T_(t,n){function i(u){try{var d=E_(u);t.exifdata=d||{};var v;n&&n(t)}catch(M){n(null,M)}}if(t.src)if(/^data\:/i.test(t.src)){var o=li.base64ToArrayBuffer(t.src);i(o)}else if(/^blob\:/i.test(t.src)){var s=new FileReader;s.onload=function(u){i(u.target.result)},li.objectURLToBlob(t.src,function(u){s.readAsArrayBuffer(u)})}else{var f=new XMLHttpRequest;f.onload=function(){if(this.status==200||this.status===0)i(f.response);else throw"Could not load image";f=null},f.open("GET",t.src,!0),f.responseType="arraybuffer",f.send(null)}else if(self.FileReader&&(t instanceof self.Blob||t instanceof self.File)){var s=new FileReader;s.onload=function(d){i(d.target.result)},s.readAsArrayBuffer(t)}}function E_(t){var n=new DataView(t);if(n.getUint8(0)!=255||n.getUint8(1)!=216)return!1;for(var i=2,o=t.byteLength,s;i<o;){if(n.getUint8(i)!=255)return!1;if(s=n.getUint8(i+1),s==225)return D_(n,i+4,n.getUint16(i+2)-2);i+=2+n.getUint16(i+2)}}function s2(t){if("DOMParser"in self){var n=new DataView(t);if(n.getUint8(0)!=255||n.getUint8(1)!=216)return!1;for(var i=2,o=t.byteLength,s=new DOMParser;i<o-4;)if(li.getStringFromDB(n,i,4)=="http"){var f=i-1,u=n.getUint16(i-2)-1,d=li.getStringFromDB(n,f,u),v=d.indexOf("xmpmeta>")+8;d=d.substring(d.indexOf("<x:xmpmeta"),v);var M=d.indexOf("x:xmpmeta")+10;d=d.slice(0,M)+'xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus" xmlns:ext="http://www.gettyimages.com/xsltExtension/1.0" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" '+d.slice(M);var B=s.parseFromString(d,"text/xml");return li.xml2Object(B)}else i++}}function D_(t,n){if(li.getStringFromDB(t,n,4)!="Exif")return!1;var i,o,s,f,u,d=n+6;if(t.getUint16(d)==18761)i=!1;else if(t.getUint16(d)==19789)i=!0;else return!1;if(t.getUint16(d+2,!i)!=42)return!1;var v=t.getUint32(d+4,!i);if(v<8)return!1;if(o=Pc(t,d,d+v,x_,i),o.ExifIFDPointer){f=Pc(t,d,d+o.ExifIFDPointer,b_,i);for(s in f){switch(s){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":f[s]=ks[s][f[s]];break;case"ExifVersion":case"FlashpixVersion":f[s]=String.fromCharCode(f[s][0],f[s][1],f[s][2],f[s][3]);break;case"ComponentsConfiguration":f[s]=ks.Components[f[s][0]]+ks.Components[f[s][1]]+ks.Components[f[s][2]]+ks.Components[f[s][3]];break}o[s]=f[s]}}if(o.GPSInfoIFDPointer){u=Pc(t,d,d+o.GPSInfoIFDPointer,w_,i);for(s in u){switch(s){case"GPSVersionID":u[s]=u[s][0]+"."+u[s][1]+"."+u[s][2]+"."+u[s][3];break}o[s]=u[s]}}return o}function Pc(t,n,i,o,s){var f=t.getUint16(i,!s),u={},d,v,M;for(M=0;M<f;M++)d=i+M*12+2,v=o[t.getUint16(d,!s)],u[v]=L_(t,d,n,i,s);return u}function L_(t,n,i,o,s){var f=t.getUint16(n+2,!s),u=t.getUint32(n+4,!s),d=t.getUint32(n+8,!s)+i,v,M,B,p,U,q;switch(f){case 1:case 7:if(u==1)return t.getUint8(n+8,!s);for(v=u>4?d:n+8,M=[],p=0;p<u;p++)M[p]=t.getUint8(v+p);return M;case 2:return v=u>4?d:n+8,li.getStringFromDB(t,v,u-1);case 3:if(u==1)return t.getUint16(n+8,!s);for(v=u>2?d:n+8,M=[],p=0;p<u;p++)M[p]=t.getUint16(v+2*p,!s);return M;case 4:if(u==1)return t.getUint32(n+8,!s);for(M=[],p=0;p<u;p++)M[p]=t.getUint32(d+4*p,!s);return M;case 5:if(u==1)return U=t.getUint32(d,!s),q=t.getUint32(d+4,!s),B=new Number(U/q),B.numerator=U,B.denominator=q,B;for(M=[],p=0;p<u;p++)U=t.getUint32(d+8*p,!s),q=t.getUint32(d+4+8*p,!s),M[p]=new Number(U/q),M[p].numerator=U,M[p].denominator=q;return M;case 9:if(u==1)return t.getInt32(n+8,!s);for(M=[],p=0;p<u;p++)M[p]=t.getInt32(d+4*p,!s);return M;case 10:if(u==1)return t.getInt32(d,!s)/t.getInt32(d+4,!s);for(M=[],p=0;p<u;p++)M[p]=t.getInt32(d+8*p,!s)/t.getInt32(d+4+8*p,!s);return M}}const R_=function(t){if(!li.imageHasData(t))return{};var n,i=t.exifdata,o={};for(n in i)i.hasOwnProperty(n)&&(o[n]=i[n]);return o},Bc=t=>new Promise((n,i)=>{A_(t,function(o,s){if(s){i(s);return}let f=R_(o),u=JSON.parse(JSON.stringify(f).replaceAll("\\u0000",""))||{};n(u)})});let el;const C_=new Uint8Array(16);function O_(){if(!el&&(el=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!el))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return el(C_)}const Nn=[];for(let t=0;t<256;++t)Nn.push((t+256).toString(16).slice(1));function M_(t,n=0){return(Nn[t[n+0]]+Nn[t[n+1]]+Nn[t[n+2]]+Nn[t[n+3]]+"-"+Nn[t[n+4]]+Nn[t[n+5]]+"-"+Nn[t[n+6]]+Nn[t[n+7]]+"-"+Nn[t[n+8]]+Nn[t[n+9]]+"-"+Nn[t[n+10]]+Nn[t[n+11]]+Nn[t[n+12]]+Nn[t[n+13]]+Nn[t[n+14]]+Nn[t[n+15]]).toLowerCase()}const l0={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function I_(t,n,i){if(l0.randomUUID&&!n&&!t)return l0.randomUUID();t=t||{};const o=t.random||(t.rng||O_)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,n){i=i||0;for(let s=0;s<16;++s)n[i+s]=o[s];return n}return M_(o)}//! moment.js
|
|
2
|
+
//! version : 2.29.4
|
|
3
|
+
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
4
|
+
//! license : MIT
|
|
5
|
+
//! momentjs.com
|
|
6
|
+
var c0;function _t(){return c0.apply(null,arguments)}function F_(t){c0=t}function Pi(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function Vo(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function wr(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function Gc(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var n;for(n in t)if(wr(t,n))return!1;return!0}function Jn(t){return t===void 0}function Ta(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function Ns(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function h0(t,n){var i=[],o,s=t.length;for(o=0;o<s;++o)i.push(n(t[o],o));return i}function vo(t,n){for(var i in n)wr(n,i)&&(t[i]=n[i]);return wr(n,"toString")&&(t.toString=n.toString),wr(n,"valueOf")&&(t.valueOf=n.valueOf),t}function ia(t,n,i,o){return G0(t,n,i,o,!0).utc()}function k_(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function tr(t){return t._pf==null&&(t._pf=k_()),t._pf}var Uc;Array.prototype.some?Uc=Array.prototype.some:Uc=function(t){var n=Object(this),i=n.length>>>0,o;for(o=0;o<i;o++)if(o in n&&t.call(this,n[o],o,n))return!0;return!1};function Yc(t){if(t._isValid==null){var n=tr(t),i=Uc.call(n.parsedDateParts,function(s){return s!=null}),o=!isNaN(t._d.getTime())&&n.overflow<0&&!n.empty&&!n.invalidEra&&!n.invalidMonth&&!n.invalidWeekday&&!n.weekdayMismatch&&!n.nullInput&&!n.invalidFormat&&!n.userInvalidated&&(!n.meridiem||n.meridiem&&i);if(t._strict&&(o=o&&n.charsLeftOver===0&&n.unusedTokens.length===0&&n.bigHour===void 0),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=o;else return o}return t._isValid}function tl(t){var n=ia(NaN);return t!=null?vo(tr(n),t):tr(n).userInvalidated=!0,n}var d0=_t.momentProperties=[],Hc=!1;function zc(t,n){var i,o,s,f=d0.length;if(Jn(n._isAMomentObject)||(t._isAMomentObject=n._isAMomentObject),Jn(n._i)||(t._i=n._i),Jn(n._f)||(t._f=n._f),Jn(n._l)||(t._l=n._l),Jn(n._strict)||(t._strict=n._strict),Jn(n._tzm)||(t._tzm=n._tzm),Jn(n._isUTC)||(t._isUTC=n._isUTC),Jn(n._offset)||(t._offset=n._offset),Jn(n._pf)||(t._pf=tr(n)),Jn(n._locale)||(t._locale=n._locale),f>0)for(i=0;i<f;i++)o=d0[i],s=n[o],Jn(s)||(t[o]=s);return t}function Ps(t){zc(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Hc===!1&&(Hc=!0,_t.updateOffset(this),Hc=!1)}function Bi(t){return t instanceof Ps||t!=null&&t._isAMomentObject!=null}function v0(t){_t.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Di(t,n){var i=!0;return vo(function(){if(_t.deprecationHandler!=null&&_t.deprecationHandler(null,t),i){var o=[],s,f,u,d=arguments.length;for(f=0;f<d;f++){if(s="",typeof arguments[f]=="object"){s+=`
|
|
7
|
+
[`+f+"] ";for(u in arguments[0])wr(arguments[0],u)&&(s+=u+": "+arguments[0][u]+", ");s=s.slice(0,-2)}else s=arguments[f];o.push(s)}v0(t+`
|
|
8
|
+
Arguments: `+Array.prototype.slice.call(o).join("")+`
|
|
9
|
+
`+new Error().stack),i=!1}return n.apply(this,arguments)},n)}var _0={};function p0(t,n){_t.deprecationHandler!=null&&_t.deprecationHandler(t,n),_0[t]||(v0(n),_0[t]=!0)}_t.suppressDeprecationWarnings=!1,_t.deprecationHandler=null;function aa(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function N_(t){var n,i;for(i in t)wr(t,i)&&(n=t[i],aa(n)?this[i]=n:this["_"+i]=n);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Wc(t,n){var i=vo({},t),o;for(o in n)wr(n,o)&&(Vo(t[o])&&Vo(n[o])?(i[o]={},vo(i[o],t[o]),vo(i[o],n[o])):n[o]!=null?i[o]=n[o]:delete i[o]);for(o in t)wr(t,o)&&!wr(n,o)&&Vo(t[o])&&(i[o]=vo({},i[o]));return i}function Vc(t){t!=null&&this.set(t)}var $c;Object.keys?$c=Object.keys:$c=function(t){var n,i=[];for(n in t)wr(t,n)&&i.push(n);return i};var P_={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function B_(t,n,i){var o=this._calendar[t]||this._calendar.sameElse;return aa(o)?o.call(n,i):o}function oa(t,n,i){var o=""+Math.abs(t),s=n-o.length,f=t>=0;return(f?i?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+o}var Zc=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,rl=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Xc={},Mf={};function Ft(t,n,i,o){var s=o;typeof o=="string"&&(s=function(){return this[o]()}),t&&(Mf[t]=s),n&&(Mf[n[0]]=function(){return oa(s.apply(this,arguments),n[1],n[2])}),i&&(Mf[i]=function(){return this.localeData().ordinal(s.apply(this,arguments),t)})}function G_(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function U_(t){var n=t.match(Zc),i,o;for(i=0,o=n.length;i<o;i++)Mf[n[i]]?n[i]=Mf[n[i]]:n[i]=G_(n[i]);return function(s){var f="",u;for(u=0;u<o;u++)f+=aa(n[u])?n[u].call(s,t):n[u];return f}}function nl(t,n){return t.isValid()?(n=m0(n,t.localeData()),Xc[n]=Xc[n]||U_(n),Xc[n](t)):t.localeData().invalidDate()}function m0(t,n){var i=5;function o(s){return n.longDateFormat(s)||s}for(rl.lastIndex=0;i>=0&&rl.test(t);)t=t.replace(rl,o),rl.lastIndex=0,i-=1;return t}var Y_={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function H_(t){var n=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return n||!i?n:(this._longDateFormat[t]=i.match(Zc).map(function(o){return o==="MMMM"||o==="MM"||o==="DD"||o==="dddd"?o.slice(1):o}).join(""),this._longDateFormat[t])}var z_="Invalid date";function W_(){return this._invalidDate}var V_="%d",$_=/\d{1,2}/;function Z_(t){return this._ordinal.replace("%d",t)}var X_={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function q_(t,n,i,o){var s=this._relativeTime[i];return aa(s)?s(t,n,i,o):s.replace(/%d/i,t)}function K_(t,n){var i=this._relativeTime[t>0?"future":"past"];return aa(i)?i(n):i.replace(/%s/i,n)}var Bs={};function Yn(t,n){var i=t.toLowerCase();Bs[i]=Bs[i+"s"]=Bs[n]=t}function Li(t){return typeof t=="string"?Bs[t]||Bs[t.toLowerCase()]:void 0}function qc(t){var n={},i,o;for(o in t)wr(t,o)&&(i=Li(o),i&&(n[i]=t[o]));return n}var g0={};function Hn(t,n){g0[t]=n}function j_(t){var n=[],i;for(i in t)wr(t,i)&&n.push({unit:i,priority:g0[i]});return n.sort(function(o,s){return o.priority-s.priority}),n}function il(t){return t%4===0&&t%100!==0||t%400===0}function Ri(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function fr(t){var n=+t,i=0;return n!==0&&isFinite(n)&&(i=Ri(n)),i}function If(t,n){return function(i){return i!=null?(y0(this,t,i),_t.updateOffset(this,n),this):al(this,t)}}function al(t,n){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+n]():NaN}function y0(t,n,i){t.isValid()&&!isNaN(i)&&(n==="FullYear"&&il(t.year())&&t.month()===1&&t.date()===29?(i=fr(i),t._d["set"+(t._isUTC?"UTC":"")+n](i,t.month(),hl(i,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+n](i))}function Q_(t){return t=Li(t),aa(this[t])?this[t]():this}function J_(t,n){if(typeof t=="object"){t=qc(t);var i=j_(t),o,s=i.length;for(o=0;o<s;o++)this[i[o].unit](t[i[o].unit])}else if(t=Li(t),aa(this[t]))return this[t](n);return this}var x0=/\d/,ci=/\d\d/,b0=/\d{3}/,Kc=/\d{4}/,ol=/[+-]?\d{6}/,Gr=/\d\d?/,w0=/\d\d\d\d?/,S0=/\d\d\d\d\d\d?/,fl=/\d{1,3}/,jc=/\d{1,4}/,sl=/[+-]?\d{1,6}/,Ff=/\d+/,ul=/[+-]?\d+/,ep=/Z|[+-]\d\d:?\d\d/gi,ll=/Z|[+-]\d\d(?::?\d\d)?/gi,tp=/[+-]?\d+(\.\d{1,3})?/,Gs=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,cl;cl={};function bt(t,n,i){cl[t]=aa(n)?n:function(o,s){return o&&i?i:n}}function rp(t,n){return wr(cl,t)?cl[t](n._strict,n._locale):new RegExp(np(t))}function np(t){return hi(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(n,i,o,s,f){return i||o||s||f}))}function hi(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Qc={};function Ir(t,n){var i,o=n,s;for(typeof t=="string"&&(t=[t]),Ta(n)&&(o=function(f,u){u[n]=fr(f)}),s=t.length,i=0;i<s;i++)Qc[t[i]]=o}function Us(t,n){Ir(t,function(i,o,s,f){s._w=s._w||{},n(i,s._w,s,f)})}function ip(t,n,i){n!=null&&wr(Qc,t)&&Qc[t](n,i._a,i,t)}var zn=0,Ea=1,fa=2,xn=3,Gi=4,Da=5,$o=6,ap=7,op=8;function fp(t,n){return(t%n+n)%n}var nn;Array.prototype.indexOf?nn=Array.prototype.indexOf:nn=function(t){var n;for(n=0;n<this.length;++n)if(this[n]===t)return n;return-1};function hl(t,n){if(isNaN(t)||isNaN(n))return NaN;var i=fp(n,12);return t+=(n-i)/12,i===1?il(t)?29:28:31-i%7%2}Ft("M",["MM",2],"Mo",function(){return this.month()+1}),Ft("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),Ft("MMMM",0,0,function(t){return this.localeData().months(this,t)}),Yn("month","M"),Hn("month",8),bt("M",Gr),bt("MM",Gr,ci),bt("MMM",function(t,n){return n.monthsShortRegex(t)}),bt("MMMM",function(t,n){return n.monthsRegex(t)}),Ir(["M","MM"],function(t,n){n[Ea]=fr(t)-1}),Ir(["MMM","MMMM"],function(t,n,i,o){var s=i._locale.monthsParse(t,o,i._strict);s!=null?n[Ea]=s:tr(i).invalidMonth=t});var sp="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),A0="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),T0=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,up=Gs,lp=Gs;function cp(t,n){return t?Pi(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||T0).test(n)?"format":"standalone"][t.month()]:Pi(this._months)?this._months:this._months.standalone}function hp(t,n){return t?Pi(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[T0.test(n)?"format":"standalone"][t.month()]:Pi(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function dp(t,n,i){var o,s,f,u=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],o=0;o<12;++o)f=ia([2e3,o]),this._shortMonthsParse[o]=this.monthsShort(f,"").toLocaleLowerCase(),this._longMonthsParse[o]=this.months(f,"").toLocaleLowerCase();return i?n==="MMM"?(s=nn.call(this._shortMonthsParse,u),s!==-1?s:null):(s=nn.call(this._longMonthsParse,u),s!==-1?s:null):n==="MMM"?(s=nn.call(this._shortMonthsParse,u),s!==-1?s:(s=nn.call(this._longMonthsParse,u),s!==-1?s:null)):(s=nn.call(this._longMonthsParse,u),s!==-1?s:(s=nn.call(this._shortMonthsParse,u),s!==-1?s:null))}function vp(t,n,i){var o,s,f;if(this._monthsParseExact)return dp.call(this,t,n,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),o=0;o<12;o++){if(s=ia([2e3,o]),i&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),!i&&!this._monthsParse[o]&&(f="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[o]=new RegExp(f.replace(".",""),"i")),i&&n==="MMMM"&&this._longMonthsParse[o].test(t))return o;if(i&&n==="MMM"&&this._shortMonthsParse[o].test(t))return o;if(!i&&this._monthsParse[o].test(t))return o}}function E0(t,n){var i;if(!t.isValid())return t;if(typeof n=="string"){if(/^\d+$/.test(n))n=fr(n);else if(n=t.localeData().monthsParse(n),!Ta(n))return t}return i=Math.min(t.date(),hl(t.year(),n)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](n,i),t}function D0(t){return t!=null?(E0(this,t),_t.updateOffset(this,!0),this):al(this,"Month")}function _p(){return hl(this.year(),this.month())}function pp(t){return this._monthsParseExact?(wr(this,"_monthsRegex")||L0.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(wr(this,"_monthsShortRegex")||(this._monthsShortRegex=up),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function mp(t){return this._monthsParseExact?(wr(this,"_monthsRegex")||L0.call(this),t?this._monthsStrictRegex:this._monthsRegex):(wr(this,"_monthsRegex")||(this._monthsRegex=lp),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function L0(){function t(u,d){return d.length-u.length}var n=[],i=[],o=[],s,f;for(s=0;s<12;s++)f=ia([2e3,s]),n.push(this.monthsShort(f,"")),i.push(this.months(f,"")),o.push(this.months(f,"")),o.push(this.monthsShort(f,""));for(n.sort(t),i.sort(t),o.sort(t),s=0;s<12;s++)n[s]=hi(n[s]),i[s]=hi(i[s]);for(s=0;s<24;s++)o[s]=hi(o[s]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}Ft("Y",0,0,function(){var t=this.year();return t<=9999?oa(t,4):"+"+t}),Ft(0,["YY",2],0,function(){return this.year()%100}),Ft(0,["YYYY",4],0,"year"),Ft(0,["YYYYY",5],0,"year"),Ft(0,["YYYYYY",6,!0],0,"year"),Yn("year","y"),Hn("year",1),bt("Y",ul),bt("YY",Gr,ci),bt("YYYY",jc,Kc),bt("YYYYY",sl,ol),bt("YYYYYY",sl,ol),Ir(["YYYYY","YYYYYY"],zn),Ir("YYYY",function(t,n){n[zn]=t.length===2?_t.parseTwoDigitYear(t):fr(t)}),Ir("YY",function(t,n){n[zn]=_t.parseTwoDigitYear(t)}),Ir("Y",function(t,n){n[zn]=parseInt(t,10)});function Ys(t){return il(t)?366:365}_t.parseTwoDigitYear=function(t){return fr(t)+(fr(t)>68?1900:2e3)};var R0=If("FullYear",!0);function gp(){return il(this.year())}function yp(t,n,i,o,s,f,u){var d;return t<100&&t>=0?(d=new Date(t+400,n,i,o,s,f,u),isFinite(d.getFullYear())&&d.setFullYear(t)):d=new Date(t,n,i,o,s,f,u),d}function Hs(t){var n,i;return t<100&&t>=0?(i=Array.prototype.slice.call(arguments),i[0]=t+400,n=new Date(Date.UTC.apply(null,i)),isFinite(n.getUTCFullYear())&&n.setUTCFullYear(t)):n=new Date(Date.UTC.apply(null,arguments)),n}function dl(t,n,i){var o=7+n-i,s=(7+Hs(t,0,o).getUTCDay()-n)%7;return-s+o-1}function C0(t,n,i,o,s){var f=(7+i-o)%7,u=dl(t,o,s),d=1+7*(n-1)+f+u,v,M;return d<=0?(v=t-1,M=Ys(v)+d):d>Ys(t)?(v=t+1,M=d-Ys(t)):(v=t,M=d),{year:v,dayOfYear:M}}function zs(t,n,i){var o=dl(t.year(),n,i),s=Math.floor((t.dayOfYear()-o-1)/7)+1,f,u;return s<1?(u=t.year()-1,f=s+La(u,n,i)):s>La(t.year(),n,i)?(f=s-La(t.year(),n,i),u=t.year()+1):(u=t.year(),f=s),{week:f,year:u}}function La(t,n,i){var o=dl(t,n,i),s=dl(t+1,n,i);return(Ys(t)-o+s)/7}Ft("w",["ww",2],"wo","week"),Ft("W",["WW",2],"Wo","isoWeek"),Yn("week","w"),Yn("isoWeek","W"),Hn("week",5),Hn("isoWeek",5),bt("w",Gr),bt("ww",Gr,ci),bt("W",Gr),bt("WW",Gr,ci),Us(["w","ww","W","WW"],function(t,n,i,o){n[o.substr(0,1)]=fr(t)});function xp(t){return zs(t,this._week.dow,this._week.doy).week}var bp={dow:0,doy:6};function wp(){return this._week.dow}function Sp(){return this._week.doy}function Ap(t){var n=this.localeData().week(this);return t==null?n:this.add((t-n)*7,"d")}function Tp(t){var n=zs(this,1,4).week;return t==null?n:this.add((t-n)*7,"d")}Ft("d",0,"do","day"),Ft("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),Ft("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),Ft("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),Ft("e",0,0,"weekday"),Ft("E",0,0,"isoWeekday"),Yn("day","d"),Yn("weekday","e"),Yn("isoWeekday","E"),Hn("day",11),Hn("weekday",11),Hn("isoWeekday",11),bt("d",Gr),bt("e",Gr),bt("E",Gr),bt("dd",function(t,n){return n.weekdaysMinRegex(t)}),bt("ddd",function(t,n){return n.weekdaysShortRegex(t)}),bt("dddd",function(t,n){return n.weekdaysRegex(t)}),Us(["dd","ddd","dddd"],function(t,n,i,o){var s=i._locale.weekdaysParse(t,o,i._strict);s!=null?n.d=s:tr(i).invalidWeekday=t}),Us(["d","e","E"],function(t,n,i,o){n[o]=fr(t)});function Ep(t,n){return typeof t!="string"?t:isNaN(t)?(t=n.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function Dp(t,n){return typeof t=="string"?n.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Jc(t,n){return t.slice(n,7).concat(t.slice(0,n))}var Lp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),O0="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rp="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Cp=Gs,Op=Gs,Mp=Gs;function Ip(t,n){var i=Pi(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(n)?"format":"standalone"];return t===!0?Jc(i,this._week.dow):t?i[t.day()]:i}function Fp(t){return t===!0?Jc(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function kp(t){return t===!0?Jc(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Np(t,n,i){var o,s,f,u=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)f=ia([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(f,"").toLocaleLowerCase();return i?n==="dddd"?(s=nn.call(this._weekdaysParse,u),s!==-1?s:null):n==="ddd"?(s=nn.call(this._shortWeekdaysParse,u),s!==-1?s:null):(s=nn.call(this._minWeekdaysParse,u),s!==-1?s:null):n==="dddd"?(s=nn.call(this._weekdaysParse,u),s!==-1||(s=nn.call(this._shortWeekdaysParse,u),s!==-1)?s:(s=nn.call(this._minWeekdaysParse,u),s!==-1?s:null)):n==="ddd"?(s=nn.call(this._shortWeekdaysParse,u),s!==-1||(s=nn.call(this._weekdaysParse,u),s!==-1)?s:(s=nn.call(this._minWeekdaysParse,u),s!==-1?s:null)):(s=nn.call(this._minWeekdaysParse,u),s!==-1||(s=nn.call(this._weekdaysParse,u),s!==-1)?s:(s=nn.call(this._shortWeekdaysParse,u),s!==-1?s:null))}function Pp(t,n,i){var o,s,f;if(this._weekdaysParseExact)return Np.call(this,t,n,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(s=ia([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[o]||(f="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[o]=new RegExp(f.replace(".",""),"i")),i&&n==="dddd"&&this._fullWeekdaysParse[o].test(t))return o;if(i&&n==="ddd"&&this._shortWeekdaysParse[o].test(t))return o;if(i&&n==="dd"&&this._minWeekdaysParse[o].test(t))return o;if(!i&&this._weekdaysParse[o].test(t))return o}}function Bp(t){if(!this.isValid())return t!=null?this:NaN;var n=this._isUTC?this._d.getUTCDay():this._d.getDay();return t!=null?(t=Ep(t,this.localeData()),this.add(t-n,"d")):n}function Gp(t){if(!this.isValid())return t!=null?this:NaN;var n=(this.day()+7-this.localeData()._week.dow)%7;return t==null?n:this.add(t-n,"d")}function Up(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var n=Dp(t,this.localeData());return this.day(this.day()%7?n:n-7)}else return this.day()||7}function Yp(t){return this._weekdaysParseExact?(wr(this,"_weekdaysRegex")||eh.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(wr(this,"_weekdaysRegex")||(this._weekdaysRegex=Cp),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Hp(t){return this._weekdaysParseExact?(wr(this,"_weekdaysRegex")||eh.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(wr(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Op),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function zp(t){return this._weekdaysParseExact?(wr(this,"_weekdaysRegex")||eh.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(wr(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Mp),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function eh(){function t(B,p){return p.length-B.length}var n=[],i=[],o=[],s=[],f,u,d,v,M;for(f=0;f<7;f++)u=ia([2e3,1]).day(f),d=hi(this.weekdaysMin(u,"")),v=hi(this.weekdaysShort(u,"")),M=hi(this.weekdays(u,"")),n.push(d),i.push(v),o.push(M),s.push(d),s.push(v),s.push(M);n.sort(t),i.sort(t),o.sort(t),s.sort(t),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+n.join("|")+")","i")}function th(){return this.hours()%12||12}function Wp(){return this.hours()||24}Ft("H",["HH",2],0,"hour"),Ft("h",["hh",2],0,th),Ft("k",["kk",2],0,Wp),Ft("hmm",0,0,function(){return""+th.apply(this)+oa(this.minutes(),2)}),Ft("hmmss",0,0,function(){return""+th.apply(this)+oa(this.minutes(),2)+oa(this.seconds(),2)}),Ft("Hmm",0,0,function(){return""+this.hours()+oa(this.minutes(),2)}),Ft("Hmmss",0,0,function(){return""+this.hours()+oa(this.minutes(),2)+oa(this.seconds(),2)});function M0(t,n){Ft(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),n)})}M0("a",!0),M0("A",!1),Yn("hour","h"),Hn("hour",13);function I0(t,n){return n._meridiemParse}bt("a",I0),bt("A",I0),bt("H",Gr),bt("h",Gr),bt("k",Gr),bt("HH",Gr,ci),bt("hh",Gr,ci),bt("kk",Gr,ci),bt("hmm",w0),bt("hmmss",S0),bt("Hmm",w0),bt("Hmmss",S0),Ir(["H","HH"],xn),Ir(["k","kk"],function(t,n,i){var o=fr(t);n[xn]=o===24?0:o}),Ir(["a","A"],function(t,n,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),Ir(["h","hh"],function(t,n,i){n[xn]=fr(t),tr(i).bigHour=!0}),Ir("hmm",function(t,n,i){var o=t.length-2;n[xn]=fr(t.substr(0,o)),n[Gi]=fr(t.substr(o)),tr(i).bigHour=!0}),Ir("hmmss",function(t,n,i){var o=t.length-4,s=t.length-2;n[xn]=fr(t.substr(0,o)),n[Gi]=fr(t.substr(o,2)),n[Da]=fr(t.substr(s)),tr(i).bigHour=!0}),Ir("Hmm",function(t,n,i){var o=t.length-2;n[xn]=fr(t.substr(0,o)),n[Gi]=fr(t.substr(o))}),Ir("Hmmss",function(t,n,i){var o=t.length-4,s=t.length-2;n[xn]=fr(t.substr(0,o)),n[Gi]=fr(t.substr(o,2)),n[Da]=fr(t.substr(s))});function Vp(t){return(t+"").toLowerCase().charAt(0)==="p"}var $p=/[ap]\.?m?\.?/i,Zp=If("Hours",!0);function Xp(t,n,i){return t>11?i?"pm":"PM":i?"am":"AM"}var F0={calendar:P_,longDateFormat:Y_,invalidDate:z_,ordinal:V_,dayOfMonthOrdinalParse:$_,relativeTime:X_,months:sp,monthsShort:A0,week:bp,weekdays:Lp,weekdaysMin:Rp,weekdaysShort:O0,meridiemParse:$p},$r={},Ws={},Vs;function qp(t,n){var i,o=Math.min(t.length,n.length);for(i=0;i<o;i+=1)if(t[i]!==n[i])return i;return o}function k0(t){return t&&t.toLowerCase().replace("_","-")}function Kp(t){for(var n=0,i,o,s,f;n<t.length;){for(f=k0(t[n]).split("-"),i=f.length,o=k0(t[n+1]),o=o?o.split("-"):null;i>0;){if(s=vl(f.slice(0,i).join("-")),s)return s;if(o&&o.length>=i&&qp(f,o)>=i-1)break;i--}n++}return Vs}function jp(t){return t.match("^[^/\\\\]*$")!=null}function vl(t){var n=null,i;if($r[t]===void 0&&typeof module<"u"&&module&&module.exports&&jp(t))try{n=Vs._abbr,i=require,i("./locale/"+t),_o(n)}catch{$r[t]=null}return $r[t]}function _o(t,n){var i;return t&&(Jn(n)?i=Ra(t):i=rh(t,n),i?Vs=i:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Vs._abbr}function rh(t,n){if(n!==null){var i,o=F0;if(n.abbr=t,$r[t]!=null)p0("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=$r[t]._config;else if(n.parentLocale!=null)if($r[n.parentLocale]!=null)o=$r[n.parentLocale]._config;else if(i=vl(n.parentLocale),i!=null)o=i._config;else return Ws[n.parentLocale]||(Ws[n.parentLocale]=[]),Ws[n.parentLocale].push({name:t,config:n}),null;return $r[t]=new Vc(Wc(o,n)),Ws[t]&&Ws[t].forEach(function(s){rh(s.name,s.config)}),_o(t),$r[t]}else return delete $r[t],null}function Qp(t,n){if(n!=null){var i,o,s=F0;$r[t]!=null&&$r[t].parentLocale!=null?$r[t].set(Wc($r[t]._config,n)):(o=vl(t),o!=null&&(s=o._config),n=Wc(s,n),o==null&&(n.abbr=t),i=new Vc(n),i.parentLocale=$r[t],$r[t]=i),_o(t)}else $r[t]!=null&&($r[t].parentLocale!=null?($r[t]=$r[t].parentLocale,t===_o()&&_o(t)):$r[t]!=null&&delete $r[t]);return $r[t]}function Ra(t){var n;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Vs;if(!Pi(t)){if(n=vl(t),n)return n;t=[t]}return Kp(t)}function Jp(){return $c($r)}function nh(t){var n,i=t._a;return i&&tr(t).overflow===-2&&(n=i[Ea]<0||i[Ea]>11?Ea:i[fa]<1||i[fa]>hl(i[zn],i[Ea])?fa:i[xn]<0||i[xn]>24||i[xn]===24&&(i[Gi]!==0||i[Da]!==0||i[$o]!==0)?xn:i[Gi]<0||i[Gi]>59?Gi:i[Da]<0||i[Da]>59?Da:i[$o]<0||i[$o]>999?$o:-1,tr(t)._overflowDayOfYear&&(n<zn||n>fa)&&(n=fa),tr(t)._overflowWeeks&&n===-1&&(n=ap),tr(t)._overflowWeekday&&n===-1&&(n=op),tr(t).overflow=n),t}var em=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tm=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,rm=/Z|[+-]\d\d(?::?\d\d)?/,_l=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ih=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],nm=/^\/?Date\((-?\d+)/i,im=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,am={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function N0(t){var n,i,o=t._i,s=em.exec(o)||tm.exec(o),f,u,d,v,M=_l.length,B=ih.length;if(s){for(tr(t).iso=!0,n=0,i=M;n<i;n++)if(_l[n][1].exec(s[1])){u=_l[n][0],f=_l[n][2]!==!1;break}if(u==null){t._isValid=!1;return}if(s[3]){for(n=0,i=B;n<i;n++)if(ih[n][1].exec(s[3])){d=(s[2]||" ")+ih[n][0];break}if(d==null){t._isValid=!1;return}}if(!f&&d!=null){t._isValid=!1;return}if(s[4])if(rm.exec(s[4]))v="Z";else{t._isValid=!1;return}t._f=u+(d||"")+(v||""),oh(t)}else t._isValid=!1}function om(t,n,i,o,s,f){var u=[fm(t),A0.indexOf(n),parseInt(i,10),parseInt(o,10),parseInt(s,10)];return f&&u.push(parseInt(f,10)),u}function fm(t){var n=parseInt(t,10);return n<=49?2e3+n:n<=999?1900+n:n}function sm(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function um(t,n,i){if(t){var o=O0.indexOf(t),s=new Date(n[0],n[1],n[2]).getDay();if(o!==s)return tr(i).weekdayMismatch=!0,i._isValid=!1,!1}return!0}function lm(t,n,i){if(t)return am[t];if(n)return 0;var o=parseInt(i,10),s=o%100,f=(o-s)/100;return f*60+s}function P0(t){var n=im.exec(sm(t._i)),i;if(n){if(i=om(n[4],n[3],n[2],n[5],n[6],n[7]),!um(n[1],i,t))return;t._a=i,t._tzm=lm(n[8],n[9],n[10]),t._d=Hs.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),tr(t).rfc2822=!0}else t._isValid=!1}function cm(t){var n=nm.exec(t._i);if(n!==null){t._d=new Date(+n[1]);return}if(N0(t),t._isValid===!1)delete t._isValid;else return;if(P0(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:_t.createFromInputFallback(t)}_t.createFromInputFallback=Di("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function kf(t,n,i){return t!=null?t:n!=null?n:i}function hm(t){var n=new Date(_t.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function ah(t){var n,i,o=[],s,f,u;if(!t._d){for(s=hm(t),t._w&&t._a[fa]==null&&t._a[Ea]==null&&dm(t),t._dayOfYear!=null&&(u=kf(t._a[zn],s[zn]),(t._dayOfYear>Ys(u)||t._dayOfYear===0)&&(tr(t)._overflowDayOfYear=!0),i=Hs(u,0,t._dayOfYear),t._a[Ea]=i.getUTCMonth(),t._a[fa]=i.getUTCDate()),n=0;n<3&&t._a[n]==null;++n)t._a[n]=o[n]=s[n];for(;n<7;n++)t._a[n]=o[n]=t._a[n]==null?n===2?1:0:t._a[n];t._a[xn]===24&&t._a[Gi]===0&&t._a[Da]===0&&t._a[$o]===0&&(t._nextDay=!0,t._a[xn]=0),t._d=(t._useUTC?Hs:yp).apply(null,o),f=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[xn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==f&&(tr(t).weekdayMismatch=!0)}}function dm(t){var n,i,o,s,f,u,d,v,M;n=t._w,n.GG!=null||n.W!=null||n.E!=null?(f=1,u=4,i=kf(n.GG,t._a[zn],zs(Ur(),1,4).year),o=kf(n.W,1),s=kf(n.E,1),(s<1||s>7)&&(v=!0)):(f=t._locale._week.dow,u=t._locale._week.doy,M=zs(Ur(),f,u),i=kf(n.gg,t._a[zn],M.year),o=kf(n.w,M.week),n.d!=null?(s=n.d,(s<0||s>6)&&(v=!0)):n.e!=null?(s=n.e+f,(n.e<0||n.e>6)&&(v=!0)):s=f),o<1||o>La(i,f,u)?tr(t)._overflowWeeks=!0:v!=null?tr(t)._overflowWeekday=!0:(d=C0(i,o,s,f,u),t._a[zn]=d.year,t._dayOfYear=d.dayOfYear)}_t.ISO_8601=function(){},_t.RFC_2822=function(){};function oh(t){if(t._f===_t.ISO_8601){N0(t);return}if(t._f===_t.RFC_2822){P0(t);return}t._a=[],tr(t).empty=!0;var n=""+t._i,i,o,s,f,u,d=n.length,v=0,M,B;for(s=m0(t._f,t._locale).match(Zc)||[],B=s.length,i=0;i<B;i++)f=s[i],o=(n.match(rp(f,t))||[])[0],o&&(u=n.substr(0,n.indexOf(o)),u.length>0&&tr(t).unusedInput.push(u),n=n.slice(n.indexOf(o)+o.length),v+=o.length),Mf[f]?(o?tr(t).empty=!1:tr(t).unusedTokens.push(f),ip(f,o,t)):t._strict&&!o&&tr(t).unusedTokens.push(f);tr(t).charsLeftOver=d-v,n.length>0&&tr(t).unusedInput.push(n),t._a[xn]<=12&&tr(t).bigHour===!0&&t._a[xn]>0&&(tr(t).bigHour=void 0),tr(t).parsedDateParts=t._a.slice(0),tr(t).meridiem=t._meridiem,t._a[xn]=vm(t._locale,t._a[xn],t._meridiem),M=tr(t).era,M!==null&&(t._a[zn]=t._locale.erasConvertYear(M,t._a[zn])),ah(t),nh(t)}function vm(t,n,i){var o;return i==null?n:t.meridiemHour!=null?t.meridiemHour(n,i):(t.isPM!=null&&(o=t.isPM(i),o&&n<12&&(n+=12),!o&&n===12&&(n=0)),n)}function _m(t){var n,i,o,s,f,u,d=!1,v=t._f.length;if(v===0){tr(t).invalidFormat=!0,t._d=new Date(NaN);return}for(s=0;s<v;s++)f=0,u=!1,n=zc({},t),t._useUTC!=null&&(n._useUTC=t._useUTC),n._f=t._f[s],oh(n),Yc(n)&&(u=!0),f+=tr(n).charsLeftOver,f+=tr(n).unusedTokens.length*10,tr(n).score=f,d?f<o&&(o=f,i=n):(o==null||f<o||u)&&(o=f,i=n,u&&(d=!0));vo(t,i||n)}function pm(t){if(!t._d){var n=qc(t._i),i=n.day===void 0?n.date:n.day;t._a=h0([n.year,n.month,i,n.hour,n.minute,n.second,n.millisecond],function(o){return o&&parseInt(o,10)}),ah(t)}}function mm(t){var n=new Ps(nh(B0(t)));return n._nextDay&&(n.add(1,"d"),n._nextDay=void 0),n}function B0(t){var n=t._i,i=t._f;return t._locale=t._locale||Ra(t._l),n===null||i===void 0&&n===""?tl({nullInput:!0}):(typeof n=="string"&&(t._i=n=t._locale.preparse(n)),Bi(n)?new Ps(nh(n)):(Ns(n)?t._d=n:Pi(i)?_m(t):i?oh(t):gm(t),Yc(t)||(t._d=null),t))}function gm(t){var n=t._i;Jn(n)?t._d=new Date(_t.now()):Ns(n)?t._d=new Date(n.valueOf()):typeof n=="string"?cm(t):Pi(n)?(t._a=h0(n.slice(0),function(i){return parseInt(i,10)}),ah(t)):Vo(n)?pm(t):Ta(n)?t._d=new Date(n):_t.createFromInputFallback(t)}function G0(t,n,i,o,s){var f={};return(n===!0||n===!1)&&(o=n,n=void 0),(i===!0||i===!1)&&(o=i,i=void 0),(Vo(t)&&Gc(t)||Pi(t)&&t.length===0)&&(t=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=s,f._l=i,f._i=t,f._f=n,f._strict=o,mm(f)}function Ur(t,n,i,o){return G0(t,n,i,o,!1)}var ym=Di("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Ur.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:tl()}),xm=Di("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Ur.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:tl()});function U0(t,n){var i,o;if(n.length===1&&Pi(n[0])&&(n=n[0]),!n.length)return Ur();for(i=n[0],o=1;o<n.length;++o)(!n[o].isValid()||n[o][t](i))&&(i=n[o]);return i}function bm(){var t=[].slice.call(arguments,0);return U0("isBefore",t)}function wm(){var t=[].slice.call(arguments,0);return U0("isAfter",t)}var Sm=function(){return Date.now?Date.now():+new Date},$s=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Am(t){var n,i=!1,o,s=$s.length;for(n in t)if(wr(t,n)&&!(nn.call($s,n)!==-1&&(t[n]==null||!isNaN(t[n]))))return!1;for(o=0;o<s;++o)if(t[$s[o]]){if(i)return!1;parseFloat(t[$s[o]])!==fr(t[$s[o]])&&(i=!0)}return!0}function Tm(){return this._isValid}function Em(){return Ui(NaN)}function pl(t){var n=qc(t),i=n.year||0,o=n.quarter||0,s=n.month||0,f=n.week||n.isoWeek||0,u=n.day||0,d=n.hour||0,v=n.minute||0,M=n.second||0,B=n.millisecond||0;this._isValid=Am(n),this._milliseconds=+B+M*1e3+v*6e4+d*1e3*60*60,this._days=+u+f*7,this._months=+s+o*3+i*12,this._data={},this._locale=Ra(),this._bubble()}function ml(t){return t instanceof pl}function fh(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function Dm(t,n,i){var o=Math.min(t.length,n.length),s=Math.abs(t.length-n.length),f=0,u;for(u=0;u<o;u++)(i&&t[u]!==n[u]||!i&&fr(t[u])!==fr(n[u]))&&f++;return f+s}function Y0(t,n){Ft(t,0,0,function(){var i=this.utcOffset(),o="+";return i<0&&(i=-i,o="-"),o+oa(~~(i/60),2)+n+oa(~~i%60,2)})}Y0("Z",":"),Y0("ZZ",""),bt("Z",ll),bt("ZZ",ll),Ir(["Z","ZZ"],function(t,n,i){i._useUTC=!0,i._tzm=sh(ll,t)});var Lm=/([\+\-]|\d\d)/gi;function sh(t,n){var i=(n||"").match(t),o,s,f;return i===null?null:(o=i[i.length-1]||[],s=(o+"").match(Lm)||["-",0,0],f=+(s[1]*60)+fr(s[2]),f===0?0:s[0]==="+"?f:-f)}function uh(t,n){var i,o;return n._isUTC?(i=n.clone(),o=(Bi(t)||Ns(t)?t.valueOf():Ur(t).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+o),_t.updateOffset(i,!1),i):Ur(t).local()}function lh(t){return-Math.round(t._d.getTimezoneOffset())}_t.updateOffset=function(){};function Rm(t,n,i){var o=this._offset||0,s;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=sh(ll,t),t===null)return this}else Math.abs(t)<16&&!i&&(t=t*60);return!this._isUTC&&n&&(s=lh(this)),this._offset=t,this._isUTC=!0,s!=null&&this.add(s,"m"),o!==t&&(!n||this._changeInProgress?V0(this,Ui(t-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,_t.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?o:lh(this)}function Cm(t,n){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,n),this):-this.utcOffset()}function Om(t){return this.utcOffset(0,t)}function Mm(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(lh(this),"m")),this}function Im(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=sh(ep,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function Fm(t){return this.isValid()?(t=t?Ur(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function km(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Nm(){if(!Jn(this._isDSTShifted))return this._isDSTShifted;var t={},n;return zc(t,this),t=B0(t),t._a?(n=t._isUTC?ia(t._a):Ur(t._a),this._isDSTShifted=this.isValid()&&Dm(t._a,n.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Pm(){return this.isValid()?!this._isUTC:!1}function Bm(){return this.isValid()?this._isUTC:!1}function H0(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Gm=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Um=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ui(t,n){var i=t,o=null,s,f,u;return ml(t)?i={ms:t._milliseconds,d:t._days,M:t._months}:Ta(t)||!isNaN(+t)?(i={},n?i[n]=+t:i.milliseconds=+t):(o=Gm.exec(t))?(s=o[1]==="-"?-1:1,i={y:0,d:fr(o[fa])*s,h:fr(o[xn])*s,m:fr(o[Gi])*s,s:fr(o[Da])*s,ms:fr(fh(o[$o]*1e3))*s}):(o=Um.exec(t))?(s=o[1]==="-"?-1:1,i={y:Zo(o[2],s),M:Zo(o[3],s),w:Zo(o[4],s),d:Zo(o[5],s),h:Zo(o[6],s),m:Zo(o[7],s),s:Zo(o[8],s)}):i==null?i={}:typeof i=="object"&&("from"in i||"to"in i)&&(u=Ym(Ur(i.from),Ur(i.to)),i={},i.ms=u.milliseconds,i.M=u.months),f=new pl(i),ml(t)&&wr(t,"_locale")&&(f._locale=t._locale),ml(t)&&wr(t,"_isValid")&&(f._isValid=t._isValid),f}Ui.fn=pl.prototype,Ui.invalid=Em;function Zo(t,n){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*n}function z0(t,n){var i={};return i.months=n.month()-t.month()+(n.year()-t.year())*12,t.clone().add(i.months,"M").isAfter(n)&&--i.months,i.milliseconds=+n-+t.clone().add(i.months,"M"),i}function Ym(t,n){var i;return t.isValid()&&n.isValid()?(n=uh(n,t),t.isBefore(n)?i=z0(t,n):(i=z0(n,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function W0(t,n){return function(i,o){var s,f;return o!==null&&!isNaN(+o)&&(p0(n,"moment()."+n+"(period, number) is deprecated. Please use moment()."+n+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),f=i,i=o,o=f),s=Ui(i,o),V0(this,s,t),this}}function V0(t,n,i,o){var s=n._milliseconds,f=fh(n._days),u=fh(n._months);!t.isValid()||(o=o==null?!0:o,u&&E0(t,al(t,"Month")+u*i),f&&y0(t,"Date",al(t,"Date")+f*i),s&&t._d.setTime(t._d.valueOf()+s*i),o&&_t.updateOffset(t,f||u))}var Hm=W0(1,"add"),zm=W0(-1,"subtract");function $0(t){return typeof t=="string"||t instanceof String}function Wm(t){return Bi(t)||Ns(t)||$0(t)||Ta(t)||$m(t)||Vm(t)||t===null||t===void 0}function Vm(t){var n=Vo(t)&&!Gc(t),i=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,f,u=o.length;for(s=0;s<u;s+=1)f=o[s],i=i||wr(t,f);return n&&i}function $m(t){var n=Pi(t),i=!1;return n&&(i=t.filter(function(o){return!Ta(o)&&$0(t)}).length===0),n&&i}function Zm(t){var n=Vo(t)&&!Gc(t),i=!1,o=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],s,f;for(s=0;s<o.length;s+=1)f=o[s],i=i||wr(t,f);return n&&i}function Xm(t,n){var i=t.diff(n,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function qm(t,n){arguments.length===1&&(arguments[0]?Wm(arguments[0])?(t=arguments[0],n=void 0):Zm(arguments[0])&&(n=arguments[0],t=void 0):(t=void 0,n=void 0));var i=t||Ur(),o=uh(i,this).startOf("day"),s=_t.calendarFormat(this,o)||"sameElse",f=n&&(aa(n[s])?n[s].call(this,i):n[s]);return this.format(f||this.localeData().calendar(s,this,Ur(i)))}function Km(){return new Ps(this)}function jm(t,n){var i=Bi(t)?t:Ur(t);return this.isValid()&&i.isValid()?(n=Li(n)||"millisecond",n==="millisecond"?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(n).valueOf()):!1}function Qm(t,n){var i=Bi(t)?t:Ur(t);return this.isValid()&&i.isValid()?(n=Li(n)||"millisecond",n==="millisecond"?this.valueOf()<i.valueOf():this.clone().endOf(n).valueOf()<i.valueOf()):!1}function Jm(t,n,i,o){var s=Bi(t)?t:Ur(t),f=Bi(n)?n:Ur(n);return this.isValid()&&s.isValid()&&f.isValid()?(o=o||"()",(o[0]==="("?this.isAfter(s,i):!this.isBefore(s,i))&&(o[1]===")"?this.isBefore(f,i):!this.isAfter(f,i))):!1}function e1(t,n){var i=Bi(t)?t:Ur(t),o;return this.isValid()&&i.isValid()?(n=Li(n)||"millisecond",n==="millisecond"?this.valueOf()===i.valueOf():(o=i.valueOf(),this.clone().startOf(n).valueOf()<=o&&o<=this.clone().endOf(n).valueOf())):!1}function t1(t,n){return this.isSame(t,n)||this.isAfter(t,n)}function r1(t,n){return this.isSame(t,n)||this.isBefore(t,n)}function n1(t,n,i){var o,s,f;if(!this.isValid())return NaN;if(o=uh(t,this),!o.isValid())return NaN;switch(s=(o.utcOffset()-this.utcOffset())*6e4,n=Li(n),n){case"year":f=gl(this,o)/12;break;case"month":f=gl(this,o);break;case"quarter":f=gl(this,o)/3;break;case"second":f=(this-o)/1e3;break;case"minute":f=(this-o)/6e4;break;case"hour":f=(this-o)/36e5;break;case"day":f=(this-o-s)/864e5;break;case"week":f=(this-o-s)/6048e5;break;default:f=this-o}return i?f:Ri(f)}function gl(t,n){if(t.date()<n.date())return-gl(n,t);var i=(n.year()-t.year())*12+(n.month()-t.month()),o=t.clone().add(i,"months"),s,f;return n-o<0?(s=t.clone().add(i-1,"months"),f=(n-o)/(o-s)):(s=t.clone().add(i+1,"months"),f=(n-o)/(s-o)),-(i+f)||0}_t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",_t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function i1(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function a1(t){if(!this.isValid())return null;var n=t!==!0,i=n?this.clone().utc():this;return i.year()<0||i.year()>9999?nl(i,n?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):aa(Date.prototype.toISOString)?n?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",nl(i,"Z")):nl(i,n?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function o1(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",n="",i,o,s,f;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",n="Z"),i="["+t+'("]',o=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",f=n+'[")]',this.format(i+o+s+f)}function f1(t){t||(t=this.isUtc()?_t.defaultFormatUtc:_t.defaultFormat);var n=nl(this,t);return this.localeData().postformat(n)}function s1(t,n){return this.isValid()&&(Bi(t)&&t.isValid()||Ur(t).isValid())?Ui({to:this,from:t}).locale(this.locale()).humanize(!n):this.localeData().invalidDate()}function u1(t){return this.from(Ur(),t)}function l1(t,n){return this.isValid()&&(Bi(t)&&t.isValid()||Ur(t).isValid())?Ui({from:this,to:t}).locale(this.locale()).humanize(!n):this.localeData().invalidDate()}function c1(t){return this.to(Ur(),t)}function Z0(t){var n;return t===void 0?this._locale._abbr:(n=Ra(t),n!=null&&(this._locale=n),this)}var X0=Di("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function q0(){return this._locale}var yl=1e3,Nf=60*yl,xl=60*Nf,K0=(365*400+97)*24*xl;function Pf(t,n){return(t%n+n)%n}function j0(t,n,i){return t<100&&t>=0?new Date(t+400,n,i)-K0:new Date(t,n,i).valueOf()}function Q0(t,n,i){return t<100&&t>=0?Date.UTC(t+400,n,i)-K0:Date.UTC(t,n,i)}function h1(t){var n,i;if(t=Li(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(i=this._isUTC?Q0:j0,t){case"year":n=i(this.year(),0,1);break;case"quarter":n=i(this.year(),this.month()-this.month()%3,1);break;case"month":n=i(this.year(),this.month(),1);break;case"week":n=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":n=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":n=i(this.year(),this.month(),this.date());break;case"hour":n=this._d.valueOf(),n-=Pf(n+(this._isUTC?0:this.utcOffset()*Nf),xl);break;case"minute":n=this._d.valueOf(),n-=Pf(n,Nf);break;case"second":n=this._d.valueOf(),n-=Pf(n,yl);break}return this._d.setTime(n),_t.updateOffset(this,!0),this}function d1(t){var n,i;if(t=Li(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(i=this._isUTC?Q0:j0,t){case"year":n=i(this.year()+1,0,1)-1;break;case"quarter":n=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":n=i(this.year(),this.month()+1,1)-1;break;case"week":n=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":n=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":n=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":n=this._d.valueOf(),n+=xl-Pf(n+(this._isUTC?0:this.utcOffset()*Nf),xl)-1;break;case"minute":n=this._d.valueOf(),n+=Nf-Pf(n,Nf)-1;break;case"second":n=this._d.valueOf(),n+=yl-Pf(n,yl)-1;break}return this._d.setTime(n),_t.updateOffset(this,!0),this}function v1(){return this._d.valueOf()-(this._offset||0)*6e4}function _1(){return Math.floor(this.valueOf()/1e3)}function p1(){return new Date(this.valueOf())}function m1(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function g1(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function y1(){return this.isValid()?this.toISOString():null}function x1(){return Yc(this)}function b1(){return vo({},tr(this))}function w1(){return tr(this).overflow}function S1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ft("N",0,0,"eraAbbr"),Ft("NN",0,0,"eraAbbr"),Ft("NNN",0,0,"eraAbbr"),Ft("NNNN",0,0,"eraName"),Ft("NNNNN",0,0,"eraNarrow"),Ft("y",["y",1],"yo","eraYear"),Ft("y",["yy",2],0,"eraYear"),Ft("y",["yyy",3],0,"eraYear"),Ft("y",["yyyy",4],0,"eraYear"),bt("N",ch),bt("NN",ch),bt("NNN",ch),bt("NNNN",F1),bt("NNNNN",k1),Ir(["N","NN","NNN","NNNN","NNNNN"],function(t,n,i,o){var s=i._locale.erasParse(t,o,i._strict);s?tr(i).era=s:tr(i).invalidEra=t}),bt("y",Ff),bt("yy",Ff),bt("yyy",Ff),bt("yyyy",Ff),bt("yo",N1),Ir(["y","yy","yyy","yyyy"],zn),Ir(["yo"],function(t,n,i,o){var s;i._locale._eraYearOrdinalRegex&&(s=t.match(i._locale._eraYearOrdinalRegex)),i._locale.eraYearOrdinalParse?n[zn]=i._locale.eraYearOrdinalParse(t,s):n[zn]=parseInt(t,10)});function A1(t,n){var i,o,s,f=this._eras||Ra("en")._eras;for(i=0,o=f.length;i<o;++i){switch(typeof f[i].since){case"string":s=_t(f[i].since).startOf("day"),f[i].since=s.valueOf();break}switch(typeof f[i].until){case"undefined":f[i].until=1/0;break;case"string":s=_t(f[i].until).startOf("day").valueOf(),f[i].until=s.valueOf();break}}return f}function T1(t,n,i){var o,s,f=this.eras(),u,d,v;for(t=t.toUpperCase(),o=0,s=f.length;o<s;++o)if(u=f[o].name.toUpperCase(),d=f[o].abbr.toUpperCase(),v=f[o].narrow.toUpperCase(),i)switch(n){case"N":case"NN":case"NNN":if(d===t)return f[o];break;case"NNNN":if(u===t)return f[o];break;case"NNNNN":if(v===t)return f[o];break}else if([u,d,v].indexOf(t)>=0)return f[o]}function E1(t,n){var i=t.since<=t.until?1:-1;return n===void 0?_t(t.since).year():_t(t.since).year()+(n-t.offset)*i}function D1(){var t,n,i,o=this.localeData().eras();for(t=0,n=o.length;t<n;++t)if(i=this.clone().startOf("day").valueOf(),o[t].since<=i&&i<=o[t].until||o[t].until<=i&&i<=o[t].since)return o[t].name;return""}function L1(){var t,n,i,o=this.localeData().eras();for(t=0,n=o.length;t<n;++t)if(i=this.clone().startOf("day").valueOf(),o[t].since<=i&&i<=o[t].until||o[t].until<=i&&i<=o[t].since)return o[t].narrow;return""}function R1(){var t,n,i,o=this.localeData().eras();for(t=0,n=o.length;t<n;++t)if(i=this.clone().startOf("day").valueOf(),o[t].since<=i&&i<=o[t].until||o[t].until<=i&&i<=o[t].since)return o[t].abbr;return""}function C1(){var t,n,i,o,s=this.localeData().eras();for(t=0,n=s.length;t<n;++t)if(i=s[t].since<=s[t].until?1:-1,o=this.clone().startOf("day").valueOf(),s[t].since<=o&&o<=s[t].until||s[t].until<=o&&o<=s[t].since)return(this.year()-_t(s[t].since).year())*i+s[t].offset;return this.year()}function O1(t){return wr(this,"_erasNameRegex")||hh.call(this),t?this._erasNameRegex:this._erasRegex}function M1(t){return wr(this,"_erasAbbrRegex")||hh.call(this),t?this._erasAbbrRegex:this._erasRegex}function I1(t){return wr(this,"_erasNarrowRegex")||hh.call(this),t?this._erasNarrowRegex:this._erasRegex}function ch(t,n){return n.erasAbbrRegex(t)}function F1(t,n){return n.erasNameRegex(t)}function k1(t,n){return n.erasNarrowRegex(t)}function N1(t,n){return n._eraYearOrdinalRegex||Ff}function hh(){var t=[],n=[],i=[],o=[],s,f,u=this.eras();for(s=0,f=u.length;s<f;++s)n.push(hi(u[s].name)),t.push(hi(u[s].abbr)),i.push(hi(u[s].narrow)),o.push(hi(u[s].name)),o.push(hi(u[s].abbr)),o.push(hi(u[s].narrow));this._erasRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+n.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+i.join("|")+")","i")}Ft(0,["gg",2],0,function(){return this.weekYear()%100}),Ft(0,["GG",2],0,function(){return this.isoWeekYear()%100});function bl(t,n){Ft(0,[t,t.length],0,n)}bl("gggg","weekYear"),bl("ggggg","weekYear"),bl("GGGG","isoWeekYear"),bl("GGGGG","isoWeekYear"),Yn("weekYear","gg"),Yn("isoWeekYear","GG"),Hn("weekYear",1),Hn("isoWeekYear",1),bt("G",ul),bt("g",ul),bt("GG",Gr,ci),bt("gg",Gr,ci),bt("GGGG",jc,Kc),bt("gggg",jc,Kc),bt("GGGGG",sl,ol),bt("ggggg",sl,ol),Us(["gggg","ggggg","GGGG","GGGGG"],function(t,n,i,o){n[o.substr(0,2)]=fr(t)}),Us(["gg","GG"],function(t,n,i,o){n[o]=_t.parseTwoDigitYear(t)});function P1(t){return J0.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function B1(t){return J0.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function G1(){return La(this.year(),1,4)}function U1(){return La(this.isoWeekYear(),1,4)}function Y1(){var t=this.localeData()._week;return La(this.year(),t.dow,t.doy)}function H1(){var t=this.localeData()._week;return La(this.weekYear(),t.dow,t.doy)}function J0(t,n,i,o,s){var f;return t==null?zs(this,o,s).year:(f=La(t,o,s),n>f&&(n=f),z1.call(this,t,n,i,o,s))}function z1(t,n,i,o,s){var f=C0(t,n,i,o,s),u=Hs(f.year,0,f.dayOfYear);return this.year(u.getUTCFullYear()),this.month(u.getUTCMonth()),this.date(u.getUTCDate()),this}Ft("Q",0,"Qo","quarter"),Yn("quarter","Q"),Hn("quarter",7),bt("Q",x0),Ir("Q",function(t,n){n[Ea]=(fr(t)-1)*3});function W1(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Ft("D",["DD",2],"Do","date"),Yn("date","D"),Hn("date",9),bt("D",Gr),bt("DD",Gr,ci),bt("Do",function(t,n){return t?n._dayOfMonthOrdinalParse||n._ordinalParse:n._dayOfMonthOrdinalParseLenient}),Ir(["D","DD"],fa),Ir("Do",function(t,n){n[fa]=fr(t.match(Gr)[0])});var ev=If("Date",!0);Ft("DDD",["DDDD",3],"DDDo","dayOfYear"),Yn("dayOfYear","DDD"),Hn("dayOfYear",4),bt("DDD",fl),bt("DDDD",b0),Ir(["DDD","DDDD"],function(t,n,i){i._dayOfYear=fr(t)});function V1(t){var n=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?n:this.add(t-n,"d")}Ft("m",["mm",2],0,"minute"),Yn("minute","m"),Hn("minute",14),bt("m",Gr),bt("mm",Gr,ci),Ir(["m","mm"],Gi);var $1=If("Minutes",!1);Ft("s",["ss",2],0,"second"),Yn("second","s"),Hn("second",15),bt("s",Gr),bt("ss",Gr,ci),Ir(["s","ss"],Da);var Z1=If("Seconds",!1);Ft("S",0,0,function(){return~~(this.millisecond()/100)}),Ft(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Ft(0,["SSS",3],0,"millisecond"),Ft(0,["SSSS",4],0,function(){return this.millisecond()*10}),Ft(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Ft(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Ft(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Ft(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Ft(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Yn("millisecond","ms"),Hn("millisecond",16),bt("S",fl,x0),bt("SS",fl,ci),bt("SSS",fl,b0);var po,tv;for(po="SSSS";po.length<=9;po+="S")bt(po,Ff);function X1(t,n){n[$o]=fr(("0."+t)*1e3)}for(po="S";po.length<=9;po+="S")Ir(po,X1);tv=If("Milliseconds",!1),Ft("z",0,0,"zoneAbbr"),Ft("zz",0,0,"zoneName");function q1(){return this._isUTC?"UTC":""}function K1(){return this._isUTC?"Coordinated Universal Time":""}var et=Ps.prototype;et.add=Hm,et.calendar=qm,et.clone=Km,et.diff=n1,et.endOf=d1,et.format=f1,et.from=s1,et.fromNow=u1,et.to=l1,et.toNow=c1,et.get=Q_,et.invalidAt=w1,et.isAfter=jm,et.isBefore=Qm,et.isBetween=Jm,et.isSame=e1,et.isSameOrAfter=t1,et.isSameOrBefore=r1,et.isValid=x1,et.lang=X0,et.locale=Z0,et.localeData=q0,et.max=xm,et.min=ym,et.parsingFlags=b1,et.set=J_,et.startOf=h1,et.subtract=zm,et.toArray=m1,et.toObject=g1,et.toDate=p1,et.toISOString=a1,et.inspect=o1,typeof Symbol<"u"&&Symbol.for!=null&&(et[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),et.toJSON=y1,et.toString=i1,et.unix=_1,et.valueOf=v1,et.creationData=S1,et.eraName=D1,et.eraNarrow=L1,et.eraAbbr=R1,et.eraYear=C1,et.year=R0,et.isLeapYear=gp,et.weekYear=P1,et.isoWeekYear=B1,et.quarter=et.quarters=W1,et.month=D0,et.daysInMonth=_p,et.week=et.weeks=Ap,et.isoWeek=et.isoWeeks=Tp,et.weeksInYear=Y1,et.weeksInWeekYear=H1,et.isoWeeksInYear=G1,et.isoWeeksInISOWeekYear=U1,et.date=ev,et.day=et.days=Bp,et.weekday=Gp,et.isoWeekday=Up,et.dayOfYear=V1,et.hour=et.hours=Zp,et.minute=et.minutes=$1,et.second=et.seconds=Z1,et.millisecond=et.milliseconds=tv,et.utcOffset=Rm,et.utc=Om,et.local=Mm,et.parseZone=Im,et.hasAlignedHourOffset=Fm,et.isDST=km,et.isLocal=Pm,et.isUtcOffset=Bm,et.isUtc=H0,et.isUTC=H0,et.zoneAbbr=q1,et.zoneName=K1,et.dates=Di("dates accessor is deprecated. Use date instead.",ev),et.months=Di("months accessor is deprecated. Use month instead",D0),et.years=Di("years accessor is deprecated. Use year instead",R0),et.zone=Di("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Cm),et.isDSTShifted=Di("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Nm);function j1(t){return Ur(t*1e3)}function Q1(){return Ur.apply(null,arguments).parseZone()}function rv(t){return t}var Sr=Vc.prototype;Sr.calendar=B_,Sr.longDateFormat=H_,Sr.invalidDate=W_,Sr.ordinal=Z_,Sr.preparse=rv,Sr.postformat=rv,Sr.relativeTime=q_,Sr.pastFuture=K_,Sr.set=N_,Sr.eras=A1,Sr.erasParse=T1,Sr.erasConvertYear=E1,Sr.erasAbbrRegex=M1,Sr.erasNameRegex=O1,Sr.erasNarrowRegex=I1,Sr.months=cp,Sr.monthsShort=hp,Sr.monthsParse=vp,Sr.monthsRegex=mp,Sr.monthsShortRegex=pp,Sr.week=xp,Sr.firstDayOfYear=Sp,Sr.firstDayOfWeek=wp,Sr.weekdays=Ip,Sr.weekdaysMin=kp,Sr.weekdaysShort=Fp,Sr.weekdaysParse=Pp,Sr.weekdaysRegex=Yp,Sr.weekdaysShortRegex=Hp,Sr.weekdaysMinRegex=zp,Sr.isPM=Vp,Sr.meridiem=Xp;function wl(t,n,i,o){var s=Ra(),f=ia().set(o,n);return s[i](f,t)}function nv(t,n,i){if(Ta(t)&&(n=t,t=void 0),t=t||"",n!=null)return wl(t,n,i,"month");var o,s=[];for(o=0;o<12;o++)s[o]=wl(t,o,i,"month");return s}function dh(t,n,i,o){typeof t=="boolean"?(Ta(n)&&(i=n,n=void 0),n=n||""):(n=t,i=n,t=!1,Ta(n)&&(i=n,n=void 0),n=n||"");var s=Ra(),f=t?s._week.dow:0,u,d=[];if(i!=null)return wl(n,(i+f)%7,o,"day");for(u=0;u<7;u++)d[u]=wl(n,(u+f)%7,o,"day");return d}function J1(t,n){return nv(t,n,"months")}function eg(t,n){return nv(t,n,"monthsShort")}function tg(t,n,i){return dh(t,n,i,"weekdays")}function rg(t,n,i){return dh(t,n,i,"weekdaysShort")}function ng(t,n,i){return dh(t,n,i,"weekdaysMin")}_o("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var n=t%10,i=fr(t%100/10)===1?"th":n===1?"st":n===2?"nd":n===3?"rd":"th";return t+i}}),_t.lang=Di("moment.lang is deprecated. Use moment.locale instead.",_o),_t.langData=Di("moment.langData is deprecated. Use moment.localeData instead.",Ra);var Ca=Math.abs;function ig(){var t=this._data;return this._milliseconds=Ca(this._milliseconds),this._days=Ca(this._days),this._months=Ca(this._months),t.milliseconds=Ca(t.milliseconds),t.seconds=Ca(t.seconds),t.minutes=Ca(t.minutes),t.hours=Ca(t.hours),t.months=Ca(t.months),t.years=Ca(t.years),this}function iv(t,n,i,o){var s=Ui(n,i);return t._milliseconds+=o*s._milliseconds,t._days+=o*s._days,t._months+=o*s._months,t._bubble()}function ag(t,n){return iv(this,t,n,1)}function og(t,n){return iv(this,t,n,-1)}function av(t){return t<0?Math.floor(t):Math.ceil(t)}function fg(){var t=this._milliseconds,n=this._days,i=this._months,o=this._data,s,f,u,d,v;return t>=0&&n>=0&&i>=0||t<=0&&n<=0&&i<=0||(t+=av(vh(i)+n)*864e5,n=0,i=0),o.milliseconds=t%1e3,s=Ri(t/1e3),o.seconds=s%60,f=Ri(s/60),o.minutes=f%60,u=Ri(f/60),o.hours=u%24,n+=Ri(u/24),v=Ri(ov(n)),i+=v,n-=av(vh(v)),d=Ri(i/12),i%=12,o.days=n,o.months=i,o.years=d,this}function ov(t){return t*4800/146097}function vh(t){return t*146097/4800}function sg(t){if(!this.isValid())return NaN;var n,i,o=this._milliseconds;if(t=Li(t),t==="month"||t==="quarter"||t==="year")switch(n=this._days+o/864e5,i=this._months+ov(n),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(n=this._days+Math.round(vh(this._months)),t){case"week":return n/7+o/6048e5;case"day":return n+o/864e5;case"hour":return n*24+o/36e5;case"minute":return n*1440+o/6e4;case"second":return n*86400+o/1e3;case"millisecond":return Math.floor(n*864e5)+o;default:throw new Error("Unknown unit "+t)}}function ug(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+fr(this._months/12)*31536e6:NaN}function Oa(t){return function(){return this.as(t)}}var lg=Oa("ms"),cg=Oa("s"),hg=Oa("m"),dg=Oa("h"),vg=Oa("d"),_g=Oa("w"),pg=Oa("M"),mg=Oa("Q"),gg=Oa("y");function yg(){return Ui(this)}function xg(t){return t=Li(t),this.isValid()?this[t+"s"]():NaN}function Xo(t){return function(){return this.isValid()?this._data[t]:NaN}}var bg=Xo("milliseconds"),wg=Xo("seconds"),Sg=Xo("minutes"),Ag=Xo("hours"),Tg=Xo("days"),Eg=Xo("months"),Dg=Xo("years");function Lg(){return Ri(this.days()/7)}var Ma=Math.round,Bf={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Rg(t,n,i,o,s){return s.relativeTime(n||1,!!i,t,o)}function Cg(t,n,i,o){var s=Ui(t).abs(),f=Ma(s.as("s")),u=Ma(s.as("m")),d=Ma(s.as("h")),v=Ma(s.as("d")),M=Ma(s.as("M")),B=Ma(s.as("w")),p=Ma(s.as("y")),U=f<=i.ss&&["s",f]||f<i.s&&["ss",f]||u<=1&&["m"]||u<i.m&&["mm",u]||d<=1&&["h"]||d<i.h&&["hh",d]||v<=1&&["d"]||v<i.d&&["dd",v];return i.w!=null&&(U=U||B<=1&&["w"]||B<i.w&&["ww",B]),U=U||M<=1&&["M"]||M<i.M&&["MM",M]||p<=1&&["y"]||["yy",p],U[2]=n,U[3]=+t>0,U[4]=o,Rg.apply(null,U)}function Og(t){return t===void 0?Ma:typeof t=="function"?(Ma=t,!0):!1}function Mg(t,n){return Bf[t]===void 0?!1:n===void 0?Bf[t]:(Bf[t]=n,t==="s"&&(Bf.ss=n-1),!0)}function Ig(t,n){if(!this.isValid())return this.localeData().invalidDate();var i=!1,o=Bf,s,f;return typeof t=="object"&&(n=t,t=!1),typeof t=="boolean"&&(i=t),typeof n=="object"&&(o=Object.assign({},Bf,n),n.s!=null&&n.ss==null&&(o.ss=n.s-1)),s=this.localeData(),f=Cg(this,!i,o,s),i&&(f=s.pastFuture(+this,f)),s.postformat(f)}var _h=Math.abs;function Gf(t){return(t>0)-(t<0)||+t}function Sl(){if(!this.isValid())return this.localeData().invalidDate();var t=_h(this._milliseconds)/1e3,n=_h(this._days),i=_h(this._months),o,s,f,u,d=this.asSeconds(),v,M,B,p;return d?(o=Ri(t/60),s=Ri(o/60),t%=60,o%=60,f=Ri(i/12),i%=12,u=t?t.toFixed(3).replace(/\.?0+$/,""):"",v=d<0?"-":"",M=Gf(this._months)!==Gf(d)?"-":"",B=Gf(this._days)!==Gf(d)?"-":"",p=Gf(this._milliseconds)!==Gf(d)?"-":"",v+"P"+(f?M+f+"Y":"")+(i?M+i+"M":"")+(n?B+n+"D":"")+(s||o||t?"T":"")+(s?p+s+"H":"")+(o?p+o+"M":"")+(t?p+u+"S":"")):"P0D"}var yr=pl.prototype;yr.isValid=Tm,yr.abs=ig,yr.add=ag,yr.subtract=og,yr.as=sg,yr.asMilliseconds=lg,yr.asSeconds=cg,yr.asMinutes=hg,yr.asHours=dg,yr.asDays=vg,yr.asWeeks=_g,yr.asMonths=pg,yr.asQuarters=mg,yr.asYears=gg,yr.valueOf=ug,yr._bubble=fg,yr.clone=yg,yr.get=xg,yr.milliseconds=bg,yr.seconds=wg,yr.minutes=Sg,yr.hours=Ag,yr.days=Tg,yr.weeks=Lg,yr.months=Eg,yr.years=Dg,yr.humanize=Ig,yr.toISOString=Sl,yr.toString=Sl,yr.toJSON=Sl,yr.locale=Z0,yr.localeData=q0,yr.toIsoString=Di("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Sl),yr.lang=X0,Ft("X",0,0,"unix"),Ft("x",0,0,"valueOf"),bt("x",ul),bt("X",tp),Ir("X",function(t,n,i){i._d=new Date(parseFloat(t)*1e3)}),Ir("x",function(t,n,i){i._d=new Date(fr(t))});//! moment.js
|
|
10
|
+
_t.version="2.29.4",F_(Ur),_t.fn=et,_t.min=bm,_t.max=wm,_t.now=Sm,_t.utc=ia,_t.unix=j1,_t.months=J1,_t.isDate=Ns,_t.locale=_o,_t.invalid=tl,_t.duration=Ui,_t.isMoment=Bi,_t.weekdays=tg,_t.parseZone=Q1,_t.localeData=Ra,_t.isDuration=ml,_t.monthsShort=eg,_t.weekdaysMin=ng,_t.defineLocale=rh,_t.updateLocale=Qp,_t.locales=Jp,_t.weekdaysShort=rg,_t.normalizeUnits=Li,_t.relativeTimeRounding=Og,_t.relativeTimeThreshold=Mg,_t.calendarFormat=Xm,_t.prototype=et,_t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};var Uf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},fv={exports:{}};(function(t,n){(function(i){t.exports=i()})(function(i){var o=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function s(x,A){var g=x[0],b=x[1],N=x[2],F=x[3];g+=(b&N|~b&F)+A[0]-680876936|0,g=(g<<7|g>>>25)+b|0,F+=(g&b|~g&N)+A[1]-389564586|0,F=(F<<12|F>>>20)+g|0,N+=(F&g|~F&b)+A[2]+606105819|0,N=(N<<17|N>>>15)+F|0,b+=(N&F|~N&g)+A[3]-1044525330|0,b=(b<<22|b>>>10)+N|0,g+=(b&N|~b&F)+A[4]-176418897|0,g=(g<<7|g>>>25)+b|0,F+=(g&b|~g&N)+A[5]+1200080426|0,F=(F<<12|F>>>20)+g|0,N+=(F&g|~F&b)+A[6]-1473231341|0,N=(N<<17|N>>>15)+F|0,b+=(N&F|~N&g)+A[7]-45705983|0,b=(b<<22|b>>>10)+N|0,g+=(b&N|~b&F)+A[8]+1770035416|0,g=(g<<7|g>>>25)+b|0,F+=(g&b|~g&N)+A[9]-1958414417|0,F=(F<<12|F>>>20)+g|0,N+=(F&g|~F&b)+A[10]-42063|0,N=(N<<17|N>>>15)+F|0,b+=(N&F|~N&g)+A[11]-1990404162|0,b=(b<<22|b>>>10)+N|0,g+=(b&N|~b&F)+A[12]+1804603682|0,g=(g<<7|g>>>25)+b|0,F+=(g&b|~g&N)+A[13]-40341101|0,F=(F<<12|F>>>20)+g|0,N+=(F&g|~F&b)+A[14]-1502002290|0,N=(N<<17|N>>>15)+F|0,b+=(N&F|~N&g)+A[15]+1236535329|0,b=(b<<22|b>>>10)+N|0,g+=(b&F|N&~F)+A[1]-165796510|0,g=(g<<5|g>>>27)+b|0,F+=(g&N|b&~N)+A[6]-1069501632|0,F=(F<<9|F>>>23)+g|0,N+=(F&b|g&~b)+A[11]+643717713|0,N=(N<<14|N>>>18)+F|0,b+=(N&g|F&~g)+A[0]-373897302|0,b=(b<<20|b>>>12)+N|0,g+=(b&F|N&~F)+A[5]-701558691|0,g=(g<<5|g>>>27)+b|0,F+=(g&N|b&~N)+A[10]+38016083|0,F=(F<<9|F>>>23)+g|0,N+=(F&b|g&~b)+A[15]-660478335|0,N=(N<<14|N>>>18)+F|0,b+=(N&g|F&~g)+A[4]-405537848|0,b=(b<<20|b>>>12)+N|0,g+=(b&F|N&~F)+A[9]+568446438|0,g=(g<<5|g>>>27)+b|0,F+=(g&N|b&~N)+A[14]-1019803690|0,F=(F<<9|F>>>23)+g|0,N+=(F&b|g&~b)+A[3]-187363961|0,N=(N<<14|N>>>18)+F|0,b+=(N&g|F&~g)+A[8]+1163531501|0,b=(b<<20|b>>>12)+N|0,g+=(b&F|N&~F)+A[13]-1444681467|0,g=(g<<5|g>>>27)+b|0,F+=(g&N|b&~N)+A[2]-51403784|0,F=(F<<9|F>>>23)+g|0,N+=(F&b|g&~b)+A[7]+1735328473|0,N=(N<<14|N>>>18)+F|0,b+=(N&g|F&~g)+A[12]-1926607734|0,b=(b<<20|b>>>12)+N|0,g+=(b^N^F)+A[5]-378558|0,g=(g<<4|g>>>28)+b|0,F+=(g^b^N)+A[8]-2022574463|0,F=(F<<11|F>>>21)+g|0,N+=(F^g^b)+A[11]+1839030562|0,N=(N<<16|N>>>16)+F|0,b+=(N^F^g)+A[14]-35309556|0,b=(b<<23|b>>>9)+N|0,g+=(b^N^F)+A[1]-1530992060|0,g=(g<<4|g>>>28)+b|0,F+=(g^b^N)+A[4]+1272893353|0,F=(F<<11|F>>>21)+g|0,N+=(F^g^b)+A[7]-155497632|0,N=(N<<16|N>>>16)+F|0,b+=(N^F^g)+A[10]-1094730640|0,b=(b<<23|b>>>9)+N|0,g+=(b^N^F)+A[13]+681279174|0,g=(g<<4|g>>>28)+b|0,F+=(g^b^N)+A[0]-358537222|0,F=(F<<11|F>>>21)+g|0,N+=(F^g^b)+A[3]-722521979|0,N=(N<<16|N>>>16)+F|0,b+=(N^F^g)+A[6]+76029189|0,b=(b<<23|b>>>9)+N|0,g+=(b^N^F)+A[9]-640364487|0,g=(g<<4|g>>>28)+b|0,F+=(g^b^N)+A[12]-421815835|0,F=(F<<11|F>>>21)+g|0,N+=(F^g^b)+A[15]+530742520|0,N=(N<<16|N>>>16)+F|0,b+=(N^F^g)+A[2]-995338651|0,b=(b<<23|b>>>9)+N|0,g+=(N^(b|~F))+A[0]-198630844|0,g=(g<<6|g>>>26)+b|0,F+=(b^(g|~N))+A[7]+1126891415|0,F=(F<<10|F>>>22)+g|0,N+=(g^(F|~b))+A[14]-1416354905|0,N=(N<<15|N>>>17)+F|0,b+=(F^(N|~g))+A[5]-57434055|0,b=(b<<21|b>>>11)+N|0,g+=(N^(b|~F))+A[12]+1700485571|0,g=(g<<6|g>>>26)+b|0,F+=(b^(g|~N))+A[3]-1894986606|0,F=(F<<10|F>>>22)+g|0,N+=(g^(F|~b))+A[10]-1051523|0,N=(N<<15|N>>>17)+F|0,b+=(F^(N|~g))+A[1]-2054922799|0,b=(b<<21|b>>>11)+N|0,g+=(N^(b|~F))+A[8]+1873313359|0,g=(g<<6|g>>>26)+b|0,F+=(b^(g|~N))+A[15]-30611744|0,F=(F<<10|F>>>22)+g|0,N+=(g^(F|~b))+A[6]-1560198380|0,N=(N<<15|N>>>17)+F|0,b+=(F^(N|~g))+A[13]+1309151649|0,b=(b<<21|b>>>11)+N|0,g+=(N^(b|~F))+A[4]-145523070|0,g=(g<<6|g>>>26)+b|0,F+=(b^(g|~N))+A[11]-1120210379|0,F=(F<<10|F>>>22)+g|0,N+=(g^(F|~b))+A[2]+718787259|0,N=(N<<15|N>>>17)+F|0,b+=(F^(N|~g))+A[9]-343485551|0,b=(b<<21|b>>>11)+N|0,x[0]=g+x[0]|0,x[1]=b+x[1]|0,x[2]=N+x[2]|0,x[3]=F+x[3]|0}function f(x){var A=[],g;for(g=0;g<64;g+=4)A[g>>2]=x.charCodeAt(g)+(x.charCodeAt(g+1)<<8)+(x.charCodeAt(g+2)<<16)+(x.charCodeAt(g+3)<<24);return A}function u(x){var A=[],g;for(g=0;g<64;g+=4)A[g>>2]=x[g]+(x[g+1]<<8)+(x[g+2]<<16)+(x[g+3]<<24);return A}function d(x){var A=x.length,g=[1732584193,-271733879,-1732584194,271733878],b,N,F,J,Te,nt;for(b=64;b<=A;b+=64)s(g,f(x.substring(b-64,b)));for(x=x.substring(b-64),N=x.length,F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0;b<N;b+=1)F[b>>2]|=x.charCodeAt(b)<<(b%4<<3);if(F[b>>2]|=128<<(b%4<<3),b>55)for(s(g,F),b=0;b<16;b+=1)F[b]=0;return J=A*8,J=J.toString(16).match(/(.*?)(.{0,8})$/),Te=parseInt(J[2],16),nt=parseInt(J[1],16)||0,F[14]=Te,F[15]=nt,s(g,F),g}function v(x){var A=x.length,g=[1732584193,-271733879,-1732584194,271733878],b,N,F,J,Te,nt;for(b=64;b<=A;b+=64)s(g,u(x.subarray(b-64,b)));for(x=b-64<A?x.subarray(b-64):new Uint8Array(0),N=x.length,F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0;b<N;b+=1)F[b>>2]|=x[b]<<(b%4<<3);if(F[b>>2]|=128<<(b%4<<3),b>55)for(s(g,F),b=0;b<16;b+=1)F[b]=0;return J=A*8,J=J.toString(16).match(/(.*?)(.{0,8})$/),Te=parseInt(J[2],16),nt=parseInt(J[1],16)||0,F[14]=Te,F[15]=nt,s(g,F),g}function M(x){var A="",g;for(g=0;g<4;g+=1)A+=o[x>>g*8+4&15]+o[x>>g*8&15];return A}function B(x){var A;for(A=0;A<x.length;A+=1)x[A]=M(x[A]);return x.join("")}B(d("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function x(A,g){return A=A|0||0,A<0?Math.max(A+g,0):Math.min(A,g)}ArrayBuffer.prototype.slice=function(A,g){var b=this.byteLength,N=x(A,b),F=b,J,Te,nt,lt;return g!==i&&(F=x(g,b)),N>F?new ArrayBuffer(0):(J=F-N,Te=new ArrayBuffer(J),nt=new Uint8Array(Te),lt=new Uint8Array(this,N,J),nt.set(lt),Te)}}();function p(x){return/[\u0080-\uFFFF]/.test(x)&&(x=unescape(encodeURIComponent(x))),x}function U(x,A){var g=x.length,b=new ArrayBuffer(g),N=new Uint8Array(b),F;for(F=0;F<g;F+=1)N[F]=x.charCodeAt(F);return A?N:b}function q(x){return String.fromCharCode.apply(null,new Uint8Array(x))}function D(x,A,g){var b=new Uint8Array(x.byteLength+A.byteLength);return b.set(new Uint8Array(x)),b.set(new Uint8Array(A),x.byteLength),g?b:b.buffer}function pe(x){var A=[],g=x.length,b;for(b=0;b<g-1;b+=2)A.push(parseInt(x.substr(b,2),16));return String.fromCharCode.apply(String,A)}function le(){this.reset()}return le.prototype.append=function(x){return this.appendBinary(p(x)),this},le.prototype.appendBinary=function(x){this._buff+=x,this._length+=x.length;var A=this._buff.length,g;for(g=64;g<=A;g+=64)s(this._hash,f(this._buff.substring(g-64,g)));return this._buff=this._buff.substring(g-64),this},le.prototype.end=function(x){var A=this._buff,g=A.length,b,N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],F;for(b=0;b<g;b+=1)N[b>>2]|=A.charCodeAt(b)<<(b%4<<3);return this._finish(N,g),F=B(this._hash),x&&(F=pe(F)),this.reset(),F},le.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},le.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},le.prototype.setState=function(x){return this._buff=x.buff,this._length=x.length,this._hash=x.hash,this},le.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},le.prototype._finish=function(x,A){var g=A,b,N,F;if(x[g>>2]|=128<<(g%4<<3),g>55)for(s(this._hash,x),g=0;g<16;g+=1)x[g]=0;b=this._length*8,b=b.toString(16).match(/(.*?)(.{0,8})$/),N=parseInt(b[2],16),F=parseInt(b[1],16)||0,x[14]=N,x[15]=F,s(this._hash,x)},le.hash=function(x,A){return le.hashBinary(p(x),A)},le.hashBinary=function(x,A){var g=d(x),b=B(g);return A?pe(b):b},le.ArrayBuffer=function(){this.reset()},le.ArrayBuffer.prototype.append=function(x){var A=D(this._buff.buffer,x,!0),g=A.length,b;for(this._length+=x.byteLength,b=64;b<=g;b+=64)s(this._hash,u(A.subarray(b-64,b)));return this._buff=b-64<g?new Uint8Array(A.buffer.slice(b-64)):new Uint8Array(0),this},le.ArrayBuffer.prototype.end=function(x){var A=this._buff,g=A.length,b=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],N,F;for(N=0;N<g;N+=1)b[N>>2]|=A[N]<<(N%4<<3);return this._finish(b,g),F=B(this._hash),x&&(F=pe(F)),this.reset(),F},le.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},le.ArrayBuffer.prototype.getState=function(){var x=le.prototype.getState.call(this);return x.buff=q(x.buff),x},le.ArrayBuffer.prototype.setState=function(x){return x.buff=U(x.buff,!0),le.prototype.setState.call(this,x)},le.ArrayBuffer.prototype.destroy=le.prototype.destroy,le.ArrayBuffer.prototype._finish=le.prototype._finish,le.ArrayBuffer.hash=function(x,A){var g=v(new Uint8Array(x)),b=B(g);return A?pe(b):b},le})})(fv);const Fg=fv.exports;var Yf={exports:{}};/**
|
|
11
|
+
* @license
|
|
12
|
+
* Lodash <https://lodash.com/>
|
|
13
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
14
|
+
* Released under MIT license <https://lodash.com/license>
|
|
15
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
16
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
17
|
+
*/(function(t,n){(function(){var i,o="4.17.21",s=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",d="Invalid `variable` option passed into `_.template`",v="__lodash_hash_undefined__",M=500,B="__lodash_placeholder__",p=1,U=2,q=4,D=1,pe=2,le=1,x=2,A=4,g=8,b=16,N=32,F=64,J=128,Te=256,nt=512,lt=30,it="...",ft=800,tt=16,Re=1,Ot=2,xt=3,Me=1/0,Ze=9007199254740991,St=17976931348623157e292,$t=0/0,Wt=4294967295,Qt=Wt-1,or=Wt>>>1,xr=[["ary",J],["bind",le],["bindKey",x],["curry",g],["curryRight",b],["flip",nt],["partial",N],["partialRight",F],["rearg",Te]],sr="[object Arguments]",Kt="[object Array]",br="[object AsyncFunction]",Gt="[object Boolean]",It="[object Date]",hn="[object DOMException]",jr="[object Error]",kt="[object Function]",Pr="[object GeneratorFunction]",Fr="[object Map]",Zr="[object Number]",Qr="[object Null]",ir="[object Object]",Nt="[object Promise]",Tn="[object Proxy]",En="[object RegExp]",Jr="[object Set]",an="[object String]",E="[object Symbol]",di="[object Undefined]",dn="[object WeakMap]",zi="[object WeakSet]",Pn="[object ArrayBuffer]",Ar="[object DataView]",Dn="[object Float32Array]",Bn="[object Float64Array]",C="[object Int8Array]",Ue="[object Int16Array]",Xe="[object Int32Array]",dt="[object Uint8Array]",Z="[object Uint8ClampedArray]",we="[object Uint16Array]",m="[object Uint32Array]",He=/\b__p \+= '';/g,Pt=/\b(__p \+=) '' \+/g,l=/(__e\(.*?\)|\b__t\)) \+\n'';/g,de=/&(?:amp|lt|gt|quot|#39);/g,ye=/[&<>"']/g,w=RegExp(de.source),V=RegExp(ye.source),ce=/<%-([\s\S]+?)%>/g,Et=/<%([\s\S]+?)%>/g,at=/<%=([\s\S]+?)%>/g,mt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ur=/^\w*$/,vi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kr=/[\\^$.*+?()[\]{}|]/g,hr=RegExp(kr.source),Yr=/^\s+/,vn=/\s/,Ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ia=/\{\n\/\* \[wrapped with (.+)\] \*/,Fa=/,? & /,jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Wn=/[()=,{}\[\]\/\s]/,on=/\\(\\)?/g,_i=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Xn=/\w*$/,Wf=/^[-+]0x[0-9a-f]+$/i,kh=/^0b[01]+$/i,Nh=/^\[object .+?Constructor\]$/,Ph=/^0o[0-7]+$/i,Bh=/^(?:0|[1-9]\d*)$/,Gh=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vf=/($^)/,Uh=/['\n\r\u2028\u2029\\]/g,$f="\\ud800-\\udfff",Yh="\\u0300-\\u036f",Hh="\\ufe20-\\ufe2f",zh="\\u20d0-\\u20ff",El=Yh+Hh+zh,Dl="\\u2700-\\u27bf",Ll="a-z\\xdf-\\xf6\\xf8-\\xff",Wh="\\xac\\xb1\\xd7\\xf7",Vh="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$h="\\u2000-\\u206f",Zh=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rl="A-Z\\xc0-\\xd6\\xd8-\\xde",Cl="\\ufe0e\\ufe0f",Ol=Wh+Vh+$h+Zh,qs="['\u2019]",Zf="["+$f+"]",Ks="["+Ol+"]",Xf="["+El+"]",Ml="\\d+",Qo="["+Dl+"]",qf="["+Ll+"]",js="[^"+$f+Ol+Ml+Dl+Ll+Rl+"]",Jo="\\ud83c[\\udffb-\\udfff]",Xh="(?:"+Xf+"|"+Jo+")",Il="[^"+$f+"]",Qs="(?:\\ud83c[\\udde6-\\uddff]){2}",Js="[\\ud800-\\udbff][\\udc00-\\udfff]",Rn="["+Rl+"]",Vn="\\u200d",ef="(?:"+qf+"|"+js+")",qh="(?:"+Rn+"|"+js+")",Fl="(?:"+qs+"(?:d|ll|m|re|s|t|ve))?",eu="(?:"+qs+"(?:D|LL|M|RE|S|T|VE))?",tu=Xh+"?",kl="["+Cl+"]?",Kh="(?:"+Vn+"(?:"+[Il,Qs,Js].join("|")+")"+kl+tu+")*",ru="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Nl=kl+tu+Kh,Qh="(?:"+[Qo,Qs,Js].join("|")+")"+Nl,Jh="(?:"+[Il+Xf+"?",Xf,Qs,Js,Zf].join("|")+")",ed=RegExp(qs,"g"),td=RegExp(Xf,"g"),nu=RegExp(Jo+"(?="+Jo+")|"+Jh+Nl,"g"),rd=RegExp([Rn+"?"+qf+"+"+Fl+"(?="+[Ks,Rn,"$"].join("|")+")",qh+"+"+eu+"(?="+[Ks,Rn+ef,"$"].join("|")+")",Rn+"?"+ef+"+"+Fl,Rn+"+"+eu,jh,ru,Ml,Qh].join("|"),"g"),ka=RegExp("["+Vn+$f+El+Cl+"]"),nd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,id=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Kf=-1,Cr={};Cr[Dn]=Cr[Bn]=Cr[C]=Cr[Ue]=Cr[Xe]=Cr[dt]=Cr[Z]=Cr[we]=Cr[m]=!0,Cr[sr]=Cr[Kt]=Cr[Pn]=Cr[Gt]=Cr[Ar]=Cr[It]=Cr[jr]=Cr[kt]=Cr[Fr]=Cr[Zr]=Cr[ir]=Cr[En]=Cr[Jr]=Cr[an]=Cr[dn]=!1;var Or={};Or[sr]=Or[Kt]=Or[Pn]=Or[Ar]=Or[Gt]=Or[It]=Or[Dn]=Or[Bn]=Or[C]=Or[Ue]=Or[Xe]=Or[Fr]=Or[Zr]=Or[ir]=Or[En]=Or[Jr]=Or[an]=Or[E]=Or[dt]=Or[Z]=Or[we]=Or[m]=!0,Or[jr]=Or[kt]=Or[dn]=!1;var Pl={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},ad={"&":"&","<":"<",">":">",'"':""","'":"'"},iu={"&":"&","<":"<",">":">",""":'"',"'":"'"},au={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},sa=parseFloat,jf=parseInt,ou=typeof Uf=="object"&&Uf&&Uf.Object===Object&&Uf,Bl=typeof self=="object"&&self&&self.Object===Object&&self,bn=ou||Bl||Function("return this")(),fu=n&&!n.nodeType&&n,Na=fu&&!0&&t&&!t.nodeType&&t,Gl=Na&&Na.exports===fu,su=Gl&&ou.process,ti=function(){try{var te=Na&&Na.require&&Na.require("util").types;return te||su&&su.binding&&su.binding("util")}catch{}}(),Ul=ti&&ti.isArrayBuffer,Wi=ti&&ti.isDate,Yl=ti&&ti.isMap,Hl=ti&&ti.isRegExp,yo=ti&&ti.isSet,zl=ti&&ti.isTypedArray;function _n(te,Ee,ve){switch(ve.length){case 0:return te.call(Ee);case 1:return te.call(Ee,ve[0]);case 2:return te.call(Ee,ve[0],ve[1]);case 3:return te.call(Ee,ve[0],ve[1],ve[2])}return te.apply(Ee,ve)}function Wl(te,Ee,ve,gt){for(var Zt=-1,pr=te==null?0:te.length;++Zt<pr;){var fn=te[Zt];Ee(gt,fn,ve(fn),te)}return gt}function wn(te,Ee){for(var ve=-1,gt=te==null?0:te.length;++ve<gt&&Ee(te[ve],ve,te)!==!1;);return te}function Vl(te,Ee){for(var ve=te==null?0:te.length;ve--&&Ee(te[ve],ve,te)!==!1;);return te}function ua(te,Ee){for(var ve=-1,gt=te==null?0:te.length;++ve<gt;)if(!Ee(te[ve],ve,te))return!1;return!0}function Oi(te,Ee){for(var ve=-1,gt=te==null?0:te.length,Zt=0,pr=[];++ve<gt;){var fn=te[ve];Ee(fn,ve,te)&&(pr[Zt++]=fn)}return pr}function Qf(te,Ee){var ve=te==null?0:te.length;return!!ve&&$i(te,Ee,0)>-1}function uu(te,Ee,ve){for(var gt=-1,Zt=te==null?0:te.length;++gt<Zt;)if(ve(Ee,te[gt]))return!0;return!1}function Br(te,Ee){for(var ve=-1,gt=te==null?0:te.length,Zt=Array(gt);++ve<gt;)Zt[ve]=Ee(te[ve],ve,te);return Zt}function Vi(te,Ee){for(var ve=-1,gt=Ee.length,Zt=te.length;++ve<gt;)te[Zt+ve]=Ee[ve];return te}function lu(te,Ee,ve,gt){var Zt=-1,pr=te==null?0:te.length;for(gt&&pr&&(ve=te[++Zt]);++Zt<pr;)ve=Ee(ve,te[Zt],Zt,te);return ve}function od(te,Ee,ve,gt){var Zt=te==null?0:te.length;for(gt&&Zt&&(ve=te[--Zt]);Zt--;)ve=Ee(ve,te[Zt],Zt,te);return ve}function Jf(te,Ee){for(var ve=-1,gt=te==null?0:te.length;++ve<gt;)if(Ee(te[ve],ve,te))return!0;return!1}var Nr=Ba("length");function $l(te){return te.split("")}function fd(te){return te.match(jt)||[]}function pi(te,Ee,ve){var gt;return ve(te,function(Zt,pr,fn){if(Ee(Zt,pr,fn))return gt=pr,!1}),gt}function xo(te,Ee,ve,gt){for(var Zt=te.length,pr=ve+(gt?1:-1);gt?pr--:++pr<Zt;)if(Ee(te[pr],pr,te))return pr;return-1}function $i(te,Ee,ve){return Ee===Ee?So(te,Ee,ve):xo(te,es,ve)}function Pa(te,Ee,ve,gt){for(var Zt=ve-1,pr=te.length;++Zt<pr;)if(gt(te[Zt],Ee))return Zt;return-1}function es(te){return te!==te}function tf(te,Ee){var ve=te==null?0:te.length;return ve?ts(te,Ee)/ve:$t}function Ba(te){return function(Ee){return Ee==null?i:Ee[te]}}function bo(te){return function(Ee){return te==null?i:te[Ee]}}function cu(te,Ee,ve,gt,Zt){return Zt(te,function(pr,fn,Tr){ve=gt?(gt=!1,pr):Ee(ve,pr,fn,Tr)}),ve}function hu(te,Ee){var ve=te.length;for(te.sort(Ee);ve--;)te[ve]=te[ve].value;return te}function ts(te,Ee){for(var ve,gt=-1,Zt=te.length;++gt<Zt;){var pr=Ee(te[gt]);pr!==i&&(ve=ve===i?pr:ve+pr)}return ve}function du(te,Ee){for(var ve=-1,gt=Array(te);++ve<te;)gt[ve]=Ee(ve);return gt}function sd(te,Ee){return Br(Ee,function(ve){return[ve,te[ve]]})}function Zl(te){return te&&te.slice(0,jl(te)+1).replace(Yr,"")}function qn(te){return function(Ee){return te(Ee)}}function rf(te,Ee){return Br(Ee,function(ve){return te[ve]})}function la(te,Ee){return te.has(Ee)}function rs(te,Ee){for(var ve=-1,gt=te.length;++ve<gt&&$i(Ee,te[ve],0)>-1;);return ve}function ns(te,Ee){for(var ve=te.length;ve--&&$i(Ee,te[ve],0)>-1;);return ve}function wo(te,Ee){for(var ve=te.length,gt=0;ve--;)te[ve]===Ee&&++gt;return gt}var vu=bo(Pl),_u=bo(ad);function pu(te){return"\\"+au[te]}function mu(te,Ee){return te==null?i:te[Ee]}function Ga(te){return ka.test(te)}function Xl(te){return nd.test(te)}function ql(te){for(var Ee,ve=[];!(Ee=te.next()).done;)ve.push(Ee.value);return ve}function is(te){var Ee=-1,ve=Array(te.size);return te.forEach(function(gt,Zt){ve[++Ee]=[Zt,gt]}),ve}function gu(te,Ee){return function(ve){return te(Ee(ve))}}function Zi(te,Ee){for(var ve=-1,gt=te.length,Zt=0,pr=[];++ve<gt;){var fn=te[ve];(fn===Ee||fn===B)&&(te[ve]=B,pr[Zt++]=ve)}return pr}function nf(te){var Ee=-1,ve=Array(te.size);return te.forEach(function(gt){ve[++Ee]=gt}),ve}function Kl(te){var Ee=-1,ve=Array(te.size);return te.forEach(function(gt){ve[++Ee]=[gt,gt]}),ve}function So(te,Ee,ve){for(var gt=ve-1,Zt=te.length;++gt<Zt;)if(te[gt]===Ee)return gt;return-1}function yu(te,Ee,ve){for(var gt=ve+1;gt--;)if(te[gt]===Ee)return gt;return gt}function ca(te){return Ga(te)?ld(te):Nr(te)}function Gn(te){return Ga(te)?xu(te):$l(te)}function jl(te){for(var Ee=te.length;Ee--&&vn.test(te.charAt(Ee)););return Ee}var ud=bo(iu);function ld(te){for(var Ee=nu.lastIndex=0;nu.test(te);)++Ee;return Ee}function xu(te){return te.match(nu)||[]}function cd(te){return te.match(rd)||[]}var hd=function te(Ee){Ee=Ee==null?bn:Ao.defaults(bn.Object(),Ee,Ao.pick(bn,id));var ve=Ee.Array,gt=Ee.Date,Zt=Ee.Error,pr=Ee.Function,fn=Ee.Math,Tr=Ee.Object,bu=Ee.RegExp,dd=Ee.String,ri=Ee.TypeError,as=ve.prototype,vd=pr.prototype,To=Tr.prototype,os=Ee["__core-js_shared__"],af=vd.toString,mr=To.hasOwnProperty,_d=0,of=function(){var e=/[^.]+$/.exec(os&&os.keys&&os.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Un=To.toString,Eo=af.call(Tr),Ql=bn._,Jl=bu("^"+af.call(mr).replace(kr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ff=Gl?Ee.Buffer:i,Xi=Ee.Symbol,sf=Ee.Uint8Array,wu=ff?ff.allocUnsafe:i,fs=gu(Tr.getPrototypeOf,Tr),Ua=Tr.create,sn=To.propertyIsEnumerable,uf=as.splice,Su=Xi?Xi.isConcatSpreadable:i,mi=Xi?Xi.iterator:i,ha=Xi?Xi.toStringTag:i,lf=function(){try{var e=G(Tr,"defineProperty");return e({},"",{}),e}catch{}}(),pd=Ee.clearTimeout!==bn.clearTimeout&&Ee.clearTimeout,md=gt&>.now!==bn.Date.now&>.now,gd=Ee.setTimeout!==bn.setTimeout&&Ee.setTimeout,ss=fn.ceil,Do=fn.floor,us=Tr.getOwnPropertySymbols,yd=ff?ff.isBuffer:i,Au=Ee.isFinite,ec=as.join,xd=gu(Tr.keys,Tr),Xr=fn.max,Cn=fn.min,da=gt.now,ls=Ee.parseInt,Tu=fn.random,tc=as.reverse,cs=G(Ee,"DataView"),Lo=G(Ee,"Map"),hs=G(Ee,"Promise"),Ya=G(Ee,"Set"),Ro=G(Ee,"WeakMap"),Co=G(Tr,"create"),cf=Ro&&new Ro,On={},rc=_r(cs),bd=_r(Lo),qi=_r(hs),Eu=_r(Ya),Ha=_r(Ro),za=Xi?Xi.prototype:i,Oo=za?za.valueOf:i,Du=za?za.toString:i;function S(e){if(rn(e)&&!Jt(e)&&!(e instanceof lr)){if(e instanceof ni)return e;if(mr.call(e,"__wrapped__"))return Kr(e)}return new ni(e)}var Wa=function(){function e(){}return function(r){if(!tn(r))return{};if(Ua)return Ua(r);e.prototype=r;var a=new e;return e.prototype=i,a}}();function hf(){}function ni(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=i}S.templateSettings={escape:ce,evaluate:Et,interpolate:at,variable:"",imports:{_:S}},S.prototype=hf.prototype,S.prototype.constructor=S,ni.prototype=Wa(hf.prototype),ni.prototype.constructor=ni;function lr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Wt,this.__views__=[]}function wd(){var e=new lr(this.__wrapped__);return e.__actions__=In(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=In(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=In(this.__views__),e}function Sd(){if(this.__filtered__){var e=new lr(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Ad(){var e=this.__wrapped__.value(),r=this.__dir__,a=Jt(e),c=r<0,_=a?e.length:0,L=Le(0,_,this.__views__),z=L.start,$=L.end,ie=$-z,Fe=c?$:z-1,Ne=this.__iteratees__,ze=Ne.length,vt=0,Rt=Cn(ie,this.__takeCount__);if(!a||!c&&_==ie&&Rt==ie)return wf(e,this.__actions__);var Yt=[];e:for(;ie--&&vt<Rt;){Fe+=r;for(var ar=-1,Ht=e[Fe];++ar<ze;){var vr=Ne[ar],gr=vr.iteratee,Ti=vr.type,Qn=gr(Ht);if(Ti==Ot)Ht=Qn;else if(!Qn){if(Ti==Re)continue e;break e}}Yt[vt++]=Ht}return Yt}lr.prototype=Wa(hf.prototype),lr.prototype.constructor=lr;function Va(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var c=e[r];this.set(c[0],c[1])}}function Td(){this.__data__=Co?Co(null):{},this.size=0}function nc(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}function ic(e){var r=this.__data__;if(Co){var a=r[e];return a===v?i:a}return mr.call(r,e)?r[e]:i}function Ed(e){var r=this.__data__;return Co?r[e]!==i:mr.call(r,e)}function Dd(e,r){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=Co&&r===i?v:r,this}Va.prototype.clear=Td,Va.prototype.delete=nc,Va.prototype.get=ic,Va.prototype.has=Ed,Va.prototype.set=Dd;function gi(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var c=e[r];this.set(c[0],c[1])}}function ds(){this.__data__=[],this.size=0}function Ld(e){var r=this.__data__,a=va(r,e);if(a<0)return!1;var c=r.length-1;return a==c?r.pop():uf.call(r,a,1),--this.size,!0}function Rd(e){var r=this.__data__,a=va(r,e);return a<0?i:r[a][1]}function Cd(e){return va(this.__data__,e)>-1}function Od(e,r){var a=this.__data__,c=va(a,e);return c<0?(++this.size,a.push([e,r])):a[c][1]=r,this}gi.prototype.clear=ds,gi.prototype.delete=Ld,gi.prototype.get=Rd,gi.prototype.has=Cd,gi.prototype.set=Od;function Ki(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var c=e[r];this.set(c[0],c[1])}}function ac(){this.size=0,this.__data__={hash:new Va,map:new(Lo||gi),string:new Va}}function Md(e){var r=h(this,e).delete(e);return this.size-=r?1:0,r}function Id(e){return h(this,e).get(e)}function Fd(e){return h(this,e).has(e)}function kd(e,r){var a=h(this,e),c=a.size;return a.set(e,r),this.size+=a.size==c?0:1,this}Ki.prototype.clear=ac,Ki.prototype.delete=Md,Ki.prototype.get=Id,Ki.prototype.has=Fd,Ki.prototype.set=kd;function $a(e){var r=-1,a=e==null?0:e.length;for(this.__data__=new Ki;++r<a;)this.add(e[r])}function Mo(e){return this.__data__.set(e,v),this}function Nd(e){return this.__data__.has(e)}$a.prototype.add=$a.prototype.push=Mo,$a.prototype.has=Nd;function yi(e){var r=this.__data__=new gi(e);this.size=r.size}function oc(){this.__data__=new gi,this.size=0}function vs(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}function fc(e){return this.__data__.get(e)}function Lu(e){return this.__data__.has(e)}function Pd(e,r){var a=this.__data__;if(a instanceof gi){var c=a.__data__;if(!Lo||c.length<s-1)return c.push([e,r]),this.size=++a.size,this;a=this.__data__=new Ki(c)}return a.set(e,r),this.size=a.size,this}yi.prototype.clear=oc,yi.prototype.delete=vs,yi.prototype.get=fc,yi.prototype.has=Lu,yi.prototype.set=Pd;function Ru(e,r){var a=Jt(e),c=!a&&Of(e),_=!a&&!c&&Wo(e),L=!a&&!c&&!_&&Is(e),z=a||c||_||L,$=z?du(e.length,dd):[],ie=$.length;for(var Fe in e)(r||mr.call(e,Fe))&&!(z&&(Fe=="length"||_&&(Fe=="offset"||Fe=="parent")||L&&(Fe=="buffer"||Fe=="byteLength"||Fe=="byteOffset")||K(Fe,ie)))&&$.push(Fe);return $}function sc(e){var r=e.length;return r?e[bs(0,r-1)]:i}function Bd(e,r){return Lr(In(e),Za(r,0,e.length))}function Gd(e){return Lr(In(e))}function Cu(e,r,a){(a!==i&&!ra(e[r],a)||a===i&&!(r in e))&&$n(e,r,a)}function df(e,r,a){var c=e[r];(!(mr.call(e,r)&&ra(c,a))||a===i&&!(r in e))&&$n(e,r,a)}function va(e,r){for(var a=e.length;a--;)if(ra(e[a][0],r))return a;return-1}function Ud(e,r,a,c){return Mi(e,function(_,L,z){r(c,_,a(_),z)}),c}function vf(e,r){return e&&Ii(r,kn(r),e)}function Yd(e,r){return e&&Ii(r,si(r),e)}function $n(e,r,a){r=="__proto__"&&lf?lf(e,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[r]=a}function _a(e,r){for(var a=-1,c=r.length,_=ve(c),L=e==null;++a<c;)_[a]=L?i:t0(e,r[a]);return _}function Za(e,r,a){return e===e&&(a!==i&&(e=e<=a?e:a),r!==i&&(e=e>=r?e:r)),e}function Sn(e,r,a,c,_,L){var z,$=r&p,ie=r&U,Fe=r&q;if(a&&(z=_?a(e,c,_,L):a(e)),z!==i)return z;if(!tn(e))return e;var Ne=Jt(e);if(Ne){if(z=Ge(e),!$)return In(e,z)}else{var ze=se(e),vt=ze==kt||ze==Pr;if(Wo(e))return Af(e,$);if(ze==ir||ze==sr||vt&&!_){if(z=ie||vt?{}:Be(e),!$)return ie?Vd(e,Yd(z,e)):Wd(e,vf(z,e))}else{if(!Or[ze])return _?e:{};z=We(e,ze,$)}}L||(L=new yi);var Rt=L.get(e);if(Rt)return Rt;L.set(e,z),a_(e)?e.forEach(function(Ht){z.add(Sn(Ht,r,a,Ht,e,L))}):n_(e)&&e.forEach(function(Ht,vr){z.set(vr,Sn(Ht,r,a,vr,e,L))});var Yt=Fe?ie?Cs:Rs:ie?si:kn,ar=Ne?i:Yt(e);return wn(ar||e,function(Ht,vr){ar&&(vr=Ht,Ht=e[vr]),df(z,vr,Sn(Ht,r,a,vr,e,L))}),z}function uc(e){var r=kn(e);return function(a){return Xa(a,e,r)}}function Xa(e,r,a){var c=a.length;if(e==null)return!c;for(e=Tr(e);c--;){var _=a[c],L=r[_],z=e[_];if(z===i&&!(_ in e)||!L(z))return!1}return!0}function _s(e,r,a){if(typeof e!="function")throw new ri(u);return wt(function(){e.apply(i,a)},r)}function qa(e,r,a,c){var _=-1,L=Qf,z=!0,$=e.length,ie=[],Fe=r.length;if(!$)return ie;a&&(r=Br(r,qn(a))),c?(L=uu,z=!1):r.length>=s&&(L=la,z=!1,r=new $a(r));e:for(;++_<$;){var Ne=e[_],ze=a==null?Ne:a(Ne);if(Ne=c||Ne!==0?Ne:0,z&&ze===ze){for(var vt=Fe;vt--;)if(r[vt]===ze)continue e;ie.push(Ne)}else L(r,ze,c)||ie.push(Ne)}return ie}var Mi=$u(ii),ps=$u(_f,!0);function Ou(e,r){var a=!0;return Mi(e,function(c,_,L){return a=!!r(c,_,L),a}),a}function Ka(e,r,a){for(var c=-1,_=e.length;++c<_;){var L=e[c],z=r(L);if(z!=null&&($===i?z===z&&!Ai(z):a(z,$)))var $=z,ie=L}return ie}function lc(e,r,a,c){var _=e.length;for(a=nr(a),a<0&&(a=-a>_?0:_+a),c=c===i||c>_?_:nr(c),c<0&&(c+=_),c=a>c?0:f_(c);a<c;)e[a++]=r;return e}function Mu(e,r){var a=[];return Mi(e,function(c,_,L){r(c,_,L)&&a.push(c)}),a}function pn(e,r,a,c,_){var L=-1,z=e.length;for(a||(a=ke),_||(_=[]);++L<z;){var $=e[L];r>0&&a($)?r>1?pn($,r-1,a,c,_):Vi(_,$):c||(_[_.length]=$)}return _}var ms=Zu(),Iu=Zu(!0);function ii(e,r){return e&&ms(e,r,kn)}function _f(e,r){return e&&Iu(e,r,kn)}function pf(e,r){return Oi(r,function(a){return lo(e[a])})}function pa(e,r){r=xi(r,e);for(var a=0,c=r.length;e!=null&&a<c;)e=e[Er(r[a++])];return a&&a==c?e:i}function Fu(e,r,a){var c=r(e);return Jt(e)?c:Vi(c,a(e))}function Mn(e){return e==null?e===i?di:Qr:ha&&ha in Tr(e)?fe(e):$e(e)}function mf(e,r){return e>r}function cc(e,r){return e!=null&&mr.call(e,r)}function hc(e,r){return e!=null&&r in Tr(e)}function ku(e,r,a){return e>=Cn(r,a)&&e<Xr(r,a)}function gf(e,r,a){for(var c=a?uu:Qf,_=e[0].length,L=e.length,z=L,$=ve(L),ie=1/0,Fe=[];z--;){var Ne=e[z];z&&r&&(Ne=Br(Ne,qn(r))),ie=Cn(Ne.length,ie),$[z]=!a&&(r||_>=120&&Ne.length>=120)?new $a(z&&Ne):i}Ne=e[0];var ze=-1,vt=$[0];e:for(;++ze<_&&Fe.length<ie;){var Rt=Ne[ze],Yt=r?r(Rt):Rt;if(Rt=a||Rt!==0?Rt:0,!(vt?la(vt,Yt):c(Fe,Yt,a))){for(z=L;--z;){var ar=$[z];if(!(ar?la(ar,Yt):c(e[z],Yt,a)))continue e}vt&&vt.push(Yt),Fe.push(Rt)}}return Fe}function dc(e,r,a,c){return ii(e,function(_,L,z){r(c,a(_),L,z)}),c}function ja(e,r,a){r=xi(r,e),e=Mt(e,r);var c=e==null?e:e[Er(Y(r))];return c==null?i:_n(c,e,a)}function Nu(e){return rn(e)&&Mn(e)==sr}function vc(e){return rn(e)&&Mn(e)==Pn}function Pu(e){return rn(e)&&Mn(e)==It}function Io(e,r,a,c,_){return e===r?!0:e==null||r==null||!rn(e)&&!rn(r)?e!==e&&r!==r:_c(e,r,a,c,Io,_)}function _c(e,r,a,c,_,L){var z=Jt(e),$=Jt(r),ie=z?Kt:se(e),Fe=$?Kt:se(r);ie=ie==sr?ir:ie,Fe=Fe==sr?ir:Fe;var Ne=ie==ir,ze=Fe==ir,vt=ie==Fe;if(vt&&Wo(e)){if(!Wo(r))return!1;z=!0,Ne=!1}if(vt&&!Ne)return L||(L=new yi),z||Is(e)?Ec(e,r,a,c,_,L):qd(e,r,ie,a,c,_,L);if(!(a&D)){var Rt=Ne&&mr.call(e,"__wrapped__"),Yt=ze&&mr.call(r,"__wrapped__");if(Rt||Yt){var ar=Rt?e.value():e,Ht=Yt?r.value():r;return L||(L=new yi),_(ar,Ht,a,c,L)}}return vt?(L||(L=new yi),Kd(e,r,a,c,_,L)):!1}function Bu(e){return rn(e)&&se(e)==Fr}function yf(e,r,a,c){var _=a.length,L=_,z=!c;if(e==null)return!L;for(e=Tr(e);_--;){var $=a[_];if(z&&$[2]?$[1]!==e[$[0]]:!($[0]in e))return!1}for(;++_<L;){$=a[_];var ie=$[0],Fe=e[ie],Ne=$[1];if(z&&$[2]){if(Fe===i&&!(ie in e))return!1}else{var ze=new yi;if(c)var vt=c(Fe,Ne,ie,e,r,ze);if(!(vt===i?Io(Ne,Fe,D|pe,c,ze):vt))return!1}}return!0}function Fo(e){if(!tn(e)||Qe(e))return!1;var r=lo(e)?Jl:Nh;return r.test(_r(e))}function pc(e){return rn(e)&&Mn(e)==En}function gs(e){return rn(e)&&se(e)==Jr}function ji(e){return rn(e)&&Fc(e.length)&&!!Cr[Mn(e)]}function ko(e){return typeof e=="function"?e:e==null?ui:typeof e=="object"?Jt(e)?ya(e[0],e[1]):ga(e):g_(e)}function Qi(e){if(!pt(e))return xd(e);var r=[];for(var a in Tr(e))mr.call(e,a)&&a!="constructor"&&r.push(a);return r}function xf(e){if(!tn(e))return Ie(e);var r=pt(e),a=[];for(var c in e)c=="constructor"&&(r||!mr.call(e,c))||a.push(c);return a}function Qa(e,r){return e<r}function ma(e,r){var a=-1,c=fi(e)?ve(e.length):[];return Mi(e,function(_,L,z){c[++a]=r(_,L,z)}),c}function ga(e){var r=T(e);return r.length==1&&r[0][2]?ge(r[0][0],r[0][1]):function(a){return a===e||yf(a,e,r)}}function ya(e,r){return Oe(e)&&xe(r)?ge(Er(e),r):function(a){var c=t0(a,e);return c===i&&c===r?r0(a,e):Io(r,c,D|pe)}}function Ja(e,r,a,c,_){e!==r&&ms(r,function(L,z){if(_||(_=new yi),tn(L))ys(e,r,z,a,Ja,c,_);else{var $=c?c(Ke(e,z),L,z+"",e,r,_):i;$===i&&($=L),Cu(e,z,$)}},si)}function ys(e,r,a,c,_,L,z){var $=Ke(e,a),ie=Ke(r,a),Fe=z.get(ie);if(Fe){Cu(e,a,Fe);return}var Ne=L?L($,ie,a+"",e,r,z):i,ze=Ne===i;if(ze){var vt=Jt(ie),Rt=!vt&&Wo(ie),Yt=!vt&&!Rt&&Is(ie);Ne=ie,vt||Rt||Yt?Jt($)?Ne=$:ln($)?Ne=In($):Rt?(ze=!1,Ne=Af(ie,!0)):Yt?(ze=!1,Ne=Ho(ie,!0)):Ne=[]:Ju(ie)||Of(ie)?(Ne=$,Of($)?Ne=s_($):(!tn($)||lo($))&&(Ne=Be(ie))):ze=!1}ze&&(z.set(ie,Ne),_(Ne,ie,c,L,z),z.delete(ie)),Cu(e,a,Ne)}function No(e,r){var a=e.length;if(!!a)return r+=r<0?a:0,K(r,a)?e[r]:i}function xs(e,r,a){r.length?r=Br(r,function(L){return Jt(L)?function(z){return pa(z,L.length===1?L[0]:L)}:L}):r=[ui];var c=-1;r=Br(r,qn(Bt()));var _=ma(e,function(L,z,$){var ie=Br(r,function(Fe){return Fe(L)});return{criteria:ie,index:++c,value:L}});return hu(_,function(L,z){return Lf(L,z,a)})}function Gu(e,r){return eo(e,r,function(a,c){return r0(e,c)})}function eo(e,r,a){for(var c=-1,_=r.length,L={};++c<_;){var z=r[c],$=pa(e,z);a($,z)&&bf(L,xi(z,e),$)}return L}function Po(e){return function(r){return pa(r,e)}}function Uu(e,r,a,c){var _=c?Pa:$i,L=-1,z=r.length,$=e;for(e===r&&(r=In(r)),a&&($=Br(e,qn(a)));++L<z;)for(var ie=0,Fe=r[L],Ne=a?a(Fe):Fe;(ie=_($,Ne,ie,c))>-1;)$!==e&&uf.call($,ie,1),uf.call(e,ie,1);return e}function mc(e,r){for(var a=e?r.length:0,c=a-1;a--;){var _=r[a];if(a==c||_!==L){var L=_;K(_)?uf.call(e,_,1):zu(e,_)}}return e}function bs(e,r){return e+Do(Tu()*(r-e+1))}function gc(e,r,a,c){for(var _=-1,L=Xr(ss((r-e)/(a||1)),0),z=ve(L);L--;)z[c?L:++_]=e,e+=a;return z}function ws(e,r){var a="";if(!e||r<1||r>Ze)return a;do r%2&&(a+=e),r=Do(r/2),r&&(e+=e);while(r);return a}function rr(e,r){return Ct(qe(e,r,ui),e+"")}function Bo(e){return sc(Fs(e))}function Yu(e,r){var a=Fs(e);return Lr(a,Za(r,0,a.length))}function bf(e,r,a,c){if(!tn(e))return e;r=xi(r,e);for(var _=-1,L=r.length,z=L-1,$=e;$!=null&&++_<L;){var ie=Er(r[_]),Fe=a;if(ie==="__proto__"||ie==="constructor"||ie==="prototype")return e;if(_!=z){var Ne=$[ie];Fe=c?c(Ne,ie,$):i,Fe===i&&(Fe=tn(Ne)?Ne:K(r[_+1])?[]:{})}df($,ie,Fe),$=$[ie]}return e}var yc=cf?function(e,r){return cf.set(e,r),e}:ui,xc=lf?function(e,r){return lf(e,"toString",{configurable:!0,enumerable:!1,value:i0(r),writable:!0})}:ui;function Hd(e){return Lr(Fs(e))}function ai(e,r,a){var c=-1,_=e.length;r<0&&(r=-r>_?0:_+r),a=a>_?_:a,a<0&&(a+=_),_=r>a?0:a-r>>>0,r>>>=0;for(var L=ve(_);++c<_;)L[c]=e[c+r];return L}function zd(e,r){var a;return Mi(e,function(c,_,L){return a=r(c,_,L),!a}),!!a}function Ss(e,r,a){var c=0,_=e==null?c:e.length;if(typeof r=="number"&&r===r&&_<=or){for(;c<_;){var L=c+_>>>1,z=e[L];z!==null&&!Ai(z)&&(a?z<=r:z<r)?c=L+1:_=L}return _}return Hu(e,r,ui,a)}function Hu(e,r,a,c){var _=0,L=e==null?0:e.length;if(L===0)return 0;r=a(r);for(var z=r!==r,$=r===null,ie=Ai(r),Fe=r===i;_<L;){var Ne=Do((_+L)/2),ze=a(e[Ne]),vt=ze!==i,Rt=ze===null,Yt=ze===ze,ar=Ai(ze);if(z)var Ht=c||Yt;else Fe?Ht=Yt&&(c||vt):$?Ht=Yt&&vt&&(c||!Rt):ie?Ht=Yt&&vt&&!Rt&&(c||!ar):Rt||ar?Ht=!1:Ht=c?ze<=r:ze<r;Ht?_=Ne+1:L=Ne}return Cn(L,Qt)}function bc(e,r){for(var a=-1,c=e.length,_=0,L=[];++a<c;){var z=e[a],$=r?r(z):z;if(!a||!ra($,ie)){var ie=$;L[_++]=z===0?0:z}}return L}function wc(e){return typeof e=="number"?e:Ai(e)?$t:+e}function Kn(e){if(typeof e=="string")return e;if(Jt(e))return Br(e,Kn)+"";if(Ai(e))return Du?Du.call(e):"";var r=e+"";return r=="0"&&1/e==-Me?"-0":r}function xa(e,r,a){var c=-1,_=Qf,L=e.length,z=!0,$=[],ie=$;if(a)z=!1,_=uu;else if(L>=s){var Fe=r?null:Zd(e);if(Fe)return nf(Fe);z=!1,_=la,ie=new $a}else ie=r?[]:$;e:for(;++c<L;){var Ne=e[c],ze=r?r(Ne):Ne;if(Ne=a||Ne!==0?Ne:0,z&&ze===ze){for(var vt=ie.length;vt--;)if(ie[vt]===ze)continue e;r&&ie.push(ze),$.push(Ne)}else _(ie,ze,a)||(ie!==$&&ie.push(ze),$.push(Ne))}return $}function zu(e,r){return r=xi(r,e),e=Mt(e,r),e==null||delete e[Er(Y(r))]}function As(e,r,a,c){return bf(e,r,a(pa(e,r)),c)}function to(e,r,a,c){for(var _=e.length,L=c?_:-1;(c?L--:++L<_)&&r(e[L],L,e););return a?ai(e,c?0:L,c?L+1:_):ai(e,c?L+1:0,c?_:L)}function wf(e,r){var a=e;return a instanceof lr&&(a=a.value()),lu(r,function(c,_){return _.func.apply(_.thisArg,Vi([c],_.args))},a)}function Go(e,r,a){var c=e.length;if(c<2)return c?xa(e[0]):[];for(var _=-1,L=ve(c);++_<c;)for(var z=e[_],$=-1;++$<c;)$!=_&&(L[_]=qa(L[_]||z,e[$],r,a));return xa(pn(L,1),r,a)}function Ts(e,r,a){for(var c=-1,_=e.length,L=r.length,z={};++c<_;){var $=c<L?r[c]:i;a(z,e[c],$)}return z}function Uo(e){return ln(e)?e:[]}function Yo(e){return typeof e=="function"?e:ui}function xi(e,r){return Jt(e)?e:Oe(e,r)?[e]:Xt(Rr(e))}var Wu=rr;function bi(e,r,a){var c=e.length;return a=a===i?c:a,!r&&a>=c?e:ai(e,r,a)}var Sf=pd||function(e){return bn.clearTimeout(e)};function Af(e,r){if(r)return e.slice();var a=e.length,c=wu?wu(a):new e.constructor(a);return e.copy(c),c}function ro(e){var r=new e.constructor(e.byteLength);return new sf(r).set(new sf(e)),r}function Tf(e,r){var a=r?ro(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.byteLength)}function Ef(e){var r=new e.constructor(e.source,Xn.exec(e));return r.lastIndex=e.lastIndex,r}function Df(e){return Oo?Tr(Oo.call(e)):{}}function Ho(e,r){var a=r?ro(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}function Es(e,r){if(e!==r){var a=e!==i,c=e===null,_=e===e,L=Ai(e),z=r!==i,$=r===null,ie=r===r,Fe=Ai(r);if(!$&&!Fe&&!L&&e>r||L&&z&&ie&&!$&&!Fe||c&&z&&ie||!a&&ie||!_)return 1;if(!c&&!L&&!Fe&&e<r||Fe&&a&&_&&!c&&!L||$&&a&&_||!z&&_||!ie)return-1}return 0}function Lf(e,r,a){for(var c=-1,_=e.criteria,L=r.criteria,z=_.length,$=a.length;++c<z;){var ie=Es(_[c],L[c]);if(ie){if(c>=$)return ie;var Fe=a[c];return ie*(Fe=="desc"?-1:1)}}return e.index-r.index}function ba(e,r,a,c){for(var _=-1,L=e.length,z=a.length,$=-1,ie=r.length,Fe=Xr(L-z,0),Ne=ve(ie+Fe),ze=!c;++$<ie;)Ne[$]=r[$];for(;++_<z;)(ze||_<L)&&(Ne[a[_]]=e[_]);for(;Fe--;)Ne[$++]=e[_++];return Ne}function Vu(e,r,a,c){for(var _=-1,L=e.length,z=-1,$=a.length,ie=-1,Fe=r.length,Ne=Xr(L-$,0),ze=ve(Ne+Fe),vt=!c;++_<Ne;)ze[_]=e[_];for(var Rt=_;++ie<Fe;)ze[Rt+ie]=r[ie];for(;++z<$;)(vt||_<L)&&(ze[Rt+a[z]]=e[_++]);return ze}function In(e,r){var a=-1,c=e.length;for(r||(r=ve(c));++a<c;)r[a]=e[a];return r}function Ii(e,r,a,c){var _=!a;a||(a={});for(var L=-1,z=r.length;++L<z;){var $=r[L],ie=c?c(a[$],e[$],$,a,e):i;ie===i&&(ie=e[$]),_?$n(a,$,ie):df(a,$,ie)}return a}function Wd(e,r){return Ii(e,me(e),r)}function Vd(e,r){return Ii(e,ae(e),r)}function wi(e,r){return function(a,c){var _=Jt(a)?Wl:Ud,L=r?r():{};return _(a,e,Bt(c,2),L)}}function no(e){return rr(function(r,a){var c=-1,_=a.length,L=_>1?a[_-1]:i,z=_>2?a[2]:i;for(L=e.length>3&&typeof L=="function"?(_--,L):i,z&&oe(a[0],a[1],z)&&(L=_<3?i:L,_=1),r=Tr(r);++c<_;){var $=a[c];$&&e(r,$,c,L)}return r})}function $u(e,r){return function(a,c){if(a==null)return a;if(!fi(a))return e(a,c);for(var _=a.length,L=r?_:-1,z=Tr(a);(r?L--:++L<_)&&c(z[L],L,z)!==!1;);return a}}function Zu(e){return function(r,a,c){for(var _=-1,L=Tr(r),z=c(r),$=z.length;$--;){var ie=z[e?$:++_];if(a(L[ie],ie,L)===!1)break}return r}}function $d(e,r,a){var c=r&le,_=Zn(e);function L(){var z=this&&this!==bn&&this instanceof L?_:e;return z.apply(c?a:this,arguments)}return L}function Xu(e){return function(r){r=Rr(r);var a=Ga(r)?Gn(r):i,c=a?a[0]:r.charAt(0),_=a?bi(a,1).join(""):r.slice(1);return c[e]()+_}}function zo(e){return function(r){return lu(p_(__(r).replace(ed,"")),e,"")}}function Zn(e){return function(){var r=arguments;switch(r.length){case 0:return new e;case 1:return new e(r[0]);case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[1],r[2]);case 4:return new e(r[0],r[1],r[2],r[3]);case 5:return new e(r[0],r[1],r[2],r[3],r[4]);case 6:return new e(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new e(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var a=Wa(e.prototype),c=e.apply(a,r);return tn(c)?c:a}}function Sc(e,r,a){var c=Zn(e);function _(){for(var L=arguments.length,z=ve(L),$=L,ie=oo(_);$--;)z[$]=arguments[$];var Fe=L<3&&z[0]!==ie&&z[L-1]!==ie?[]:Zi(z,ie);if(L-=Fe.length,L<a)return qu(e,r,Rf,_.placeholder,i,z,Fe,i,i,a-L);var Ne=this&&this!==bn&&this instanceof _?c:e;return _n(Ne,this,z)}return _}function io(e){return function(r,a,c){var _=Tr(r);if(!fi(r)){var L=Bt(a,3);r=kn(r),a=function($){return L(_[$],$,_)}}var z=e(r,a,c);return z>-1?_[L?r[z]:z]:i}}function Ji(e){return Fi(function(r){var a=r.length,c=a,_=ni.prototype.thru;for(e&&r.reverse();c--;){var L=r[c];if(typeof L!="function")throw new ri(u);if(_&&!z&&Os(L)=="wrapper")var z=new ni([],!0)}for(c=z?c:a;++c<a;){L=r[c];var $=Os(L),ie=$=="wrapper"?Qu(L):i;ie&&Se(ie[0])&&ie[1]==(J|g|N|Te)&&!ie[4].length&&ie[9]==1?z=z[Os(ie[0])].apply(z,ie[3]):z=L.length==1&&Se(L)?z[$]():z.thru(L)}return function(){var Fe=arguments,Ne=Fe[0];if(z&&Fe.length==1&&Jt(Ne))return z.plant(Ne).value();for(var ze=0,vt=a?r[ze].apply(this,Fe):Ne;++ze<a;)vt=r[ze].call(this,vt);return vt}})}function Rf(e,r,a,c,_,L,z,$,ie,Fe){var Ne=r&J,ze=r&le,vt=r&x,Rt=r&(g|b),Yt=r&nt,ar=vt?i:Zn(e);function Ht(){for(var vr=arguments.length,gr=ve(vr),Ti=vr;Ti--;)gr[Ti]=arguments[Ti];if(Rt)var Qn=oo(Ht),Ei=wo(gr,Qn);if(c&&(gr=ba(gr,c,_,Rt)),L&&(gr=Vu(gr,L,z,Rt)),vr-=Ei,Rt&&vr<Fe){var cn=Zi(gr,Qn);return qu(e,r,Rf,Ht.placeholder,a,gr,cn,$,ie,Fe-vr)}var na=ze?a:this,ho=vt?na[e]:e;return vr=gr.length,$?gr=Lt(gr,$):Yt&&vr>1&&gr.reverse(),Ne&&ie<vr&&(gr.length=ie),this&&this!==bn&&this instanceof Ht&&(ho=ar||Zn(ho)),ho.apply(na,gr)}return Ht}function Ds(e,r){return function(a,c){return dc(a,e,r(c),{})}}function ao(e,r){return function(a,c){var _;if(a===i&&c===i)return r;if(a!==i&&(_=a),c!==i){if(_===i)return c;typeof a=="string"||typeof c=="string"?(a=Kn(a),c=Kn(c)):(a=wc(a),c=wc(c)),_=e(a,c)}return _}}function Ls(e){return Fi(function(r){return r=Br(r,qn(Bt())),rr(function(a){var c=this;return e(r,function(_){return _n(_,c,a)})})})}function Hr(e,r){r=r===i?" ":Kn(r);var a=r.length;if(a<2)return a?ws(r,e):r;var c=ws(r,ss(e/ca(r)));return Ga(r)?bi(Gn(c),0,e).join(""):c.slice(0,e)}function wa(e,r,a,c){var _=r&le,L=Zn(e);function z(){for(var $=-1,ie=arguments.length,Fe=-1,Ne=c.length,ze=ve(Ne+ie),vt=this&&this!==bn&&this instanceof z?L:e;++Fe<Ne;)ze[Fe]=c[Fe];for(;ie--;)ze[Fe++]=arguments[++$];return _n(vt,_?a:this,ze)}return z}function zr(e){return function(r,a,c){return c&&typeof c!="number"&&oe(r,a,c)&&(a=c=i),r=co(r),a===i?(a=r,r=0):a=co(a),c=c===i?r<a?1:-1:co(c),gc(r,a,c,e)}}function An(e){return function(r,a){return typeof r=="string"&&typeof a=="string"||(r=Ni(r),a=Ni(a)),e(r,a)}}function qu(e,r,a,c,_,L,z,$,ie,Fe){var Ne=r&g,ze=Ne?z:i,vt=Ne?i:z,Rt=Ne?L:i,Yt=Ne?i:L;r|=Ne?N:F,r&=~(Ne?F:N),r&A||(r&=~(le|x));var ar=[e,r,_,Rt,ze,Yt,vt,$,ie,Fe],Ht=a.apply(i,ar);return Se(e)&&Je(Ht,ar),Ht.placeholder=c,Vt(Ht,e,r)}function Ku(e){var r=fn[e];return function(a,c){if(a=Ni(a),c=c==null?0:Cn(nr(c),292),c&&Au(a)){var _=(Rr(a)+"e").split("e"),L=r(_[0]+"e"+(+_[1]+c));return _=(Rr(L)+"e").split("e"),+(_[0]+"e"+(+_[1]-c))}return r(a)}}var Zd=Ya&&1/nf(new Ya([,-0]))[1]==Me?function(e){return new Ya(e)}:f0;function Ac(e){return function(r){var a=se(r);return a==Fr?is(r):a==Jr?Kl(r):sd(r,e(r))}}function ea(e,r,a,c,_,L,z,$){var ie=r&x;if(!ie&&typeof e!="function")throw new ri(u);var Fe=c?c.length:0;if(Fe||(r&=~(N|F),c=_=i),z=z===i?z:Xr(nr(z),0),$=$===i?$:nr($),Fe-=_?_.length:0,r&F){var Ne=c,ze=_;c=_=i}var vt=ie?i:Qu(e),Rt=[e,r,a,c,_,Ne,ze,L,z,$];if(vt&&Ve(Rt,vt),e=Rt[0],r=Rt[1],a=Rt[2],c=Rt[3],_=Rt[4],$=Rt[9]=Rt[9]===i?ie?0:e.length:Xr(Rt[9]-Fe,0),!$&&r&(g|b)&&(r&=~(g|b)),!r||r==le)var Yt=$d(e,r,a);else r==g||r==b?Yt=Sc(e,r,$):(r==N||r==(le|N))&&!_.length?Yt=wa(e,r,a,c):Yt=Rf.apply(i,Rt);var ar=vt?yc:Je;return Vt(ar(Yt,Rt),e,r)}function ju(e,r,a,c){return e===i||ra(e,To[a])&&!mr.call(c,a)?r:e}function Tc(e,r,a,c,_,L){return tn(e)&&tn(r)&&(L.set(r,e),Ja(e,r,i,Tc,L),L.delete(r)),e}function Xd(e){return Ju(e)?i:e}function Ec(e,r,a,c,_,L){var z=a&D,$=e.length,ie=r.length;if($!=ie&&!(z&&ie>$))return!1;var Fe=L.get(e),Ne=L.get(r);if(Fe&&Ne)return Fe==r&&Ne==e;var ze=-1,vt=!0,Rt=a&pe?new $a:i;for(L.set(e,r),L.set(r,e);++ze<$;){var Yt=e[ze],ar=r[ze];if(c)var Ht=z?c(ar,Yt,ze,r,e,L):c(Yt,ar,ze,e,r,L);if(Ht!==i){if(Ht)continue;vt=!1;break}if(Rt){if(!Jf(r,function(vr,gr){if(!la(Rt,gr)&&(Yt===vr||_(Yt,vr,a,c,L)))return Rt.push(gr)})){vt=!1;break}}else if(!(Yt===ar||_(Yt,ar,a,c,L))){vt=!1;break}}return L.delete(e),L.delete(r),vt}function qd(e,r,a,c,_,L,z){switch(a){case Ar:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case Pn:return!(e.byteLength!=r.byteLength||!L(new sf(e),new sf(r)));case Gt:case It:case Zr:return ra(+e,+r);case jr:return e.name==r.name&&e.message==r.message;case En:case an:return e==r+"";case Fr:var $=is;case Jr:var ie=c&D;if($||($=nf),e.size!=r.size&&!ie)return!1;var Fe=z.get(e);if(Fe)return Fe==r;c|=pe,z.set(e,r);var Ne=Ec($(e),$(r),c,_,L,z);return z.delete(e),Ne;case E:if(Oo)return Oo.call(e)==Oo.call(r)}return!1}function Kd(e,r,a,c,_,L){var z=a&D,$=Rs(e),ie=$.length,Fe=Rs(r),Ne=Fe.length;if(ie!=Ne&&!z)return!1;for(var ze=ie;ze--;){var vt=$[ze];if(!(z?vt in r:mr.call(r,vt)))return!1}var Rt=L.get(e),Yt=L.get(r);if(Rt&&Yt)return Rt==r&&Yt==e;var ar=!0;L.set(e,r),L.set(r,e);for(var Ht=z;++ze<ie;){vt=$[ze];var vr=e[vt],gr=r[vt];if(c)var Ti=z?c(gr,vr,vt,r,e,L):c(vr,gr,vt,e,r,L);if(!(Ti===i?vr===gr||_(vr,gr,a,c,L):Ti)){ar=!1;break}Ht||(Ht=vt=="constructor")}if(ar&&!Ht){var Qn=e.constructor,Ei=r.constructor;Qn!=Ei&&"constructor"in e&&"constructor"in r&&!(typeof Qn=="function"&&Qn instanceof Qn&&typeof Ei=="function"&&Ei instanceof Ei)&&(ar=!1)}return L.delete(e),L.delete(r),ar}function Fi(e){return Ct(qe(e,i,k),e+"")}function Rs(e){return Fu(e,kn,me)}function Cs(e){return Fu(e,si,ae)}var Qu=cf?function(e){return cf.get(e)}:f0;function Os(e){for(var r=e.name+"",a=On[r],c=mr.call(On,r)?a.length:0;c--;){var _=a[c],L=_.func;if(L==null||L==e)return _.name}return r}function oo(e){var r=mr.call(S,"placeholder")?S:e;return r.placeholder}function Bt(){var e=S.iteratee||a0;return e=e===a0?ko:e,arguments.length?e(arguments[0],arguments[1]):e}function h(e,r){var a=e.__data__;return rt(r)?a[typeof r=="string"?"string":"hash"]:a.map}function T(e){for(var r=kn(e),a=r.length;a--;){var c=r[a],_=e[c];r[a]=[c,_,xe(_)]}return r}function G(e,r){var a=mu(e,r);return Fo(a)?a:i}function fe(e){var r=mr.call(e,ha),a=e[ha];try{e[ha]=i;var c=!0}catch{}var _=Un.call(e);return c&&(r?e[ha]=a:delete e[ha]),_}var me=us?function(e){return e==null?[]:(e=Tr(e),Oi(us(e),function(r){return sn.call(e,r)}))}:s0,ae=us?function(e){for(var r=[];e;)Vi(r,me(e)),e=fs(e);return r}:s0,se=Mn;(cs&&se(new cs(new ArrayBuffer(1)))!=Ar||Lo&&se(new Lo)!=Fr||hs&&se(hs.resolve())!=Nt||Ya&&se(new Ya)!=Jr||Ro&&se(new Ro)!=dn)&&(se=function(e){var r=Mn(e),a=r==ir?e.constructor:i,c=a?_r(a):"";if(c)switch(c){case rc:return Ar;case bd:return Fr;case qi:return Nt;case Eu:return Jr;case Ha:return dn}return r});function Le(e,r,a){for(var c=-1,_=a.length;++c<_;){var L=a[c],z=L.size;switch(L.type){case"drop":e+=z;break;case"dropRight":r-=z;break;case"take":r=Cn(r,e+z);break;case"takeRight":e=Xr(e,r-z);break}}return{start:e,end:r}}function De(e){var r=e.match(Ia);return r?r[1].split(Fa):[]}function Pe(e,r,a){r=xi(r,e);for(var c=-1,_=r.length,L=!1;++c<_;){var z=Er(r[c]);if(!(L=e!=null&&a(e,z)))break;e=e[z]}return L||++c!=_?L:(_=e==null?0:e.length,!!_&&Fc(_)&&K(z,_)&&(Jt(e)||Of(e)))}function Ge(e){var r=e.length,a=new e.constructor(r);return r&&typeof e[0]=="string"&&mr.call(e,"index")&&(a.index=e.index,a.input=e.input),a}function Be(e){return typeof e.constructor=="function"&&!pt(e)?Wa(fs(e)):{}}function We(e,r,a){var c=e.constructor;switch(r){case Pn:return ro(e);case Gt:case It:return new c(+e);case Ar:return Tf(e,a);case Dn:case Bn:case C:case Ue:case Xe:case dt:case Z:case we:case m:return Ho(e,a);case Fr:return new c;case Zr:case an:return new c(e);case En:return Ef(e);case Jr:return new c;case E:return Df(e)}}function Ce(e,r){var a=r.length;if(!a)return e;var c=a-1;return r[c]=(a>1?"& ":"")+r[c],r=r.join(a>2?", ":" "),e.replace(Ln,`{
|
|
18
|
+
/* [wrapped with `+r+`] */
|
|
19
|
+
`)}function ke(e){return Jt(e)||Of(e)||!!(Su&&e&&e[Su])}function K(e,r){var a=typeof e;return r=r==null?Ze:r,!!r&&(a=="number"||a!="symbol"&&Bh.test(e))&&e>-1&&e%1==0&&e<r}function oe(e,r,a){if(!tn(a))return!1;var c=typeof r;return(c=="number"?fi(a)&&K(r,a.length):c=="string"&&r in a)?ra(a[r],e):!1}function Oe(e,r){if(Jt(e))return!1;var a=typeof e;return a=="number"||a=="symbol"||a=="boolean"||e==null||Ai(e)?!0:ur.test(e)||!mt.test(e)||r!=null&&e in Tr(r)}function rt(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function Se(e){var r=Os(e),a=S[r];if(typeof a!="function"||!(r in lr.prototype))return!1;if(e===a)return!0;var c=Qu(a);return!!c&&e===c[0]}function Qe(e){return!!of&&of in e}var je=os?lo:u0;function pt(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||To;return e===a}function xe(e){return e===e&&!tn(e)}function ge(e,r){return function(a){return a==null?!1:a[e]===r&&(r!==i||e in Tr(a))}}function ut(e){var r=Mc(e,function(c){return a.size===M&&a.clear(),c}),a=r.cache;return r}function Ve(e,r){var a=e[1],c=r[1],_=a|c,L=_<(le|x|J),z=c==J&&a==g||c==J&&a==Te&&e[7].length<=r[8]||c==(J|Te)&&r[7].length<=r[8]&&a==g;if(!(L||z))return e;c&le&&(e[2]=r[2],_|=a&le?0:A);var $=r[3];if($){var ie=e[3];e[3]=ie?ba(ie,$,r[4]):$,e[4]=ie?Zi(e[3],B):r[4]}return $=r[5],$&&(ie=e[5],e[5]=ie?Vu(ie,$,r[6]):$,e[6]=ie?Zi(e[5],B):r[6]),$=r[7],$&&(e[7]=$),c&J&&(e[8]=e[8]==null?r[8]:Cn(e[8],r[8])),e[9]==null&&(e[9]=r[9]),e[0]=r[0],e[1]=_,e}function Ie(e){var r=[];if(e!=null)for(var a in Tr(e))r.push(a);return r}function $e(e){return Un.call(e)}function qe(e,r,a){return r=Xr(r===i?e.length-1:r,0),function(){for(var c=arguments,_=-1,L=Xr(c.length-r,0),z=ve(L);++_<L;)z[_]=c[r+_];_=-1;for(var $=ve(r+1);++_<r;)$[_]=c[_];return $[r]=a(z),_n(e,this,$)}}function Mt(e,r){return r.length<2?e:pa(e,ai(r,0,-1))}function Lt(e,r){for(var a=e.length,c=Cn(r.length,a),_=In(e);c--;){var L=r[c];e[c]=K(L,a)?_[L]:i}return e}function Ke(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}var Je=Mr(yc),wt=gd||function(e,r){return bn.setTimeout(e,r)},Ct=Mr(xc);function Vt(e,r,a){var c=r+"";return Ct(e,Ce(c,qr(De(c),a)))}function Mr(e){var r=0,a=0;return function(){var c=da(),_=tt-(c-a);if(a=c,_>0){if(++r>=ft)return arguments[0]}else r=0;return e.apply(i,arguments)}}function Lr(e,r){var a=-1,c=e.length,_=c-1;for(r=r===i?c:r;++a<r;){var L=bs(a,_),z=e[L];e[L]=e[a],e[a]=z}return e.length=r,e}var Xt=ut(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(vi,function(a,c,_,L){r.push(_?L.replace(on,"$1"):c||a)}),r});function Er(e){if(typeof e=="string"||Ai(e))return e;var r=e+"";return r=="0"&&1/e==-Me?"-0":r}function _r(e){if(e!=null){try{return af.call(e)}catch{}try{return e+""}catch{}}return""}function qr(e,r){return wn(xr,function(a){var c="_."+a[0];r&a[1]&&!Qf(e,c)&&e.push(c)}),e.sort()}function Kr(e){if(e instanceof lr)return e.clone();var r=new ni(e.__wrapped__,e.__chain__);return r.__actions__=In(e.__actions__),r.__index__=e.__index__,r.__values__=e.__values__,r}function en(e,r,a){(a?oe(e,r,a):r===i)?r=1:r=Xr(nr(r),0);var c=e==null?0:e.length;if(!c||r<1)return[];for(var _=0,L=0,z=ve(ss(c/r));_<c;)z[L++]=ai(e,_,_+=r);return z}function un(e){for(var r=-1,a=e==null?0:e.length,c=0,_=[];++r<a;){var L=e[r];L&&(_[c++]=L)}return _}function mn(){var e=arguments.length;if(!e)return[];for(var r=ve(e-1),a=arguments[0],c=e;c--;)r[c-1]=arguments[c];return Vi(Jt(a)?In(a):[a],pn(r,1))}var Wr=rr(function(e,r){return ln(e)?qa(e,pn(r,1,ln,!0)):[]}),Ut=rr(function(e,r){var a=Y(r);return ln(a)&&(a=i),ln(e)?qa(e,pn(r,1,ln,!0),Bt(a,2)):[]}),gn=rr(function(e,r){var a=Y(r);return ln(a)&&(a=i),ln(e)?qa(e,pn(r,1,ln,!0),i,a):[]});function cr(e,r,a){var c=e==null?0:e.length;return c?(r=a||r===i?1:nr(r),ai(e,r<0?0:r,c)):[]}function At(e,r,a){var c=e==null?0:e.length;return c?(r=a||r===i?1:nr(r),r=c-r,ai(e,0,r<0?0:r)):[]}function qt(e,r){return e&&e.length?to(e,Bt(r,3),!0,!0):[]}function er(e,r){return e&&e.length?to(e,Bt(r,3),!0):[]}function Vr(e,r,a,c){var _=e==null?0:e.length;return _?(a&&typeof a!="number"&&oe(e,r,a)&&(a=0,c=_),lc(e,r,a,c)):[]}function Si(e,r,a){var c=e==null?0:e.length;if(!c)return-1;var _=a==null?0:nr(a);return _<0&&(_=Xr(c+_,0)),xo(e,Bt(r,3),_)}function Sa(e,r,a){var c=e==null?0:e.length;if(!c)return-1;var _=c-1;return a!==i&&(_=nr(a),_=a<0?Xr(c+_,0):Cn(_,c-1)),xo(e,Bt(r,3),_,!0)}function k(e){var r=e==null?0:e.length;return r?pn(e,1):[]}function ue(e){var r=e==null?0:e.length;return r?pn(e,Me):[]}function ne(e,r){var a=e==null?0:e.length;return a?(r=r===i?1:nr(r),pn(e,r)):[]}function st(e){for(var r=-1,a=e==null?0:e.length,c={};++r<a;){var _=e[r];c[_[0]]=_[1]}return c}function zt(e){return e&&e.length?e[0]:i}function R(e,r,a){var c=e==null?0:e.length;if(!c)return-1;var _=a==null?0:nr(a);return _<0&&(_=Xr(c+_,0)),$i(e,r,_)}function y(e){var r=e==null?0:e.length;return r?ai(e,0,-1):[]}var H=rr(function(e){var r=Br(e,Uo);return r.length&&r[0]===e[0]?gf(r):[]}),j=rr(function(e){var r=Y(e),a=Br(e,Uo);return r===Y(a)?r=i:a.pop(),a.length&&a[0]===e[0]?gf(a,Bt(r,2)):[]}),Q=rr(function(e){var r=Y(e),a=Br(e,Uo);return r=typeof r=="function"?r:i,r&&a.pop(),a.length&&a[0]===e[0]?gf(a,i,r):[]});function W(e,r){return e==null?"":ec.call(e,r)}function Y(e){var r=e==null?0:e.length;return r?e[r-1]:i}function X(e,r,a){var c=e==null?0:e.length;if(!c)return-1;var _=c;return a!==i&&(_=nr(a),_=_<0?Xr(c+_,0):Cn(_,c-1)),r===r?yu(e,r,_):xo(e,es,_,!0)}function O(e,r){return e&&e.length?No(e,nr(r)):i}var P=rr(I);function I(e,r){return e&&e.length&&r&&r.length?Uu(e,r):e}function re(e,r,a){return e&&e.length&&r&&r.length?Uu(e,r,Bt(a,2)):e}function ee(e,r,a){return e&&e.length&&r&&r.length?Uu(e,r,i,a):e}var _e=Fi(function(e,r){var a=e==null?0:e.length,c=_a(e,r);return mc(e,Br(r,function(_){return K(_,a)?+_:_}).sort(Es)),c});function be(e,r){var a=[];if(!(e&&e.length))return a;var c=-1,_=[],L=e.length;for(r=Bt(r,3);++c<L;){var z=e[c];r(z,c,e)&&(a.push(z),_.push(c))}return mc(e,_),a}function Ye(e){return e==null?e:tc.call(e)}function Dt(e,r,a){var c=e==null?0:e.length;return c?(a&&typeof a!="number"&&oe(e,r,a)?(r=0,a=c):(r=r==null?0:nr(r),a=a===i?c:nr(a)),ai(e,r,a)):[]}function yt(e,r){return Ss(e,r)}function ot(e,r,a){return Hu(e,r,Bt(a,2))}function Ae(e,r){var a=e==null?0:e.length;if(a){var c=Ss(e,r);if(c<a&&ra(e[c],r))return c}return-1}function he(e,r){return Ss(e,r,!0)}function ht(e,r,a){return Hu(e,r,Bt(a,2),!0)}function ct(e,r){var a=e==null?0:e.length;if(a){var c=Ss(e,r,!0)-1;if(ra(e[c],r))return c}return-1}function Tt(e){return e&&e.length?bc(e):[]}function dr(e,r){return e&&e.length?bc(e,Bt(r,2)):[]}function yn(e){var r=e==null?0:e.length;return r?ai(e,1,r):[]}function fo(e,r,a){return e&&e.length?(r=a||r===i?1:nr(r),ai(e,0,r<0?0:r)):[]}function ta(e,r,a){var c=e==null?0:e.length;return c?(r=a||r===i?1:nr(r),r=c-r,ai(e,r<0?0:r,c)):[]}function ki(e,r){return e&&e.length?to(e,Bt(r,3),!1,!0):[]}function Aa(e,r){return e&&e.length?to(e,Bt(r,3)):[]}var so=rr(function(e){return xa(pn(e,1,ln,!0))}),Dc=rr(function(e){var r=Y(e);return ln(r)&&(r=i),xa(pn(e,1,ln,!0),Bt(r,2))}),jn=rr(function(e){var r=Y(e);return r=typeof r=="function"?r:i,xa(pn(e,1,ln,!0),i,r)});function uo(e){return e&&e.length?xa(e):[]}function oi(e,r){return e&&e.length?xa(e,Bt(r,2)):[]}function Lc(e,r){return r=typeof r=="function"?r:i,e&&e.length?xa(e,i,r):[]}function Fn(e){if(!(e&&e.length))return[];var r=0;return e=Oi(e,function(a){if(ln(a))return r=Xr(a.length,r),!0}),du(r,function(a){return Br(e,Ba(a))})}function Cf(e,r){if(!(e&&e.length))return[];var a=Fn(e);return r==null?a:Br(a,function(c){return _n(r,i,c)})}var Ms=rr(function(e,r){return ln(e)?qa(e,r):[]}),Wy=rr(function(e){return Go(Oi(e,ln))}),Vy=rr(function(e){var r=Y(e);return ln(r)&&(r=i),Go(Oi(e,ln),Bt(r,2))}),$y=rr(function(e){var r=Y(e);return r=typeof r=="function"?r:i,Go(Oi(e,ln),i,r)}),Zy=rr(Fn);function Xy(e,r){return Ts(e||[],r||[],df)}function qy(e,r){return Ts(e||[],r||[],bf)}var Ky=rr(function(e){var r=e.length,a=r>1?e[r-1]:i;return a=typeof a=="function"?(e.pop(),a):i,Cf(e,a)});function $v(e){var r=S(e);return r.__chain__=!0,r}function jy(e,r){return r(e),e}function Rc(e,r){return r(e)}var Qy=Fi(function(e){var r=e.length,a=r?e[0]:0,c=this.__wrapped__,_=function(L){return _a(L,e)};return r>1||this.__actions__.length||!(c instanceof lr)||!K(a)?this.thru(_):(c=c.slice(a,+a+(r?1:0)),c.__actions__.push({func:Rc,args:[_],thisArg:i}),new ni(c,this.__chain__).thru(function(L){return r&&!L.length&&L.push(i),L}))});function Jy(){return $v(this)}function ex(){return new ni(this.value(),this.__chain__)}function tx(){this.__values__===i&&(this.__values__=o_(this.value()));var e=this.__index__>=this.__values__.length,r=e?i:this.__values__[this.__index__++];return{done:e,value:r}}function rx(){return this}function nx(e){for(var r,a=this;a instanceof hf;){var c=Kr(a);c.__index__=0,c.__values__=i,r?_.__wrapped__=c:r=c;var _=c;a=a.__wrapped__}return _.__wrapped__=e,r}function ix(){var e=this.__wrapped__;if(e instanceof lr){var r=e;return this.__actions__.length&&(r=new lr(this)),r=r.reverse(),r.__actions__.push({func:Rc,args:[Ye],thisArg:i}),new ni(r,this.__chain__)}return this.thru(Ye)}function ax(){return wf(this.__wrapped__,this.__actions__)}var ox=wi(function(e,r,a){mr.call(e,a)?++e[a]:$n(e,a,1)});function fx(e,r,a){var c=Jt(e)?ua:Ou;return a&&oe(e,r,a)&&(r=i),c(e,Bt(r,3))}function sx(e,r){var a=Jt(e)?Oi:Mu;return a(e,Bt(r,3))}var ux=io(Si),lx=io(Sa);function cx(e,r){return pn(Cc(e,r),1)}function hx(e,r){return pn(Cc(e,r),Me)}function dx(e,r,a){return a=a===i?1:nr(a),pn(Cc(e,r),a)}function Zv(e,r){var a=Jt(e)?wn:Mi;return a(e,Bt(r,3))}function Xv(e,r){var a=Jt(e)?Vl:ps;return a(e,Bt(r,3))}var vx=wi(function(e,r,a){mr.call(e,a)?e[a].push(r):$n(e,a,[r])});function _x(e,r,a,c){e=fi(e)?e:Fs(e),a=a&&!c?nr(a):0;var _=e.length;return a<0&&(a=Xr(_+a,0)),kc(e)?a<=_&&e.indexOf(r,a)>-1:!!_&&$i(e,r,a)>-1}var px=rr(function(e,r,a){var c=-1,_=typeof r=="function",L=fi(e)?ve(e.length):[];return Mi(e,function(z){L[++c]=_?_n(r,z,a):ja(z,r,a)}),L}),mx=wi(function(e,r,a){$n(e,a,r)});function Cc(e,r){var a=Jt(e)?Br:ma;return a(e,Bt(r,3))}function gx(e,r,a,c){return e==null?[]:(Jt(r)||(r=r==null?[]:[r]),a=c?i:a,Jt(a)||(a=a==null?[]:[a]),xs(e,r,a))}var yx=wi(function(e,r,a){e[a?0:1].push(r)},function(){return[[],[]]});function xx(e,r,a){var c=Jt(e)?lu:cu,_=arguments.length<3;return c(e,Bt(r,4),a,_,Mi)}function bx(e,r,a){var c=Jt(e)?od:cu,_=arguments.length<3;return c(e,Bt(r,4),a,_,ps)}function wx(e,r){var a=Jt(e)?Oi:Mu;return a(e,Ic(Bt(r,3)))}function Sx(e){var r=Jt(e)?sc:Bo;return r(e)}function Ax(e,r,a){(a?oe(e,r,a):r===i)?r=1:r=nr(r);var c=Jt(e)?Bd:Yu;return c(e,r)}function Tx(e){var r=Jt(e)?Gd:Hd;return r(e)}function Ex(e){if(e==null)return 0;if(fi(e))return kc(e)?ca(e):e.length;var r=se(e);return r==Fr||r==Jr?e.size:Qi(e).length}function Dx(e,r,a){var c=Jt(e)?Jf:zd;return a&&oe(e,r,a)&&(r=i),c(e,Bt(r,3))}var Lx=rr(function(e,r){if(e==null)return[];var a=r.length;return a>1&&oe(e,r[0],r[1])?r=[]:a>2&&oe(r[0],r[1],r[2])&&(r=[r[0]]),xs(e,pn(r,1),[])}),Oc=md||function(){return bn.Date.now()};function Rx(e,r){if(typeof r!="function")throw new ri(u);return e=nr(e),function(){if(--e<1)return r.apply(this,arguments)}}function qv(e,r,a){return r=a?i:r,r=e&&r==null?e.length:r,ea(e,J,i,i,i,i,r)}function Kv(e,r){var a;if(typeof r!="function")throw new ri(u);return e=nr(e),function(){return--e>0&&(a=r.apply(this,arguments)),e<=1&&(r=i),a}}var jd=rr(function(e,r,a){var c=le;if(a.length){var _=Zi(a,oo(jd));c|=N}return ea(e,c,r,a,_)}),jv=rr(function(e,r,a){var c=le|x;if(a.length){var _=Zi(a,oo(jv));c|=N}return ea(r,c,e,a,_)});function Qv(e,r,a){r=a?i:r;var c=ea(e,g,i,i,i,i,i,r);return c.placeholder=Qv.placeholder,c}function Jv(e,r,a){r=a?i:r;var c=ea(e,b,i,i,i,i,i,r);return c.placeholder=Jv.placeholder,c}function e_(e,r,a){var c,_,L,z,$,ie,Fe=0,Ne=!1,ze=!1,vt=!0;if(typeof e!="function")throw new ri(u);r=Ni(r)||0,tn(a)&&(Ne=!!a.leading,ze="maxWait"in a,L=ze?Xr(Ni(a.maxWait)||0,r):L,vt="trailing"in a?!!a.trailing:vt);function Rt(cn){var na=c,ho=_;return c=_=i,Fe=cn,z=e.apply(ho,na),z}function Yt(cn){return Fe=cn,$=wt(vr,r),Ne?Rt(cn):z}function ar(cn){var na=cn-ie,ho=cn-Fe,y_=r-na;return ze?Cn(y_,L-ho):y_}function Ht(cn){var na=cn-ie,ho=cn-Fe;return ie===i||na>=r||na<0||ze&&ho>=L}function vr(){var cn=Oc();if(Ht(cn))return gr(cn);$=wt(vr,ar(cn))}function gr(cn){return $=i,vt&&c?Rt(cn):(c=_=i,z)}function Ti(){$!==i&&Sf($),Fe=0,c=ie=_=$=i}function Qn(){return $===i?z:gr(Oc())}function Ei(){var cn=Oc(),na=Ht(cn);if(c=arguments,_=this,ie=cn,na){if($===i)return Yt(ie);if(ze)return Sf($),$=wt(vr,r),Rt(ie)}return $===i&&($=wt(vr,r)),z}return Ei.cancel=Ti,Ei.flush=Qn,Ei}var Cx=rr(function(e,r){return _s(e,1,r)}),Ox=rr(function(e,r,a){return _s(e,Ni(r)||0,a)});function Mx(e){return ea(e,nt)}function Mc(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new ri(u);var a=function(){var c=arguments,_=r?r.apply(this,c):c[0],L=a.cache;if(L.has(_))return L.get(_);var z=e.apply(this,c);return a.cache=L.set(_,z)||L,z};return a.cache=new(Mc.Cache||Ki),a}Mc.Cache=Ki;function Ic(e){if(typeof e!="function")throw new ri(u);return function(){var r=arguments;switch(r.length){case 0:return!e.call(this);case 1:return!e.call(this,r[0]);case 2:return!e.call(this,r[0],r[1]);case 3:return!e.call(this,r[0],r[1],r[2])}return!e.apply(this,r)}}function Ix(e){return Kv(2,e)}var Fx=Wu(function(e,r){r=r.length==1&&Jt(r[0])?Br(r[0],qn(Bt())):Br(pn(r,1),qn(Bt()));var a=r.length;return rr(function(c){for(var _=-1,L=Cn(c.length,a);++_<L;)c[_]=r[_].call(this,c[_]);return _n(e,this,c)})}),Qd=rr(function(e,r){var a=Zi(r,oo(Qd));return ea(e,N,i,r,a)}),t_=rr(function(e,r){var a=Zi(r,oo(t_));return ea(e,F,i,r,a)}),kx=Fi(function(e,r){return ea(e,Te,i,i,i,r)});function Nx(e,r){if(typeof e!="function")throw new ri(u);return r=r===i?r:nr(r),rr(e,r)}function Px(e,r){if(typeof e!="function")throw new ri(u);return r=r==null?0:Xr(nr(r),0),rr(function(a){var c=a[r],_=bi(a,0,r);return c&&Vi(_,c),_n(e,this,_)})}function Bx(e,r,a){var c=!0,_=!0;if(typeof e!="function")throw new ri(u);return tn(a)&&(c="leading"in a?!!a.leading:c,_="trailing"in a?!!a.trailing:_),e_(e,r,{leading:c,maxWait:r,trailing:_})}function Gx(e){return qv(e,1)}function Ux(e,r){return Qd(Yo(r),e)}function Yx(){if(!arguments.length)return[];var e=arguments[0];return Jt(e)?e:[e]}function Hx(e){return Sn(e,q)}function zx(e,r){return r=typeof r=="function"?r:i,Sn(e,q,r)}function Wx(e){return Sn(e,p|q)}function Vx(e,r){return r=typeof r=="function"?r:i,Sn(e,p|q,r)}function $x(e,r){return r==null||Xa(e,r,kn(r))}function ra(e,r){return e===r||e!==e&&r!==r}var Zx=An(mf),Xx=An(function(e,r){return e>=r}),Of=Nu(function(){return arguments}())?Nu:function(e){return rn(e)&&mr.call(e,"callee")&&!sn.call(e,"callee")},Jt=ve.isArray,qx=Ul?qn(Ul):vc;function fi(e){return e!=null&&Fc(e.length)&&!lo(e)}function ln(e){return rn(e)&&fi(e)}function Kx(e){return e===!0||e===!1||rn(e)&&Mn(e)==Gt}var Wo=yd||u0,jx=Wi?qn(Wi):Pu;function Qx(e){return rn(e)&&e.nodeType===1&&!Ju(e)}function Jx(e){if(e==null)return!0;if(fi(e)&&(Jt(e)||typeof e=="string"||typeof e.splice=="function"||Wo(e)||Is(e)||Of(e)))return!e.length;var r=se(e);if(r==Fr||r==Jr)return!e.size;if(pt(e))return!Qi(e).length;for(var a in e)if(mr.call(e,a))return!1;return!0}function eb(e,r){return Io(e,r)}function tb(e,r,a){a=typeof a=="function"?a:i;var c=a?a(e,r):i;return c===i?Io(e,r,i,a):!!c}function Jd(e){if(!rn(e))return!1;var r=Mn(e);return r==jr||r==hn||typeof e.message=="string"&&typeof e.name=="string"&&!Ju(e)}function rb(e){return typeof e=="number"&&Au(e)}function lo(e){if(!tn(e))return!1;var r=Mn(e);return r==kt||r==Pr||r==br||r==Tn}function r_(e){return typeof e=="number"&&e==nr(e)}function Fc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ze}function tn(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}function rn(e){return e!=null&&typeof e=="object"}var n_=Yl?qn(Yl):Bu;function nb(e,r){return e===r||yf(e,r,T(r))}function ib(e,r,a){return a=typeof a=="function"?a:i,yf(e,r,T(r),a)}function ab(e){return i_(e)&&e!=+e}function ob(e){if(je(e))throw new Zt(f);return Fo(e)}function fb(e){return e===null}function sb(e){return e==null}function i_(e){return typeof e=="number"||rn(e)&&Mn(e)==Zr}function Ju(e){if(!rn(e)||Mn(e)!=ir)return!1;var r=fs(e);if(r===null)return!0;var a=mr.call(r,"constructor")&&r.constructor;return typeof a=="function"&&a instanceof a&&af.call(a)==Eo}var e0=Hl?qn(Hl):pc;function ub(e){return r_(e)&&e>=-Ze&&e<=Ze}var a_=yo?qn(yo):gs;function kc(e){return typeof e=="string"||!Jt(e)&&rn(e)&&Mn(e)==an}function Ai(e){return typeof e=="symbol"||rn(e)&&Mn(e)==E}var Is=zl?qn(zl):ji;function lb(e){return e===i}function cb(e){return rn(e)&&se(e)==dn}function hb(e){return rn(e)&&Mn(e)==zi}var db=An(Qa),vb=An(function(e,r){return e<=r});function o_(e){if(!e)return[];if(fi(e))return kc(e)?Gn(e):In(e);if(mi&&e[mi])return ql(e[mi]());var r=se(e),a=r==Fr?is:r==Jr?nf:Fs;return a(e)}function co(e){if(!e)return e===0?e:0;if(e=Ni(e),e===Me||e===-Me){var r=e<0?-1:1;return r*St}return e===e?e:0}function nr(e){var r=co(e),a=r%1;return r===r?a?r-a:r:0}function f_(e){return e?Za(nr(e),0,Wt):0}function Ni(e){if(typeof e=="number")return e;if(Ai(e))return $t;if(tn(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=tn(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=Zl(e);var a=kh.test(e);return a||Ph.test(e)?jf(e.slice(2),a?2:8):Wf.test(e)?$t:+e}function s_(e){return Ii(e,si(e))}function _b(e){return e?Za(nr(e),-Ze,Ze):e===0?e:0}function Rr(e){return e==null?"":Kn(e)}var pb=no(function(e,r){if(pt(r)||fi(r)){Ii(r,kn(r),e);return}for(var a in r)mr.call(r,a)&&df(e,a,r[a])}),u_=no(function(e,r){Ii(r,si(r),e)}),Nc=no(function(e,r,a,c){Ii(r,si(r),e,c)}),mb=no(function(e,r,a,c){Ii(r,kn(r),e,c)}),gb=Fi(_a);function yb(e,r){var a=Wa(e);return r==null?a:vf(a,r)}var xb=rr(function(e,r){e=Tr(e);var a=-1,c=r.length,_=c>2?r[2]:i;for(_&&oe(r[0],r[1],_)&&(c=1);++a<c;)for(var L=r[a],z=si(L),$=-1,ie=z.length;++$<ie;){var Fe=z[$],Ne=e[Fe];(Ne===i||ra(Ne,To[Fe])&&!mr.call(e,Fe))&&(e[Fe]=L[Fe])}return e}),bb=rr(function(e){return e.push(i,Tc),_n(l_,i,e)});function wb(e,r){return pi(e,Bt(r,3),ii)}function Sb(e,r){return pi(e,Bt(r,3),_f)}function Ab(e,r){return e==null?e:ms(e,Bt(r,3),si)}function Tb(e,r){return e==null?e:Iu(e,Bt(r,3),si)}function Eb(e,r){return e&&ii(e,Bt(r,3))}function Db(e,r){return e&&_f(e,Bt(r,3))}function Lb(e){return e==null?[]:pf(e,kn(e))}function Rb(e){return e==null?[]:pf(e,si(e))}function t0(e,r,a){var c=e==null?i:pa(e,r);return c===i?a:c}function Cb(e,r){return e!=null&&Pe(e,r,cc)}function r0(e,r){return e!=null&&Pe(e,r,hc)}var Ob=Ds(function(e,r,a){r!=null&&typeof r.toString!="function"&&(r=Un.call(r)),e[r]=a},i0(ui)),Mb=Ds(function(e,r,a){r!=null&&typeof r.toString!="function"&&(r=Un.call(r)),mr.call(e,r)?e[r].push(a):e[r]=[a]},Bt),Ib=rr(ja);function kn(e){return fi(e)?Ru(e):Qi(e)}function si(e){return fi(e)?Ru(e,!0):xf(e)}function Fb(e,r){var a={};return r=Bt(r,3),ii(e,function(c,_,L){$n(a,r(c,_,L),c)}),a}function kb(e,r){var a={};return r=Bt(r,3),ii(e,function(c,_,L){$n(a,_,r(c,_,L))}),a}var Nb=no(function(e,r,a){Ja(e,r,a)}),l_=no(function(e,r,a,c){Ja(e,r,a,c)}),Pb=Fi(function(e,r){var a={};if(e==null)return a;var c=!1;r=Br(r,function(L){return L=xi(L,e),c||(c=L.length>1),L}),Ii(e,Cs(e),a),c&&(a=Sn(a,p|U|q,Xd));for(var _=r.length;_--;)zu(a,r[_]);return a});function Bb(e,r){return c_(e,Ic(Bt(r)))}var Gb=Fi(function(e,r){return e==null?{}:Gu(e,r)});function c_(e,r){if(e==null)return{};var a=Br(Cs(e),function(c){return[c]});return r=Bt(r),eo(e,a,function(c,_){return r(c,_[0])})}function Ub(e,r,a){r=xi(r,e);var c=-1,_=r.length;for(_||(_=1,e=i);++c<_;){var L=e==null?i:e[Er(r[c])];L===i&&(c=_,L=a),e=lo(L)?L.call(e):L}return e}function Yb(e,r,a){return e==null?e:bf(e,r,a)}function Hb(e,r,a,c){return c=typeof c=="function"?c:i,e==null?e:bf(e,r,a,c)}var h_=Ac(kn),d_=Ac(si);function zb(e,r,a){var c=Jt(e),_=c||Wo(e)||Is(e);if(r=Bt(r,4),a==null){var L=e&&e.constructor;_?a=c?new L:[]:tn(e)?a=lo(L)?Wa(fs(e)):{}:a={}}return(_?wn:ii)(e,function(z,$,ie){return r(a,z,$,ie)}),a}function Wb(e,r){return e==null?!0:zu(e,r)}function Vb(e,r,a){return e==null?e:As(e,r,Yo(a))}function $b(e,r,a,c){return c=typeof c=="function"?c:i,e==null?e:As(e,r,Yo(a),c)}function Fs(e){return e==null?[]:rf(e,kn(e))}function Zb(e){return e==null?[]:rf(e,si(e))}function Xb(e,r,a){return a===i&&(a=r,r=i),a!==i&&(a=Ni(a),a=a===a?a:0),r!==i&&(r=Ni(r),r=r===r?r:0),Za(Ni(e),r,a)}function qb(e,r,a){return r=co(r),a===i?(a=r,r=0):a=co(a),e=Ni(e),ku(e,r,a)}function Kb(e,r,a){if(a&&typeof a!="boolean"&&oe(e,r,a)&&(r=a=i),a===i&&(typeof r=="boolean"?(a=r,r=i):typeof e=="boolean"&&(a=e,e=i)),e===i&&r===i?(e=0,r=1):(e=co(e),r===i?(r=e,e=0):r=co(r)),e>r){var c=e;e=r,r=c}if(a||e%1||r%1){var _=Tu();return Cn(e+_*(r-e+sa("1e-"+((_+"").length-1))),r)}return bs(e,r)}var jb=zo(function(e,r,a){return r=r.toLowerCase(),e+(a?v_(r):r)});function v_(e){return n0(Rr(e).toLowerCase())}function __(e){return e=Rr(e),e&&e.replace(Gh,vu).replace(td,"")}function Qb(e,r,a){e=Rr(e),r=Kn(r);var c=e.length;a=a===i?c:Za(nr(a),0,c);var _=a;return a-=r.length,a>=0&&e.slice(a,_)==r}function Jb(e){return e=Rr(e),e&&V.test(e)?e.replace(ye,_u):e}function ew(e){return e=Rr(e),e&&hr.test(e)?e.replace(kr,"\\$&"):e}var tw=zo(function(e,r,a){return e+(a?"-":"")+r.toLowerCase()}),rw=zo(function(e,r,a){return e+(a?" ":"")+r.toLowerCase()}),nw=Xu("toLowerCase");function iw(e,r,a){e=Rr(e),r=nr(r);var c=r?ca(e):0;if(!r||c>=r)return e;var _=(r-c)/2;return Hr(Do(_),a)+e+Hr(ss(_),a)}function aw(e,r,a){e=Rr(e),r=nr(r);var c=r?ca(e):0;return r&&c<r?e+Hr(r-c,a):e}function ow(e,r,a){e=Rr(e),r=nr(r);var c=r?ca(e):0;return r&&c<r?Hr(r-c,a)+e:e}function fw(e,r,a){return a||r==null?r=0:r&&(r=+r),ls(Rr(e).replace(Yr,""),r||0)}function sw(e,r,a){return(a?oe(e,r,a):r===i)?r=1:r=nr(r),ws(Rr(e),r)}function uw(){var e=arguments,r=Rr(e[0]);return e.length<3?r:r.replace(e[1],e[2])}var lw=zo(function(e,r,a){return e+(a?"_":"")+r.toLowerCase()});function cw(e,r,a){return a&&typeof a!="number"&&oe(e,r,a)&&(r=a=i),a=a===i?Wt:a>>>0,a?(e=Rr(e),e&&(typeof r=="string"||r!=null&&!e0(r))&&(r=Kn(r),!r&&Ga(e))?bi(Gn(e),0,a):e.split(r,a)):[]}var hw=zo(function(e,r,a){return e+(a?" ":"")+n0(r)});function dw(e,r,a){return e=Rr(e),a=a==null?0:Za(nr(a),0,e.length),r=Kn(r),e.slice(a,a+r.length)==r}function vw(e,r,a){var c=S.templateSettings;a&&oe(e,r,a)&&(r=i),e=Rr(e),r=Nc({},r,c,ju);var _=Nc({},r.imports,c.imports,ju),L=kn(_),z=rf(_,L),$,ie,Fe=0,Ne=r.interpolate||Vf,ze="__p += '",vt=bu((r.escape||Vf).source+"|"+Ne.source+"|"+(Ne===at?_i:Vf).source+"|"+(r.evaluate||Vf).source+"|$","g"),Rt="//# sourceURL="+(mr.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Kf+"]")+`
|
|
20
|
+
`;e.replace(vt,function(Ht,vr,gr,Ti,Qn,Ei){return gr||(gr=Ti),ze+=e.slice(Fe,Ei).replace(Uh,pu),vr&&($=!0,ze+=`' +
|
|
21
|
+
__e(`+vr+`) +
|
|
22
|
+
'`),Qn&&(ie=!0,ze+=`';
|
|
23
|
+
`+Qn+`;
|
|
24
|
+
__p += '`),gr&&(ze+=`' +
|
|
25
|
+
((__t = (`+gr+`)) == null ? '' : __t) +
|
|
26
|
+
'`),Fe=Ei+Ht.length,Ht}),ze+=`';
|
|
27
|
+
`;var Yt=mr.call(r,"variable")&&r.variable;if(!Yt)ze=`with (obj) {
|
|
28
|
+
`+ze+`
|
|
29
|
+
}
|
|
30
|
+
`;else if(Wn.test(Yt))throw new Zt(d);ze=(ie?ze.replace(He,""):ze).replace(Pt,"$1").replace(l,"$1;"),ze="function("+(Yt||"obj")+`) {
|
|
31
|
+
`+(Yt?"":`obj || (obj = {});
|
|
32
|
+
`)+"var __t, __p = ''"+($?", __e = _.escape":"")+(ie?`, __j = Array.prototype.join;
|
|
33
|
+
function print() { __p += __j.call(arguments, '') }
|
|
34
|
+
`:`;
|
|
35
|
+
`)+ze+`return __p
|
|
36
|
+
}`;var ar=m_(function(){return pr(L,Rt+"return "+ze).apply(i,z)});if(ar.source=ze,Jd(ar))throw ar;return ar}function _w(e){return Rr(e).toLowerCase()}function pw(e){return Rr(e).toUpperCase()}function mw(e,r,a){if(e=Rr(e),e&&(a||r===i))return Zl(e);if(!e||!(r=Kn(r)))return e;var c=Gn(e),_=Gn(r),L=rs(c,_),z=ns(c,_)+1;return bi(c,L,z).join("")}function gw(e,r,a){if(e=Rr(e),e&&(a||r===i))return e.slice(0,jl(e)+1);if(!e||!(r=Kn(r)))return e;var c=Gn(e),_=ns(c,Gn(r))+1;return bi(c,0,_).join("")}function yw(e,r,a){if(e=Rr(e),e&&(a||r===i))return e.replace(Yr,"");if(!e||!(r=Kn(r)))return e;var c=Gn(e),_=rs(c,Gn(r));return bi(c,_).join("")}function xw(e,r){var a=lt,c=it;if(tn(r)){var _="separator"in r?r.separator:_;a="length"in r?nr(r.length):a,c="omission"in r?Kn(r.omission):c}e=Rr(e);var L=e.length;if(Ga(e)){var z=Gn(e);L=z.length}if(a>=L)return e;var $=a-ca(c);if($<1)return c;var ie=z?bi(z,0,$).join(""):e.slice(0,$);if(_===i)return ie+c;if(z&&($+=ie.length-$),e0(_)){if(e.slice($).search(_)){var Fe,Ne=ie;for(_.global||(_=bu(_.source,Rr(Xn.exec(_))+"g")),_.lastIndex=0;Fe=_.exec(Ne);)var ze=Fe.index;ie=ie.slice(0,ze===i?$:ze)}}else if(e.indexOf(Kn(_),$)!=$){var vt=ie.lastIndexOf(_);vt>-1&&(ie=ie.slice(0,vt))}return ie+c}function bw(e){return e=Rr(e),e&&w.test(e)?e.replace(de,ud):e}var ww=zo(function(e,r,a){return e+(a?" ":"")+r.toUpperCase()}),n0=Xu("toUpperCase");function p_(e,r,a){return e=Rr(e),r=a?i:r,r===i?Xl(e)?cd(e):fd(e):e.match(r)||[]}var m_=rr(function(e,r){try{return _n(e,i,r)}catch(a){return Jd(a)?a:new Zt(a)}}),Sw=Fi(function(e,r){return wn(r,function(a){a=Er(a),$n(e,a,jd(e[a],e))}),e});function Aw(e){var r=e==null?0:e.length,a=Bt();return e=r?Br(e,function(c){if(typeof c[1]!="function")throw new ri(u);return[a(c[0]),c[1]]}):[],rr(function(c){for(var _=-1;++_<r;){var L=e[_];if(_n(L[0],this,c))return _n(L[1],this,c)}})}function Tw(e){return uc(Sn(e,p))}function i0(e){return function(){return e}}function Ew(e,r){return e==null||e!==e?r:e}var Dw=Ji(),Lw=Ji(!0);function ui(e){return e}function a0(e){return ko(typeof e=="function"?e:Sn(e,p))}function Rw(e){return ga(Sn(e,p))}function Cw(e,r){return ya(e,Sn(r,p))}var Ow=rr(function(e,r){return function(a){return ja(a,e,r)}}),Mw=rr(function(e,r){return function(a){return ja(e,a,r)}});function o0(e,r,a){var c=kn(r),_=pf(r,c);a==null&&!(tn(r)&&(_.length||!c.length))&&(a=r,r=e,e=this,_=pf(r,kn(r)));var L=!(tn(a)&&"chain"in a)||!!a.chain,z=lo(e);return wn(_,function($){var ie=r[$];e[$]=ie,z&&(e.prototype[$]=function(){var Fe=this.__chain__;if(L||Fe){var Ne=e(this.__wrapped__),ze=Ne.__actions__=In(this.__actions__);return ze.push({func:ie,args:arguments,thisArg:e}),Ne.__chain__=Fe,Ne}return ie.apply(e,Vi([this.value()],arguments))})}),e}function Iw(){return bn._===this&&(bn._=Ql),this}function f0(){}function Fw(e){return e=nr(e),rr(function(r){return No(r,e)})}var kw=Ls(Br),Nw=Ls(ua),Pw=Ls(Jf);function g_(e){return Oe(e)?Ba(Er(e)):Po(e)}function Bw(e){return function(r){return e==null?i:pa(e,r)}}var Gw=zr(),Uw=zr(!0);function s0(){return[]}function u0(){return!1}function Yw(){return{}}function Hw(){return""}function zw(){return!0}function Ww(e,r){if(e=nr(e),e<1||e>Ze)return[];var a=Wt,c=Cn(e,Wt);r=Bt(r),e-=Wt;for(var _=du(c,r);++a<e;)r(a);return _}function Vw(e){return Jt(e)?Br(e,Er):Ai(e)?[e]:In(Xt(Rr(e)))}function $w(e){var r=++_d;return Rr(e)+r}var Zw=ao(function(e,r){return e+r},0),Xw=Ku("ceil"),qw=ao(function(e,r){return e/r},1),Kw=Ku("floor");function jw(e){return e&&e.length?Ka(e,ui,mf):i}function Qw(e,r){return e&&e.length?Ka(e,Bt(r,2),mf):i}function Jw(e){return tf(e,ui)}function e2(e,r){return tf(e,Bt(r,2))}function t2(e){return e&&e.length?Ka(e,ui,Qa):i}function r2(e,r){return e&&e.length?Ka(e,Bt(r,2),Qa):i}var n2=ao(function(e,r){return e*r},1),i2=Ku("round"),a2=ao(function(e,r){return e-r},0);function o2(e){return e&&e.length?ts(e,ui):0}function f2(e,r){return e&&e.length?ts(e,Bt(r,2)):0}return S.after=Rx,S.ary=qv,S.assign=pb,S.assignIn=u_,S.assignInWith=Nc,S.assignWith=mb,S.at=gb,S.before=Kv,S.bind=jd,S.bindAll=Sw,S.bindKey=jv,S.castArray=Yx,S.chain=$v,S.chunk=en,S.compact=un,S.concat=mn,S.cond=Aw,S.conforms=Tw,S.constant=i0,S.countBy=ox,S.create=yb,S.curry=Qv,S.curryRight=Jv,S.debounce=e_,S.defaults=xb,S.defaultsDeep=bb,S.defer=Cx,S.delay=Ox,S.difference=Wr,S.differenceBy=Ut,S.differenceWith=gn,S.drop=cr,S.dropRight=At,S.dropRightWhile=qt,S.dropWhile=er,S.fill=Vr,S.filter=sx,S.flatMap=cx,S.flatMapDeep=hx,S.flatMapDepth=dx,S.flatten=k,S.flattenDeep=ue,S.flattenDepth=ne,S.flip=Mx,S.flow=Dw,S.flowRight=Lw,S.fromPairs=st,S.functions=Lb,S.functionsIn=Rb,S.groupBy=vx,S.initial=y,S.intersection=H,S.intersectionBy=j,S.intersectionWith=Q,S.invert=Ob,S.invertBy=Mb,S.invokeMap=px,S.iteratee=a0,S.keyBy=mx,S.keys=kn,S.keysIn=si,S.map=Cc,S.mapKeys=Fb,S.mapValues=kb,S.matches=Rw,S.matchesProperty=Cw,S.memoize=Mc,S.merge=Nb,S.mergeWith=l_,S.method=Ow,S.methodOf=Mw,S.mixin=o0,S.negate=Ic,S.nthArg=Fw,S.omit=Pb,S.omitBy=Bb,S.once=Ix,S.orderBy=gx,S.over=kw,S.overArgs=Fx,S.overEvery=Nw,S.overSome=Pw,S.partial=Qd,S.partialRight=t_,S.partition=yx,S.pick=Gb,S.pickBy=c_,S.property=g_,S.propertyOf=Bw,S.pull=P,S.pullAll=I,S.pullAllBy=re,S.pullAllWith=ee,S.pullAt=_e,S.range=Gw,S.rangeRight=Uw,S.rearg=kx,S.reject=wx,S.remove=be,S.rest=Nx,S.reverse=Ye,S.sampleSize=Ax,S.set=Yb,S.setWith=Hb,S.shuffle=Tx,S.slice=Dt,S.sortBy=Lx,S.sortedUniq=Tt,S.sortedUniqBy=dr,S.split=cw,S.spread=Px,S.tail=yn,S.take=fo,S.takeRight=ta,S.takeRightWhile=ki,S.takeWhile=Aa,S.tap=jy,S.throttle=Bx,S.thru=Rc,S.toArray=o_,S.toPairs=h_,S.toPairsIn=d_,S.toPath=Vw,S.toPlainObject=s_,S.transform=zb,S.unary=Gx,S.union=so,S.unionBy=Dc,S.unionWith=jn,S.uniq=uo,S.uniqBy=oi,S.uniqWith=Lc,S.unset=Wb,S.unzip=Fn,S.unzipWith=Cf,S.update=Vb,S.updateWith=$b,S.values=Fs,S.valuesIn=Zb,S.without=Ms,S.words=p_,S.wrap=Ux,S.xor=Wy,S.xorBy=Vy,S.xorWith=$y,S.zip=Zy,S.zipObject=Xy,S.zipObjectDeep=qy,S.zipWith=Ky,S.entries=h_,S.entriesIn=d_,S.extend=u_,S.extendWith=Nc,o0(S,S),S.add=Zw,S.attempt=m_,S.camelCase=jb,S.capitalize=v_,S.ceil=Xw,S.clamp=Xb,S.clone=Hx,S.cloneDeep=Wx,S.cloneDeepWith=Vx,S.cloneWith=zx,S.conformsTo=$x,S.deburr=__,S.defaultTo=Ew,S.divide=qw,S.endsWith=Qb,S.eq=ra,S.escape=Jb,S.escapeRegExp=ew,S.every=fx,S.find=ux,S.findIndex=Si,S.findKey=wb,S.findLast=lx,S.findLastIndex=Sa,S.findLastKey=Sb,S.floor=Kw,S.forEach=Zv,S.forEachRight=Xv,S.forIn=Ab,S.forInRight=Tb,S.forOwn=Eb,S.forOwnRight=Db,S.get=t0,S.gt=Zx,S.gte=Xx,S.has=Cb,S.hasIn=r0,S.head=zt,S.identity=ui,S.includes=_x,S.indexOf=R,S.inRange=qb,S.invoke=Ib,S.isArguments=Of,S.isArray=Jt,S.isArrayBuffer=qx,S.isArrayLike=fi,S.isArrayLikeObject=ln,S.isBoolean=Kx,S.isBuffer=Wo,S.isDate=jx,S.isElement=Qx,S.isEmpty=Jx,S.isEqual=eb,S.isEqualWith=tb,S.isError=Jd,S.isFinite=rb,S.isFunction=lo,S.isInteger=r_,S.isLength=Fc,S.isMap=n_,S.isMatch=nb,S.isMatchWith=ib,S.isNaN=ab,S.isNative=ob,S.isNil=sb,S.isNull=fb,S.isNumber=i_,S.isObject=tn,S.isObjectLike=rn,S.isPlainObject=Ju,S.isRegExp=e0,S.isSafeInteger=ub,S.isSet=a_,S.isString=kc,S.isSymbol=Ai,S.isTypedArray=Is,S.isUndefined=lb,S.isWeakMap=cb,S.isWeakSet=hb,S.join=W,S.kebabCase=tw,S.last=Y,S.lastIndexOf=X,S.lowerCase=rw,S.lowerFirst=nw,S.lt=db,S.lte=vb,S.max=jw,S.maxBy=Qw,S.mean=Jw,S.meanBy=e2,S.min=t2,S.minBy=r2,S.stubArray=s0,S.stubFalse=u0,S.stubObject=Yw,S.stubString=Hw,S.stubTrue=zw,S.multiply=n2,S.nth=O,S.noConflict=Iw,S.noop=f0,S.now=Oc,S.pad=iw,S.padEnd=aw,S.padStart=ow,S.parseInt=fw,S.random=Kb,S.reduce=xx,S.reduceRight=bx,S.repeat=sw,S.replace=uw,S.result=Ub,S.round=i2,S.runInContext=te,S.sample=Sx,S.size=Ex,S.snakeCase=lw,S.some=Dx,S.sortedIndex=yt,S.sortedIndexBy=ot,S.sortedIndexOf=Ae,S.sortedLastIndex=he,S.sortedLastIndexBy=ht,S.sortedLastIndexOf=ct,S.startCase=hw,S.startsWith=dw,S.subtract=a2,S.sum=o2,S.sumBy=f2,S.template=vw,S.times=Ww,S.toFinite=co,S.toInteger=nr,S.toLength=f_,S.toLower=_w,S.toNumber=Ni,S.toSafeInteger=_b,S.toString=Rr,S.toUpper=pw,S.trim=mw,S.trimEnd=gw,S.trimStart=yw,S.truncate=xw,S.unescape=bw,S.uniqueId=$w,S.upperCase=ww,S.upperFirst=n0,S.each=Zv,S.eachRight=Xv,S.first=zt,o0(S,function(){var e={};return ii(S,function(r,a){mr.call(S.prototype,a)||(e[a]=r)}),e}(),{chain:!1}),S.VERSION=o,wn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){S[e].placeholder=S}),wn(["drop","take"],function(e,r){lr.prototype[e]=function(a){a=a===i?1:Xr(nr(a),0);var c=this.__filtered__&&!r?new lr(this):this.clone();return c.__filtered__?c.__takeCount__=Cn(a,c.__takeCount__):c.__views__.push({size:Cn(a,Wt),type:e+(c.__dir__<0?"Right":"")}),c},lr.prototype[e+"Right"]=function(a){return this.reverse()[e](a).reverse()}}),wn(["filter","map","takeWhile"],function(e,r){var a=r+1,c=a==Re||a==xt;lr.prototype[e]=function(_){var L=this.clone();return L.__iteratees__.push({iteratee:Bt(_,3),type:a}),L.__filtered__=L.__filtered__||c,L}}),wn(["head","last"],function(e,r){var a="take"+(r?"Right":"");lr.prototype[e]=function(){return this[a](1).value()[0]}}),wn(["initial","tail"],function(e,r){var a="drop"+(r?"":"Right");lr.prototype[e]=function(){return this.__filtered__?new lr(this):this[a](1)}}),lr.prototype.compact=function(){return this.filter(ui)},lr.prototype.find=function(e){return this.filter(e).head()},lr.prototype.findLast=function(e){return this.reverse().find(e)},lr.prototype.invokeMap=rr(function(e,r){return typeof e=="function"?new lr(this):this.map(function(a){return ja(a,e,r)})}),lr.prototype.reject=function(e){return this.filter(Ic(Bt(e)))},lr.prototype.slice=function(e,r){e=nr(e);var a=this;return a.__filtered__&&(e>0||r<0)?new lr(a):(e<0?a=a.takeRight(-e):e&&(a=a.drop(e)),r!==i&&(r=nr(r),a=r<0?a.dropRight(-r):a.take(r-e)),a)},lr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},lr.prototype.toArray=function(){return this.take(Wt)},ii(lr.prototype,function(e,r){var a=/^(?:filter|find|map|reject)|While$/.test(r),c=/^(?:head|last)$/.test(r),_=S[c?"take"+(r=="last"?"Right":""):r],L=c||/^find/.test(r);!_||(S.prototype[r]=function(){var z=this.__wrapped__,$=c?[1]:arguments,ie=z instanceof lr,Fe=$[0],Ne=ie||Jt(z),ze=function(vr){var gr=_.apply(S,Vi([vr],$));return c&&vt?gr[0]:gr};Ne&&a&&typeof Fe=="function"&&Fe.length!=1&&(ie=Ne=!1);var vt=this.__chain__,Rt=!!this.__actions__.length,Yt=L&&!vt,ar=ie&&!Rt;if(!L&&Ne){z=ar?z:new lr(this);var Ht=e.apply(z,$);return Ht.__actions__.push({func:Rc,args:[ze],thisArg:i}),new ni(Ht,vt)}return Yt&&ar?e.apply(this,$):(Ht=this.thru(ze),Yt?c?Ht.value()[0]:Ht.value():Ht)})}),wn(["pop","push","shift","sort","splice","unshift"],function(e){var r=as[e],a=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",c=/^(?:pop|shift)$/.test(e);S.prototype[e]=function(){var _=arguments;if(c&&!this.__chain__){var L=this.value();return r.apply(Jt(L)?L:[],_)}return this[a](function(z){return r.apply(Jt(z)?z:[],_)})}}),ii(lr.prototype,function(e,r){var a=S[r];if(a){var c=a.name+"";mr.call(On,c)||(On[c]=[]),On[c].push({name:r,func:a})}}),On[Rf(i,x).name]=[{name:"wrapper",func:i}],lr.prototype.clone=wd,lr.prototype.reverse=Sd,lr.prototype.value=Ad,S.prototype.at=Qy,S.prototype.chain=Jy,S.prototype.commit=ex,S.prototype.next=tx,S.prototype.plant=nx,S.prototype.reverse=ix,S.prototype.toJSON=S.prototype.valueOf=S.prototype.value=ax,S.prototype.first=S.prototype.head,mi&&(S.prototype[mi]=rx),S},Ao=hd();Na?((Na.exports=Ao)._=Ao,fu._=Ao):bn._=Ao}).call(Uf)})(Yf,Yf.exports);const Zs=Yf.exports,ph={normal:["FC6310R","FC6310"],infrared:["M3T"],multispectral:["FC6360"]};var ei=63710088e-1,sv={centimeters:ei*100,centimetres:ei*100,degrees:ei/111325,feet:ei*3.28084,inches:ei*39.37,kilometers:ei/1e3,kilometres:ei/1e3,meters:ei,metres:ei,miles:ei/1609.344,millimeters:ei*1e3,millimetres:ei*1e3,nauticalmiles:ei/1852,radians:1,yards:ei*1.0936};function kg(t,n,i){i===void 0&&(i={});var o={type:"Feature"};return(i.id===0||i.id)&&(o.id=i.id),i.bbox&&(o.bbox=i.bbox),o.properties=n||{},o.geometry=t,o}function Ng(t,n,i){if(i===void 0&&(i={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!uv(t[0])||!uv(t[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:t};return kg(o,n,i)}function Pg(t,n){n===void 0&&(n="kilometers");var i=sv[n];if(!i)throw new Error(n+" units is invalid");return t*i}function Bg(t,n){n===void 0&&(n="kilometers");var i=sv[n];if(!i)throw new Error(n+" units is invalid");return t/i}function mh(t){var n=t%(2*Math.PI);return n*180/Math.PI}function Yi(t){var n=t%360;return n*Math.PI/180}function uv(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function Xs(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Gg(t,n){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function lv(t,n,i){i===void 0&&(i={});var o=Xs(t),s=Xs(n),f=Yi(s[1]-o[1]),u=Yi(s[0]-o[0]),d=Yi(o[1]),v=Yi(s[1]),M=Math.pow(Math.sin(f/2),2)+Math.pow(Math.sin(u/2),2)*Math.cos(d)*Math.cos(v);return Pg(2*Math.atan2(Math.sqrt(M),Math.sqrt(1-M)),i.units)}function Ug(t,n,i,o){o===void 0&&(o={});var s=Xs(t),f=Yi(s[0]),u=Yi(s[1]),d=Yi(i),v=Bg(n,o.units),M=Math.asin(Math.sin(u)*Math.cos(v)+Math.cos(u)*Math.sin(v)*Math.cos(d)),B=f+Math.atan2(Math.sin(d)*Math.sin(v)*Math.cos(u),Math.cos(v)-Math.sin(u)*Math.sin(M)),p=mh(B),U=mh(M);return Ng([p,U],o.properties)}function cv(t,n,i){if(i===void 0&&(i={}),i.final===!0)return Yg(t,n);var o=Xs(t),s=Xs(n),f=Yi(o[0]),u=Yi(s[0]),d=Yi(o[1]),v=Yi(s[1]),M=Math.sin(u-f)*Math.cos(v),B=Math.cos(d)*Math.sin(v)-Math.sin(d)*Math.cos(v)*Math.cos(u-f);return mh(Math.atan2(M,B))}function Yg(t,n){var i=cv(n,t);return i=(i+180)%360,i}function Hg(t,n){var i=lv(t,n),o=cv(t,n),s=Ug(t,i/2,o);return s}function zg(){return I_()}function Wg(t){return t?_t().format("YYYY-MM-DD HH:mm:ss"):"-"}function Vg(){return _t().format("YYYY/M/D HH:mm:ss")}function $g(t){return t=parseInt(t),t=t.toString(),t.length>6?(t=(Number(t)/1e6).toFixed(2),t+" MB"):(t=(Number(t)/1e3).toFixed(2),t+" KB")}async function Zg(t){let n=t.slice(0,65536);n.name=t.name;let i=await Bc(n),{GPSAltitude:o,GPSLatitude:s,GPSLatitudeRef:f,GPSLongitude:u,GPSLongitudeRef:d,DateTimeOriginal:v,Model:M}=i;return!u||!s?{}:{date:v.split(" ")[0].replaceAll(":","-"),Model:M,position:{lng:gh(d)*yh(u),lat:gh(f)*yh(s),alt:+o}}}function Xg(t){return new Promise((n,i)=>{let o,s,f=t.slice(0,65536);f.name=t.name,Bc(f).then(M=>{s=M,v()});let u=new FileReader,d=new Fg.ArrayBuffer;u.readAsArrayBuffer(f),u.onload=M=>{d.append(M.target.result),o=d.end(),v()};function v(){!o||!s||(n({md5:o,exif:s}),u=null,d=null)}})}function gh(t){return t==="N"||t==="E"?1:-1}function yh(t){return t[0]+t[1]/60+t[2]/3600}function qg(t,n=[]){t=hv(t),n=hv(n);let i=[];for(let o of t){let{visible:s}=o;for(let f of o.items||[]){let{id:u,type:d,opacity:v,visible:M,color:B,geometry:p}=f;if(s||(M=!1),["point","line","polygon"].includes(d)&&i.find(pe=>pe[0]==="updateAnnotations"))continue;let U=Al(u,n);if(!U&&!M)continue;if(!U){["point","line","polygon"].includes(d)?i.push(["updateAnnotations",f]):i.push(["addLayer",f]);continue}let{opacity:q,visible:D}=U;Zs.isEqual(f,U)||(["point","line","polygon"].includes(d)&&i.push(["updateAnnotations",f]),v!==q?i.push(["updateLayer",f]):M!==D&&i.push([M?"addLayer":"removeLayer",f]))}}for(let o of n)for(let s of o.items||[]){let{id:f,type:u}=s;Al(f,t)||(["point","line","polygon"].includes(u)?i.find(v=>v[0]==="updateAnnotations")||i.push(["updateAnnotations",s]):i.push(["removeLayer",s]))}return i}function Al(t,n){var i;for(let o of n){if(o.id===t)return o;if((i=o.items)!=null&&i.length){let s=Al(t,o.items);if(s)return s}}return null}function hv(t){let n=Zs.cloneDeep(t);for(let i of n)for(let o of i.items||[])i.visible||(o.visible=!1);return n}function Kg(t,n){let i=t.style._layers,o=t.style.order,{layerType:s}=n.metadata;return o.find(d=>{let v=i[d].metadata;return Zs.isEmpty(v)&&(v={layerType:"dsm"}),u(s,n.id)<u(v.layerType,d)})||"";function u(d,v){const M=[["bmap"],["dom"],["ndvi"],["dsm"],["circle"],["annotation"],["label"]];let B=-1;return v.startsWith("gl-draw")?B=5:B=M.findIndex(p=>p.includes(d)),B===-1?100:B}}function jg(t){if(!t)return!1;let{message:n="",msg:i=""}=t.data;return t.status==401&&(i.toLowerCase().includes("expired")||n.toLowerCase().includes("expired"))}function Qg(t){for(let n in ph)if(ph[n].includes(t))return n;return"normal"}function Jg(t){let n=`\u5FEB\u7167${_t().format("YYYYMMDD")}${new Date().getTime()}.png`,i=document.createElement("a");i.href=t,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i)}function ey(t){let n=Gg(t);return["Point","MultiPoint"].includes(n)?"point":["LineString","MultiLineString"].includes(n)?"line":"polygon"}function ty(t){let n=t[3]>128?0:1,i=-1*(1-n)+n,o=Math.floor((t[3]+.1)%128)*2+Math.floor((t[2]+.1)/128)-127,s=t[0]+t[1]*256+Math.floor((t[2]+.1)%128)*256*256;return i*(1+s/8388607)*Math.pow(2,o)}function ry(t){let{geometry:n}=t,i=Zs.cloneDeep(t);return delete i.geometry,{id:i.id,type:"Feature",properties:i,geometry:Zs.cloneDeep(n)}}function ny(t,n){let i=[],o=n==="point"?"\u70B9\u6CE8\u8BB0":n==="line"?"\u7EBF\u6CE8\u8BB0":"\u9762\u6CE8\u8BB0";t.forEach(s=>{if(s.name===o){i.push(0);return}if(s.name.startsWith(`${o} `)){let f=Number(s.name.split(" ").pop());Number.isNaN(f)||i.push(f)}}),i=i.sort((s,f)=>s-f);for(let s=0;s<i.length;s++)if(i[s]!==s)return s===0?o:`${o} ${s}`;return i.length===0?o:`${o} ${i.length}`}function iy(t){let n=t.geometry.coordinates,i=[];for(let v=1;v<n.length;v++)lv(n[v-1],n[v],{units:"meters"})>30&&i.push([n[v-1],n[v]]);let o=[];if(i.length){let v=Math.floor(i.length/2);o=i[v]}else{let v=Math.floor(n.length/2-1);o=[n[v],n[v+1]]}let s=xh(o[0]),f=xh(o[1]),u=360-Math.atan((s.y-f.y)/(f.x-s.x))*180/Math.PI,d=Hg(o[0],o[1]);return d.properties=t.properties,d.properties.angle=u,d.geometry.coordinates.push(((o[0][2]||0)+(o[1][2]||0))/2),d}function xh(t,n=12){let[i,o]=t,s=(180+i)/360,f=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360;return{x:s*Math.pow(2,n)*512,y:f*Math.pow(2,n)*512}}function ay(t,n){n.forEach(i=>{t.loadImage(i,(o,s)=>{let f=i.split("/").pop().split(".")[0];if(!t.hasImage(f)){if(o)throw o;t.addImage(f,s)}})})}let mo=null;function dv(t,n,i){i[t]=i[t]||[],i[t].push(n)}function bh(t,n,i){if(i&&i[t]){const o=i[t].indexOf(n);o!==-1&&i[t].splice(o,1)}}function vv(t,...n){for(const i of n)for(const o in i)t[o]=i[o];return t}function oy(t,n){return t.indexOf(n,t.length-n.length)!==-1}class fy{constructor(){this._listeners=[],this._oneTimeListeners=[],this._eventedParent=null,this._eventedParentData=null}on(n,i){return this._listeners=this._listeners||{},dv(n,i,this._listeners),this}off(n,i){if(!i){this._listeners={},this._oneTimeListeners={};return}return bh(n,i,this._listeners),bh(n,i,this._oneTimeListeners),this}once(n,i){return this._oneTimeListeners=this._oneTimeListeners||{},dv(n,i,this._oneTimeListeners),this}fire(n,i){if(this.listens(n)){if(i=vv({},i,{type:n,target:this}),mo){if(i.point&&mo===i.point.x+i.point.y){if(mo===i.point.x+i.point.y)return;mo=i.point.x+i.point.y}else if(i.feature){if(mo===i.x+i.y)return;mo=i.x+i.y}}else i.point?mo=i.point.x+i.point.y:i.feature&&(mo=i.x+i.y);const o=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let f=0;f<o.length;f++)o[f].call(this,i);const s=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let f=0;f<s.length;f++)s[f].call(this,i),bh(n,s[f],this._oneTimeListeners);this._eventedParent&&this._eventedParent.fire(n,vv({},i,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData))}else oy(n,"error")&&console.error(i&&i.error||i||"Empty error event");return this}listens(n){return this._listeners&&this._listeners[n]&&this._listeners[n].length>0||this._oneTimeListeners&&this._oneTimeListeners[n]&&this._oneTimeListeners[n].length>0||this._eventedParent&&this._eventedParent.listens(n)}setEventedParent(n,i){return this._eventedParent=n,this._eventedParentData=i,this}}const sy={tileFormat:"float32",tileSize:256,colorScale:[],sentinelValues:[],transitions:!1,transitionTimeMs:800,debug:!1,extraPixelLayers:0,colorscaleMaxLength:16,sentinelMaxLength:16,minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,glOperation:"none",multiLayers:0,operationUrlA:"",operationUrlB:"",operationUrlC:"",operationUrlD:"",operationUrlE:"",operationUrlF:"",filterLowA:0,filterHighA:1e5,filterLowB:0,filterHighB:1e5,filterLowC:0,filterHighC:1e5,filterLowD:0,filterHighD:1e5,filterLowE:0,filterHighE:1e5,filterLowF:0,filterHighF:1e5,multiplierA:1,multiplierB:1,multiplierC:1,multiplierD:1,multiplierE:1,multiplierF:1,hillshadeType:"none",hsSimpleZoomdelta:0,hsSimpleSlopescale:3,hsSimpleAzimuth:315,hsSimpleAltitude:70,hsAdvValueScale:1,hsAdvPixelScale:"auto",hsAdvSoftIterations:10,hsAdvAmbientIterations:10,hsAdvSunRadiusMultiplier:100,hsAdvFinalSoftMultiplier:1,hsAdvFinalAmbientMultiplier:.25,hsAdvBaselayerUrl:"",hsAdvSmoothInput:!1,hsAdvSmoothInputKernel:3,hsPregenUrl:"",_hillshadeOptions:{hillshadeType:"none"},contourType:"none",contourSmoothLines:!1,contourSmoothInput:!1,contourSmoothInputKernel:7,contourScaleFactor:1,contourInterval:25,contourIndexInterval:100,contourLineColor:"#000000",contourIlluminatedHighlightColor:"rgba(177,174,164,.5)",contourIlluminatedShadowColor:"#5b5143",contourIlluminatedShadowSize:2,contourLineWeight:.5,contourLineIndexWeight:2,contourIndexLabels:!1,contourLabelFont:"12px Arial",contourLabelDistance:250,contourHypso:!1,contourHypsoDomain:[0,1e3,2e3],contourHypsoColors:["#486341","#e5d9c9","#dddddd"],contourBathy:!1,contourBathyDomain:[-2e3,0],contourBathyColors:["#315d9b","#d5f2ff"],contourBathyShadowColor:"#4e5c66",contourBathyHighlightColor:"rgba(224, 242, 255, .5)"};function uy(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var wh={exports:{}},Sh={},_v;function go(){return _v||(_v=1,function(t){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function i(f,u){return Object.prototype.hasOwnProperty.call(f,u)}t.assign=function(f){for(var u=Array.prototype.slice.call(arguments,1);u.length;){var d=u.shift();if(!!d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var v in d)i(d,v)&&(f[v]=d[v])}}return f},t.shrinkBuf=function(f,u){return f.length===u?f:f.subarray?f.subarray(0,u):(f.length=u,f)};var o={arraySet:function(f,u,d,v,M){if(u.subarray&&f.subarray){f.set(u.subarray(d,d+v),M);return}for(var B=0;B<v;B++)f[M+B]=u[d+B]},flattenChunks:function(f){var u,d,v,M,B,p;for(v=0,u=0,d=f.length;u<d;u++)v+=f[u].length;for(p=new Uint8Array(v),M=0,u=0,d=f.length;u<d;u++)B=f[u],p.set(B,M),M+=B.length;return p}},s={arraySet:function(f,u,d,v,M){for(var B=0;B<v;B++)f[M+B]=u[d+B]},flattenChunks:function(f){return[].concat.apply([],f)}};t.setTyped=function(f){f?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,o)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,s))},t.setTyped(n)}(Sh)),Sh}var Hf={},Hi={},qo={},pv;function ly(){if(pv)return qo;pv=1;var t=go(),n=4,i=0,o=1,s=2;function f(C){for(var Ue=C.length;--Ue>=0;)C[Ue]=0}var u=0,d=1,v=2,M=3,B=258,p=29,U=256,q=U+1+p,D=30,pe=19,le=2*q+1,x=15,A=16,g=7,b=256,N=16,F=17,J=18,Te=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],nt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],lt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],it=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ft=512,tt=new Array((q+2)*2);f(tt);var Re=new Array(D*2);f(Re);var Ot=new Array(ft);f(Ot);var xt=new Array(B-M+1);f(xt);var Me=new Array(p);f(Me);var Ze=new Array(D);f(Ze);function St(C,Ue,Xe,dt,Z){this.static_tree=C,this.extra_bits=Ue,this.extra_base=Xe,this.elems=dt,this.max_length=Z,this.has_stree=C&&C.length}var $t,Wt,Qt;function or(C,Ue){this.dyn_tree=C,this.max_code=0,this.stat_desc=Ue}function xr(C){return C<256?Ot[C]:Ot[256+(C>>>7)]}function sr(C,Ue){C.pending_buf[C.pending++]=Ue&255,C.pending_buf[C.pending++]=Ue>>>8&255}function Kt(C,Ue,Xe){C.bi_valid>A-Xe?(C.bi_buf|=Ue<<C.bi_valid&65535,sr(C,C.bi_buf),C.bi_buf=Ue>>A-C.bi_valid,C.bi_valid+=Xe-A):(C.bi_buf|=Ue<<C.bi_valid&65535,C.bi_valid+=Xe)}function br(C,Ue,Xe){Kt(C,Xe[Ue*2],Xe[Ue*2+1])}function Gt(C,Ue){var Xe=0;do Xe|=C&1,C>>>=1,Xe<<=1;while(--Ue>0);return Xe>>>1}function It(C){C.bi_valid===16?(sr(C,C.bi_buf),C.bi_buf=0,C.bi_valid=0):C.bi_valid>=8&&(C.pending_buf[C.pending++]=C.bi_buf&255,C.bi_buf>>=8,C.bi_valid-=8)}function hn(C,Ue){var Xe=Ue.dyn_tree,dt=Ue.max_code,Z=Ue.stat_desc.static_tree,we=Ue.stat_desc.has_stree,m=Ue.stat_desc.extra_bits,He=Ue.stat_desc.extra_base,Pt=Ue.stat_desc.max_length,l,de,ye,w,V,ce,Et=0;for(w=0;w<=x;w++)C.bl_count[w]=0;for(Xe[C.heap[C.heap_max]*2+1]=0,l=C.heap_max+1;l<le;l++)de=C.heap[l],w=Xe[Xe[de*2+1]*2+1]+1,w>Pt&&(w=Pt,Et++),Xe[de*2+1]=w,!(de>dt)&&(C.bl_count[w]++,V=0,de>=He&&(V=m[de-He]),ce=Xe[de*2],C.opt_len+=ce*(w+V),we&&(C.static_len+=ce*(Z[de*2+1]+V)));if(Et!==0){do{for(w=Pt-1;C.bl_count[w]===0;)w--;C.bl_count[w]--,C.bl_count[w+1]+=2,C.bl_count[Pt]--,Et-=2}while(Et>0);for(w=Pt;w!==0;w--)for(de=C.bl_count[w];de!==0;)ye=C.heap[--l],!(ye>dt)&&(Xe[ye*2+1]!==w&&(C.opt_len+=(w-Xe[ye*2+1])*Xe[ye*2],Xe[ye*2+1]=w),de--)}}function jr(C,Ue,Xe){var dt=new Array(x+1),Z=0,we,m;for(we=1;we<=x;we++)dt[we]=Z=Z+Xe[we-1]<<1;for(m=0;m<=Ue;m++){var He=C[m*2+1];He!==0&&(C[m*2]=Gt(dt[He]++,He))}}function kt(){var C,Ue,Xe,dt,Z,we=new Array(x+1);for(Xe=0,dt=0;dt<p-1;dt++)for(Me[dt]=Xe,C=0;C<1<<Te[dt];C++)xt[Xe++]=dt;for(xt[Xe-1]=dt,Z=0,dt=0;dt<16;dt++)for(Ze[dt]=Z,C=0;C<1<<nt[dt];C++)Ot[Z++]=dt;for(Z>>=7;dt<D;dt++)for(Ze[dt]=Z<<7,C=0;C<1<<nt[dt]-7;C++)Ot[256+Z++]=dt;for(Ue=0;Ue<=x;Ue++)we[Ue]=0;for(C=0;C<=143;)tt[C*2+1]=8,C++,we[8]++;for(;C<=255;)tt[C*2+1]=9,C++,we[9]++;for(;C<=279;)tt[C*2+1]=7,C++,we[7]++;for(;C<=287;)tt[C*2+1]=8,C++,we[8]++;for(jr(tt,q+1,we),C=0;C<D;C++)Re[C*2+1]=5,Re[C*2]=Gt(C,5);$t=new St(tt,Te,U+1,q,x),Wt=new St(Re,nt,0,D,x),Qt=new St(new Array(0),lt,0,pe,g)}function Pr(C){var Ue;for(Ue=0;Ue<q;Ue++)C.dyn_ltree[Ue*2]=0;for(Ue=0;Ue<D;Ue++)C.dyn_dtree[Ue*2]=0;for(Ue=0;Ue<pe;Ue++)C.bl_tree[Ue*2]=0;C.dyn_ltree[b*2]=1,C.opt_len=C.static_len=0,C.last_lit=C.matches=0}function Fr(C){C.bi_valid>8?sr(C,C.bi_buf):C.bi_valid>0&&(C.pending_buf[C.pending++]=C.bi_buf),C.bi_buf=0,C.bi_valid=0}function Zr(C,Ue,Xe,dt){Fr(C),dt&&(sr(C,Xe),sr(C,~Xe)),t.arraySet(C.pending_buf,C.window,Ue,Xe,C.pending),C.pending+=Xe}function Qr(C,Ue,Xe,dt){var Z=Ue*2,we=Xe*2;return C[Z]<C[we]||C[Z]===C[we]&&dt[Ue]<=dt[Xe]}function ir(C,Ue,Xe){for(var dt=C.heap[Xe],Z=Xe<<1;Z<=C.heap_len&&(Z<C.heap_len&&Qr(Ue,C.heap[Z+1],C.heap[Z],C.depth)&&Z++,!Qr(Ue,dt,C.heap[Z],C.depth));)C.heap[Xe]=C.heap[Z],Xe=Z,Z<<=1;C.heap[Xe]=dt}function Nt(C,Ue,Xe){var dt,Z,we=0,m,He;if(C.last_lit!==0)do dt=C.pending_buf[C.d_buf+we*2]<<8|C.pending_buf[C.d_buf+we*2+1],Z=C.pending_buf[C.l_buf+we],we++,dt===0?br(C,Z,Ue):(m=xt[Z],br(C,m+U+1,Ue),He=Te[m],He!==0&&(Z-=Me[m],Kt(C,Z,He)),dt--,m=xr(dt),br(C,m,Xe),He=nt[m],He!==0&&(dt-=Ze[m],Kt(C,dt,He)));while(we<C.last_lit);br(C,b,Ue)}function Tn(C,Ue){var Xe=Ue.dyn_tree,dt=Ue.stat_desc.static_tree,Z=Ue.stat_desc.has_stree,we=Ue.stat_desc.elems,m,He,Pt=-1,l;for(C.heap_len=0,C.heap_max=le,m=0;m<we;m++)Xe[m*2]!==0?(C.heap[++C.heap_len]=Pt=m,C.depth[m]=0):Xe[m*2+1]=0;for(;C.heap_len<2;)l=C.heap[++C.heap_len]=Pt<2?++Pt:0,Xe[l*2]=1,C.depth[l]=0,C.opt_len--,Z&&(C.static_len-=dt[l*2+1]);for(Ue.max_code=Pt,m=C.heap_len>>1;m>=1;m--)ir(C,Xe,m);l=we;do m=C.heap[1],C.heap[1]=C.heap[C.heap_len--],ir(C,Xe,1),He=C.heap[1],C.heap[--C.heap_max]=m,C.heap[--C.heap_max]=He,Xe[l*2]=Xe[m*2]+Xe[He*2],C.depth[l]=(C.depth[m]>=C.depth[He]?C.depth[m]:C.depth[He])+1,Xe[m*2+1]=Xe[He*2+1]=l,C.heap[1]=l++,ir(C,Xe,1);while(C.heap_len>=2);C.heap[--C.heap_max]=C.heap[1],hn(C,Ue),jr(Xe,Pt,C.bl_count)}function En(C,Ue,Xe){var dt,Z=-1,we,m=Ue[0*2+1],He=0,Pt=7,l=4;for(m===0&&(Pt=138,l=3),Ue[(Xe+1)*2+1]=65535,dt=0;dt<=Xe;dt++)we=m,m=Ue[(dt+1)*2+1],!(++He<Pt&&we===m)&&(He<l?C.bl_tree[we*2]+=He:we!==0?(we!==Z&&C.bl_tree[we*2]++,C.bl_tree[N*2]++):He<=10?C.bl_tree[F*2]++:C.bl_tree[J*2]++,He=0,Z=we,m===0?(Pt=138,l=3):we===m?(Pt=6,l=3):(Pt=7,l=4))}function Jr(C,Ue,Xe){var dt,Z=-1,we,m=Ue[0*2+1],He=0,Pt=7,l=4;for(m===0&&(Pt=138,l=3),dt=0;dt<=Xe;dt++)if(we=m,m=Ue[(dt+1)*2+1],!(++He<Pt&&we===m)){if(He<l)do br(C,we,C.bl_tree);while(--He!==0);else we!==0?(we!==Z&&(br(C,we,C.bl_tree),He--),br(C,N,C.bl_tree),Kt(C,He-3,2)):He<=10?(br(C,F,C.bl_tree),Kt(C,He-3,3)):(br(C,J,C.bl_tree),Kt(C,He-11,7));He=0,Z=we,m===0?(Pt=138,l=3):we===m?(Pt=6,l=3):(Pt=7,l=4)}}function an(C){var Ue;for(En(C,C.dyn_ltree,C.l_desc.max_code),En(C,C.dyn_dtree,C.d_desc.max_code),Tn(C,C.bl_desc),Ue=pe-1;Ue>=3&&C.bl_tree[it[Ue]*2+1]===0;Ue--);return C.opt_len+=3*(Ue+1)+5+5+4,Ue}function E(C,Ue,Xe,dt){var Z;for(Kt(C,Ue-257,5),Kt(C,Xe-1,5),Kt(C,dt-4,4),Z=0;Z<dt;Z++)Kt(C,C.bl_tree[it[Z]*2+1],3);Jr(C,C.dyn_ltree,Ue-1),Jr(C,C.dyn_dtree,Xe-1)}function di(C){var Ue=4093624447,Xe;for(Xe=0;Xe<=31;Xe++,Ue>>>=1)if(Ue&1&&C.dyn_ltree[Xe*2]!==0)return i;if(C.dyn_ltree[9*2]!==0||C.dyn_ltree[10*2]!==0||C.dyn_ltree[13*2]!==0)return o;for(Xe=32;Xe<U;Xe++)if(C.dyn_ltree[Xe*2]!==0)return o;return i}var dn=!1;function zi(C){dn||(kt(),dn=!0),C.l_desc=new or(C.dyn_ltree,$t),C.d_desc=new or(C.dyn_dtree,Wt),C.bl_desc=new or(C.bl_tree,Qt),C.bi_buf=0,C.bi_valid=0,Pr(C)}function Pn(C,Ue,Xe,dt){Kt(C,(u<<1)+(dt?1:0),3),Zr(C,Ue,Xe,!0)}function Ar(C){Kt(C,d<<1,3),br(C,b,tt),It(C)}function Dn(C,Ue,Xe,dt){var Z,we,m=0;C.level>0?(C.strm.data_type===s&&(C.strm.data_type=di(C)),Tn(C,C.l_desc),Tn(C,C.d_desc),m=an(C),Z=C.opt_len+3+7>>>3,we=C.static_len+3+7>>>3,we<=Z&&(Z=we)):Z=we=Xe+5,Xe+4<=Z&&Ue!==-1?Pn(C,Ue,Xe,dt):C.strategy===n||we===Z?(Kt(C,(d<<1)+(dt?1:0),3),Nt(C,tt,Re)):(Kt(C,(v<<1)+(dt?1:0),3),E(C,C.l_desc.max_code+1,C.d_desc.max_code+1,m+1),Nt(C,C.dyn_ltree,C.dyn_dtree)),Pr(C),dt&&Fr(C)}function Bn(C,Ue,Xe){return C.pending_buf[C.d_buf+C.last_lit*2]=Ue>>>8&255,C.pending_buf[C.d_buf+C.last_lit*2+1]=Ue&255,C.pending_buf[C.l_buf+C.last_lit]=Xe&255,C.last_lit++,Ue===0?C.dyn_ltree[Xe*2]++:(C.matches++,Ue--,C.dyn_ltree[(xt[Xe]+U+1)*2]++,C.dyn_dtree[xr(Ue)*2]++),C.last_lit===C.lit_bufsize-1}return qo._tr_init=zi,qo._tr_stored_block=Pn,qo._tr_flush_block=Dn,qo._tr_tally=Bn,qo._tr_align=Ar,qo}var Ah,mv;function gv(){if(mv)return Ah;mv=1;function t(n,i,o,s){for(var f=n&65535|0,u=n>>>16&65535|0,d=0;o!==0;){d=o>2e3?2e3:o,o-=d;do f=f+i[s++]|0,u=u+f|0;while(--d);f%=65521,u%=65521}return f|u<<16|0}return Ah=t,Ah}var Th,yv;function xv(){if(yv)return Th;yv=1;function t(){for(var o,s=[],f=0;f<256;f++){o=f;for(var u=0;u<8;u++)o=o&1?3988292384^o>>>1:o>>>1;s[f]=o}return s}var n=t();function i(o,s,f,u){var d=n,v=u+f;o^=-1;for(var M=u;M<v;M++)o=o>>>8^d[(o^s[M])&255];return o^-1}return Th=i,Th}var Eh,bv;function Dh(){return bv||(bv=1,Eh={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),Eh}var wv;function cy(){if(wv)return Hi;wv=1;var t=go(),n=ly(),i=gv(),o=xv(),s=Dh(),f=0,u=1,d=3,v=4,M=5,B=0,p=1,U=-2,q=-3,D=-5,pe=-1,le=1,x=2,A=3,g=4,b=0,N=2,F=8,J=9,Te=15,nt=8,lt=29,it=256,ft=it+1+lt,tt=30,Re=19,Ot=2*ft+1,xt=15,Me=3,Ze=258,St=Ze+Me+1,$t=32,Wt=42,Qt=69,or=73,xr=91,sr=103,Kt=113,br=666,Gt=1,It=2,hn=3,jr=4,kt=3;function Pr(l,de){return l.msg=s[de],de}function Fr(l){return(l<<1)-(l>4?9:0)}function Zr(l){for(var de=l.length;--de>=0;)l[de]=0}function Qr(l){var de=l.state,ye=de.pending;ye>l.avail_out&&(ye=l.avail_out),ye!==0&&(t.arraySet(l.output,de.pending_buf,de.pending_out,ye,l.next_out),l.next_out+=ye,de.pending_out+=ye,l.total_out+=ye,l.avail_out-=ye,de.pending-=ye,de.pending===0&&(de.pending_out=0))}function ir(l,de){n._tr_flush_block(l,l.block_start>=0?l.block_start:-1,l.strstart-l.block_start,de),l.block_start=l.strstart,Qr(l.strm)}function Nt(l,de){l.pending_buf[l.pending++]=de}function Tn(l,de){l.pending_buf[l.pending++]=de>>>8&255,l.pending_buf[l.pending++]=de&255}function En(l,de,ye,w){var V=l.avail_in;return V>w&&(V=w),V===0?0:(l.avail_in-=V,t.arraySet(de,l.input,l.next_in,V,ye),l.state.wrap===1?l.adler=i(l.adler,de,V,ye):l.state.wrap===2&&(l.adler=o(l.adler,de,V,ye)),l.next_in+=V,l.total_in+=V,V)}function Jr(l,de){var ye=l.max_chain_length,w=l.strstart,V,ce,Et=l.prev_length,at=l.nice_match,mt=l.strstart>l.w_size-St?l.strstart-(l.w_size-St):0,ur=l.window,vi=l.w_mask,kr=l.prev,hr=l.strstart+Ze,Yr=ur[w+Et-1],vn=ur[w+Et];l.prev_length>=l.good_match&&(ye>>=2),at>l.lookahead&&(at=l.lookahead);do if(V=de,!(ur[V+Et]!==vn||ur[V+Et-1]!==Yr||ur[V]!==ur[w]||ur[++V]!==ur[w+1])){w+=2,V++;do;while(ur[++w]===ur[++V]&&ur[++w]===ur[++V]&&ur[++w]===ur[++V]&&ur[++w]===ur[++V]&&ur[++w]===ur[++V]&&ur[++w]===ur[++V]&&ur[++w]===ur[++V]&&ur[++w]===ur[++V]&&w<hr);if(ce=Ze-(hr-w),w=hr-Ze,ce>Et){if(l.match_start=de,Et=ce,ce>=at)break;Yr=ur[w+Et-1],vn=ur[w+Et]}}while((de=kr[de&vi])>mt&&--ye!==0);return Et<=l.lookahead?Et:l.lookahead}function an(l){var de=l.w_size,ye,w,V,ce,Et;do{if(ce=l.window_size-l.lookahead-l.strstart,l.strstart>=de+(de-St)){t.arraySet(l.window,l.window,de,de,0),l.match_start-=de,l.strstart-=de,l.block_start-=de,w=l.hash_size,ye=w;do V=l.head[--ye],l.head[ye]=V>=de?V-de:0;while(--w);w=de,ye=w;do V=l.prev[--ye],l.prev[ye]=V>=de?V-de:0;while(--w);ce+=de}if(l.strm.avail_in===0)break;if(w=En(l.strm,l.window,l.strstart+l.lookahead,ce),l.lookahead+=w,l.lookahead+l.insert>=Me)for(Et=l.strstart-l.insert,l.ins_h=l.window[Et],l.ins_h=(l.ins_h<<l.hash_shift^l.window[Et+1])&l.hash_mask;l.insert&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[Et+Me-1])&l.hash_mask,l.prev[Et&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=Et,Et++,l.insert--,!(l.lookahead+l.insert<Me)););}while(l.lookahead<St&&l.strm.avail_in!==0)}function E(l,de){var ye=65535;for(ye>l.pending_buf_size-5&&(ye=l.pending_buf_size-5);;){if(l.lookahead<=1){if(an(l),l.lookahead===0&&de===f)return Gt;if(l.lookahead===0)break}l.strstart+=l.lookahead,l.lookahead=0;var w=l.block_start+ye;if((l.strstart===0||l.strstart>=w)&&(l.lookahead=l.strstart-w,l.strstart=w,ir(l,!1),l.strm.avail_out===0)||l.strstart-l.block_start>=l.w_size-St&&(ir(l,!1),l.strm.avail_out===0))return Gt}return l.insert=0,de===v?(ir(l,!0),l.strm.avail_out===0?hn:jr):(l.strstart>l.block_start&&(ir(l,!1),l.strm.avail_out===0),Gt)}function di(l,de){for(var ye,w;;){if(l.lookahead<St){if(an(l),l.lookahead<St&&de===f)return Gt;if(l.lookahead===0)break}if(ye=0,l.lookahead>=Me&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+Me-1])&l.hash_mask,ye=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),ye!==0&&l.strstart-ye<=l.w_size-St&&(l.match_length=Jr(l,ye)),l.match_length>=Me)if(w=n._tr_tally(l,l.strstart-l.match_start,l.match_length-Me),l.lookahead-=l.match_length,l.match_length<=l.max_lazy_match&&l.lookahead>=Me){l.match_length--;do l.strstart++,l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+Me-1])&l.hash_mask,ye=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart;while(--l.match_length!==0);l.strstart++}else l.strstart+=l.match_length,l.match_length=0,l.ins_h=l.window[l.strstart],l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+1])&l.hash_mask;else w=n._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++;if(w&&(ir(l,!1),l.strm.avail_out===0))return Gt}return l.insert=l.strstart<Me-1?l.strstart:Me-1,de===v?(ir(l,!0),l.strm.avail_out===0?hn:jr):l.last_lit&&(ir(l,!1),l.strm.avail_out===0)?Gt:It}function dn(l,de){for(var ye,w,V;;){if(l.lookahead<St){if(an(l),l.lookahead<St&&de===f)return Gt;if(l.lookahead===0)break}if(ye=0,l.lookahead>=Me&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+Me-1])&l.hash_mask,ye=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),l.prev_length=l.match_length,l.prev_match=l.match_start,l.match_length=Me-1,ye!==0&&l.prev_length<l.max_lazy_match&&l.strstart-ye<=l.w_size-St&&(l.match_length=Jr(l,ye),l.match_length<=5&&(l.strategy===le||l.match_length===Me&&l.strstart-l.match_start>4096)&&(l.match_length=Me-1)),l.prev_length>=Me&&l.match_length<=l.prev_length){V=l.strstart+l.lookahead-Me,w=n._tr_tally(l,l.strstart-1-l.prev_match,l.prev_length-Me),l.lookahead-=l.prev_length-1,l.prev_length-=2;do++l.strstart<=V&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+Me-1])&l.hash_mask,ye=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart);while(--l.prev_length!==0);if(l.match_available=0,l.match_length=Me-1,l.strstart++,w&&(ir(l,!1),l.strm.avail_out===0))return Gt}else if(l.match_available){if(w=n._tr_tally(l,0,l.window[l.strstart-1]),w&&ir(l,!1),l.strstart++,l.lookahead--,l.strm.avail_out===0)return Gt}else l.match_available=1,l.strstart++,l.lookahead--}return l.match_available&&(w=n._tr_tally(l,0,l.window[l.strstart-1]),l.match_available=0),l.insert=l.strstart<Me-1?l.strstart:Me-1,de===v?(ir(l,!0),l.strm.avail_out===0?hn:jr):l.last_lit&&(ir(l,!1),l.strm.avail_out===0)?Gt:It}function zi(l,de){for(var ye,w,V,ce,Et=l.window;;){if(l.lookahead<=Ze){if(an(l),l.lookahead<=Ze&&de===f)return Gt;if(l.lookahead===0)break}if(l.match_length=0,l.lookahead>=Me&&l.strstart>0&&(V=l.strstart-1,w=Et[V],w===Et[++V]&&w===Et[++V]&&w===Et[++V])){ce=l.strstart+Ze;do;while(w===Et[++V]&&w===Et[++V]&&w===Et[++V]&&w===Et[++V]&&w===Et[++V]&&w===Et[++V]&&w===Et[++V]&&w===Et[++V]&&V<ce);l.match_length=Ze-(ce-V),l.match_length>l.lookahead&&(l.match_length=l.lookahead)}if(l.match_length>=Me?(ye=n._tr_tally(l,1,l.match_length-Me),l.lookahead-=l.match_length,l.strstart+=l.match_length,l.match_length=0):(ye=n._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++),ye&&(ir(l,!1),l.strm.avail_out===0))return Gt}return l.insert=0,de===v?(ir(l,!0),l.strm.avail_out===0?hn:jr):l.last_lit&&(ir(l,!1),l.strm.avail_out===0)?Gt:It}function Pn(l,de){for(var ye;;){if(l.lookahead===0&&(an(l),l.lookahead===0)){if(de===f)return Gt;break}if(l.match_length=0,ye=n._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++,ye&&(ir(l,!1),l.strm.avail_out===0))return Gt}return l.insert=0,de===v?(ir(l,!0),l.strm.avail_out===0?hn:jr):l.last_lit&&(ir(l,!1),l.strm.avail_out===0)?Gt:It}function Ar(l,de,ye,w,V){this.good_length=l,this.max_lazy=de,this.nice_length=ye,this.max_chain=w,this.func=V}var Dn;Dn=[new Ar(0,0,0,0,E),new Ar(4,4,8,4,di),new Ar(4,5,16,8,di),new Ar(4,6,32,32,di),new Ar(4,4,16,16,dn),new Ar(8,16,32,32,dn),new Ar(8,16,128,128,dn),new Ar(8,32,128,256,dn),new Ar(32,128,258,1024,dn),new Ar(32,258,258,4096,dn)];function Bn(l){l.window_size=2*l.w_size,Zr(l.head),l.max_lazy_match=Dn[l.level].max_lazy,l.good_match=Dn[l.level].good_length,l.nice_match=Dn[l.level].nice_length,l.max_chain_length=Dn[l.level].max_chain,l.strstart=0,l.block_start=0,l.lookahead=0,l.insert=0,l.match_length=l.prev_length=Me-1,l.match_available=0,l.ins_h=0}function C(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=F,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new t.Buf16(Ot*2),this.dyn_dtree=new t.Buf16((2*tt+1)*2),this.bl_tree=new t.Buf16((2*Re+1)*2),Zr(this.dyn_ltree),Zr(this.dyn_dtree),Zr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(xt+1),this.heap=new t.Buf16(2*ft+1),Zr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*ft+1),Zr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ue(l){var de;return!l||!l.state?Pr(l,U):(l.total_in=l.total_out=0,l.data_type=N,de=l.state,de.pending=0,de.pending_out=0,de.wrap<0&&(de.wrap=-de.wrap),de.status=de.wrap?Wt:Kt,l.adler=de.wrap===2?0:1,de.last_flush=f,n._tr_init(de),B)}function Xe(l){var de=Ue(l);return de===B&&Bn(l.state),de}function dt(l,de){return!l||!l.state||l.state.wrap!==2?U:(l.state.gzhead=de,B)}function Z(l,de,ye,w,V,ce){if(!l)return U;var Et=1;if(de===pe&&(de=6),w<0?(Et=0,w=-w):w>15&&(Et=2,w-=16),V<1||V>J||ye!==F||w<8||w>15||de<0||de>9||ce<0||ce>g)return Pr(l,U);w===8&&(w=9);var at=new C;return l.state=at,at.strm=l,at.wrap=Et,at.gzhead=null,at.w_bits=w,at.w_size=1<<at.w_bits,at.w_mask=at.w_size-1,at.hash_bits=V+7,at.hash_size=1<<at.hash_bits,at.hash_mask=at.hash_size-1,at.hash_shift=~~((at.hash_bits+Me-1)/Me),at.window=new t.Buf8(at.w_size*2),at.head=new t.Buf16(at.hash_size),at.prev=new t.Buf16(at.w_size),at.lit_bufsize=1<<V+6,at.pending_buf_size=at.lit_bufsize*4,at.pending_buf=new t.Buf8(at.pending_buf_size),at.d_buf=1*at.lit_bufsize,at.l_buf=(1+2)*at.lit_bufsize,at.level=de,at.strategy=ce,at.method=ye,Xe(l)}function we(l,de){return Z(l,de,F,Te,nt,b)}function m(l,de){var ye,w,V,ce;if(!l||!l.state||de>M||de<0)return l?Pr(l,U):U;if(w=l.state,!l.output||!l.input&&l.avail_in!==0||w.status===br&&de!==v)return Pr(l,l.avail_out===0?D:U);if(w.strm=l,ye=w.last_flush,w.last_flush=de,w.status===Wt)if(w.wrap===2)l.adler=0,Nt(w,31),Nt(w,139),Nt(w,8),w.gzhead?(Nt(w,(w.gzhead.text?1:0)+(w.gzhead.hcrc?2:0)+(w.gzhead.extra?4:0)+(w.gzhead.name?8:0)+(w.gzhead.comment?16:0)),Nt(w,w.gzhead.time&255),Nt(w,w.gzhead.time>>8&255),Nt(w,w.gzhead.time>>16&255),Nt(w,w.gzhead.time>>24&255),Nt(w,w.level===9?2:w.strategy>=x||w.level<2?4:0),Nt(w,w.gzhead.os&255),w.gzhead.extra&&w.gzhead.extra.length&&(Nt(w,w.gzhead.extra.length&255),Nt(w,w.gzhead.extra.length>>8&255)),w.gzhead.hcrc&&(l.adler=o(l.adler,w.pending_buf,w.pending,0)),w.gzindex=0,w.status=Qt):(Nt(w,0),Nt(w,0),Nt(w,0),Nt(w,0),Nt(w,0),Nt(w,w.level===9?2:w.strategy>=x||w.level<2?4:0),Nt(w,kt),w.status=Kt);else{var Et=F+(w.w_bits-8<<4)<<8,at=-1;w.strategy>=x||w.level<2?at=0:w.level<6?at=1:w.level===6?at=2:at=3,Et|=at<<6,w.strstart!==0&&(Et|=$t),Et+=31-Et%31,w.status=Kt,Tn(w,Et),w.strstart!==0&&(Tn(w,l.adler>>>16),Tn(w,l.adler&65535)),l.adler=1}if(w.status===Qt)if(w.gzhead.extra){for(V=w.pending;w.gzindex<(w.gzhead.extra.length&65535)&&!(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>V&&(l.adler=o(l.adler,w.pending_buf,w.pending-V,V)),Qr(l),V=w.pending,w.pending===w.pending_buf_size));)Nt(w,w.gzhead.extra[w.gzindex]&255),w.gzindex++;w.gzhead.hcrc&&w.pending>V&&(l.adler=o(l.adler,w.pending_buf,w.pending-V,V)),w.gzindex===w.gzhead.extra.length&&(w.gzindex=0,w.status=or)}else w.status=or;if(w.status===or)if(w.gzhead.name){V=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>V&&(l.adler=o(l.adler,w.pending_buf,w.pending-V,V)),Qr(l),V=w.pending,w.pending===w.pending_buf_size)){ce=1;break}w.gzindex<w.gzhead.name.length?ce=w.gzhead.name.charCodeAt(w.gzindex++)&255:ce=0,Nt(w,ce)}while(ce!==0);w.gzhead.hcrc&&w.pending>V&&(l.adler=o(l.adler,w.pending_buf,w.pending-V,V)),ce===0&&(w.gzindex=0,w.status=xr)}else w.status=xr;if(w.status===xr)if(w.gzhead.comment){V=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>V&&(l.adler=o(l.adler,w.pending_buf,w.pending-V,V)),Qr(l),V=w.pending,w.pending===w.pending_buf_size)){ce=1;break}w.gzindex<w.gzhead.comment.length?ce=w.gzhead.comment.charCodeAt(w.gzindex++)&255:ce=0,Nt(w,ce)}while(ce!==0);w.gzhead.hcrc&&w.pending>V&&(l.adler=o(l.adler,w.pending_buf,w.pending-V,V)),ce===0&&(w.status=sr)}else w.status=sr;if(w.status===sr&&(w.gzhead.hcrc?(w.pending+2>w.pending_buf_size&&Qr(l),w.pending+2<=w.pending_buf_size&&(Nt(w,l.adler&255),Nt(w,l.adler>>8&255),l.adler=0,w.status=Kt)):w.status=Kt),w.pending!==0){if(Qr(l),l.avail_out===0)return w.last_flush=-1,B}else if(l.avail_in===0&&Fr(de)<=Fr(ye)&&de!==v)return Pr(l,D);if(w.status===br&&l.avail_in!==0)return Pr(l,D);if(l.avail_in!==0||w.lookahead!==0||de!==f&&w.status!==br){var mt=w.strategy===x?Pn(w,de):w.strategy===A?zi(w,de):Dn[w.level].func(w,de);if((mt===hn||mt===jr)&&(w.status=br),mt===Gt||mt===hn)return l.avail_out===0&&(w.last_flush=-1),B;if(mt===It&&(de===u?n._tr_align(w):de!==M&&(n._tr_stored_block(w,0,0,!1),de===d&&(Zr(w.head),w.lookahead===0&&(w.strstart=0,w.block_start=0,w.insert=0))),Qr(l),l.avail_out===0))return w.last_flush=-1,B}return de!==v?B:w.wrap<=0?p:(w.wrap===2?(Nt(w,l.adler&255),Nt(w,l.adler>>8&255),Nt(w,l.adler>>16&255),Nt(w,l.adler>>24&255),Nt(w,l.total_in&255),Nt(w,l.total_in>>8&255),Nt(w,l.total_in>>16&255),Nt(w,l.total_in>>24&255)):(Tn(w,l.adler>>>16),Tn(w,l.adler&65535)),Qr(l),w.wrap>0&&(w.wrap=-w.wrap),w.pending!==0?B:p)}function He(l){var de;return!l||!l.state?U:(de=l.state.status,de!==Wt&&de!==Qt&&de!==or&&de!==xr&&de!==sr&&de!==Kt&&de!==br?Pr(l,U):(l.state=null,de===Kt?Pr(l,q):B))}function Pt(l,de){var ye=de.length,w,V,ce,Et,at,mt,ur,vi;if(!l||!l.state||(w=l.state,Et=w.wrap,Et===2||Et===1&&w.status!==Wt||w.lookahead))return U;for(Et===1&&(l.adler=i(l.adler,de,ye,0)),w.wrap=0,ye>=w.w_size&&(Et===0&&(Zr(w.head),w.strstart=0,w.block_start=0,w.insert=0),vi=new t.Buf8(w.w_size),t.arraySet(vi,de,ye-w.w_size,w.w_size,0),de=vi,ye=w.w_size),at=l.avail_in,mt=l.next_in,ur=l.input,l.avail_in=ye,l.next_in=0,l.input=de,an(w);w.lookahead>=Me;){V=w.strstart,ce=w.lookahead-(Me-1);do w.ins_h=(w.ins_h<<w.hash_shift^w.window[V+Me-1])&w.hash_mask,w.prev[V&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=V,V++;while(--ce);w.strstart=V,w.lookahead=Me-1,an(w)}return w.strstart+=w.lookahead,w.block_start=w.strstart,w.insert=w.lookahead,w.lookahead=0,w.match_length=w.prev_length=Me-1,w.match_available=0,l.next_in=mt,l.input=ur,l.avail_in=at,w.wrap=Et,B}return Hi.deflateInit=we,Hi.deflateInit2=Z,Hi.deflateReset=Xe,Hi.deflateResetKeep=Ue,Hi.deflateSetHeader=dt,Hi.deflate=m,Hi.deflateEnd=He,Hi.deflateSetDictionary=Pt,Hi.deflateInfo="pako deflate (from Nodeca project)",Hi}var Ko={},Sv;function Av(){if(Sv)return Ko;Sv=1;var t=go(),n=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{i=!1}for(var o=new t.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;o[254]=o[254]=1,Ko.string2buf=function(u){var d,v,M,B,p,U=u.length,q=0;for(B=0;B<U;B++)v=u.charCodeAt(B),(v&64512)===55296&&B+1<U&&(M=u.charCodeAt(B+1),(M&64512)===56320&&(v=65536+(v-55296<<10)+(M-56320),B++)),q+=v<128?1:v<2048?2:v<65536?3:4;for(d=new t.Buf8(q),p=0,B=0;p<q;B++)v=u.charCodeAt(B),(v&64512)===55296&&B+1<U&&(M=u.charCodeAt(B+1),(M&64512)===56320&&(v=65536+(v-55296<<10)+(M-56320),B++)),v<128?d[p++]=v:v<2048?(d[p++]=192|v>>>6,d[p++]=128|v&63):v<65536?(d[p++]=224|v>>>12,d[p++]=128|v>>>6&63,d[p++]=128|v&63):(d[p++]=240|v>>>18,d[p++]=128|v>>>12&63,d[p++]=128|v>>>6&63,d[p++]=128|v&63);return d};function f(u,d){if(d<65534&&(u.subarray&&i||!u.subarray&&n))return String.fromCharCode.apply(null,t.shrinkBuf(u,d));for(var v="",M=0;M<d;M++)v+=String.fromCharCode(u[M]);return v}return Ko.buf2binstring=function(u){return f(u,u.length)},Ko.binstring2buf=function(u){for(var d=new t.Buf8(u.length),v=0,M=d.length;v<M;v++)d[v]=u.charCodeAt(v);return d},Ko.buf2string=function(u,d){var v,M,B,p,U=d||u.length,q=new Array(U*2);for(M=0,v=0;v<U;){if(B=u[v++],B<128){q[M++]=B;continue}if(p=o[B],p>4){q[M++]=65533,v+=p-1;continue}for(B&=p===2?31:p===3?15:7;p>1&&v<U;)B=B<<6|u[v++]&63,p--;if(p>1){q[M++]=65533;continue}B<65536?q[M++]=B:(B-=65536,q[M++]=55296|B>>10&1023,q[M++]=56320|B&1023)}return f(q,M)},Ko.utf8border=function(u,d){var v;for(d=d||u.length,d>u.length&&(d=u.length),v=d-1;v>=0&&(u[v]&192)===128;)v--;return v<0||v===0?d:v+o[u[v]]>d?v:d},Ko}var Lh,Tv;function Ev(){if(Tv)return Lh;Tv=1;function t(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return Lh=t,Lh}var Dv;function hy(){if(Dv)return Hf;Dv=1;var t=cy(),n=go(),i=Av(),o=Dh(),s=Ev(),f=Object.prototype.toString,u=0,d=4,v=0,M=1,B=2,p=-1,U=0,q=8;function D(A){if(!(this instanceof D))return new D(A);this.options=n.assign({level:p,method:q,chunkSize:16384,windowBits:15,memLevel:8,strategy:U,to:""},A||{});var g=this.options;g.raw&&g.windowBits>0?g.windowBits=-g.windowBits:g.gzip&&g.windowBits>0&&g.windowBits<16&&(g.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var b=t.deflateInit2(this.strm,g.level,g.method,g.windowBits,g.memLevel,g.strategy);if(b!==v)throw new Error(o[b]);if(g.header&&t.deflateSetHeader(this.strm,g.header),g.dictionary){var N;if(typeof g.dictionary=="string"?N=i.string2buf(g.dictionary):f.call(g.dictionary)==="[object ArrayBuffer]"?N=new Uint8Array(g.dictionary):N=g.dictionary,b=t.deflateSetDictionary(this.strm,N),b!==v)throw new Error(o[b]);this._dict_set=!0}}D.prototype.push=function(A,g){var b=this.strm,N=this.options.chunkSize,F,J;if(this.ended)return!1;J=g===~~g?g:g===!0?d:u,typeof A=="string"?b.input=i.string2buf(A):f.call(A)==="[object ArrayBuffer]"?b.input=new Uint8Array(A):b.input=A,b.next_in=0,b.avail_in=b.input.length;do{if(b.avail_out===0&&(b.output=new n.Buf8(N),b.next_out=0,b.avail_out=N),F=t.deflate(b,J),F!==M&&F!==v)return this.onEnd(F),this.ended=!0,!1;(b.avail_out===0||b.avail_in===0&&(J===d||J===B))&&(this.options.to==="string"?this.onData(i.buf2binstring(n.shrinkBuf(b.output,b.next_out))):this.onData(n.shrinkBuf(b.output,b.next_out)))}while((b.avail_in>0||b.avail_out===0)&&F!==M);return J===d?(F=t.deflateEnd(this.strm),this.onEnd(F),this.ended=!0,F===v):(J===B&&(this.onEnd(v),b.avail_out=0),!0)},D.prototype.onData=function(A){this.chunks.push(A)},D.prototype.onEnd=function(A){A===v&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};function pe(A,g){var b=new D(g);if(b.push(A,!0),b.err)throw b.msg||o[b.err];return b.result}function le(A,g){return g=g||{},g.raw=!0,pe(A,g)}function x(A,g){return g=g||{},g.gzip=!0,pe(A,g)}return Hf.Deflate=D,Hf.deflate=pe,Hf.deflateRaw=le,Hf.gzip=x,Hf}var zf={},Ci={},Rh,Lv;function dy(){if(Lv)return Rh;Lv=1;var t=30,n=12;return Rh=function(o,s){var f,u,d,v,M,B,p,U,q,D,pe,le,x,A,g,b,N,F,J,Te,nt,lt,it,ft,tt;f=o.state,u=o.next_in,ft=o.input,d=u+(o.avail_in-5),v=o.next_out,tt=o.output,M=v-(s-o.avail_out),B=v+(o.avail_out-257),p=f.dmax,U=f.wsize,q=f.whave,D=f.wnext,pe=f.window,le=f.hold,x=f.bits,A=f.lencode,g=f.distcode,b=(1<<f.lenbits)-1,N=(1<<f.distbits)-1;e:do{x<15&&(le+=ft[u++]<<x,x+=8,le+=ft[u++]<<x,x+=8),F=A[le&b];t:for(;;){if(J=F>>>24,le>>>=J,x-=J,J=F>>>16&255,J===0)tt[v++]=F&65535;else if(J&16){Te=F&65535,J&=15,J&&(x<J&&(le+=ft[u++]<<x,x+=8),Te+=le&(1<<J)-1,le>>>=J,x-=J),x<15&&(le+=ft[u++]<<x,x+=8,le+=ft[u++]<<x,x+=8),F=g[le&N];r:for(;;){if(J=F>>>24,le>>>=J,x-=J,J=F>>>16&255,J&16){if(nt=F&65535,J&=15,x<J&&(le+=ft[u++]<<x,x+=8,x<J&&(le+=ft[u++]<<x,x+=8)),nt+=le&(1<<J)-1,nt>p){o.msg="invalid distance too far back",f.mode=t;break e}if(le>>>=J,x-=J,J=v-M,nt>J){if(J=nt-J,J>q&&f.sane){o.msg="invalid distance too far back",f.mode=t;break e}if(lt=0,it=pe,D===0){if(lt+=U-J,J<Te){Te-=J;do tt[v++]=pe[lt++];while(--J);lt=v-nt,it=tt}}else if(D<J){if(lt+=U+D-J,J-=D,J<Te){Te-=J;do tt[v++]=pe[lt++];while(--J);if(lt=0,D<Te){J=D,Te-=J;do tt[v++]=pe[lt++];while(--J);lt=v-nt,it=tt}}}else if(lt+=D-J,J<Te){Te-=J;do tt[v++]=pe[lt++];while(--J);lt=v-nt,it=tt}for(;Te>2;)tt[v++]=it[lt++],tt[v++]=it[lt++],tt[v++]=it[lt++],Te-=3;Te&&(tt[v++]=it[lt++],Te>1&&(tt[v++]=it[lt++]))}else{lt=v-nt;do tt[v++]=tt[lt++],tt[v++]=tt[lt++],tt[v++]=tt[lt++],Te-=3;while(Te>2);Te&&(tt[v++]=tt[lt++],Te>1&&(tt[v++]=tt[lt++]))}}else if((J&64)===0){F=g[(F&65535)+(le&(1<<J)-1)];continue r}else{o.msg="invalid distance code",f.mode=t;break e}break}}else if((J&64)===0){F=A[(F&65535)+(le&(1<<J)-1)];continue t}else if(J&32){f.mode=n;break e}else{o.msg="invalid literal/length code",f.mode=t;break e}break}}while(u<d&&v<B);Te=x>>3,u-=Te,x-=Te<<3,le&=(1<<x)-1,o.next_in=u,o.next_out=v,o.avail_in=u<d?5+(d-u):5-(u-d),o.avail_out=v<B?257+(B-v):257-(v-B),f.hold=le,f.bits=x},Rh}var Ch,Rv;function vy(){if(Rv)return Ch;Rv=1;var t=go(),n=15,i=852,o=592,s=0,f=1,u=2,d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],v=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],M=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],B=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return Ch=function(U,q,D,pe,le,x,A,g){var b=g.bits,N=0,F=0,J=0,Te=0,nt=0,lt=0,it=0,ft=0,tt=0,Re=0,Ot,xt,Me,Ze,St,$t=null,Wt=0,Qt,or=new t.Buf16(n+1),xr=new t.Buf16(n+1),sr=null,Kt=0,br,Gt,It;for(N=0;N<=n;N++)or[N]=0;for(F=0;F<pe;F++)or[q[D+F]]++;for(nt=b,Te=n;Te>=1&&or[Te]===0;Te--);if(nt>Te&&(nt=Te),Te===0)return le[x++]=1<<24|64<<16|0,le[x++]=1<<24|64<<16|0,g.bits=1,0;for(J=1;J<Te&&or[J]===0;J++);for(nt<J&&(nt=J),ft=1,N=1;N<=n;N++)if(ft<<=1,ft-=or[N],ft<0)return-1;if(ft>0&&(U===s||Te!==1))return-1;for(xr[1]=0,N=1;N<n;N++)xr[N+1]=xr[N]+or[N];for(F=0;F<pe;F++)q[D+F]!==0&&(A[xr[q[D+F]]++]=F);if(U===s?($t=sr=A,Qt=19):U===f?($t=d,Wt-=257,sr=v,Kt-=257,Qt=256):($t=M,sr=B,Qt=-1),Re=0,F=0,N=J,St=x,lt=nt,it=0,Me=-1,tt=1<<nt,Ze=tt-1,U===f&&tt>i||U===u&&tt>o)return 1;for(;;){br=N-it,A[F]<Qt?(Gt=0,It=A[F]):A[F]>Qt?(Gt=sr[Kt+A[F]],It=$t[Wt+A[F]]):(Gt=32+64,It=0),Ot=1<<N-it,xt=1<<lt,J=xt;do xt-=Ot,le[St+(Re>>it)+xt]=br<<24|Gt<<16|It|0;while(xt!==0);for(Ot=1<<N-1;Re&Ot;)Ot>>=1;if(Ot!==0?(Re&=Ot-1,Re+=Ot):Re=0,F++,--or[N]===0){if(N===Te)break;N=q[D+A[F]]}if(N>nt&&(Re&Ze)!==Me){for(it===0&&(it=nt),St+=J,lt=N-it,ft=1<<lt;lt+it<Te&&(ft-=or[lt+it],!(ft<=0));)lt++,ft<<=1;if(tt+=1<<lt,U===f&&tt>i||U===u&&tt>o)return 1;Me=Re&Ze,le[Me]=nt<<24|lt<<16|St-x|0}}return Re!==0&&(le[St+Re]=N-it<<24|64<<16|0),g.bits=nt,0},Ch}var Cv;function _y(){if(Cv)return Ci;Cv=1;var t=go(),n=gv(),i=xv(),o=dy(),s=vy(),f=0,u=1,d=2,v=4,M=5,B=6,p=0,U=1,q=2,D=-2,pe=-3,le=-4,x=-5,A=8,g=1,b=2,N=3,F=4,J=5,Te=6,nt=7,lt=8,it=9,ft=10,tt=11,Re=12,Ot=13,xt=14,Me=15,Ze=16,St=17,$t=18,Wt=19,Qt=20,or=21,xr=22,sr=23,Kt=24,br=25,Gt=26,It=27,hn=28,jr=29,kt=30,Pr=31,Fr=32,Zr=852,Qr=592,ir=15,Nt=ir;function Tn(Z){return(Z>>>24&255)+(Z>>>8&65280)+((Z&65280)<<8)+((Z&255)<<24)}function En(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Jr(Z){var we;return!Z||!Z.state?D:(we=Z.state,Z.total_in=Z.total_out=we.total=0,Z.msg="",we.wrap&&(Z.adler=we.wrap&1),we.mode=g,we.last=0,we.havedict=0,we.dmax=32768,we.head=null,we.hold=0,we.bits=0,we.lencode=we.lendyn=new t.Buf32(Zr),we.distcode=we.distdyn=new t.Buf32(Qr),we.sane=1,we.back=-1,p)}function an(Z){var we;return!Z||!Z.state?D:(we=Z.state,we.wsize=0,we.whave=0,we.wnext=0,Jr(Z))}function E(Z,we){var m,He;return!Z||!Z.state||(He=Z.state,we<0?(m=0,we=-we):(m=(we>>4)+1,we<48&&(we&=15)),we&&(we<8||we>15))?D:(He.window!==null&&He.wbits!==we&&(He.window=null),He.wrap=m,He.wbits=we,an(Z))}function di(Z,we){var m,He;return Z?(He=new En,Z.state=He,He.window=null,m=E(Z,we),m!==p&&(Z.state=null),m):D}function dn(Z){return di(Z,Nt)}var zi=!0,Pn,Ar;function Dn(Z){if(zi){var we;for(Pn=new t.Buf32(512),Ar=new t.Buf32(32),we=0;we<144;)Z.lens[we++]=8;for(;we<256;)Z.lens[we++]=9;for(;we<280;)Z.lens[we++]=7;for(;we<288;)Z.lens[we++]=8;for(s(u,Z.lens,0,288,Pn,0,Z.work,{bits:9}),we=0;we<32;)Z.lens[we++]=5;s(d,Z.lens,0,32,Ar,0,Z.work,{bits:5}),zi=!1}Z.lencode=Pn,Z.lenbits=9,Z.distcode=Ar,Z.distbits=5}function Bn(Z,we,m,He){var Pt,l=Z.state;return l.window===null&&(l.wsize=1<<l.wbits,l.wnext=0,l.whave=0,l.window=new t.Buf8(l.wsize)),He>=l.wsize?(t.arraySet(l.window,we,m-l.wsize,l.wsize,0),l.wnext=0,l.whave=l.wsize):(Pt=l.wsize-l.wnext,Pt>He&&(Pt=He),t.arraySet(l.window,we,m-He,Pt,l.wnext),He-=Pt,He?(t.arraySet(l.window,we,m-He,He,0),l.wnext=He,l.whave=l.wsize):(l.wnext+=Pt,l.wnext===l.wsize&&(l.wnext=0),l.whave<l.wsize&&(l.whave+=Pt))),0}function C(Z,we){var m,He,Pt,l,de,ye,w,V,ce,Et,at,mt,ur,vi,kr=0,hr,Yr,vn,Ln,Ia,Fa,jt,Wn,on=new t.Buf8(4),_i,Xn,Wf=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Z||!Z.state||!Z.output||!Z.input&&Z.avail_in!==0)return D;m=Z.state,m.mode===Re&&(m.mode=Ot),de=Z.next_out,Pt=Z.output,w=Z.avail_out,l=Z.next_in,He=Z.input,ye=Z.avail_in,V=m.hold,ce=m.bits,Et=ye,at=w,Wn=p;e:for(;;)switch(m.mode){case g:if(m.wrap===0){m.mode=Ot;break}for(;ce<16;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}if(m.wrap&2&&V===35615){m.check=0,on[0]=V&255,on[1]=V>>>8&255,m.check=i(m.check,on,2,0),V=0,ce=0,m.mode=b;break}if(m.flags=0,m.head&&(m.head.done=!1),!(m.wrap&1)||(((V&255)<<8)+(V>>8))%31){Z.msg="incorrect header check",m.mode=kt;break}if((V&15)!==A){Z.msg="unknown compression method",m.mode=kt;break}if(V>>>=4,ce-=4,jt=(V&15)+8,m.wbits===0)m.wbits=jt;else if(jt>m.wbits){Z.msg="invalid window size",m.mode=kt;break}m.dmax=1<<jt,Z.adler=m.check=1,m.mode=V&512?ft:Re,V=0,ce=0;break;case b:for(;ce<16;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}if(m.flags=V,(m.flags&255)!==A){Z.msg="unknown compression method",m.mode=kt;break}if(m.flags&57344){Z.msg="unknown header flags set",m.mode=kt;break}m.head&&(m.head.text=V>>8&1),m.flags&512&&(on[0]=V&255,on[1]=V>>>8&255,m.check=i(m.check,on,2,0)),V=0,ce=0,m.mode=N;case N:for(;ce<32;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}m.head&&(m.head.time=V),m.flags&512&&(on[0]=V&255,on[1]=V>>>8&255,on[2]=V>>>16&255,on[3]=V>>>24&255,m.check=i(m.check,on,4,0)),V=0,ce=0,m.mode=F;case F:for(;ce<16;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}m.head&&(m.head.xflags=V&255,m.head.os=V>>8),m.flags&512&&(on[0]=V&255,on[1]=V>>>8&255,m.check=i(m.check,on,2,0)),V=0,ce=0,m.mode=J;case J:if(m.flags&1024){for(;ce<16;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}m.length=V,m.head&&(m.head.extra_len=V),m.flags&512&&(on[0]=V&255,on[1]=V>>>8&255,m.check=i(m.check,on,2,0)),V=0,ce=0}else m.head&&(m.head.extra=null);m.mode=Te;case Te:if(m.flags&1024&&(mt=m.length,mt>ye&&(mt=ye),mt&&(m.head&&(jt=m.head.extra_len-m.length,m.head.extra||(m.head.extra=new Array(m.head.extra_len)),t.arraySet(m.head.extra,He,l,mt,jt)),m.flags&512&&(m.check=i(m.check,He,mt,l)),ye-=mt,l+=mt,m.length-=mt),m.length))break e;m.length=0,m.mode=nt;case nt:if(m.flags&2048){if(ye===0)break e;mt=0;do jt=He[l+mt++],m.head&&jt&&m.length<65536&&(m.head.name+=String.fromCharCode(jt));while(jt&&mt<ye);if(m.flags&512&&(m.check=i(m.check,He,mt,l)),ye-=mt,l+=mt,jt)break e}else m.head&&(m.head.name=null);m.length=0,m.mode=lt;case lt:if(m.flags&4096){if(ye===0)break e;mt=0;do jt=He[l+mt++],m.head&&jt&&m.length<65536&&(m.head.comment+=String.fromCharCode(jt));while(jt&&mt<ye);if(m.flags&512&&(m.check=i(m.check,He,mt,l)),ye-=mt,l+=mt,jt)break e}else m.head&&(m.head.comment=null);m.mode=it;case it:if(m.flags&512){for(;ce<16;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}if(V!==(m.check&65535)){Z.msg="header crc mismatch",m.mode=kt;break}V=0,ce=0}m.head&&(m.head.hcrc=m.flags>>9&1,m.head.done=!0),Z.adler=m.check=0,m.mode=Re;break;case ft:for(;ce<32;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}Z.adler=m.check=Tn(V),V=0,ce=0,m.mode=tt;case tt:if(m.havedict===0)return Z.next_out=de,Z.avail_out=w,Z.next_in=l,Z.avail_in=ye,m.hold=V,m.bits=ce,q;Z.adler=m.check=1,m.mode=Re;case Re:if(we===M||we===B)break e;case Ot:if(m.last){V>>>=ce&7,ce-=ce&7,m.mode=It;break}for(;ce<3;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}switch(m.last=V&1,V>>>=1,ce-=1,V&3){case 0:m.mode=xt;break;case 1:if(Dn(m),m.mode=Qt,we===B){V>>>=2,ce-=2;break e}break;case 2:m.mode=St;break;case 3:Z.msg="invalid block type",m.mode=kt}V>>>=2,ce-=2;break;case xt:for(V>>>=ce&7,ce-=ce&7;ce<32;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}if((V&65535)!==(V>>>16^65535)){Z.msg="invalid stored block lengths",m.mode=kt;break}if(m.length=V&65535,V=0,ce=0,m.mode=Me,we===B)break e;case Me:m.mode=Ze;case Ze:if(mt=m.length,mt){if(mt>ye&&(mt=ye),mt>w&&(mt=w),mt===0)break e;t.arraySet(Pt,He,l,mt,de),ye-=mt,l+=mt,w-=mt,de+=mt,m.length-=mt;break}m.mode=Re;break;case St:for(;ce<14;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}if(m.nlen=(V&31)+257,V>>>=5,ce-=5,m.ndist=(V&31)+1,V>>>=5,ce-=5,m.ncode=(V&15)+4,V>>>=4,ce-=4,m.nlen>286||m.ndist>30){Z.msg="too many length or distance symbols",m.mode=kt;break}m.have=0,m.mode=$t;case $t:for(;m.have<m.ncode;){for(;ce<3;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}m.lens[Wf[m.have++]]=V&7,V>>>=3,ce-=3}for(;m.have<19;)m.lens[Wf[m.have++]]=0;if(m.lencode=m.lendyn,m.lenbits=7,_i={bits:m.lenbits},Wn=s(f,m.lens,0,19,m.lencode,0,m.work,_i),m.lenbits=_i.bits,Wn){Z.msg="invalid code lengths set",m.mode=kt;break}m.have=0,m.mode=Wt;case Wt:for(;m.have<m.nlen+m.ndist;){for(;kr=m.lencode[V&(1<<m.lenbits)-1],hr=kr>>>24,Yr=kr>>>16&255,vn=kr&65535,!(hr<=ce);){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}if(vn<16)V>>>=hr,ce-=hr,m.lens[m.have++]=vn;else{if(vn===16){for(Xn=hr+2;ce<Xn;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}if(V>>>=hr,ce-=hr,m.have===0){Z.msg="invalid bit length repeat",m.mode=kt;break}jt=m.lens[m.have-1],mt=3+(V&3),V>>>=2,ce-=2}else if(vn===17){for(Xn=hr+3;ce<Xn;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}V>>>=hr,ce-=hr,jt=0,mt=3+(V&7),V>>>=3,ce-=3}else{for(Xn=hr+7;ce<Xn;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}V>>>=hr,ce-=hr,jt=0,mt=11+(V&127),V>>>=7,ce-=7}if(m.have+mt>m.nlen+m.ndist){Z.msg="invalid bit length repeat",m.mode=kt;break}for(;mt--;)m.lens[m.have++]=jt}}if(m.mode===kt)break;if(m.lens[256]===0){Z.msg="invalid code -- missing end-of-block",m.mode=kt;break}if(m.lenbits=9,_i={bits:m.lenbits},Wn=s(u,m.lens,0,m.nlen,m.lencode,0,m.work,_i),m.lenbits=_i.bits,Wn){Z.msg="invalid literal/lengths set",m.mode=kt;break}if(m.distbits=6,m.distcode=m.distdyn,_i={bits:m.distbits},Wn=s(d,m.lens,m.nlen,m.ndist,m.distcode,0,m.work,_i),m.distbits=_i.bits,Wn){Z.msg="invalid distances set",m.mode=kt;break}if(m.mode=Qt,we===B)break e;case Qt:m.mode=or;case or:if(ye>=6&&w>=258){Z.next_out=de,Z.avail_out=w,Z.next_in=l,Z.avail_in=ye,m.hold=V,m.bits=ce,o(Z,at),de=Z.next_out,Pt=Z.output,w=Z.avail_out,l=Z.next_in,He=Z.input,ye=Z.avail_in,V=m.hold,ce=m.bits,m.mode===Re&&(m.back=-1);break}for(m.back=0;kr=m.lencode[V&(1<<m.lenbits)-1],hr=kr>>>24,Yr=kr>>>16&255,vn=kr&65535,!(hr<=ce);){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}if(Yr&&(Yr&240)===0){for(Ln=hr,Ia=Yr,Fa=vn;kr=m.lencode[Fa+((V&(1<<Ln+Ia)-1)>>Ln)],hr=kr>>>24,Yr=kr>>>16&255,vn=kr&65535,!(Ln+hr<=ce);){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}V>>>=Ln,ce-=Ln,m.back+=Ln}if(V>>>=hr,ce-=hr,m.back+=hr,m.length=vn,Yr===0){m.mode=Gt;break}if(Yr&32){m.back=-1,m.mode=Re;break}if(Yr&64){Z.msg="invalid literal/length code",m.mode=kt;break}m.extra=Yr&15,m.mode=xr;case xr:if(m.extra){for(Xn=m.extra;ce<Xn;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}m.length+=V&(1<<m.extra)-1,V>>>=m.extra,ce-=m.extra,m.back+=m.extra}m.was=m.length,m.mode=sr;case sr:for(;kr=m.distcode[V&(1<<m.distbits)-1],hr=kr>>>24,Yr=kr>>>16&255,vn=kr&65535,!(hr<=ce);){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}if((Yr&240)===0){for(Ln=hr,Ia=Yr,Fa=vn;kr=m.distcode[Fa+((V&(1<<Ln+Ia)-1)>>Ln)],hr=kr>>>24,Yr=kr>>>16&255,vn=kr&65535,!(Ln+hr<=ce);){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}V>>>=Ln,ce-=Ln,m.back+=Ln}if(V>>>=hr,ce-=hr,m.back+=hr,Yr&64){Z.msg="invalid distance code",m.mode=kt;break}m.offset=vn,m.extra=Yr&15,m.mode=Kt;case Kt:if(m.extra){for(Xn=m.extra;ce<Xn;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}m.offset+=V&(1<<m.extra)-1,V>>>=m.extra,ce-=m.extra,m.back+=m.extra}if(m.offset>m.dmax){Z.msg="invalid distance too far back",m.mode=kt;break}m.mode=br;case br:if(w===0)break e;if(mt=at-w,m.offset>mt){if(mt=m.offset-mt,mt>m.whave&&m.sane){Z.msg="invalid distance too far back",m.mode=kt;break}mt>m.wnext?(mt-=m.wnext,ur=m.wsize-mt):ur=m.wnext-mt,mt>m.length&&(mt=m.length),vi=m.window}else vi=Pt,ur=de-m.offset,mt=m.length;mt>w&&(mt=w),w-=mt,m.length-=mt;do Pt[de++]=vi[ur++];while(--mt);m.length===0&&(m.mode=or);break;case Gt:if(w===0)break e;Pt[de++]=m.length,w--,m.mode=or;break;case It:if(m.wrap){for(;ce<32;){if(ye===0)break e;ye--,V|=He[l++]<<ce,ce+=8}if(at-=w,Z.total_out+=at,m.total+=at,at&&(Z.adler=m.check=m.flags?i(m.check,Pt,at,de-at):n(m.check,Pt,at,de-at)),at=w,(m.flags?V:Tn(V))!==m.check){Z.msg="incorrect data check",m.mode=kt;break}V=0,ce=0}m.mode=hn;case hn:if(m.wrap&&m.flags){for(;ce<32;){if(ye===0)break e;ye--,V+=He[l++]<<ce,ce+=8}if(V!==(m.total&4294967295)){Z.msg="incorrect length check",m.mode=kt;break}V=0,ce=0}m.mode=jr;case jr:Wn=U;break e;case kt:Wn=pe;break e;case Pr:return le;case Fr:default:return D}return Z.next_out=de,Z.avail_out=w,Z.next_in=l,Z.avail_in=ye,m.hold=V,m.bits=ce,(m.wsize||at!==Z.avail_out&&m.mode<kt&&(m.mode<It||we!==v))&&Bn(Z,Z.output,Z.next_out,at-Z.avail_out),Et-=Z.avail_in,at-=Z.avail_out,Z.total_in+=Et,Z.total_out+=at,m.total+=at,m.wrap&&at&&(Z.adler=m.check=m.flags?i(m.check,Pt,at,Z.next_out-at):n(m.check,Pt,at,Z.next_out-at)),Z.data_type=m.bits+(m.last?64:0)+(m.mode===Re?128:0)+(m.mode===Qt||m.mode===Me?256:0),(Et===0&&at===0||we===v)&&Wn===p&&(Wn=x),Wn}function Ue(Z){if(!Z||!Z.state)return D;var we=Z.state;return we.window&&(we.window=null),Z.state=null,p}function Xe(Z,we){var m;return!Z||!Z.state||(m=Z.state,(m.wrap&2)===0)?D:(m.head=we,we.done=!1,p)}function dt(Z,we){var m=we.length,He,Pt,l;return!Z||!Z.state||(He=Z.state,He.wrap!==0&&He.mode!==tt)?D:He.mode===tt&&(Pt=1,Pt=n(Pt,we,m,0),Pt!==He.check)?pe:(l=Bn(Z,we,m,m),l?(He.mode=Pr,le):(He.havedict=1,p))}return Ci.inflateReset=an,Ci.inflateReset2=E,Ci.inflateResetKeep=Jr,Ci.inflateInit=dn,Ci.inflateInit2=di,Ci.inflate=C,Ci.inflateEnd=Ue,Ci.inflateGetHeader=Xe,Ci.inflateSetDictionary=dt,Ci.inflateInfo="pako inflate (from Nodeca project)",Ci}var Oh,Ov;function Mv(){return Ov||(Ov=1,Oh={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),Oh}var Mh,Iv;function py(){if(Iv)return Mh;Iv=1;function t(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}return Mh=t,Mh}var Fv;function my(){if(Fv)return zf;Fv=1;var t=_y(),n=go(),i=Av(),o=Mv(),s=Dh(),f=Ev(),u=py(),d=Object.prototype.toString;function v(p){if(!(this instanceof v))return new v(p);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},p||{});var U=this.options;U.raw&&U.windowBits>=0&&U.windowBits<16&&(U.windowBits=-U.windowBits,U.windowBits===0&&(U.windowBits=-15)),U.windowBits>=0&&U.windowBits<16&&!(p&&p.windowBits)&&(U.windowBits+=32),U.windowBits>15&&U.windowBits<48&&(U.windowBits&15)===0&&(U.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var q=t.inflateInit2(this.strm,U.windowBits);if(q!==o.Z_OK)throw new Error(s[q]);if(this.header=new u,t.inflateGetHeader(this.strm,this.header),U.dictionary&&(typeof U.dictionary=="string"?U.dictionary=i.string2buf(U.dictionary):d.call(U.dictionary)==="[object ArrayBuffer]"&&(U.dictionary=new Uint8Array(U.dictionary)),U.raw&&(q=t.inflateSetDictionary(this.strm,U.dictionary),q!==o.Z_OK)))throw new Error(s[q])}v.prototype.push=function(p,U){var q=this.strm,D=this.options.chunkSize,pe=this.options.dictionary,le,x,A,g,b,N=!1;if(this.ended)return!1;x=U===~~U?U:U===!0?o.Z_FINISH:o.Z_NO_FLUSH,typeof p=="string"?q.input=i.binstring2buf(p):d.call(p)==="[object ArrayBuffer]"?q.input=new Uint8Array(p):q.input=p,q.next_in=0,q.avail_in=q.input.length;do{if(q.avail_out===0&&(q.output=new n.Buf8(D),q.next_out=0,q.avail_out=D),le=t.inflate(q,o.Z_NO_FLUSH),le===o.Z_NEED_DICT&&pe&&(le=t.inflateSetDictionary(this.strm,pe)),le===o.Z_BUF_ERROR&&N===!0&&(le=o.Z_OK,N=!1),le!==o.Z_STREAM_END&&le!==o.Z_OK)return this.onEnd(le),this.ended=!0,!1;q.next_out&&(q.avail_out===0||le===o.Z_STREAM_END||q.avail_in===0&&(x===o.Z_FINISH||x===o.Z_SYNC_FLUSH))&&(this.options.to==="string"?(A=i.utf8border(q.output,q.next_out),g=q.next_out-A,b=i.buf2string(q.output,A),q.next_out=g,q.avail_out=D-g,g&&n.arraySet(q.output,q.output,A,g,0),this.onData(b)):this.onData(n.shrinkBuf(q.output,q.next_out))),q.avail_in===0&&q.avail_out===0&&(N=!0)}while((q.avail_in>0||q.avail_out===0)&&le!==o.Z_STREAM_END);return le===o.Z_STREAM_END&&(x=o.Z_FINISH),x===o.Z_FINISH?(le=t.inflateEnd(this.strm),this.onEnd(le),this.ended=!0,le===o.Z_OK):(x===o.Z_SYNC_FLUSH&&(this.onEnd(o.Z_OK),q.avail_out=0),!0)},v.prototype.onData=function(p){this.chunks.push(p)},v.prototype.onEnd=function(p){p===o.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg};function M(p,U){var q=new v(U);if(q.push(p,!0),q.err)throw q.msg||s[q.err];return q.result}function B(p,U){return U=U||{},U.raw=!0,M(p,U)}return zf.Inflate=v,zf.inflate=M,zf.inflateRaw=B,zf.ungzip=M,zf}var Ih,kv;function gy(){if(kv)return Ih;kv=1;var t=go().assign,n=hy(),i=my(),o=Mv(),s={};return t(s,n,i,o),Ih=s,Ih}(function(t){(function(){var n={},i;t.exports=n,typeof uy=="function"?i=gy():i=window.pako,function(o,s){o.toRGBA8=function(f){var u=f.width,d=f.height;if(f.tabs.acTL==null)return[o.toRGBA8.decodeImage(f.data,u,d,f).buffer];var v=[];f.frames[0].data==null&&(f.frames[0].data=f.data);for(var M,B=new Uint8Array(u*d*4),p=0;p<f.frames.length;p++){var U=f.frames[p],q=U.rect.x,D=U.rect.y,pe=U.rect.width,le=U.rect.height,x=o.toRGBA8.decodeImage(U.data,pe,le,f);if(p==0?M=x:U.blend==0?o._copyTile(x,pe,le,M,u,d,q,D,0):U.blend==1&&o._copyTile(x,pe,le,M,u,d,q,D,1),v.push(M.buffer),M=M.slice(0),U.dispose!=0){if(U.dispose==1)o._copyTile(B,pe,le,M,u,d,q,D,0);else if(U.dispose==2){for(var A=p-1;f.frames[A].dispose==2;)A--;M=new Uint8Array(v[A]).slice(0)}}}return v},o.toRGBA8.decodeImage=function(f,u,d,v){var M=u*d,B=o.decode._getBPP(v),p=Math.ceil(u*B/8),U=new Uint8Array(M*4),q=new Uint32Array(U.buffer),D=v.ctype,pe=v.depth,le=o._bin.readUshort;if(D==6){var x=M<<2;if(pe==8)for(var A=0;A<x;A++)U[A]=f[A];if(pe==16)for(var A=0;A<x;A++)U[A]=f[A<<1]}else if(D==2){var g=v.tabs.tRNS,b=-1,N=-1,F=-1;if(g&&(b=g[0],N=g[1],F=g[2]),pe==8)for(var A=0;A<M;A++){var J=A<<2,Te=A*3;U[J]=f[Te],U[J+1]=f[Te+1],U[J+2]=f[Te+2],U[J+3]=255,b!=-1&&f[Te]==b&&f[Te+1]==N&&f[Te+2]==F&&(U[J+3]=0)}if(pe==16)for(var A=0;A<M;A++){var J=A<<2,Te=A*6;U[J]=f[Te],U[J+1]=f[Te+2],U[J+2]=f[Te+4],U[J+3]=255,b!=-1&&le(f,Te)==b&&le(f,Te+2)==N&&le(f,Te+4)==F&&(U[J+3]=0)}}else if(D==3){var nt=v.tabs.PLTE,lt=v.tabs.tRNS,it=lt?lt.length:0;if(pe==1)for(var ft=0;ft<d;ft++)for(var tt=ft*p,Re=ft*u,A=0;A<u;A++){var J=Re+A<<2,Ot=f[tt+(A>>3)]>>7-((A&7)<<0)&1,xt=3*Ot;U[J]=nt[xt],U[J+1]=nt[xt+1],U[J+2]=nt[xt+2],U[J+3]=Ot<it?lt[Ot]:255}if(pe==2)for(var ft=0;ft<d;ft++)for(var tt=ft*p,Re=ft*u,A=0;A<u;A++){var J=Re+A<<2,Ot=f[tt+(A>>2)]>>6-((A&3)<<1)&3,xt=3*Ot;U[J]=nt[xt],U[J+1]=nt[xt+1],U[J+2]=nt[xt+2],U[J+3]=Ot<it?lt[Ot]:255}if(pe==4)for(var ft=0;ft<d;ft++)for(var tt=ft*p,Re=ft*u,A=0;A<u;A++){var J=Re+A<<2,Ot=f[tt+(A>>1)]>>4-((A&1)<<2)&15,xt=3*Ot;U[J]=nt[xt],U[J+1]=nt[xt+1],U[J+2]=nt[xt+2],U[J+3]=Ot<it?lt[Ot]:255}if(pe==8)for(var A=0;A<M;A++){var J=A<<2,Ot=f[A],xt=3*Ot;U[J]=nt[xt],U[J+1]=nt[xt+1],U[J+2]=nt[xt+2],U[J+3]=Ot<it?lt[Ot]:255}}else if(D==4){if(pe==8)for(var A=0;A<M;A++){var J=A<<2,Me=A<<1,Ze=f[Me];U[J]=Ze,U[J+1]=Ze,U[J+2]=Ze,U[J+3]=f[Me+1]}if(pe==16)for(var A=0;A<M;A++){var J=A<<2,Me=A<<2,Ze=f[Me];U[J]=Ze,U[J+1]=Ze,U[J+2]=Ze,U[J+3]=f[Me+2]}}else if(D==0){var b=v.tabs.tRNS?v.tabs.tRNS:-1;if(pe==1)for(var A=0;A<M;A++){var Ze=255*(f[A>>3]>>7-(A&7)&1),St=Ze==b*255?0:255;q[A]=St<<24|Ze<<16|Ze<<8|Ze}if(pe==2)for(var A=0;A<M;A++){var Ze=85*(f[A>>2]>>6-((A&3)<<1)&3),St=Ze==b*85?0:255;q[A]=St<<24|Ze<<16|Ze<<8|Ze}if(pe==4)for(var A=0;A<M;A++){var Ze=17*(f[A>>1]>>4-((A&1)<<2)&15),St=Ze==b*17?0:255;q[A]=St<<24|Ze<<16|Ze<<8|Ze}if(pe==8)for(var A=0;A<M;A++){var Ze=f[A],St=Ze==b?0:255;q[A]=St<<24|Ze<<16|Ze<<8|Ze}if(pe==16)for(var A=0;A<M;A++){var Ze=f[A<<1],St=le(f,A<<1)==b?0:255;q[A]=St<<24|Ze<<16|Ze<<8|Ze}}return U},o.decode=function(f){for(var u=new Uint8Array(f),d=8,v=o._bin,M=v.readUshort,B=v.readUint,p={tabs:{},frames:[]},U=new Uint8Array(u.length),q=0,D,pe=0,le=[137,80,78,71,13,10,26,10],x=0;x<8;x++)if(u[x]!=le[x])throw"The input is not a PNG file!";for(;d<u.length;){var A=v.readUint(u,d);d+=4;var g=v.readASCII(u,d,4);if(d+=4,g=="IHDR")o.decode._IHDR(u,d,p);else if(g=="IDAT"){for(var x=0;x<A;x++)U[q+x]=u[d+x];q+=A}else if(g=="acTL")p.tabs[g]={num_frames:B(u,d),num_plays:B(u,d+4)},D=new Uint8Array(u.length);else if(g=="fcTL"){if(pe!=0){var b=p.frames[p.frames.length-1];b.data=o.decode._decompress(p,D.slice(0,pe),b.rect.width,b.rect.height),pe=0}var N={x:B(u,d+12),y:B(u,d+16),width:B(u,d+4),height:B(u,d+8)},F=M(u,d+22);F=M(u,d+20)/(F==0?100:F);var J={rect:N,delay:Math.round(F*1e3),dispose:u[d+24],blend:u[d+25]};p.frames.push(J)}else if(g=="fdAT"){for(var x=0;x<A-4;x++)D[pe+x]=u[d+x+4];pe+=A-4}else if(g=="pHYs")p.tabs[g]=[v.readUint(u,d),v.readUint(u,d+4),u[d+8]];else if(g=="cHRM"){p.tabs[g]=[];for(var x=0;x<8;x++)p.tabs[g].push(v.readUint(u,d+x*4))}else if(g=="tEXt"){p.tabs[g]==null&&(p.tabs[g]={});var Te=v.nextZero(u,d),nt=v.readASCII(u,d,Te-d),lt=v.readASCII(u,Te+1,d+A-Te-1);p.tabs[g][nt]=lt}else if(g=="iTXt"){p.tabs[g]==null&&(p.tabs[g]={});var Te=0,it=d;Te=v.nextZero(u,it);var nt=v.readASCII(u,it,Te-it);it=Te+1,u[it],u[it+1],it+=2,Te=v.nextZero(u,it),v.readASCII(u,it,Te-it),it=Te+1,Te=v.nextZero(u,it),v.readUTF8(u,it,Te-it),it=Te+1;var lt=v.readUTF8(u,it,A-(it-d));p.tabs[g][nt]=lt}else if(g=="PLTE")p.tabs[g]=v.readBytes(u,d,A);else if(g=="hIST"){var ft=p.tabs.PLTE.length/3;p.tabs[g]=[];for(var x=0;x<ft;x++)p.tabs[g].push(M(u,d+x*2))}else if(g=="tRNS")p.ctype==3?p.tabs[g]=v.readBytes(u,d,A):p.ctype==0?p.tabs[g]=M(u,d):p.ctype==2&&(p.tabs[g]=[M(u,d),M(u,d+2),M(u,d+4)]);else if(g=="gAMA")p.tabs[g]=v.readUint(u,d)/1e5;else if(g=="sRGB")p.tabs[g]=u[d];else if(g=="bKGD")p.ctype==0||p.ctype==4?p.tabs[g]=[M(u,d)]:p.ctype==2||p.ctype==6?p.tabs[g]=[M(u,d),M(u,d+2),M(u,d+4)]:p.ctype==3&&(p.tabs[g]=u[d]);else if(g=="IEND"){if(pe!=0){var b=p.frames[p.frames.length-1];b.data=o.decode._decompress(p,D.slice(0,pe),b.rect.width,b.rect.height),pe=0}p.data=o.decode._decompress(p,U,p.width,p.height);break}d+=A,v.readUint(u,d),d+=4}return delete p.compress,delete p.interlace,delete p.filter,p},o.decode._decompress=function(f,u,d,v){return f.compress==0&&(u=o.decode._inflate(u)),f.interlace==0?u=o.decode._filterZero(u,f,0,d,v):f.interlace==1&&(u=o.decode._readInterlace(u,f)),u},o.decode._inflate=function(f){return s.inflate(f)},o.decode._readInterlace=function(f,u){for(var d=u.width,v=u.height,M=o.decode._getBPP(u),B=M>>3,p=Math.ceil(d*M/8),U=new Uint8Array(v*p),q=0,D=[0,0,4,0,2,0,1],pe=[0,4,0,2,0,1,0],le=[8,8,8,4,4,2,2],x=[8,8,4,4,2,2,1],A=0;A<7;){for(var g=le[A],b=x[A],N=0,F=0,J=D[A];J<v;)J+=g,F++;for(var Te=pe[A];Te<d;)Te+=b,N++;var nt=Math.ceil(N*M/8);o.decode._filterZero(f,u,q,N,F);for(var lt=0,it=D[A];it<v;){for(var ft=pe[A],tt=q+lt*nt<<3;ft<d;){if(M==1){var Re=f[tt>>3];Re=Re>>7-(tt&7)&1,U[it*p+(ft>>3)]|=Re<<7-((ft&3)<<0)}if(M==2){var Re=f[tt>>3];Re=Re>>6-(tt&7)&3,U[it*p+(ft>>2)]|=Re<<6-((ft&3)<<1)}if(M==4){var Re=f[tt>>3];Re=Re>>4-(tt&7)&15,U[it*p+(ft>>1)]|=Re<<4-((ft&1)<<2)}if(M>=8)for(var Ot=it*p+ft*B,xt=0;xt<B;xt++)U[Ot+xt]=f[(tt>>3)+xt];tt+=M,ft+=b}lt++,it+=g}N*F!=0&&(q+=F*(1+nt)),A=A+1}return U},o.decode._getBPP=function(f){var u=[1,null,3,1,2,null,4][f.ctype];return u*f.depth},o.decode._filterZero=function(f,u,d,v,M){var B=o.decode._getBPP(u),p=Math.ceil(v*B/8),U=o.decode._paeth;B=Math.ceil(B/8);for(var q=0;q<M;q++){var D=d+q*p,pe=D+q+1,le=f[pe-1];if(le==0)for(var x=0;x<p;x++)f[D+x]=f[pe+x];else if(le==1){for(var x=0;x<B;x++)f[D+x]=f[pe+x];for(var x=B;x<p;x++)f[D+x]=f[pe+x]+f[D+x-B]&255}else if(q==0){for(var x=0;x<B;x++)f[D+x]=f[pe+x];if(le==2)for(var x=B;x<p;x++)f[D+x]=f[pe+x]&255;if(le==3)for(var x=B;x<p;x++)f[D+x]=f[pe+x]+(f[D+x-B]>>1)&255;if(le==4)for(var x=B;x<p;x++)f[D+x]=f[pe+x]+U(f[D+x-B],0,0)&255}else{if(le==2)for(var x=0;x<p;x++)f[D+x]=f[pe+x]+f[D+x-p]&255;if(le==3){for(var x=0;x<B;x++)f[D+x]=f[pe+x]+(f[D+x-p]>>1)&255;for(var x=B;x<p;x++)f[D+x]=f[pe+x]+(f[D+x-p]+f[D+x-B]>>1)&255}if(le==4){for(var x=0;x<B;x++)f[D+x]=f[pe+x]+U(0,f[D+x-p],0)&255;for(var x=B;x<p;x++)f[D+x]=f[pe+x]+U(f[D+x-B],f[D+x-p],f[D+x-B-p])&255}}}return f},o.decode._paeth=function(f,u,d){var v=f+u-d,M=Math.abs(v-f),B=Math.abs(v-u),p=Math.abs(v-d);return M<=B&&M<=p?f:B<=p?u:d},o.decode._IHDR=function(f,u,d){var v=o._bin;d.width=v.readUint(f,u),u+=4,d.height=v.readUint(f,u),u+=4,d.depth=f[u],u++,d.ctype=f[u],u++,d.compress=f[u],u++,d.filter=f[u],u++,d.interlace=f[u],u++},o._bin={nextZero:function(f,u){for(;f[u]!=0;)u++;return u},readUshort:function(f,u){return f[u]<<8|f[u+1]},writeUshort:function(f,u,d){f[u]=d>>8&255,f[u+1]=d&255},readUint:function(f,u){return f[u]*(256*256*256)+(f[u+1]<<16|f[u+2]<<8|f[u+3])},writeUint:function(f,u,d){f[u]=d>>24&255,f[u+1]=d>>16&255,f[u+2]=d>>8&255,f[u+3]=d&255},readASCII:function(f,u,d){for(var v="",M=0;M<d;M++)v+=String.fromCharCode(f[u+M]);return v},writeASCII:function(f,u,d){for(var v=0;v<d.length;v++)f[u+v]=d.charCodeAt(v)},readBytes:function(f,u,d){for(var v=[],M=0;M<d;M++)v.push(f[u+M]);return v},pad:function(f){return f.length<2?"0"+f:f},readUTF8:function(f,u,d){for(var v="",M,B=0;B<d;B++)v+="%"+o._bin.pad(f[u+B].toString(16));try{M=decodeURIComponent(v)}catch{return o._bin.readASCII(f,u,d)}return M}},o._copyTile=function(f,u,d,v,M,B,p,U,q){for(var D=Math.min(u,M),pe=Math.min(d,B),le=0,x=0,A=0;A<pe;A++)for(var g=0;g<D;g++)if(p>=0&&U>=0?(le=A*u+g<<2,x=(U+A)*M+p+g<<2):(le=(-U+A)*u-p+g<<2,x=A*M+g<<2),q==0)v[x]=f[le],v[x+1]=f[le+1],v[x+2]=f[le+2],v[x+3]=f[le+3];else if(q==1){var b=f[le+3]*.00392156862745098,N=f[le]*b,F=f[le+1]*b,J=f[le+2]*b,Te=v[x+3]*(1/255),nt=v[x]*Te,lt=v[x+1]*Te,it=v[x+2]*Te,ft=1-b,tt=b+Te*ft,Re=tt==0?0:1/tt;v[x+3]=255*tt,v[x+0]=(N+nt*ft)*Re,v[x+1]=(F+lt*ft)*Re,v[x+2]=(J+it*ft)*Re}else if(q==2){var b=f[le+3],N=f[le],F=f[le+1],J=f[le+2],Te=v[x+3],nt=v[x],lt=v[x+1],it=v[x+2];b==Te&&N==nt&&F==lt&&J==it?(v[x]=0,v[x+1]=0,v[x+2]=0,v[x+3]=0):(v[x]=N,v[x+1]=F,v[x+2]=J,v[x+3]=b)}else if(q==3){var b=f[le+3],N=f[le],F=f[le+1],J=f[le+2],Te=v[x+3],nt=v[x],lt=v[x+1],it=v[x+2];if(b==Te&&N==nt&&F==lt&&J==it)continue;if(b<220&&Te>20)return!1}return!0},o.encode=function(f,u,d,v,M,B){v==null&&(v=0),B==null&&(B=!1);for(var p=new Uint8Array(f[0].byteLength*f.length+100),U=[137,80,78,71,13,10,26,10],q=0;q<8;q++)p[q]=U[q];var D=8,pe=o._bin,le=o.crc.crc,x=pe.writeUint,A=pe.writeUshort,g=pe.writeASCII,b=o.encode.compressPNG(f,u,d,v,B);x(p,D,13),D+=4,g(p,D,"IHDR"),D+=4,x(p,D,u),D+=4,x(p,D,d),D+=4,p[D]=b.depth,D++,p[D]=b.ctype,D++,p[D]=0,D++,p[D]=0,D++,p[D]=0,D++,x(p,D,le(p,D-17,17)),D+=4,x(p,D,1),D+=4,g(p,D,"sRGB"),D+=4,p[D]=1,D++,x(p,D,le(p,D-5,5)),D+=4;var N=f.length>1;if(N&&(x(p,D,8),D+=4,g(p,D,"acTL"),D+=4,x(p,D,f.length),D+=4,x(p,D,0),D+=4,x(p,D,le(p,D-12,12)),D+=4),b.ctype==3){var F=b.plte.length;x(p,D,F*3),D+=4,g(p,D,"PLTE"),D+=4;for(var q=0;q<F;q++){var J=q*3,Te=b.plte[q],nt=Te&255,lt=Te>>8&255,it=Te>>16&255;p[D+J+0]=nt,p[D+J+1]=lt,p[D+J+2]=it}if(D+=F*3,x(p,D,le(p,D-F*3-4,F*3+4)),D+=4,b.gotAlpha){x(p,D,F),D+=4,g(p,D,"tRNS"),D+=4;for(var q=0;q<F;q++)p[D+q]=b.plte[q]>>24&255;D+=F,x(p,D,le(p,D-F-4,F+4)),D+=4}}for(var ft=0,tt=0;tt<b.frames.length;tt++){var Re=b.frames[tt];N&&(x(p,D,26),D+=4,g(p,D,"fcTL"),D+=4,x(p,D,ft++),D+=4,x(p,D,Re.rect.width),D+=4,x(p,D,Re.rect.height),D+=4,x(p,D,Re.rect.x),D+=4,x(p,D,Re.rect.y),D+=4,A(p,D,M[tt]),D+=2,A(p,D,1e3),D+=2,p[D]=Re.dispose,D++,p[D]=Re.blend,D++,x(p,D,le(p,D-30,30)),D+=4);var Ot=Re.cimg,F=Ot.length;x(p,D,F+(tt==0?0:4)),D+=4;var xt=D;g(p,D,tt==0?"IDAT":"fdAT"),D+=4,tt!=0&&(x(p,D,ft++),D+=4);for(var q=0;q<F;q++)p[D+q]=Ot[q];D+=F,x(p,D,le(p,xt,D-xt)),D+=4}return x(p,D,0),D+=4,g(p,D,"IEND"),D+=4,x(p,D,le(p,D-4,4)),D+=4,p.buffer.slice(0,D)},o.encode.compressPNG=function(f,u,d,v,M){for(var B=o.encode.compress(f,u,d,v,!1,M),p=0;p<f.length;p++){var U=B.frames[p];U.rect.width;var q=U.rect.height,D=U.bpl,pe=U.bpp,le=new Uint8Array(q*D+q);U.cimg=o.encode._filterZero(U.img,q,pe,D,le)}return B},o.encode.compress=function(f,u,d,v,M,B){B==null&&(B=!1);for(var p=6,U=8,q=4,D=255,pe=0;pe<f.length;pe++)for(var le=new Uint8Array(f[pe]),x=le.length,A=0;A<x;A+=4)D&=le[A+3];var g=D!=255,b={},N=[];if(f.length!=0&&(b[0]=0,N.push(0),v!=0&&v--),v!=0){var F=o.quantize(f,v,M);f=F.bufs;for(var A=0;A<F.plte.length;A++){var J=F.plte[A].est.rgba;b[J]==null&&(b[J]=N.length,N.push(J))}}else for(var pe=0;pe<f.length;pe++)for(var Te=new Uint32Array(f[pe]),x=Te.length,A=0;A<x;A++){var J=Te[A];if((A<u||J!=Te[A-1]&&J!=Te[A-u])&&b[J]==null&&(b[J]=N.length,N.push(J),N.length>=300))break}var nt=g?M:!1,lt=N.length;lt<=256&&B==!1&&(lt<=2?U=1:lt<=4?U=2:lt<=16?U=4:U=8,M&&(U=8),g=!0);for(var it=[],pe=0;pe<f.length;pe++){var ft=new Uint8Array(f[pe]),tt=new Uint32Array(ft.buffer),Re=0,Ot=0,xt=u,Me=d,Ze=0;if(pe!=0&&!nt){for(var St=M||pe==1||it[it.length-2].dispose==2?1:2,$t=0,Wt=1e9,Qt=0;Qt<St;Qt++){for(var jr=new Uint8Array(f[pe-1-Qt]),or=new Uint32Array(f[pe-1-Qt]),xr=u,sr=d,Kt=-1,br=-1,Gt=0;Gt<d;Gt++)for(var It=0;It<u;It++){var A=Gt*u+It;tt[A]!=or[A]&&(It<xr&&(xr=It),It>Kt&&(Kt=It),Gt<sr&&(sr=Gt),Gt>br&&(br=Gt))}var hn=Kt==-1?1:(Kt-xr+1)*(br-sr+1);hn<Wt&&(Wt=hn,$t=Qt,Kt==-1?(Re=Ot=0,xt=Me=1):(Re=xr,Ot=sr,xt=Kt-xr+1,Me=br-sr+1))}var jr=new Uint8Array(f[pe-1-$t]);$t==1&&(it[it.length-1].dispose=2);var kt=new Uint8Array(xt*Me*4);new Uint32Array(kt.buffer),o._copyTile(jr,u,d,kt,xt,Me,-Re,-Ot,0),o._copyTile(ft,u,d,kt,xt,Me,-Re,-Ot,3)?(o._copyTile(ft,u,d,kt,xt,Me,-Re,-Ot,2),Ze=1):(o._copyTile(ft,u,d,kt,xt,Me,-Re,-Ot,0),Ze=0),ft=kt,tt=new Uint32Array(ft.buffer)}var Pr=4*xt;if(lt<=256&&B==!1){Pr=Math.ceil(U*xt/8);for(var kt=new Uint8Array(Pr*Me),Gt=0;Gt<Me;Gt++){var A=Gt*Pr,Fr=Gt*xt;if(U==8)for(var It=0;It<xt;It++)kt[A+It]=b[tt[Fr+It]];else if(U==4)for(var It=0;It<xt;It++)kt[A+(It>>1)]|=b[tt[Fr+It]]<<4-(It&1)*4;else if(U==2)for(var It=0;It<xt;It++)kt[A+(It>>2)]|=b[tt[Fr+It]]<<6-(It&3)*2;else if(U==1)for(var It=0;It<xt;It++)kt[A+(It>>3)]|=b[tt[Fr+It]]<<7-(It&7)*1}ft=kt,p=3,q=1}else if(g==!1&&f.length==1){for(var kt=new Uint8Array(xt*Me*3),Zr=xt*Me,A=0;A<Zr;A++){var Qr=A*3,ir=A*4;kt[Qr]=ft[ir],kt[Qr+1]=ft[ir+1],kt[Qr+2]=ft[ir+2]}ft=kt,p=2,q=3,Pr=3*xt}it.push({rect:{x:Re,y:Ot,width:xt,height:Me},img:ft,bpl:Pr,bpp:q,blend:Ze,dispose:nt?1:0})}return{ctype:p,depth:U,plte:N,gotAlpha:g,frames:it}},o.encode._filterZero=function(f,u,d,v,M){for(var B=[],p=0;p<5;p++)if(!(u*v>5e5&&(p==2||p==3||p==4))){for(var U=0;U<u;U++)o.encode._filterLine(M,f,U,v,d,p);if(B.push(s.deflate(M)),d==1)break}for(var q,D=1e9,pe=0;pe<B.length;pe++)B[pe].length<D&&(q=pe,D=B[pe].length);return B[q]},o.encode._filterLine=function(f,u,d,v,M,B){var p=d*v,U=p+d,q=o.decode._paeth;if(f[U]=B,U++,B==0)for(var D=0;D<v;D++)f[U+D]=u[p+D];else if(B==1){for(var D=0;D<M;D++)f[U+D]=u[p+D];for(var D=M;D<v;D++)f[U+D]=u[p+D]-u[p+D-M]+256&255}else if(d==0){for(var D=0;D<M;D++)f[U+D]=u[p+D];if(B==2)for(var D=M;D<v;D++)f[U+D]=u[p+D];if(B==3)for(var D=M;D<v;D++)f[U+D]=u[p+D]-(u[p+D-M]>>1)+256&255;if(B==4)for(var D=M;D<v;D++)f[U+D]=u[p+D]-q(u[p+D-M],0,0)+256&255}else{if(B==2)for(var D=0;D<v;D++)f[U+D]=u[p+D]+256-u[p+D-v]&255;if(B==3){for(var D=0;D<M;D++)f[U+D]=u[p+D]+256-(u[p+D-v]>>1)&255;for(var D=M;D<v;D++)f[U+D]=u[p+D]+256-(u[p+D-v]+u[p+D-M]>>1)&255}if(B==4){for(var D=0;D<M;D++)f[U+D]=u[p+D]+256-q(0,u[p+D-v],0)&255;for(var D=M;D<v;D++)f[U+D]=u[p+D]+256-q(u[p+D-M],u[p+D-v],u[p+D-M-v])&255}}},o.crc={table:function(){for(var f=new Uint32Array(256),u=0;u<256;u++){for(var d=u,v=0;v<8;v++)d&1?d=3988292384^d>>>1:d=d>>>1;f[u]=d}return f}(),update:function(f,u,d,v){for(var M=0;M<v;M++)f=o.crc.table[(f^u[d+M])&255]^f>>>8;return f},crc:function(f,u,d){return o.crc.update(4294967295,f,u,d)^4294967295}},o.quantize=function(f,u,d){for(var v=[],M=0,B=0;B<f.length;B++)v.push(o.encode.alphaMul(new Uint8Array(f[B]),d)),M+=f[B].byteLength;for(var p=new Uint8Array(M),U=new Uint32Array(p.buffer),q=0,B=0;B<v.length;B++){for(var D=v[B],pe=D.length,le=0;le<pe;le++)p[q+le]=D[le];q+=pe}var x={i0:0,i1:p.length,bst:null,est:null,tdst:0,left:null,right:null};x.bst=o.quantize.stats(p,x.i0,x.i1),x.est=o.quantize.estats(x.bst);for(var A=[x];A.length<u;){for(var g=0,b=0,B=0;B<A.length;B++)A[B].est.L>g&&(g=A[B].est.L,b=B);if(g<.001)break;var N=A[b],F=o.quantize.splitPixels(p,U,N.i0,N.i1,N.est.e,N.est.eMq255),J={i0:N.i0,i1:F,bst:null,est:null,tdst:0,left:null,right:null};J.bst=o.quantize.stats(p,J.i0,J.i1),J.est=o.quantize.estats(J.bst);var Te={i0:F,i1:N.i1,bst:null,est:null,tdst:0,left:null,right:null};Te.bst={R:[],m:[],N:N.bst.N-J.bst.N};for(var B=0;B<16;B++)Te.bst.R[B]=N.bst.R[B]-J.bst.R[B];for(var B=0;B<4;B++)Te.bst.m[B]=N.bst.m[B]-J.bst.m[B];Te.est=o.quantize.estats(Te.bst),N.left=J,N.right=Te,A[b]=J,A.push(Te)}A.sort(function(St,$t){return $t.bst.N-St.bst.N});for(var nt=0;nt<v.length;nt++){for(var lt=o.quantize.planeDst,it=new Uint8Array(v[nt].buffer),ft=new Uint32Array(v[nt].buffer),tt=it.length,B=0;B<tt;B+=4){for(var Re=it[B]*.00392156862745098,Ot=it[B+1]*(1/255),xt=it[B+2]*(1/255),Me=it[B+3]*(1/255),Ze=x;Ze.left;)Ze=lt(Ze.est,Re,Ot,xt,Me)<=0?Ze.left:Ze.right;ft[B>>2]=Ze.est.rgba}v[nt]=ft.buffer}return{bufs:v,plte:A}},o.quantize.getNearest=function(f,u,d,v,M){if(f.left==null)return f.tdst=o.quantize.dist(f.est.q,u,d,v,M),f;var B=o.quantize.planeDst(f.est,u,d,v,M),p=f.left,U=f.right;B>0&&(p=f.right,U=f.left);var q=o.quantize.getNearest(p,u,d,v,M);if(q.tdst<=B*B)return q;var D=o.quantize.getNearest(U,u,d,v,M);return D.tdst<q.tdst?D:q},o.quantize.planeDst=function(f,u,d,v,M){var B=f.e;return B[0]*u+B[1]*d+B[2]*v+B[3]*M-f.eMq},o.quantize.dist=function(f,u,d,v,M){var B=u-f[0],p=d-f[1],U=v-f[2],q=M-f[3];return B*B+p*p+U*U+q*q},o.quantize.splitPixels=function(f,u,d,v,M,B){var p=o.quantize.vecDot;for(v-=4;d<v;){for(;p(f,d,M)<=B;)d+=4;for(;p(f,v,M)>B;)v-=4;if(d>=v)break;var U=u[d>>2];u[d>>2]=u[v>>2],u[v>>2]=U,d+=4,v-=4}for(;p(f,d,M)>B;)d-=4;return d+4},o.quantize.vecDot=function(f,u,d){return f[u]*d[0]+f[u+1]*d[1]+f[u+2]*d[2]+f[u+3]*d[3]},o.quantize.stats=function(f,u,d){for(var v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],M=[0,0,0,0],B=d-u>>2,p=u;p<d;p+=4){var U=f[p]*.00392156862745098,q=f[p+1]*(1/255),D=f[p+2]*(1/255),pe=f[p+3]*(1/255);M[0]+=U,M[1]+=q,M[2]+=D,M[3]+=pe,v[0]+=U*U,v[1]+=U*q,v[2]+=U*D,v[3]+=U*pe,v[5]+=q*q,v[6]+=q*D,v[7]+=q*pe,v[10]+=D*D,v[11]+=D*pe,v[15]+=pe*pe}return v[4]=v[1],v[8]=v[2],v[12]=v[3],v[9]=v[6],v[13]=v[7],v[14]=v[11],{R:v,m:M,N:B}},o.quantize.estats=function(f){var u=f.R,d=f.m,v=f.N,M=d[0],B=d[1],p=d[2],U=d[3],q=v==0?0:1/v,D=[u[0]-M*M*q,u[1]-M*B*q,u[2]-M*p*q,u[3]-M*U*q,u[4]-B*M*q,u[5]-B*B*q,u[6]-B*p*q,u[7]-B*U*q,u[8]-p*M*q,u[9]-p*B*q,u[10]-p*p*q,u[11]-p*U*q,u[12]-U*M*q,u[13]-U*B*q,u[14]-U*p*q,u[15]-U*U*q],pe=D,le=o.M4,x=[.5,.5,.5,.5],A=0,g=0;if(v!=0)for(var b=0;b<10&&(x=le.multVec(pe,x),g=Math.sqrt(le.dot(x,x)),x=le.sml(1/g,x),!(Math.abs(g-A)<1e-9));b++)A=g;var N=[M*q,B*q,p*q,U*q],F=le.dot(le.sml(255,N),x),J=N[3]<.001?0:1/N[3];return{Cov:D,q:N,e:x,L:A,eMq255:F,eMq:le.dot(x,N),rgba:(Math.round(255*N[3])<<24|Math.round(255*N[2]*J)<<16|Math.round(255*N[1]*J)<<8|Math.round(255*N[0]*J)<<0)>>>0}},o.M4={multVec:function(f,u){return[f[0]*u[0]+f[1]*u[1]+f[2]*u[2]+f[3]*u[3],f[4]*u[0]+f[5]*u[1]+f[6]*u[2]+f[7]*u[3],f[8]*u[0]+f[9]*u[1]+f[10]*u[2]+f[11]*u[3],f[12]*u[0]+f[13]*u[1]+f[14]*u[2]+f[15]*u[3]]},dot:function(f,u){return f[0]*u[0]+f[1]*u[1]+f[2]*u[2]+f[3]*u[3]},sml:function(f,u){return[f*u[0],f*u[1],f*u[2],f*u[3]]}},o.encode.alphaMul=function(f,u){for(var d=new Uint8Array(f.length),v=f.length>>2,M=0;M<v;M++){var B=M<<2,p=f[B+3];u&&(p=p<128?0:255);var U=p*(1/255);d[B+0]=f[B+0]*U,d[B+1]=f[B+1]*U,d[B+2]=f[B+2]*U,d[B+3]=p}return d}}(n,i)})()})(wh);var Nv={exports:{}};(function(t,n){(function(i,o){t.exports=o()})(Uf,function(){var i=function(h){return h instanceof Uint8Array||h instanceof Uint16Array||h instanceof Uint32Array||h instanceof Int8Array||h instanceof Int16Array||h instanceof Int32Array||h instanceof Float32Array||h instanceof Float64Array||h instanceof Uint8ClampedArray},o=function(h,T){for(var G=Object.keys(T),fe=0;fe<G.length;++fe)h[G[fe]]=T[G[fe]];return h},s=`
|
|
37
|
+
`;function f(h){return typeof atob<"u"?atob(h):"base64:"+h}function u(h){var T=new Error("(regl) "+h);throw console.error(T),T}function d(h,T){h||u(T)}function v(h){return h?": "+h:""}function M(h,T,G){h in T||u("unknown parameter ("+h+")"+v(G)+". possible values: "+Object.keys(T).join())}function B(h,T){i(h)||u("invalid parameter type"+v(T)+". must be a typed array")}function p(h,T){switch(T){case"number":return typeof h=="number";case"object":return typeof h=="object";case"string":return typeof h=="string";case"boolean":return typeof h=="boolean";case"function":return typeof h=="function";case"undefined":return typeof h>"u";case"symbol":return typeof h=="symbol"}}function U(h,T,G){p(h,T)||u("invalid parameter type"+v(G)+". expected "+T+", got "+typeof h)}function q(h,T){h>=0&&(h|0)===h||u("invalid parameter type, ("+h+")"+v(T)+". must be a nonnegative integer")}function D(h,T,G){T.indexOf(h)<0&&u("invalid value"+v(G)+". must be one of: "+T)}var pe=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function le(h){Object.keys(h).forEach(function(T){pe.indexOf(T)<0&&u('invalid regl constructor argument "'+T+'". must be one of '+pe)})}function x(h,T){for(h=h+"";h.length<T;)h=" "+h;return h}function A(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function g(h,T){this.number=h,this.line=T,this.errors=[]}function b(h,T,G){this.file=h,this.line=T,this.message=G}function N(){var h=new Error,T=(h.stack||h).toString(),G=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(T);if(G)return G[1];var fe=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(T);return fe?fe[1]:"unknown"}function F(){var h=new Error,T=(h.stack||h).toString(),G=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(T);if(G)return G[1];var fe=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(T);return fe?fe[1]:"unknown"}function J(h,T){var G=h.split(`
|
|
38
|
+
`),fe=1,me=0,ae={unknown:new A,0:new A};ae.unknown.name=ae[0].name=T||N(),ae.unknown.lines.push(new g(0,""));for(var se=0;se<G.length;++se){var Le=G[se],De=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(Le);if(De)switch(De[1]){case"line":var Pe=/(\d+)(\s+\d+)?/.exec(De[2]);Pe&&(fe=Pe[1]|0,Pe[2]&&(me=Pe[2]|0,me in ae||(ae[me]=new A)));break;case"define":var Ge=/SHADER_NAME(_B64)?\s+(.*)$/.exec(De[2]);Ge&&(ae[me].name=Ge[1]?f(Ge[2]):Ge[2]);break}ae[me].lines.push(new g(fe++,Le))}return Object.keys(ae).forEach(function(Be){var We=ae[Be];We.lines.forEach(function(Ce){We.index[Ce.number]=Ce})}),ae}function Te(h){var T=[];return h.split(`
|
|
39
|
+
`).forEach(function(G){if(!(G.length<5)){var fe=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(G);fe?T.push(new b(fe[1]|0,fe[2]|0,fe[3].trim())):G.length>0&&T.push(new b("unknown",0,G))}}),T}function nt(h,T){T.forEach(function(G){var fe=h[G.file];if(fe){var me=fe.index[G.line];if(me){me.errors.push(G),fe.hasErrors=!0;return}}h.unknown.hasErrors=!0,h.unknown.lines[0].errors.push(G)})}function lt(h,T,G,fe,me){if(!h.getShaderParameter(T,h.COMPILE_STATUS)){var ae=h.getShaderInfoLog(T),se=fe===h.FRAGMENT_SHADER?"fragment":"vertex";Me(G,"string",se+" shader source must be a string",me);var Le=J(G,me),De=Te(ae);nt(Le,De),Object.keys(Le).forEach(function(Pe){var Ge=Le[Pe];if(!Ge.hasErrors)return;var Be=[""],We=[""];function Ce(ke,K){Be.push(ke),We.push(K||"")}Ce("file number "+Pe+": "+Ge.name+`
|
|
40
|
+
`,"color:red;text-decoration:underline;font-weight:bold"),Ge.lines.forEach(function(ke){if(ke.errors.length>0){Ce(x(ke.number,4)+"| ","background-color:yellow; font-weight:bold"),Ce(ke.line+s,"color:red; background-color:yellow; font-weight:bold");var K=0;ke.errors.forEach(function(oe){var Oe=oe.message,rt=/^\s*'(.*)'\s*:\s*(.*)$/.exec(Oe);if(rt){var Se=rt[1];switch(Oe=rt[2],Se){case"assign":Se="=";break}K=Math.max(ke.line.indexOf(Se,K),0)}else K=0;Ce(x("| ",6)),Ce(x("^^^",K+3)+s,"font-weight:bold"),Ce(x("| ",6)),Ce(Oe+s,"font-weight:bold")}),Ce(x("| ",6)+s)}else Ce(x(ke.number,4)+"| "),Ce(ke.line+s,"color:red")}),typeof document<"u"&&!window.chrome?(We[0]=Be.join("%c"),console.log.apply(console,We)):console.log(Be.join(""))}),d.raise("Error compiling "+se+" shader, "+Le[0].name)}}function it(h,T,G,fe,me){if(!h.getProgramParameter(T,h.LINK_STATUS)){var ae=h.getProgramInfoLog(T),se=J(G,me),Le=J(fe,me),De='Error linking program with vertex shader, "'+Le[0].name+'", and fragment shader "'+se[0].name+'"';typeof document<"u"?console.log("%c"+De+s+"%c"+ae,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(De+s+ae),d.raise(De)}}function ft(h){h._commandRef=N()}function tt(h,T,G,fe){ft(h);function me(De){return De?fe.id(De):0}h._fragId=me(h.static.frag),h._vertId=me(h.static.vert);function ae(De,Pe){Object.keys(Pe).forEach(function(Ge){De[fe.id(Ge)]=!0})}var se=h._uniformSet={};ae(se,T.static),ae(se,T.dynamic);var Le=h._attributeSet={};ae(Le,G.static),ae(Le,G.dynamic),h._hasCount="count"in h.static||"count"in h.dynamic||"elements"in h.static||"elements"in h.dynamic}function Re(h,T){var G=F();u(h+" in command "+(T||N())+(G==="unknown"?"":" called from "+G))}function Ot(h,T,G){h||Re(T,G||N())}function xt(h,T,G,fe){h in T||Re("unknown parameter ("+h+")"+v(G)+". possible values: "+Object.keys(T).join(),fe||N())}function Me(h,T,G,fe){p(h,T)||Re("invalid parameter type"+v(G)+". expected "+T+", got "+typeof h,fe||N())}function Ze(h){h()}function St(h,T,G){h.texture?D(h.texture._texture.internalformat,T,"unsupported texture format for attachment"):D(h.renderbuffer._renderbuffer.format,G,"unsupported renderbuffer format for attachment")}var $t=33071,Wt=9728,Qt=9984,or=9985,xr=9986,sr=9987,Kt=5120,br=5121,Gt=5122,It=5123,hn=5124,jr=5125,kt=5126,Pr=32819,Fr=32820,Zr=33635,Qr=34042,ir=36193,Nt={};Nt[Kt]=Nt[br]=1,Nt[Gt]=Nt[It]=Nt[ir]=Nt[Zr]=Nt[Pr]=Nt[Fr]=2,Nt[hn]=Nt[jr]=Nt[kt]=Nt[Qr]=4;function Tn(h,T){return h===Fr||h===Pr||h===Zr?2:h===Qr?4:Nt[h]*T}function En(h){return!(h&h-1)&&!!h}function Jr(h,T,G){var fe,me=T.width,ae=T.height,se=T.channels;d(me>0&&me<=G.maxTextureSize&&ae>0&&ae<=G.maxTextureSize,"invalid texture shape"),(h.wrapS!==$t||h.wrapT!==$t)&&d(En(me)&&En(ae),"incompatible wrap mode for texture, both width and height must be power of 2"),T.mipmask===1?me!==1&&ae!==1&&d(h.minFilter!==Qt&&h.minFilter!==xr&&h.minFilter!==or&&h.minFilter!==sr,"min filter requires mipmap"):(d(En(me)&&En(ae),"texture must be a square power of 2 to support mipmapping"),d(T.mipmask===(me<<1)-1,"missing or incomplete mipmap data")),T.type===kt&&(G.extensions.indexOf("oes_texture_float_linear")<0&&d(h.minFilter===Wt&&h.magFilter===Wt,"filter not supported, must enable oes_texture_float_linear"),d(!h.genMipmaps,"mipmap generation not supported with float textures"));var Le=T.images;for(fe=0;fe<16;++fe)if(Le[fe]){var De=me>>fe,Pe=ae>>fe;d(T.mipmask&1<<fe,"missing mipmap data");var Ge=Le[fe];if(d(Ge.width===De&&Ge.height===Pe,"invalid shape for mip images"),d(Ge.format===T.format&&Ge.internalformat===T.internalformat&&Ge.type===T.type,"incompatible type for mip image"),!Ge.compressed)if(Ge.data){var Be=Math.ceil(Tn(Ge.type,se)*De/Ge.unpackAlignment)*Ge.unpackAlignment;d(Ge.data.byteLength===Be*Pe,"invalid data for image, buffer size is inconsistent with image format")}else Ge.element||Ge.copy}else h.genMipmaps||d((T.mipmask&1<<fe)===0,"extra mipmap data");T.compressed&&d(!h.genMipmaps,"mipmap generation for compressed images not supported")}function an(h,T,G,fe){var me=h.width,ae=h.height,se=h.channels;d(me>0&&me<=fe.maxTextureSize&&ae>0&&ae<=fe.maxTextureSize,"invalid texture shape"),d(me===ae,"cube map must be square"),d(T.wrapS===$t&&T.wrapT===$t,"wrap mode not supported by cube map");for(var Le=0;Le<G.length;++Le){var De=G[Le];d(De.width===me&&De.height===ae,"inconsistent cube map face shape"),T.genMipmaps&&(d(!De.compressed,"can not generate mipmap for compressed textures"),d(De.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var Pe=De.images,Ge=0;Ge<16;++Ge){var Be=Pe[Ge];if(Be){var We=me>>Ge,Ce=ae>>Ge;d(De.mipmask&1<<Ge,"missing mipmap data"),d(Be.width===We&&Be.height===Ce,"invalid shape for mip images"),d(Be.format===h.format&&Be.internalformat===h.internalformat&&Be.type===h.type,"incompatible type for mip image"),Be.compressed||(Be.data?d(Be.data.byteLength===We*Ce*Math.max(Tn(Be.type,se),Be.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):Be.element||Be.copy)}}}}var E=o(d,{optional:Ze,raise:u,commandRaise:Re,command:Ot,parameter:M,commandParameter:xt,constructor:le,type:U,commandType:Me,isTypedArray:B,nni:q,oneOf:D,shaderError:lt,linkError:it,callSite:F,saveCommandRef:ft,saveDrawInfo:tt,framebufferFormat:St,guessCommand:N,texture2D:Jr,textureCube:an}),di=0,dn=0,zi=5,Pn=6;function Ar(h,T){this.id=di++,this.type=h,this.data=T}function Dn(h){return h.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Bn(h){if(h.length===0)return[];var T=h.charAt(0),G=h.charAt(h.length-1);if(h.length>1&&T===G&&(T==='"'||T==="'"))return['"'+Dn(h.substr(1,h.length-2))+'"'];var fe=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(h);if(fe)return Bn(h.substr(0,fe.index)).concat(Bn(fe[1])).concat(Bn(h.substr(fe.index+fe[0].length)));var me=h.split(".");if(me.length===1)return['"'+Dn(h)+'"'];for(var ae=[],se=0;se<me.length;++se)ae=ae.concat(Bn(me[se]));return ae}function C(h){return"["+Bn(h).join("][")+"]"}function Ue(h,T){return new Ar(h,C(T+""))}function Xe(h){return typeof h=="function"&&!h._reglType||h instanceof Ar}function dt(h,T){if(typeof h=="function")return new Ar(dn,h);if(typeof h=="number"||typeof h=="boolean")return new Ar(zi,h);if(Array.isArray(h))return new Ar(Pn,h.map(function(G,fe){return dt(G,T+"["+fe+"]")}));if(h instanceof Ar)return h;E(!1,"invalid option type in uniform "+T)}var Z={DynamicVariable:Ar,define:Ue,isDynamic:Xe,unbox:dt,accessor:C},we={next:typeof requestAnimationFrame=="function"?function(h){return requestAnimationFrame(h)}:function(h){return setTimeout(h,16)},cancel:typeof cancelAnimationFrame=="function"?function(h){return cancelAnimationFrame(h)}:clearTimeout},m=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function He(){var h={"":0},T=[""];return{id:function(G){var fe=h[G];return fe||(fe=h[G]=T.length,T.push(G),fe)},str:function(G){return T[G]}}}function Pt(h,T,G){var fe=document.createElement("canvas");o(fe.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),h.appendChild(fe),h===document.body&&(fe.style.position="absolute",o(h.style,{margin:0,padding:0}));function me(){var Le=window.innerWidth,De=window.innerHeight;if(h!==document.body){var Pe=fe.getBoundingClientRect();Le=Pe.right-Pe.left,De=Pe.bottom-Pe.top}fe.width=G*Le,fe.height=G*De}var ae;h!==document.body&&typeof ResizeObserver=="function"?(ae=new ResizeObserver(function(){setTimeout(me)}),ae.observe(h)):window.addEventListener("resize",me,!1);function se(){ae?ae.disconnect():window.removeEventListener("resize",me),h.removeChild(fe)}return me(),{canvas:fe,onDestroy:se}}function l(h,T){function G(fe){try{return h.getContext(fe,T)}catch{return null}}return G("webgl")||G("experimental-webgl")||G("webgl-experimental")}function de(h){return typeof h.nodeName=="string"&&typeof h.appendChild=="function"&&typeof h.getBoundingClientRect=="function"}function ye(h){return typeof h.drawArrays=="function"||typeof h.drawElements=="function"}function w(h){return typeof h=="string"?h.split():(E(Array.isArray(h),"invalid extension array"),h)}function V(h){return typeof h=="string"?(E(typeof document<"u","not supported outside of DOM"),document.querySelector(h)):h}function ce(h){var T=h||{},G,fe,me,ae,se={},Le=[],De=[],Pe=typeof window>"u"?1:window.devicePixelRatio,Ge=!1,Be=function(ke){ke&&E.raise(ke)},We=function(){};if(typeof T=="string"?(E(typeof document<"u","selector queries only supported in DOM enviroments"),G=document.querySelector(T),E(G,"invalid query string for element")):typeof T=="object"?de(T)?G=T:ye(T)?(ae=T,me=ae.canvas):(E.constructor(T),"gl"in T?ae=T.gl:"canvas"in T?me=V(T.canvas):"container"in T&&(fe=V(T.container)),"attributes"in T&&(se=T.attributes,E.type(se,"object","invalid context attributes")),"extensions"in T&&(Le=w(T.extensions)),"optionalExtensions"in T&&(De=w(T.optionalExtensions)),"onDone"in T&&(E.type(T.onDone,"function","invalid or missing onDone callback"),Be=T.onDone),"profile"in T&&(Ge=!!T.profile),"pixelRatio"in T&&(Pe=+T.pixelRatio,E(Pe>0,"invalid pixel ratio"))):E.raise("invalid arguments to regl"),G&&(G.nodeName.toLowerCase()==="canvas"?me=G:fe=G),!ae){if(!me){E(typeof document<"u","must manually specify webgl context outside of DOM environments");var Ce=Pt(fe||document.body,Be,Pe);if(!Ce)return null;me=Ce.canvas,We=Ce.onDestroy}se.premultipliedAlpha===void 0&&(se.premultipliedAlpha=!0),ae=l(me,se)}return ae?{gl:ae,canvas:me,container:fe,extensions:Le,optionalExtensions:De,pixelRatio:Pe,profile:Ge,onDone:Be,onDestroy:We}:(We(),Be("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Et(h,T){var G={};function fe(se){E.type(se,"string","extension name must be string");var Le=se.toLowerCase(),De;try{De=G[Le]=h.getExtension(Le)}catch{}return!!De}for(var me=0;me<T.extensions.length;++me){var ae=T.extensions[me];if(!fe(ae))return T.onDestroy(),T.onDone('"'+ae+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return T.optionalExtensions.forEach(fe),{extensions:G,restore:function(){Object.keys(G).forEach(function(se){if(G[se]&&!fe(se))throw new Error("(regl): error restoring extension "+se)})}}}function at(h,T){for(var G=Array(h),fe=0;fe<h;++fe)G[fe]=T(fe);return G}var mt=5120,ur=5121,vi=5122,kr=5123,hr=5124,Yr=5125,vn=5126;function Ln(h){for(var T=16;T<=1<<28;T*=16)if(h<=T)return T;return 0}function Ia(h){var T,G;return T=(h>65535)<<4,h>>>=T,G=(h>255)<<3,h>>>=G,T|=G,G=(h>15)<<2,h>>>=G,T|=G,G=(h>3)<<1,h>>>=G,T|=G,T|h>>1}function Fa(){var h=at(8,function(){return[]});function T(ae){var se=Ln(ae),Le=h[Ia(se)>>2];return Le.length>0?Le.pop():new ArrayBuffer(se)}function G(ae){h[Ia(ae.byteLength)>>2].push(ae)}function fe(ae,se){var Le=null;switch(ae){case mt:Le=new Int8Array(T(se),0,se);break;case ur:Le=new Uint8Array(T(se),0,se);break;case vi:Le=new Int16Array(T(2*se),0,se);break;case kr:Le=new Uint16Array(T(2*se),0,se);break;case hr:Le=new Int32Array(T(4*se),0,se);break;case Yr:Le=new Uint32Array(T(4*se),0,se);break;case vn:Le=new Float32Array(T(4*se),0,se);break;default:return null}return Le.length!==se?Le.subarray(0,se):Le}function me(ae){G(ae.buffer)}return{alloc:T,free:G,allocType:fe,freeType:me}}var jt=Fa();jt.zero=Fa();var Wn=3408,on=3410,_i=3411,Xn=3412,Wf=3413,kh=3414,Nh=3415,Ph=33901,Bh=33902,Gh=3379,Vf=3386,Uh=34921,$f=36347,Yh=36348,Hh=35661,zh=35660,El=34930,Dl=36349,Ll=34076,Wh=34024,Vh=7936,$h=7937,Zh=7938,Rl=35724,Cl=34047,Ol=36063,qs=34852,Zf=3553,Ks=34067,Xf=34069,Ml=33984,Qo=6408,qf=5126,js=5121,Jo=36160,Xh=36053,Il=36064,Qs=16384,Js=function(h,T){var G=1;T.ext_texture_filter_anisotropic&&(G=h.getParameter(Cl));var fe=1,me=1;T.webgl_draw_buffers&&(fe=h.getParameter(qs),me=h.getParameter(Ol));var ae=!!T.oes_texture_float;if(ae){var se=h.createTexture();h.bindTexture(Zf,se),h.texImage2D(Zf,0,Qo,1,1,0,Qo,qf,null);var Le=h.createFramebuffer();if(h.bindFramebuffer(Jo,Le),h.framebufferTexture2D(Jo,Il,Zf,se,0),h.bindTexture(Zf,null),h.checkFramebufferStatus(Jo)!==Xh)ae=!1;else{h.viewport(0,0,1,1),h.clearColor(1,0,0,1),h.clear(Qs);var De=jt.allocType(qf,4);h.readPixels(0,0,1,1,Qo,qf,De),h.getError()?ae=!1:(h.deleteFramebuffer(Le),h.deleteTexture(se),ae=De[0]===1),jt.freeType(De)}}var Pe=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Ge=!0;if(!Pe){var Be=h.createTexture(),We=jt.allocType(js,36);h.activeTexture(Ml),h.bindTexture(Ks,Be),h.texImage2D(Xf,0,Qo,3,3,0,Qo,js,We),jt.freeType(We),h.bindTexture(Ks,null),h.deleteTexture(Be),Ge=!h.getError()}return{colorBits:[h.getParameter(on),h.getParameter(_i),h.getParameter(Xn),h.getParameter(Wf)],depthBits:h.getParameter(kh),stencilBits:h.getParameter(Nh),subpixelBits:h.getParameter(Wn),extensions:Object.keys(T).filter(function(Ce){return!!T[Ce]}),maxAnisotropic:G,maxDrawbuffers:fe,maxColorAttachments:me,pointSizeDims:h.getParameter(Ph),lineWidthDims:h.getParameter(Bh),maxViewportDims:h.getParameter(Vf),maxCombinedTextureUnits:h.getParameter(Hh),maxCubeMapSize:h.getParameter(Ll),maxRenderbufferSize:h.getParameter(Wh),maxTextureUnits:h.getParameter(El),maxTextureSize:h.getParameter(Gh),maxAttributes:h.getParameter(Uh),maxVertexUniforms:h.getParameter($f),maxVertexTextureUnits:h.getParameter(zh),maxVaryingVectors:h.getParameter(Yh),maxFragmentUniforms:h.getParameter(Dl),glsl:h.getParameter(Rl),renderer:h.getParameter($h),vendor:h.getParameter(Vh),version:h.getParameter(Zh),readFloat:ae,npotTextureCube:Ge}};function Rn(h){return!!h&&typeof h=="object"&&Array.isArray(h.shape)&&Array.isArray(h.stride)&&typeof h.offset=="number"&&h.shape.length===h.stride.length&&(Array.isArray(h.data)||i(h.data))}var Vn=function(h){return Object.keys(h).map(function(T){return h[T]})},ef={shape:Kh,flatten:kl};function qh(h,T,G){for(var fe=0;fe<T;++fe)G[fe]=h[fe]}function Fl(h,T,G,fe){for(var me=0,ae=0;ae<T;++ae)for(var se=h[ae],Le=0;Le<G;++Le)fe[me++]=se[Le]}function eu(h,T,G,fe,me,ae){for(var se=ae,Le=0;Le<T;++Le)for(var De=h[Le],Pe=0;Pe<G;++Pe)for(var Ge=De[Pe],Be=0;Be<fe;++Be)me[se++]=Ge[Be]}function tu(h,T,G,fe,me){for(var ae=1,se=G+1;se<T.length;++se)ae*=T[se];var Le=T[G];if(T.length-G===4){var De=T[G+1],Pe=T[G+2],Ge=T[G+3];for(se=0;se<Le;++se)eu(h[se],De,Pe,Ge,fe,me),me+=ae}else for(se=0;se<Le;++se)tu(h[se],T,G+1,fe,me),me+=ae}function kl(h,T,G,fe){var me=1;if(T.length)for(var ae=0;ae<T.length;++ae)me*=T[ae];else me=0;var se=fe||jt.allocType(G,me);switch(T.length){case 0:break;case 1:qh(h,T[0],se);break;case 2:Fl(h,T[0],T[1],se);break;case 3:eu(h,T[0],T[1],T[2],se,0);break;default:tu(h,T,0,se,0)}return se}function Kh(h){for(var T=[],G=h;G.length;G=G[0])T.push(G.length);return T}var ru={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},jh=5120,Nl=5122,Qh=5124,Jh=5121,ed=5123,td=5125,nu=5126,rd=5126,ka={int8:jh,int16:Nl,int32:Qh,uint8:Jh,uint16:ed,uint32:td,float:nu,float32:rd},nd=35048,id=35040,Kf={dynamic:nd,stream:id,static:35044},Cr=ef.flatten,Or=ef.shape,Pl=35044,ad=35040,iu=5121,au=5126,sa=[];sa[5120]=1,sa[5122]=2,sa[5124]=4,sa[5121]=1,sa[5123]=2,sa[5125]=4,sa[5126]=4;function jf(h){return ru[Object.prototype.toString.call(h)]|0}function ou(h,T){for(var G=0;G<T.length;++G)h[G]=T[G]}function Bl(h,T,G,fe,me,ae,se){for(var Le=0,De=0;De<G;++De)for(var Pe=0;Pe<fe;++Pe)h[Le++]=T[me*De+ae*Pe+se]}function bn(h,T,G,fe){var me=0,ae={};function se(K){this.id=me++,this.buffer=h.createBuffer(),this.type=K,this.usage=Pl,this.byteLength=0,this.dimension=1,this.dtype=iu,this.persistentData=null,G.profile&&(this.stats={size:0})}se.prototype.bind=function(){h.bindBuffer(this.type,this.buffer)},se.prototype.destroy=function(){We(this)};var Le=[];function De(K,oe){var Oe=Le.pop();return Oe||(Oe=new se(K)),Oe.bind(),Be(Oe,oe,ad,0,1,!1),Oe}function Pe(K){Le.push(K)}function Ge(K,oe,Oe){K.byteLength=oe.byteLength,h.bufferData(K.type,oe,Oe)}function Be(K,oe,Oe,rt,Se,Qe){var je;if(K.usage=Oe,Array.isArray(oe)){if(K.dtype=rt||au,oe.length>0){var pt;if(Array.isArray(oe[0])){je=Or(oe);for(var xe=1,ge=1;ge<je.length;++ge)xe*=je[ge];K.dimension=xe,pt=Cr(oe,je,K.dtype),Ge(K,pt,Oe),Qe?K.persistentData=pt:jt.freeType(pt)}else if(typeof oe[0]=="number"){K.dimension=Se;var ut=jt.allocType(K.dtype,oe.length);ou(ut,oe),Ge(K,ut,Oe),Qe?K.persistentData=ut:jt.freeType(ut)}else i(oe[0])?(K.dimension=oe[0].length,K.dtype=rt||jf(oe[0])||au,pt=Cr(oe,[oe.length,oe[0].length],K.dtype),Ge(K,pt,Oe),Qe?K.persistentData=pt:jt.freeType(pt)):E.raise("invalid buffer data")}}else if(i(oe))K.dtype=rt||jf(oe),K.dimension=Se,Ge(K,oe,Oe),Qe&&(K.persistentData=new Uint8Array(new Uint8Array(oe.buffer)));else if(Rn(oe)){je=oe.shape;var Ve=oe.stride,Ie=oe.offset,$e=0,qe=0,Mt=0,Lt=0;je.length===1?($e=je[0],qe=1,Mt=Ve[0],Lt=0):je.length===2?($e=je[0],qe=je[1],Mt=Ve[0],Lt=Ve[1]):E.raise("invalid shape"),K.dtype=rt||jf(oe.data)||au,K.dimension=qe;var Ke=jt.allocType(K.dtype,$e*qe);Bl(Ke,oe.data,$e,qe,Mt,Lt,Ie),Ge(K,Ke,Oe),Qe?K.persistentData=Ke:jt.freeType(Ke)}else oe instanceof ArrayBuffer?(K.dtype=iu,K.dimension=Se,Ge(K,oe,Oe),Qe&&(K.persistentData=new Uint8Array(new Uint8Array(oe)))):E.raise("invalid buffer data")}function We(K){T.bufferCount--,fe(K);var oe=K.buffer;E(oe,"buffer must not be deleted already"),h.deleteBuffer(oe),K.buffer=null,delete ae[K.id]}function Ce(K,oe,Oe,rt){T.bufferCount++;var Se=new se(oe);ae[Se.id]=Se;function Qe(xe){var ge=Pl,ut=null,Ve=0,Ie=0,$e=1;return Array.isArray(xe)||i(xe)||Rn(xe)||xe instanceof ArrayBuffer?ut=xe:typeof xe=="number"?Ve=xe|0:xe&&(E.type(xe,"object","buffer arguments must be an object, a number or an array"),"data"in xe&&(E(ut===null||Array.isArray(ut)||i(ut)||Rn(ut),"invalid data for buffer"),ut=xe.data),"usage"in xe&&(E.parameter(xe.usage,Kf,"invalid buffer usage"),ge=Kf[xe.usage]),"type"in xe&&(E.parameter(xe.type,ka,"invalid buffer type"),Ie=ka[xe.type]),"dimension"in xe&&(E.type(xe.dimension,"number","invalid dimension"),$e=xe.dimension|0),"length"in xe&&(E.nni(Ve,"buffer length must be a nonnegative integer"),Ve=xe.length|0)),Se.bind(),ut?Be(Se,ut,ge,Ie,$e,rt):(Ve&&h.bufferData(Se.type,Ve,ge),Se.dtype=Ie||iu,Se.usage=ge,Se.dimension=$e,Se.byteLength=Ve),G.profile&&(Se.stats.size=Se.byteLength*sa[Se.dtype]),Qe}function je(xe,ge){E(ge+xe.byteLength<=Se.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+xe.byteLength+" starting from offset "+ge+" to a buffer of size "+Se.byteLength),h.bufferSubData(Se.type,ge,xe)}function pt(xe,ge){var ut=(ge||0)|0,Ve;if(Se.bind(),i(xe)||xe instanceof ArrayBuffer)je(xe,ut);else if(Array.isArray(xe)){if(xe.length>0)if(typeof xe[0]=="number"){var Ie=jt.allocType(Se.dtype,xe.length);ou(Ie,xe),je(Ie,ut),jt.freeType(Ie)}else if(Array.isArray(xe[0])||i(xe[0])){Ve=Or(xe);var $e=Cr(xe,Ve,Se.dtype);je($e,ut),jt.freeType($e)}else E.raise("invalid buffer data")}else if(Rn(xe)){Ve=xe.shape;var qe=xe.stride,Mt=0,Lt=0,Ke=0,Je=0;Ve.length===1?(Mt=Ve[0],Lt=1,Ke=qe[0],Je=0):Ve.length===2?(Mt=Ve[0],Lt=Ve[1],Ke=qe[0],Je=qe[1]):E.raise("invalid shape");var wt=Array.isArray(xe.data)?Se.dtype:jf(xe.data),Ct=jt.allocType(wt,Mt*Lt);Bl(Ct,xe.data,Mt,Lt,Ke,Je,xe.offset),je(Ct,ut),jt.freeType(Ct)}else E.raise("invalid data for buffer subdata");return Qe}return Oe||Qe(K),Qe._reglType="buffer",Qe._buffer=Se,Qe.subdata=pt,G.profile&&(Qe.stats=Se.stats),Qe.destroy=function(){We(Se)},Qe}function ke(){Vn(ae).forEach(function(K){K.buffer=h.createBuffer(),h.bindBuffer(K.type,K.buffer),h.bufferData(K.type,K.persistentData||K.byteLength,K.usage)})}return G.profile&&(T.getTotalBufferSize=function(){var K=0;return Object.keys(ae).forEach(function(oe){K+=ae[oe].stats.size}),K}),{create:Ce,createStream:De,destroyStream:Pe,clear:function(){Vn(ae).forEach(We),Le.forEach(We)},getBuffer:function(K){return K&&K._buffer instanceof se?K._buffer:null},restore:ke,_initBuffer:Be}}var fu=0,Na=0,Gl=1,su=1,ti=4,Ul=4,Wi={points:fu,point:Na,lines:Gl,line:su,triangles:ti,triangle:Ul,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Yl=0,Hl=1,yo=4,zl=5120,_n=5121,Wl=5122,wn=5123,Vl=5124,ua=5125,Oi=34963,Qf=35040,uu=35044;function Br(h,T,G,fe){var me={},ae=0,se={uint8:_n,uint16:wn};T.oes_element_index_uint&&(se.uint32=ua);function Le(ke){this.id=ae++,me[this.id]=this,this.buffer=ke,this.primType=yo,this.vertCount=0,this.type=0}Le.prototype.bind=function(){this.buffer.bind()};var De=[];function Pe(ke){var K=De.pop();return K||(K=new Le(G.create(null,Oi,!0,!1)._buffer)),Be(K,ke,Qf,-1,-1,0,0),K}function Ge(ke){De.push(ke)}function Be(ke,K,oe,Oe,rt,Se,Qe){ke.buffer.bind();var je;if(K){var pt=Qe;!Qe&&(!i(K)||Rn(K)&&!i(K.data))&&(pt=T.oes_element_index_uint?ua:wn),G._initBuffer(ke.buffer,K,oe,pt,3)}else h.bufferData(Oi,Se,oe),ke.buffer.dtype=je||_n,ke.buffer.usage=oe,ke.buffer.dimension=3,ke.buffer.byteLength=Se;if(je=Qe,!Qe){switch(ke.buffer.dtype){case _n:case zl:je=_n;break;case wn:case Wl:je=wn;break;case ua:case Vl:je=ua;break;default:E.raise("unsupported type for element array")}ke.buffer.dtype=je}ke.type=je,E(je!==ua||!!T.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var xe=rt;xe<0&&(xe=ke.buffer.byteLength,je===wn?xe>>=1:je===ua&&(xe>>=2)),ke.vertCount=xe;var ge=Oe;if(Oe<0){ge=yo;var ut=ke.buffer.dimension;ut===1&&(ge=Yl),ut===2&&(ge=Hl),ut===3&&(ge=yo)}ke.primType=ge}function We(ke){fe.elementsCount--,E(ke.buffer!==null,"must not double destroy elements"),delete me[ke.id],ke.buffer.destroy(),ke.buffer=null}function Ce(ke,K){var oe=G.create(null,Oi,!0),Oe=new Le(oe._buffer);fe.elementsCount++;function rt(Se){if(!Se)oe(),Oe.primType=yo,Oe.vertCount=0,Oe.type=_n;else if(typeof Se=="number")oe(Se),Oe.primType=yo,Oe.vertCount=Se|0,Oe.type=_n;else{var Qe=null,je=uu,pt=-1,xe=-1,ge=0,ut=0;Array.isArray(Se)||i(Se)||Rn(Se)?Qe=Se:(E.type(Se,"object","invalid arguments for elements"),"data"in Se&&(Qe=Se.data,E(Array.isArray(Qe)||i(Qe)||Rn(Qe),"invalid data for element buffer")),"usage"in Se&&(E.parameter(Se.usage,Kf,"invalid element buffer usage"),je=Kf[Se.usage]),"primitive"in Se&&(E.parameter(Se.primitive,Wi,"invalid element buffer primitive"),pt=Wi[Se.primitive]),"count"in Se&&(E(typeof Se.count=="number"&&Se.count>=0,"invalid vertex count for elements"),xe=Se.count|0),"type"in Se&&(E.parameter(Se.type,se,"invalid buffer type"),ut=se[Se.type]),"length"in Se?ge=Se.length|0:(ge=xe,ut===wn||ut===Wl?ge*=2:(ut===ua||ut===Vl)&&(ge*=4))),Be(Oe,Qe,je,pt,xe,ge,ut)}return rt}return rt(ke),rt._reglType="elements",rt._elements=Oe,rt.subdata=function(Se,Qe){return oe.subdata(Se,Qe),rt},rt.destroy=function(){We(Oe)},rt}return{create:Ce,createStream:Pe,destroyStream:Ge,getElements:function(ke){return typeof ke=="function"&&ke._elements instanceof Le?ke._elements:null},clear:function(){Vn(me).forEach(We)}}}var Vi=new Float32Array(1),lu=new Uint32Array(Vi.buffer),od=5123;function Jf(h){for(var T=jt.allocType(od,h.length),G=0;G<h.length;++G)if(isNaN(h[G]))T[G]=65535;else if(h[G]===1/0)T[G]=31744;else if(h[G]===-1/0)T[G]=64512;else{Vi[0]=h[G];var fe=lu[0],me=fe>>>31<<15,ae=(fe<<1>>>24)-127,se=fe>>13&(1<<10)-1;if(ae<-24)T[G]=me;else if(ae<-14){var Le=-14-ae;T[G]=me+(se+(1<<10)>>Le)}else ae>15?T[G]=me+31744:T[G]=me+(ae+15<<10)+se}return T}function Nr(h){return Array.isArray(h)||i(h)}var $l=function(h){return!(h&h-1)&&!!h},fd=34467,pi=3553,xo=34067,$i=34069,Pa=6408,es=6406,tf=6407,Ba=6409,bo=6410,cu=32854,hu=32855,ts=36194,du=32819,sd=32820,Zl=33635,qn=34042,rf=6402,la=34041,rs=35904,ns=35906,wo=36193,vu=33776,_u=33777,pu=33778,mu=33779,Ga=35986,Xl=35987,ql=34798,is=35840,gu=35841,Zi=35842,nf=35843,Kl=36196,So=5121,yu=5123,ca=5125,Gn=5126,jl=10242,ud=10243,ld=10497,xu=33071,cd=33648,hd=10240,Ao=10241,te=9728,Ee=9729,ve=9984,gt=9985,Zt=9986,pr=9987,fn=33170,Tr=4352,bu=4353,dd=4354,ri=34046,as=3317,vd=37440,To=37441,os=37443,af=37444,mr=33984,_d=[ve,Zt,gt,pr],of=[0,Ba,bo,tf,Pa],Un={};Un[Ba]=Un[es]=Un[rf]=1,Un[la]=Un[bo]=2,Un[tf]=Un[rs]=3,Un[Pa]=Un[ns]=4;function Eo(h){return"[object "+h+"]"}var Ql=Eo("HTMLCanvasElement"),Jl=Eo("OffscreenCanvas"),ff=Eo("CanvasRenderingContext2D"),Xi=Eo("ImageBitmap"),sf=Eo("HTMLImageElement"),wu=Eo("HTMLVideoElement"),fs=Object.keys(ru).concat([Ql,Jl,ff,Xi,sf,wu]),Ua=[];Ua[So]=1,Ua[Gn]=4,Ua[wo]=2,Ua[yu]=2,Ua[ca]=4;var sn=[];sn[cu]=2,sn[hu]=2,sn[ts]=2,sn[la]=4,sn[vu]=.5,sn[_u]=.5,sn[pu]=1,sn[mu]=1,sn[Ga]=.5,sn[Xl]=1,sn[ql]=1,sn[is]=.5,sn[gu]=.25,sn[Zi]=.5,sn[nf]=.25,sn[Kl]=.5;function uf(h){return Array.isArray(h)&&(h.length===0||typeof h[0]=="number")}function Su(h){if(!Array.isArray(h))return!1;var T=h.length;return!(T===0||!Nr(h[0]))}function mi(h){return Object.prototype.toString.call(h)}function ha(h){return mi(h)===Ql}function lf(h){return mi(h)===Jl}function pd(h){return mi(h)===ff}function md(h){return mi(h)===Xi}function gd(h){return mi(h)===sf}function ss(h){return mi(h)===wu}function Do(h){if(!h)return!1;var T=mi(h);return fs.indexOf(T)>=0?!0:uf(h)||Su(h)||Rn(h)}function us(h){return ru[Object.prototype.toString.call(h)]|0}function yd(h,T){var G=T.length;switch(h.type){case So:case yu:case ca:case Gn:var fe=jt.allocType(h.type,G);fe.set(T),h.data=fe;break;case wo:h.data=Jf(T);break;default:E.raise("unsupported texture type, must specify a typed array")}}function Au(h,T){return jt.allocType(h.type===wo?Gn:h.type,T)}function ec(h,T){h.type===wo?(h.data=Jf(T),jt.freeType(T)):h.data=T}function xd(h,T,G,fe,me,ae){for(var se=h.width,Le=h.height,De=h.channels,Pe=se*Le*De,Ge=Au(h,Pe),Be=0,We=0;We<Le;++We)for(var Ce=0;Ce<se;++Ce)for(var ke=0;ke<De;++ke)Ge[Be++]=T[G*Ce+fe*We+me*ke+ae];ec(h,Ge)}function Xr(h,T,G,fe,me,ae){var se;if(typeof sn[h]<"u"?se=sn[h]:se=Un[h]*Ua[T],ae&&(se*=6),me){for(var Le=0,De=G;De>=1;)Le+=se*De*De,De/=2;return Le}else return se*G*fe}function Cn(h,T,G,fe,me,ae,se){var Le={"don't care":Tr,"dont care":Tr,nice:dd,fast:bu},De={repeat:ld,clamp:xu,mirror:cd},Pe={nearest:te,linear:Ee},Ge=o({mipmap:pr,"nearest mipmap nearest":ve,"linear mipmap nearest":gt,"nearest mipmap linear":Zt,"linear mipmap linear":pr},Pe),Be={none:0,browser:af},We={uint8:So,rgba4:du,rgb565:Zl,"rgb5 a1":sd},Ce={alpha:es,luminance:Ba,"luminance alpha":bo,rgb:tf,rgba:Pa,rgba4:cu,"rgb5 a1":hu,rgb565:ts},ke={};T.ext_srgb&&(Ce.srgb=rs,Ce.srgba=ns),T.oes_texture_float&&(We.float32=We.float=Gn),T.oes_texture_half_float&&(We.float16=We["half float"]=wo),T.webgl_depth_texture&&(o(Ce,{depth:rf,"depth stencil":la}),o(We,{uint16:yu,uint32:ca,"depth stencil":qn})),T.webgl_compressed_texture_s3tc&&o(ke,{"rgb s3tc dxt1":vu,"rgba s3tc dxt1":_u,"rgba s3tc dxt3":pu,"rgba s3tc dxt5":mu}),T.webgl_compressed_texture_atc&&o(ke,{"rgb atc":Ga,"rgba atc explicit alpha":Xl,"rgba atc interpolated alpha":ql}),T.webgl_compressed_texture_pvrtc&&o(ke,{"rgb pvrtc 4bppv1":is,"rgb pvrtc 2bppv1":gu,"rgba pvrtc 4bppv1":Zi,"rgba pvrtc 2bppv1":nf}),T.webgl_compressed_texture_etc1&&(ke["rgb etc1"]=Kl);var K=Array.prototype.slice.call(h.getParameter(fd));Object.keys(ke).forEach(function(k){var ue=ke[k];K.indexOf(ue)>=0&&(Ce[k]=ue)});var oe=Object.keys(Ce);G.textureFormats=oe;var Oe=[];Object.keys(Ce).forEach(function(k){var ue=Ce[k];Oe[ue]=k});var rt=[];Object.keys(We).forEach(function(k){var ue=We[k];rt[ue]=k});var Se=[];Object.keys(Pe).forEach(function(k){var ue=Pe[k];Se[ue]=k});var Qe=[];Object.keys(Ge).forEach(function(k){var ue=Ge[k];Qe[ue]=k});var je=[];Object.keys(De).forEach(function(k){var ue=De[k];je[ue]=k});var pt=oe.reduce(function(k,ue){var ne=Ce[ue];return ne===Ba||ne===es||ne===Ba||ne===bo||ne===rf||ne===la||T.ext_srgb&&(ne===rs||ne===ns)?k[ne]=ne:ne===hu||ue.indexOf("rgba")>=0?k[ne]=Pa:k[ne]=tf,k},{});function xe(){this.internalformat=Pa,this.format=Pa,this.type=So,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=af,this.width=0,this.height=0,this.channels=0}function ge(k,ue){k.internalformat=ue.internalformat,k.format=ue.format,k.type=ue.type,k.compressed=ue.compressed,k.premultiplyAlpha=ue.premultiplyAlpha,k.flipY=ue.flipY,k.unpackAlignment=ue.unpackAlignment,k.colorSpace=ue.colorSpace,k.width=ue.width,k.height=ue.height,k.channels=ue.channels}function ut(k,ue){if(!(typeof ue!="object"||!ue)){if("premultiplyAlpha"in ue&&(E.type(ue.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),k.premultiplyAlpha=ue.premultiplyAlpha),"flipY"in ue&&(E.type(ue.flipY,"boolean","invalid texture flip"),k.flipY=ue.flipY),"alignment"in ue&&(E.oneOf(ue.alignment,[1,2,4,8],"invalid texture unpack alignment"),k.unpackAlignment=ue.alignment),"colorSpace"in ue&&(E.parameter(ue.colorSpace,Be,"invalid colorSpace"),k.colorSpace=Be[ue.colorSpace]),"type"in ue){var ne=ue.type;E(T.oes_texture_float||!(ne==="float"||ne==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),E(T.oes_texture_half_float||!(ne==="half float"||ne==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),E(T.webgl_depth_texture||!(ne==="uint16"||ne==="uint32"||ne==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(ne,We,"invalid texture type"),k.type=We[ne]}var st=k.width,zt=k.height,R=k.channels,y=!1;"shape"in ue?(E(Array.isArray(ue.shape)&&ue.shape.length>=2,"shape must be an array"),st=ue.shape[0],zt=ue.shape[1],ue.shape.length===3&&(R=ue.shape[2],E(R>0&&R<=4,"invalid number of channels"),y=!0),E(st>=0&&st<=G.maxTextureSize,"invalid width"),E(zt>=0&&zt<=G.maxTextureSize,"invalid height")):("radius"in ue&&(st=zt=ue.radius,E(st>=0&&st<=G.maxTextureSize,"invalid radius")),"width"in ue&&(st=ue.width,E(st>=0&&st<=G.maxTextureSize,"invalid width")),"height"in ue&&(zt=ue.height,E(zt>=0&&zt<=G.maxTextureSize,"invalid height")),"channels"in ue&&(R=ue.channels,E(R>0&&R<=4,"invalid number of channels"),y=!0)),k.width=st|0,k.height=zt|0,k.channels=R|0;var H=!1;if("format"in ue){var j=ue.format;E(T.webgl_depth_texture||!(j==="depth"||j==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(j,Ce,"invalid texture format");var Q=k.internalformat=Ce[j];k.format=pt[Q],j in We&&("type"in ue||(k.type=We[j])),j in ke&&(k.compressed=!0),H=!0}!y&&H?k.channels=Un[k.format]:y&&!H?k.channels!==of[k.format]&&(k.format=k.internalformat=of[k.channels]):H&&y&&E(k.channels===Un[k.format],"number of channels inconsistent with specified format")}}function Ve(k){h.pixelStorei(vd,k.flipY),h.pixelStorei(To,k.premultiplyAlpha),h.pixelStorei(os,k.colorSpace),h.pixelStorei(as,k.unpackAlignment)}function Ie(){xe.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function $e(k,ue){var ne=null;if(Do(ue)?ne=ue:ue&&(E.type(ue,"object","invalid pixel data type"),ut(k,ue),"x"in ue&&(k.xOffset=ue.x|0),"y"in ue&&(k.yOffset=ue.y|0),Do(ue.data)&&(ne=ue.data)),E(!k.compressed||ne instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),ue.copy){E(!ne,"can not specify copy and data field for the same texture");var st=me.viewportWidth,zt=me.viewportHeight;k.width=k.width||st-k.xOffset,k.height=k.height||zt-k.yOffset,k.needsCopy=!0,E(k.xOffset>=0&&k.xOffset<st&&k.yOffset>=0&&k.yOffset<zt&&k.width>0&&k.width<=st&&k.height>0&&k.height<=zt,"copy texture read out of bounds")}else if(!ne)k.width=k.width||1,k.height=k.height||1,k.channels=k.channels||4;else if(i(ne))k.channels=k.channels||4,k.data=ne,!("type"in ue)&&k.type===So&&(k.type=us(ne));else if(uf(ne))k.channels=k.channels||4,yd(k,ne),k.alignment=1,k.needsFree=!0;else if(Rn(ne)){var R=ne.data;!Array.isArray(R)&&k.type===So&&(k.type=us(R));var y=ne.shape,H=ne.stride,j,Q,W,Y,X,O;y.length===3?(W=y[2],O=H[2]):(E(y.length===2,"invalid ndarray pixel data, must be 2 or 3D"),W=1,O=1),j=y[0],Q=y[1],Y=H[0],X=H[1],k.alignment=1,k.width=j,k.height=Q,k.channels=W,k.format=k.internalformat=of[W],k.needsFree=!0,xd(k,R,Y,X,O,ne.offset)}else if(ha(ne)||lf(ne)||pd(ne))ha(ne)||lf(ne)?k.element=ne:k.element=ne.canvas,k.width=k.element.width,k.height=k.element.height,k.channels=4;else if(md(ne))k.element=ne,k.width=ne.width,k.height=ne.height,k.channels=4;else if(gd(ne))k.element=ne,k.width=ne.naturalWidth,k.height=ne.naturalHeight,k.channels=4;else if(ss(ne))k.element=ne,k.width=ne.videoWidth,k.height=ne.videoHeight,k.channels=4;else if(Su(ne)){var P=k.width||ne[0].length,I=k.height||ne.length,re=k.channels;Nr(ne[0][0])?re=re||ne[0][0].length:re=re||1;for(var ee=ef.shape(ne),_e=1,be=0;be<ee.length;++be)_e*=ee[be];var Ye=Au(k,_e);ef.flatten(ne,ee,"",Ye),ec(k,Ye),k.alignment=1,k.width=P,k.height=I,k.channels=re,k.format=k.internalformat=of[re],k.needsFree=!0}k.type===Gn?E(G.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):k.type===wo&&E(G.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function qe(k,ue,ne){var st=k.element,zt=k.data,R=k.internalformat,y=k.format,H=k.type,j=k.width,Q=k.height;Ve(k),st?h.texImage2D(ue,ne,y,y,H,st):k.compressed?h.compressedTexImage2D(ue,ne,R,j,Q,0,zt):k.needsCopy?(fe(),h.copyTexImage2D(ue,ne,y,k.xOffset,k.yOffset,j,Q,0)):h.texImage2D(ue,ne,y,j,Q,0,y,H,zt||null)}function Mt(k,ue,ne,st,zt){var R=k.element,y=k.data,H=k.internalformat,j=k.format,Q=k.type,W=k.width,Y=k.height;Ve(k),R?h.texSubImage2D(ue,zt,ne,st,j,Q,R):k.compressed?h.compressedTexSubImage2D(ue,zt,ne,st,H,W,Y,y):k.needsCopy?(fe(),h.copyTexSubImage2D(ue,zt,ne,st,k.xOffset,k.yOffset,W,Y)):h.texSubImage2D(ue,zt,ne,st,W,Y,j,Q,y)}var Lt=[];function Ke(){return Lt.pop()||new Ie}function Je(k){k.needsFree&&jt.freeType(k.data),Ie.call(k),Lt.push(k)}function wt(){xe.call(this),this.genMipmaps=!1,this.mipmapHint=Tr,this.mipmask=0,this.images=Array(16)}function Ct(k,ue,ne){var st=k.images[0]=Ke();k.mipmask=1,st.width=k.width=ue,st.height=k.height=ne,st.channels=k.channels=4}function Vt(k,ue){var ne=null;if(Do(ue))ne=k.images[0]=Ke(),ge(ne,k),$e(ne,ue),k.mipmask=1;else if(ut(k,ue),Array.isArray(ue.mipmap))for(var st=ue.mipmap,zt=0;zt<st.length;++zt)ne=k.images[zt]=Ke(),ge(ne,k),ne.width>>=zt,ne.height>>=zt,$e(ne,st[zt]),k.mipmask|=1<<zt;else ne=k.images[0]=Ke(),ge(ne,k),$e(ne,ue),k.mipmask=1;ge(k,k.images[0]),k.compressed&&(k.internalformat===vu||k.internalformat===_u||k.internalformat===pu||k.internalformat===mu)&&E(k.width%4===0&&k.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function Mr(k,ue){for(var ne=k.images,st=0;st<ne.length;++st){if(!ne[st])return;qe(ne[st],ue,st)}}var Lr=[];function Xt(){var k=Lr.pop()||new wt;xe.call(k),k.mipmask=0;for(var ue=0;ue<16;++ue)k.images[ue]=null;return k}function Er(k){for(var ue=k.images,ne=0;ne<ue.length;++ne)ue[ne]&&Je(ue[ne]),ue[ne]=null;Lr.push(k)}function _r(){this.minFilter=te,this.magFilter=te,this.wrapS=xu,this.wrapT=xu,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Tr}function qr(k,ue){if("min"in ue){var ne=ue.min;E.parameter(ne,Ge),k.minFilter=Ge[ne],_d.indexOf(k.minFilter)>=0&&!("faces"in ue)&&(k.genMipmaps=!0)}if("mag"in ue){var st=ue.mag;E.parameter(st,Pe),k.magFilter=Pe[st]}var zt=k.wrapS,R=k.wrapT;if("wrap"in ue){var y=ue.wrap;typeof y=="string"?(E.parameter(y,De),zt=R=De[y]):Array.isArray(y)&&(E.parameter(y[0],De),E.parameter(y[1],De),zt=De[y[0]],R=De[y[1]])}else{if("wrapS"in ue){var H=ue.wrapS;E.parameter(H,De),zt=De[H]}if("wrapT"in ue){var j=ue.wrapT;E.parameter(j,De),R=De[j]}}if(k.wrapS=zt,k.wrapT=R,"anisotropic"in ue){var Q=ue.anisotropic;E(typeof Q=="number"&&Q>=1&&Q<=G.maxAnisotropic,"aniso samples must be between 1 and "),k.anisotropic=ue.anisotropic}if("mipmap"in ue){var W=!1;switch(typeof ue.mipmap){case"string":E.parameter(ue.mipmap,Le,"invalid mipmap hint"),k.mipmapHint=Le[ue.mipmap],k.genMipmaps=!0,W=!0;break;case"boolean":W=k.genMipmaps=ue.mipmap;break;case"object":E(Array.isArray(ue.mipmap),"invalid mipmap type"),k.genMipmaps=!1,W=!0;break;default:E.raise("invalid mipmap type")}W&&!("min"in ue)&&(k.minFilter=ve)}}function Kr(k,ue){h.texParameteri(ue,Ao,k.minFilter),h.texParameteri(ue,hd,k.magFilter),h.texParameteri(ue,jl,k.wrapS),h.texParameteri(ue,ud,k.wrapT),T.ext_texture_filter_anisotropic&&h.texParameteri(ue,ri,k.anisotropic),k.genMipmaps&&(h.hint(fn,k.mipmapHint),h.generateMipmap(ue))}var en=0,un={},mn=G.maxTextureUnits,Wr=Array(mn).map(function(){return null});function Ut(k){xe.call(this),this.mipmask=0,this.internalformat=Pa,this.id=en++,this.refCount=1,this.target=k,this.texture=h.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new _r,se.profile&&(this.stats={size:0})}function gn(k){h.activeTexture(mr),h.bindTexture(k.target,k.texture)}function cr(){var k=Wr[0];k?h.bindTexture(k.target,k.texture):h.bindTexture(pi,null)}function At(k){var ue=k.texture;E(ue,"must not double destroy texture");var ne=k.unit,st=k.target;ne>=0&&(h.activeTexture(mr+ne),h.bindTexture(st,null),Wr[ne]=null),h.deleteTexture(ue),k.texture=null,k.params=null,k.pixels=null,k.refCount=0,delete un[k.id],ae.textureCount--}o(Ut.prototype,{bind:function(){var k=this;k.bindCount+=1;var ue=k.unit;if(ue<0){for(var ne=0;ne<mn;++ne){var st=Wr[ne];if(st){if(st.bindCount>0)continue;st.unit=-1}Wr[ne]=k,ue=ne;break}ue>=mn&&E.raise("insufficient number of texture units"),se.profile&&ae.maxTextureUnits<ue+1&&(ae.maxTextureUnits=ue+1),k.unit=ue,h.activeTexture(mr+ue),h.bindTexture(k.target,k.texture)}return ue},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&At(this)}});function qt(k,ue){var ne=new Ut(pi);un[ne.id]=ne,ae.textureCount++;function st(y,H){var j=ne.texInfo;_r.call(j);var Q=Xt();return typeof y=="number"?typeof H=="number"?Ct(Q,y|0,H|0):Ct(Q,y|0,y|0):y?(E.type(y,"object","invalid arguments to regl.texture"),qr(j,y),Vt(Q,y)):Ct(Q,1,1),j.genMipmaps&&(Q.mipmask=(Q.width<<1)-1),ne.mipmask=Q.mipmask,ge(ne,Q),E.texture2D(j,Q,G),ne.internalformat=Q.internalformat,st.width=Q.width,st.height=Q.height,gn(ne),Mr(Q,pi),Kr(j,pi),cr(),Er(Q),se.profile&&(ne.stats.size=Xr(ne.internalformat,ne.type,Q.width,Q.height,j.genMipmaps,!1)),st.format=Oe[ne.internalformat],st.type=rt[ne.type],st.mag=Se[j.magFilter],st.min=Qe[j.minFilter],st.wrapS=je[j.wrapS],st.wrapT=je[j.wrapT],st}function zt(y,H,j,Q){E(!!y,"must specify image data");var W=H|0,Y=j|0,X=Q|0,O=Ke();return ge(O,ne),O.width=0,O.height=0,$e(O,y),O.width=O.width||(ne.width>>X)-W,O.height=O.height||(ne.height>>X)-Y,E(ne.type===O.type&&ne.format===O.format&&ne.internalformat===O.internalformat,"incompatible format for texture.subimage"),E(W>=0&&Y>=0&&W+O.width<=ne.width&&Y+O.height<=ne.height,"texture.subimage write out of bounds"),E(ne.mipmask&1<<X,"missing mipmap data"),E(O.data||O.element||O.needsCopy,"missing image data"),gn(ne),Mt(O,pi,W,Y,X),cr(),Je(O),st}function R(y,H){var j=y|0,Q=H|0||j;if(j===ne.width&&Q===ne.height)return st;st.width=ne.width=j,st.height=ne.height=Q,gn(ne);for(var W=0;ne.mipmask>>W;++W){var Y=j>>W,X=Q>>W;if(!Y||!X)break;h.texImage2D(pi,W,ne.format,Y,X,0,ne.format,ne.type,null)}return cr(),se.profile&&(ne.stats.size=Xr(ne.internalformat,ne.type,j,Q,!1,!1)),st}return st(k,ue),st.subimage=zt,st.resize=R,st._reglType="texture2d",st._texture=ne,se.profile&&(st.stats=ne.stats),st.destroy=function(){ne.decRef()},st}function er(k,ue,ne,st,zt,R){var y=new Ut(xo);un[y.id]=y,ae.cubeCount++;var H=new Array(6);function j(Y,X,O,P,I,re){var ee,_e=y.texInfo;for(_r.call(_e),ee=0;ee<6;++ee)H[ee]=Xt();if(typeof Y=="number"||!Y){var be=Y|0||1;for(ee=0;ee<6;++ee)Ct(H[ee],be,be)}else if(typeof Y=="object")if(X)Vt(H[0],Y),Vt(H[1],X),Vt(H[2],O),Vt(H[3],P),Vt(H[4],I),Vt(H[5],re);else if(qr(_e,Y),ut(y,Y),"faces"in Y){var Ye=Y.faces;for(E(Array.isArray(Ye)&&Ye.length===6,"cube faces must be a length 6 array"),ee=0;ee<6;++ee)E(typeof Ye[ee]=="object"&&!!Ye[ee],"invalid input for cube map face"),ge(H[ee],y),Vt(H[ee],Ye[ee])}else for(ee=0;ee<6;++ee)Vt(H[ee],Y);else E.raise("invalid arguments to cube map");for(ge(y,H[0]),E.optional(function(){G.npotTextureCube||E($l(y.width)&&$l(y.height),"your browser does not support non power or two texture dimensions")}),_e.genMipmaps?y.mipmask=(H[0].width<<1)-1:y.mipmask=H[0].mipmask,E.textureCube(y,_e,H,G),y.internalformat=H[0].internalformat,j.width=H[0].width,j.height=H[0].height,gn(y),ee=0;ee<6;++ee)Mr(H[ee],$i+ee);for(Kr(_e,xo),cr(),se.profile&&(y.stats.size=Xr(y.internalformat,y.type,j.width,j.height,_e.genMipmaps,!0)),j.format=Oe[y.internalformat],j.type=rt[y.type],j.mag=Se[_e.magFilter],j.min=Qe[_e.minFilter],j.wrapS=je[_e.wrapS],j.wrapT=je[_e.wrapT],ee=0;ee<6;++ee)Er(H[ee]);return j}function Q(Y,X,O,P,I){E(!!X,"must specify image data"),E(typeof Y=="number"&&Y===(Y|0)&&Y>=0&&Y<6,"invalid face");var re=O|0,ee=P|0,_e=I|0,be=Ke();return ge(be,y),be.width=0,be.height=0,$e(be,X),be.width=be.width||(y.width>>_e)-re,be.height=be.height||(y.height>>_e)-ee,E(y.type===be.type&&y.format===be.format&&y.internalformat===be.internalformat,"incompatible format for texture.subimage"),E(re>=0&&ee>=0&&re+be.width<=y.width&&ee+be.height<=y.height,"texture.subimage write out of bounds"),E(y.mipmask&1<<_e,"missing mipmap data"),E(be.data||be.element||be.needsCopy,"missing image data"),gn(y),Mt(be,$i+Y,re,ee,_e),cr(),Je(be),j}function W(Y){var X=Y|0;if(X!==y.width){j.width=y.width=X,j.height=y.height=X,gn(y);for(var O=0;O<6;++O)for(var P=0;y.mipmask>>P;++P)h.texImage2D($i+O,P,y.format,X>>P,X>>P,0,y.format,y.type,null);return cr(),se.profile&&(y.stats.size=Xr(y.internalformat,y.type,j.width,j.height,!1,!0)),j}}return j(k,ue,ne,st,zt,R),j.subimage=Q,j.resize=W,j._reglType="textureCube",j._texture=y,se.profile&&(j.stats=y.stats),j.destroy=function(){y.decRef()},j}function Vr(){for(var k=0;k<mn;++k)h.activeTexture(mr+k),h.bindTexture(pi,null),Wr[k]=null;Vn(un).forEach(At),ae.cubeCount=0,ae.textureCount=0}se.profile&&(ae.getTotalTextureSize=function(){var k=0;return Object.keys(un).forEach(function(ue){k+=un[ue].stats.size}),k});function Si(){for(var k=0;k<mn;++k){var ue=Wr[k];ue&&(ue.bindCount=0,ue.unit=-1,Wr[k]=null)}Vn(un).forEach(function(ne){ne.texture=h.createTexture(),h.bindTexture(ne.target,ne.texture);for(var st=0;st<32;++st)if((ne.mipmask&1<<st)!==0)if(ne.target===pi)h.texImage2D(pi,st,ne.internalformat,ne.width>>st,ne.height>>st,0,ne.internalformat,ne.type,null);else for(var zt=0;zt<6;++zt)h.texImage2D($i+zt,st,ne.internalformat,ne.width>>st,ne.height>>st,0,ne.internalformat,ne.type,null);Kr(ne.texInfo,ne.target)})}function Sa(){for(var k=0;k<mn;++k){var ue=Wr[k];ue&&(ue.bindCount=0,ue.unit=-1,Wr[k]=null),h.activeTexture(mr+k),h.bindTexture(pi,null),h.bindTexture(xo,null)}}return{create2D:qt,createCube:er,clear:Vr,getTexture:function(k){return null},restore:Si,refresh:Sa}}var da=36161,ls=32854,Tu=32855,tc=36194,cs=33189,Lo=36168,hs=34041,Ya=35907,Ro=34836,Co=34842,cf=34843,On=[];On[ls]=2,On[Tu]=2,On[tc]=2,On[cs]=2,On[Lo]=1,On[hs]=4,On[Ya]=4,On[Ro]=16,On[Co]=8,On[cf]=6;function rc(h,T,G){return On[h]*T*G}var bd=function(h,T,G,fe,me){var ae={rgba4:ls,rgb565:tc,"rgb5 a1":Tu,depth:cs,stencil:Lo,"depth stencil":hs};T.ext_srgb&&(ae.srgba=Ya),T.ext_color_buffer_half_float&&(ae.rgba16f=Co,ae.rgb16f=cf),T.webgl_color_buffer_float&&(ae.rgba32f=Ro);var se=[];Object.keys(ae).forEach(function(Ce){var ke=ae[Ce];se[ke]=Ce});var Le=0,De={};function Pe(Ce){this.id=Le++,this.refCount=1,this.renderbuffer=Ce,this.format=ls,this.width=0,this.height=0,me.profile&&(this.stats={size:0})}Pe.prototype.decRef=function(){--this.refCount<=0&&Ge(this)};function Ge(Ce){var ke=Ce.renderbuffer;E(ke,"must not double destroy renderbuffer"),h.bindRenderbuffer(da,null),h.deleteRenderbuffer(ke),Ce.renderbuffer=null,Ce.refCount=0,delete De[Ce.id],fe.renderbufferCount--}function Be(Ce,ke){var K=new Pe(h.createRenderbuffer());De[K.id]=K,fe.renderbufferCount++;function oe(rt,Se){var Qe=0,je=0,pt=ls;if(typeof rt=="object"&&rt){var xe=rt;if("shape"in xe){var ge=xe.shape;E(Array.isArray(ge)&&ge.length>=2,"invalid renderbuffer shape"),Qe=ge[0]|0,je=ge[1]|0}else"radius"in xe&&(Qe=je=xe.radius|0),"width"in xe&&(Qe=xe.width|0),"height"in xe&&(je=xe.height|0);"format"in xe&&(E.parameter(xe.format,ae,"invalid renderbuffer format"),pt=ae[xe.format])}else typeof rt=="number"?(Qe=rt|0,typeof Se=="number"?je=Se|0:je=Qe):rt?E.raise("invalid arguments to renderbuffer constructor"):Qe=je=1;if(E(Qe>0&&je>0&&Qe<=G.maxRenderbufferSize&&je<=G.maxRenderbufferSize,"invalid renderbuffer size"),!(Qe===K.width&&je===K.height&&pt===K.format))return oe.width=K.width=Qe,oe.height=K.height=je,K.format=pt,h.bindRenderbuffer(da,K.renderbuffer),h.renderbufferStorage(da,pt,Qe,je),E(h.getError()===0,"invalid render buffer format"),me.profile&&(K.stats.size=rc(K.format,K.width,K.height)),oe.format=se[K.format],oe}function Oe(rt,Se){var Qe=rt|0,je=Se|0||Qe;return Qe===K.width&&je===K.height||(E(Qe>0&&je>0&&Qe<=G.maxRenderbufferSize&&je<=G.maxRenderbufferSize,"invalid renderbuffer size"),oe.width=K.width=Qe,oe.height=K.height=je,h.bindRenderbuffer(da,K.renderbuffer),h.renderbufferStorage(da,K.format,Qe,je),E(h.getError()===0,"invalid render buffer format"),me.profile&&(K.stats.size=rc(K.format,K.width,K.height))),oe}return oe(Ce,ke),oe.resize=Oe,oe._reglType="renderbuffer",oe._renderbuffer=K,me.profile&&(oe.stats=K.stats),oe.destroy=function(){K.decRef()},oe}me.profile&&(fe.getTotalRenderbufferSize=function(){var Ce=0;return Object.keys(De).forEach(function(ke){Ce+=De[ke].stats.size}),Ce});function We(){Vn(De).forEach(function(Ce){Ce.renderbuffer=h.createRenderbuffer(),h.bindRenderbuffer(da,Ce.renderbuffer),h.renderbufferStorage(da,Ce.format,Ce.width,Ce.height)}),h.bindRenderbuffer(da,null)}return{create:Be,clear:function(){Vn(De).forEach(Ge)},restore:We}},qi=36160,Eu=36161,Ha=3553,za=34069,Oo=36064,Du=36096,S=36128,Wa=33306,hf=36053,ni=36054,lr=36055,wd=36057,Sd=36061,Ad=36193,Va=5121,Td=5126,nc=6407,ic=6408,Ed=6402,Dd=[nc,ic],gi=[];gi[ic]=4,gi[nc]=3;var ds=[];ds[Va]=1,ds[Td]=4,ds[Ad]=2;var Ld=32854,Rd=32855,Cd=36194,Od=33189,Ki=36168,ac=34041,Md=35907,Id=34836,Fd=34842,kd=34843,$a=[Ld,Rd,Cd,Md,Fd,kd,Id],Mo={};Mo[hf]="complete",Mo[ni]="incomplete attachment",Mo[wd]="incomplete dimensions",Mo[lr]="incomplete, missing attachment",Mo[Sd]="unsupported";function Nd(h,T,G,fe,me,ae){var se={cur:null,next:null,dirty:!1,setFBO:null},Le=["rgba"],De=["rgba4","rgb565","rgb5 a1"];T.ext_srgb&&De.push("srgba"),T.ext_color_buffer_half_float&&De.push("rgba16f","rgb16f"),T.webgl_color_buffer_float&&De.push("rgba32f");var Pe=["uint8"];T.oes_texture_half_float&&Pe.push("half float","float16"),T.oes_texture_float&&Pe.push("float","float32");function Ge(Ie,$e,qe){this.target=Ie,this.texture=$e,this.renderbuffer=qe;var Mt=0,Lt=0;$e?(Mt=$e.width,Lt=$e.height):qe&&(Mt=qe.width,Lt=qe.height),this.width=Mt,this.height=Lt}function Be(Ie){Ie&&(Ie.texture&&Ie.texture._texture.decRef(),Ie.renderbuffer&&Ie.renderbuffer._renderbuffer.decRef())}function We(Ie,$e,qe){if(!!Ie)if(Ie.texture){var Mt=Ie.texture._texture,Lt=Math.max(1,Mt.width),Ke=Math.max(1,Mt.height);E(Lt===$e&&Ke===qe,"inconsistent width/height for supplied texture"),Mt.refCount+=1}else{var Je=Ie.renderbuffer._renderbuffer;E(Je.width===$e&&Je.height===qe,"inconsistent width/height for renderbuffer"),Je.refCount+=1}}function Ce(Ie,$e){$e&&($e.texture?h.framebufferTexture2D(qi,Ie,$e.target,$e.texture._texture.texture,0):h.framebufferRenderbuffer(qi,Ie,Eu,$e.renderbuffer._renderbuffer.renderbuffer))}function ke(Ie){var $e=Ha,qe=null,Mt=null,Lt=Ie;typeof Ie=="object"&&(Lt=Ie.data,"target"in Ie&&($e=Ie.target|0)),E.type(Lt,"function","invalid attachment data");var Ke=Lt._reglType;return Ke==="texture2d"?(qe=Lt,E($e===Ha)):Ke==="textureCube"?(qe=Lt,E($e>=za&&$e<za+6,"invalid cube map target")):Ke==="renderbuffer"?(Mt=Lt,$e=Eu):E.raise("invalid regl object for attachment"),new Ge($e,qe,Mt)}function K(Ie,$e,qe,Mt,Lt){if(qe){var Ke=fe.create2D({width:Ie,height:$e,format:Mt,type:Lt});return Ke._texture.refCount=0,new Ge(Ha,Ke,null)}else{var Je=me.create({width:Ie,height:$e,format:Mt});return Je._renderbuffer.refCount=0,new Ge(Eu,null,Je)}}function oe(Ie){return Ie&&(Ie.texture||Ie.renderbuffer)}function Oe(Ie,$e,qe){Ie&&(Ie.texture?Ie.texture.resize($e,qe):Ie.renderbuffer&&Ie.renderbuffer.resize($e,qe),Ie.width=$e,Ie.height=qe)}var rt=0,Se={};function Qe(){this.id=rt++,Se[this.id]=this,this.framebuffer=h.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function je(Ie){Ie.colorAttachments.forEach(Be),Be(Ie.depthAttachment),Be(Ie.stencilAttachment),Be(Ie.depthStencilAttachment)}function pt(Ie){var $e=Ie.framebuffer;E($e,"must not double destroy framebuffer"),h.deleteFramebuffer($e),Ie.framebuffer=null,ae.framebufferCount--,delete Se[Ie.id]}function xe(Ie){var $e;h.bindFramebuffer(qi,Ie.framebuffer);var qe=Ie.colorAttachments;for($e=0;$e<qe.length;++$e)Ce(Oo+$e,qe[$e]);for($e=qe.length;$e<G.maxColorAttachments;++$e)h.framebufferTexture2D(qi,Oo+$e,Ha,null,0);h.framebufferTexture2D(qi,Wa,Ha,null,0),h.framebufferTexture2D(qi,Du,Ha,null,0),h.framebufferTexture2D(qi,S,Ha,null,0),Ce(Du,Ie.depthAttachment),Ce(S,Ie.stencilAttachment),Ce(Wa,Ie.depthStencilAttachment);var Mt=h.checkFramebufferStatus(qi);!h.isContextLost()&&Mt!==hf&&E.raise("framebuffer configuration not supported, status = "+Mo[Mt]),h.bindFramebuffer(qi,se.next?se.next.framebuffer:null),se.cur=se.next,h.getError()}function ge(Ie,$e){var qe=new Qe;ae.framebufferCount++;function Mt(Ke,Je){var wt;E(se.next!==qe,"can not update framebuffer which is currently in use");var Ct=0,Vt=0,Mr=!0,Lr=!0,Xt=null,Er=!0,_r="rgba",qr="uint8",Kr=1,en=null,un=null,mn=null,Wr=!1;if(typeof Ke=="number")Ct=Ke|0,Vt=Je|0||Ct;else if(!Ke)Ct=Vt=1;else{E.type(Ke,"object","invalid arguments for framebuffer");var Ut=Ke;if("shape"in Ut){var gn=Ut.shape;E(Array.isArray(gn)&&gn.length>=2,"invalid shape for framebuffer"),Ct=gn[0],Vt=gn[1]}else"radius"in Ut&&(Ct=Vt=Ut.radius),"width"in Ut&&(Ct=Ut.width),"height"in Ut&&(Vt=Ut.height);("color"in Ut||"colors"in Ut)&&(Xt=Ut.color||Ut.colors,Array.isArray(Xt)&&E(Xt.length===1||T.webgl_draw_buffers,"multiple render targets not supported")),Xt||("colorCount"in Ut&&(Kr=Ut.colorCount|0,E(Kr>0,"invalid color buffer count")),"colorTexture"in Ut&&(Er=!!Ut.colorTexture,_r="rgba4"),"colorType"in Ut&&(qr=Ut.colorType,Er?(E(T.oes_texture_float||!(qr==="float"||qr==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),E(T.oes_texture_half_float||!(qr==="half float"||qr==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):qr==="half float"||qr==="float16"?(E(T.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),_r="rgba16f"):(qr==="float"||qr==="float32")&&(E(T.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),_r="rgba32f"),E.oneOf(qr,Pe,"invalid color type")),"colorFormat"in Ut&&(_r=Ut.colorFormat,Le.indexOf(_r)>=0?Er=!0:De.indexOf(_r)>=0?Er=!1:E.optional(function(){Er?E.oneOf(Ut.colorFormat,Le,"invalid color format for texture"):E.oneOf(Ut.colorFormat,De,"invalid color format for renderbuffer")}))),("depthTexture"in Ut||"depthStencilTexture"in Ut)&&(Wr=!!(Ut.depthTexture||Ut.depthStencilTexture),E(!Wr||T.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Ut&&(typeof Ut.depth=="boolean"?Mr=Ut.depth:(en=Ut.depth,Lr=!1)),"stencil"in Ut&&(typeof Ut.stencil=="boolean"?Lr=Ut.stencil:(un=Ut.stencil,Mr=!1)),"depthStencil"in Ut&&(typeof Ut.depthStencil=="boolean"?Mr=Lr=Ut.depthStencil:(mn=Ut.depthStencil,Mr=!1,Lr=!1))}var cr=null,At=null,qt=null,er=null;if(Array.isArray(Xt))cr=Xt.map(ke);else if(Xt)cr=[ke(Xt)];else for(cr=new Array(Kr),wt=0;wt<Kr;++wt)cr[wt]=K(Ct,Vt,Er,_r,qr);E(T.webgl_draw_buffers||cr.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),E(cr.length<=G.maxColorAttachments,"too many color attachments, not supported"),Ct=Ct||cr[0].width,Vt=Vt||cr[0].height,en?At=ke(en):Mr&&!Lr&&(At=K(Ct,Vt,Wr,"depth","uint32")),un?qt=ke(un):Lr&&!Mr&&(qt=K(Ct,Vt,!1,"stencil","uint8")),mn?er=ke(mn):!en&&!un&&Lr&&Mr&&(er=K(Ct,Vt,Wr,"depth stencil","depth stencil")),E(!!en+!!un+!!mn<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var Vr=null;for(wt=0;wt<cr.length;++wt)if(We(cr[wt],Ct,Vt),E(!cr[wt]||cr[wt].texture&&Dd.indexOf(cr[wt].texture._texture.format)>=0||cr[wt].renderbuffer&&$a.indexOf(cr[wt].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+wt+" is invalid"),cr[wt]&&cr[wt].texture){var Si=gi[cr[wt].texture._texture.format]*ds[cr[wt].texture._texture.type];Vr===null?Vr=Si:E(Vr===Si,"all color attachments much have the same number of bits per pixel.")}return We(At,Ct,Vt),E(!At||At.texture&&At.texture._texture.format===Ed||At.renderbuffer&&At.renderbuffer._renderbuffer.format===Od,"invalid depth attachment for framebuffer object"),We(qt,Ct,Vt),E(!qt||qt.renderbuffer&&qt.renderbuffer._renderbuffer.format===Ki,"invalid stencil attachment for framebuffer object"),We(er,Ct,Vt),E(!er||er.texture&&er.texture._texture.format===ac||er.renderbuffer&&er.renderbuffer._renderbuffer.format===ac,"invalid depth-stencil attachment for framebuffer object"),je(qe),qe.width=Ct,qe.height=Vt,qe.colorAttachments=cr,qe.depthAttachment=At,qe.stencilAttachment=qt,qe.depthStencilAttachment=er,Mt.color=cr.map(oe),Mt.depth=oe(At),Mt.stencil=oe(qt),Mt.depthStencil=oe(er),Mt.width=qe.width,Mt.height=qe.height,xe(qe),Mt}function Lt(Ke,Je){E(se.next!==qe,"can not resize a framebuffer which is currently in use");var wt=Math.max(Ke|0,1),Ct=Math.max(Je|0||wt,1);if(wt===qe.width&&Ct===qe.height)return Mt;for(var Vt=qe.colorAttachments,Mr=0;Mr<Vt.length;++Mr)Oe(Vt[Mr],wt,Ct);return Oe(qe.depthAttachment,wt,Ct),Oe(qe.stencilAttachment,wt,Ct),Oe(qe.depthStencilAttachment,wt,Ct),qe.width=Mt.width=wt,qe.height=Mt.height=Ct,xe(qe),Mt}return Mt(Ie,$e),o(Mt,{resize:Lt,_reglType:"framebuffer",_framebuffer:qe,destroy:function(){pt(qe),je(qe)},use:function(Ke){se.setFBO({framebuffer:Mt},Ke)}})}function ut(Ie){var $e=Array(6);function qe(Lt){var Ke;E($e.indexOf(se.next)<0,"can not update framebuffer which is currently in use");var Je={color:null},wt=0,Ct=null,Vt="rgba",Mr="uint8",Lr=1;if(typeof Lt=="number")wt=Lt|0;else if(!Lt)wt=1;else{E.type(Lt,"object","invalid arguments for framebuffer");var Xt=Lt;if("shape"in Xt){var Er=Xt.shape;E(Array.isArray(Er)&&Er.length>=2,"invalid shape for framebuffer"),E(Er[0]===Er[1],"cube framebuffer must be square"),wt=Er[0]}else"radius"in Xt&&(wt=Xt.radius|0),"width"in Xt?(wt=Xt.width|0,"height"in Xt&&E(Xt.height===wt,"must be square")):"height"in Xt&&(wt=Xt.height|0);("color"in Xt||"colors"in Xt)&&(Ct=Xt.color||Xt.colors,Array.isArray(Ct)&&E(Ct.length===1||T.webgl_draw_buffers,"multiple render targets not supported")),Ct||("colorCount"in Xt&&(Lr=Xt.colorCount|0,E(Lr>0,"invalid color buffer count")),"colorType"in Xt&&(E.oneOf(Xt.colorType,Pe,"invalid color type"),Mr=Xt.colorType),"colorFormat"in Xt&&(Vt=Xt.colorFormat,E.oneOf(Xt.colorFormat,Le,"invalid color format for texture"))),"depth"in Xt&&(Je.depth=Xt.depth),"stencil"in Xt&&(Je.stencil=Xt.stencil),"depthStencil"in Xt&&(Je.depthStencil=Xt.depthStencil)}var _r;if(Ct)if(Array.isArray(Ct))for(_r=[],Ke=0;Ke<Ct.length;++Ke)_r[Ke]=Ct[Ke];else _r=[Ct];else{_r=Array(Lr);var qr={radius:wt,format:Vt,type:Mr};for(Ke=0;Ke<Lr;++Ke)_r[Ke]=fe.createCube(qr)}for(Je.color=Array(_r.length),Ke=0;Ke<_r.length;++Ke){var Kr=_r[Ke];E(typeof Kr=="function"&&Kr._reglType==="textureCube","invalid cube map"),wt=wt||Kr.width,E(Kr.width===wt&&Kr.height===wt,"invalid cube map shape"),Je.color[Ke]={target:za,data:_r[Ke]}}for(Ke=0;Ke<6;++Ke){for(var en=0;en<_r.length;++en)Je.color[en].target=za+Ke;Ke>0&&(Je.depth=$e[0].depth,Je.stencil=$e[0].stencil,Je.depthStencil=$e[0].depthStencil),$e[Ke]?$e[Ke](Je):$e[Ke]=ge(Je)}return o(qe,{width:wt,height:wt,color:_r})}function Mt(Lt){var Ke,Je=Lt|0;if(E(Je>0&&Je<=G.maxCubeMapSize,"invalid radius for cube fbo"),Je===qe.width)return qe;var wt=qe.color;for(Ke=0;Ke<wt.length;++Ke)wt[Ke].resize(Je);for(Ke=0;Ke<6;++Ke)$e[Ke].resize(Je);return qe.width=qe.height=Je,qe}return qe(Ie),o(qe,{faces:$e,resize:Mt,_reglType:"framebufferCube",destroy:function(){$e.forEach(function(Lt){Lt.destroy()})}})}function Ve(){se.cur=null,se.next=null,se.dirty=!0,Vn(Se).forEach(function(Ie){Ie.framebuffer=h.createFramebuffer(),xe(Ie)})}return o(se,{getFramebuffer:function(Ie){if(typeof Ie=="function"&&Ie._reglType==="framebuffer"){var $e=Ie._framebuffer;if($e instanceof Qe)return $e}return null},create:ge,createCube:ut,clear:function(){Vn(Se).forEach(pt)},restore:Ve})}var yi=5126,oc=34962,vs=34963,fc=["attributes","elements","offset","count","primitive","instances"];function Lu(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=yi,this.offset=0,this.stride=0,this.divisor=0}function Pd(h,T,G,fe,me,ae,se){for(var Le=G.maxAttributes,De=new Array(Le),Pe=0;Pe<Le;++Pe)De[Pe]=new Lu;var Ge=0,Be={},We={Record:Lu,scope:{},state:De,currentVAO:null,targetVAO:null,restore:ke()?je:function(){},createVAO:pt,getVAO:oe,destroyBuffer:Ce,setVAO:ke()?Oe:rt,clear:ke()?Se:function(){}};function Ce(xe){for(var ge=0;ge<De.length;++ge){var ut=De[ge];ut.buffer===xe&&(h.disableVertexAttribArray(ge),ut.buffer=null)}}function ke(){return T.oes_vertex_array_object}function K(){return T.angle_instanced_arrays}function oe(xe){return typeof xe=="function"&&xe._vao?xe._vao:null}function Oe(xe){if(xe!==We.currentVAO){var ge=ke();xe?ge.bindVertexArrayOES(xe.vao):ge.bindVertexArrayOES(null),We.currentVAO=xe}}function rt(xe){if(xe!==We.currentVAO){if(xe)xe.bindAttrs();else{for(var ge=K(),ut=0;ut<De.length;++ut){var Ve=De[ut];Ve.buffer?(h.enableVertexAttribArray(ut),Ve.buffer.bind(),h.vertexAttribPointer(ut,Ve.size,Ve.type,Ve.normalized,Ve.stride,Ve.offfset),ge&&Ve.divisor&&ge.vertexAttribDivisorANGLE(ut,Ve.divisor)):(h.disableVertexAttribArray(ut),h.vertexAttrib4f(ut,Ve.x,Ve.y,Ve.z,Ve.w))}se.elements?h.bindBuffer(vs,se.elements.buffer.buffer):h.bindBuffer(vs,null)}We.currentVAO=xe}}function Se(){Vn(Be).forEach(function(xe){xe.destroy()})}function Qe(){this.id=++Ge,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var xe=ke();xe?this.vao=xe.createVertexArrayOES():this.vao=null,Be[this.id]=this,this.buffers=[]}Qe.prototype.bindAttrs=function(){for(var xe=K(),ge=this.attributes,ut=0;ut<ge.length;++ut){var Ve=ge[ut];Ve.buffer?(h.enableVertexAttribArray(ut),h.bindBuffer(oc,Ve.buffer.buffer),h.vertexAttribPointer(ut,Ve.size,Ve.type,Ve.normalized,Ve.stride,Ve.offset),xe&&Ve.divisor&&xe.vertexAttribDivisorANGLE(ut,Ve.divisor)):(h.disableVertexAttribArray(ut),h.vertexAttrib4f(ut,Ve.x,Ve.y,Ve.z,Ve.w))}for(var Ie=ge.length;Ie<Le;++Ie)h.disableVertexAttribArray(Ie);var $e=ae.getElements(this.elements);$e?h.bindBuffer(vs,$e.buffer.buffer):h.bindBuffer(vs,null)},Qe.prototype.refresh=function(){var xe=ke();xe&&(xe.bindVertexArrayOES(this.vao),this.bindAttrs(),We.currentVAO=null,xe.bindVertexArrayOES(null))},Qe.prototype.destroy=function(){if(this.vao){var xe=ke();this===We.currentVAO&&(We.currentVAO=null,xe.bindVertexArrayOES(null)),xe.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),Be[this.id]&&(delete Be[this.id],fe.vaoCount-=1)};function je(){var xe=ke();xe&&Vn(Be).forEach(function(ge){ge.refresh()})}function pt(xe){var ge=new Qe;fe.vaoCount+=1;function ut(Ve){var Ie;if(Array.isArray(Ve))Ie=Ve,ge.elements&&ge.ownsElements&&ge.elements.destroy(),ge.elements=null,ge.ownsElements=!1,ge.offset=0,ge.count=0,ge.instances=-1,ge.primitive=4;else{if(E(typeof Ve=="object","invalid arguments for create vao"),E("attributes"in Ve,"must specify attributes for vao"),Ve.elements){var $e=Ve.elements;ge.ownsElements?typeof $e=="function"&&$e._reglType==="elements"?(ge.elements.destroy(),ge.ownsElements=!1):(ge.elements($e),ge.ownsElements=!1):ae.getElements(Ve.elements)?(ge.elements=Ve.elements,ge.ownsElements=!1):(ge.elements=ae.create(Ve.elements),ge.ownsElements=!0)}else ge.elements=null,ge.ownsElements=!1;Ie=Ve.attributes,ge.offset=0,ge.count=-1,ge.instances=-1,ge.primitive=4,ge.elements&&(ge.count=ge.elements._elements.vertCount,ge.primitive=ge.elements._elements.primType),"offset"in Ve&&(ge.offset=Ve.offset|0),"count"in Ve&&(ge.count=Ve.count|0),"instances"in Ve&&(ge.instances=Ve.instances|0),"primitive"in Ve&&(E(Ve.primitive in Wi,"bad primitive type: "+Ve.primitive),ge.primitive=Wi[Ve.primitive]),E.optional(()=>{for(var Mr=Object.keys(Ve),Lr=0;Lr<Mr.length;++Lr)E(fc.indexOf(Mr[Lr])>=0,'invalid option for vao: "'+Mr[Lr]+'" valid options are '+fc)}),E(Array.isArray(Ie),"attributes must be an array")}E(Ie.length<Le,"too many attributes"),E(Ie.length>0,"must specify at least one attribute");var qe={},Mt=ge.attributes;Mt.length=Ie.length;for(var Lt=0;Lt<Ie.length;++Lt){var Ke=Ie[Lt],Je=Mt[Lt]=new Lu,wt=Ke.data||Ke;if(Array.isArray(wt)||i(wt)||Rn(wt)){var Ct;ge.buffers[Lt]&&(Ct=ge.buffers[Lt],i(wt)&&Ct._buffer.byteLength>=wt.byteLength?Ct.subdata(wt):(Ct.destroy(),ge.buffers[Lt]=null)),ge.buffers[Lt]||(Ct=ge.buffers[Lt]=me.create(Ke,oc,!1,!0)),Je.buffer=me.getBuffer(Ct),Je.size=Je.buffer.dimension|0,Je.normalized=!1,Je.type=Je.buffer.dtype,Je.offset=0,Je.stride=0,Je.divisor=0,Je.state=1,qe[Lt]=1}else me.getBuffer(Ke)?(Je.buffer=me.getBuffer(Ke),Je.size=Je.buffer.dimension|0,Je.normalized=!1,Je.type=Je.buffer.dtype,Je.offset=0,Je.stride=0,Je.divisor=0,Je.state=1):me.getBuffer(Ke.buffer)?(Je.buffer=me.getBuffer(Ke.buffer),Je.size=(+Ke.size||Je.buffer.dimension)|0,Je.normalized=!!Ke.normalized||!1,"type"in Ke?(E.parameter(Ke.type,ka,"invalid buffer type"),Je.type=ka[Ke.type]):Je.type=Je.buffer.dtype,Je.offset=(Ke.offset||0)|0,Je.stride=(Ke.stride||0)|0,Je.divisor=(Ke.divisor||0)|0,Je.state=1,E(Je.size>=1&&Je.size<=4,"size must be between 1 and 4"),E(Je.offset>=0,"invalid offset"),E(Je.stride>=0&&Je.stride<=255,"stride must be between 0 and 255"),E(Je.divisor>=0,"divisor must be positive"),E(!Je.divisor||!!T.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Ke?(E(Lt>0,"first attribute must not be a constant"),Je.x=+Ke.x||0,Je.y=+Ke.y||0,Je.z=+Ke.z||0,Je.w=+Ke.w||0,Je.state=2):E(!1,"invalid attribute spec for location "+Lt)}for(var Vt=0;Vt<ge.buffers.length;++Vt)!qe[Vt]&&ge.buffers[Vt]&&(ge.buffers[Vt].destroy(),ge.buffers[Vt]=null);return ge.refresh(),ut}return ut.destroy=function(){for(var Ve=0;Ve<ge.buffers.length;++Ve)ge.buffers[Ve]&&ge.buffers[Ve].destroy();ge.buffers.length=0,ge.ownsElements&&(ge.elements.destroy(),ge.elements=null,ge.ownsElements=!1),ge.destroy()},ut._vao=ge,ut._reglType="vao",ut(xe)}return We}var Ru=35632,sc=35633,Bd=35718,Gd=35721;function Cu(h,T,G,fe){var me={},ae={};function se(K,oe,Oe,rt){this.name=K,this.id=oe,this.location=Oe,this.info=rt}function Le(K,oe){for(var Oe=0;Oe<K.length;++Oe)if(K[Oe].id===oe.id){K[Oe].location=oe.location;return}K.push(oe)}function De(K,oe,Oe){var rt=K===Ru?me:ae,Se=rt[oe];if(!Se){var Qe=T.str(oe);Se=h.createShader(K),h.shaderSource(Se,Qe),h.compileShader(Se),E.shaderError(h,Se,Qe,K,Oe),rt[oe]=Se}return Se}var Pe={},Ge=[],Be=0;function We(K,oe){this.id=Be++,this.fragId=K,this.vertId=oe,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,fe.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function Ce(K,oe,Oe){var rt,Se,Qe=De(Ru,K.fragId),je=De(sc,K.vertId),pt=K.program=h.createProgram();if(h.attachShader(pt,Qe),h.attachShader(pt,je),Oe)for(rt=0;rt<Oe.length;++rt){var xe=Oe[rt];h.bindAttribLocation(pt,xe[0],xe[1])}h.linkProgram(pt),E.linkError(h,pt,T.str(K.fragId),T.str(K.vertId),oe);var ge=h.getProgramParameter(pt,Bd);fe.profile&&(K.stats.uniformsCount=ge);var ut=K.uniforms;for(rt=0;rt<ge;++rt)if(Se=h.getActiveUniform(pt,rt),Se){if(Se.size>1)for(var Ve=0;Ve<Se.size;++Ve){var Ie=Se.name.replace("[0]","["+Ve+"]");Le(ut,new se(Ie,T.id(Ie),h.getUniformLocation(pt,Ie),Se))}var $e=Se.name;Se.size>1&&($e=$e.replace("[0]","")),Le(ut,new se($e,T.id($e),h.getUniformLocation(pt,$e),Se))}var qe=h.getProgramParameter(pt,Gd);fe.profile&&(K.stats.attributesCount=qe);var Mt=K.attributes;for(rt=0;rt<qe;++rt)Se=h.getActiveAttrib(pt,rt),Se&&Le(Mt,new se(Se.name,T.id(Se.name),h.getAttribLocation(pt,Se.name),Se))}fe.profile&&(G.getMaxUniformsCount=function(){var K=0;return Ge.forEach(function(oe){oe.stats.uniformsCount>K&&(K=oe.stats.uniformsCount)}),K},G.getMaxAttributesCount=function(){var K=0;return Ge.forEach(function(oe){oe.stats.attributesCount>K&&(K=oe.stats.attributesCount)}),K});function ke(){me={},ae={};for(var K=0;K<Ge.length;++K)Ce(Ge[K],null,Ge[K].attributes.map(function(oe){return[oe.location,oe.name]}))}return{clear:function(){var K=h.deleteShader.bind(h);Vn(me).forEach(K),me={},Vn(ae).forEach(K),ae={},Ge.forEach(function(oe){h.deleteProgram(oe.program)}),Ge.length=0,Pe={},G.shaderCount=0},program:function(K,oe,Oe,rt){E.command(K>=0,"missing vertex shader",Oe),E.command(oe>=0,"missing fragment shader",Oe);var Se=Pe[oe];Se||(Se=Pe[oe]={});var Qe=Se[K];if(Qe&&(Qe.refCount++,!rt))return Qe;var je=new We(oe,K);return G.shaderCount++,Ce(je,Oe,rt),Qe||(Se[K]=je),Ge.push(je),o(je,{destroy:function(){if(je.refCount--,je.refCount<=0){h.deleteProgram(je.program);var pt=Ge.indexOf(je);Ge.splice(pt,1),G.shaderCount--}Se[je.vertId].refCount<=0&&(h.deleteShader(ae[je.vertId]),delete ae[je.vertId],delete Pe[je.fragId][je.vertId]),Object.keys(Pe[je.fragId]).length||(h.deleteShader(me[je.fragId]),delete me[je.fragId],delete Pe[je.fragId])}})},restore:ke,shader:De,frag:-1,vert:-1}}var df=6408,va=5121,Ud=3333,vf=5126;function Yd(h,T,G,fe,me,ae,se){function Le(Ge){var Be;T.next===null?(E(me.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),Be=va):(E(T.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),Be=T.next.colorAttachments[0].texture._texture.type,E.optional(function(){ae.oes_texture_float?(E(Be===va||Be===vf,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),Be===vf&&E(se.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):E(Be===va,"Reading from a framebuffer is only allowed for the type 'uint8'")}));var We=0,Ce=0,ke=fe.framebufferWidth,K=fe.framebufferHeight,oe=null;i(Ge)?oe=Ge:Ge&&(E.type(Ge,"object","invalid arguments to regl.read()"),We=Ge.x|0,Ce=Ge.y|0,E(We>=0&&We<fe.framebufferWidth,"invalid x offset for regl.read"),E(Ce>=0&&Ce<fe.framebufferHeight,"invalid y offset for regl.read"),ke=(Ge.width||fe.framebufferWidth-We)|0,K=(Ge.height||fe.framebufferHeight-Ce)|0,oe=Ge.data||null),oe&&(Be===va?E(oe instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):Be===vf&&E(oe instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),E(ke>0&&ke+We<=fe.framebufferWidth,"invalid width for read pixels"),E(K>0&&K+Ce<=fe.framebufferHeight,"invalid height for read pixels"),G();var Oe=ke*K*4;return oe||(Be===va?oe=new Uint8Array(Oe):Be===vf&&(oe=oe||new Float32Array(Oe))),E.isTypedArray(oe,"data buffer for regl.read() must be a typedarray"),E(oe.byteLength>=Oe,"data buffer for regl.read() too small"),h.pixelStorei(Ud,4),h.readPixels(We,Ce,ke,K,df,Be,oe),oe}function De(Ge){var Be;return T.setFBO({framebuffer:Ge.framebuffer},function(){Be=Le(Ge)}),Be}function Pe(Ge){return!Ge||!("framebuffer"in Ge)?Le(Ge):De(Ge)}return Pe}function $n(h){return Array.prototype.slice.call(h)}function _a(h){return $n(h).join("")}function Za(){var h=0,T=[],G=[];function fe(Be){for(var We=0;We<G.length;++We)if(G[We]===Be)return T[We];var Ce="g"+h++;return T.push(Ce),G.push(Be),Ce}function me(){var Be=[];function We(){Be.push.apply(Be,$n(arguments))}var Ce=[];function ke(){var K="v"+h++;return Ce.push(K),arguments.length>0&&(Be.push(K,"="),Be.push.apply(Be,$n(arguments)),Be.push(";")),K}return o(We,{def:ke,toString:function(){return _a([Ce.length>0?"var "+Ce.join(",")+";":"",_a(Be)])}})}function ae(){var Be=me(),We=me(),Ce=Be.toString,ke=We.toString;function K(oe,Oe){We(oe,Oe,"=",Be.def(oe,Oe),";")}return o(function(){Be.apply(Be,$n(arguments))},{def:Be.def,entry:Be,exit:We,save:K,set:function(oe,Oe,rt){K(oe,Oe),Be(oe,Oe,"=",rt,";")},toString:function(){return Ce()+ke()}})}function se(){var Be=_a(arguments),We=ae(),Ce=ae(),ke=We.toString,K=Ce.toString;return o(We,{then:function(){return We.apply(We,$n(arguments)),this},else:function(){return Ce.apply(Ce,$n(arguments)),this},toString:function(){var oe=K();return oe&&(oe="else{"+oe+"}"),_a(["if(",Be,"){",ke(),"}",oe])}})}var Le=me(),De={};function Pe(Be,We){var Ce=[];function ke(){var Se="a"+Ce.length;return Ce.push(Se),Se}We=We||0;for(var K=0;K<We;++K)ke();var oe=ae(),Oe=oe.toString,rt=De[Be]=o(oe,{arg:ke,toString:function(){return _a(["function(",Ce.join(),"){",Oe(),"}"])}});return rt}function Ge(){var Be=['"use strict";',Le,"return {"];Object.keys(De).forEach(function(ke){Be.push('"',ke,'":',De[ke].toString(),",")}),Be.push("}");var We=_a(Be).replace(/;/g,`;
|
|
41
|
+
`).replace(/}/g,`}
|
|
42
|
+
`).replace(/{/g,`{
|
|
43
|
+
`),Ce=Function.apply(null,T.concat(We));return Ce.apply(null,G)}return{global:Le,link:fe,block:me,proc:Pe,scope:ae,cond:se,compile:Ge}}var Sn="xyzw".split(""),uc=5121,Xa=1,_s=2,qa=0,Mi=1,ps=2,Ou=3,Ka=4,lc=5,Mu=6,pn="dither",ms="blend.enable",Iu="blend.color",ii="blend.equation",_f="blend.func",pf="depth.enable",pa="depth.func",Fu="depth.range",Mn="depth.mask",mf="colorMask",cc="cull.enable",hc="cull.face",ku="frontFace",gf="lineWidth",dc="polygonOffset.enable",ja="polygonOffset.offset",Nu="sample.alpha",vc="sample.enable",Pu="sample.coverage",Io="stencil.enable",_c="stencil.mask",Bu="stencil.func",yf="stencil.opFront",Fo="stencil.opBack",pc="scissor.enable",gs="scissor.box",ji="viewport",ko="profile",Qi="framebuffer",xf="vert",Qa="frag",ma="elements",ga="primitive",ya="count",Ja="offset",ys="instances",No="vao",xs="Width",Gu="Height",eo=Qi+xs,Po=Qi+Gu,Uu=ji+xs,mc=ji+Gu,bs="drawingBuffer",gc=bs+xs,ws=bs+Gu,rr=[_f,ii,Bu,yf,Fo,Pu,ji,gs,ja],Bo=34962,Yu=34963,bf=35632,yc=35633,xc=3553,Hd=34067,ai=2884,zd=3042,Ss=3024,Hu=2960,bc=2929,wc=3089,Kn=32823,xa=32926,zu=32928,As=5126,to=35664,wf=35665,Go=35666,Ts=5124,Uo=35667,Yo=35668,xi=35669,Wu=35670,bi=35671,Sf=35672,Af=35673,ro=35674,Tf=35675,Ef=35676,Df=35678,Ho=35680,Es=4,Lf=1028,ba=1029,Vu=2304,In=2305,Ii=32775,Wd=32776,Vd=519,wi=7680,no=0,$u=1,Zu=32774,$d=513,Xu=36160,zo=36064,Zn={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Sc=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],io={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ji={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Rf={frag:bf,vert:yc},Ds={cw:Vu,ccw:In};function ao(h){return Array.isArray(h)||i(h)||Rn(h)}function Ls(h){return h.sort(function(T,G){return T===ji?-1:G===ji?1:T<G?-1:1})}function Hr(h,T,G,fe){this.thisDep=h,this.contextDep=T,this.propDep=G,this.append=fe}function wa(h){return h&&!(h.thisDep||h.contextDep||h.propDep)}function zr(h){return new Hr(!1,!1,!1,h)}function An(h,T){var G=h.type;if(G===qa){var fe=h.data.length;return new Hr(!0,fe>=1,fe>=2,T)}else if(G===Ka){var me=h.data;return new Hr(me.thisDep,me.contextDep,me.propDep,T)}else{if(G===lc)return new Hr(!1,!1,!1,T);if(G===Mu){for(var ae=!1,se=!1,Le=!1,De=0;De<h.data.length;++De){var Pe=h.data[De];if(Pe.type===Mi)Le=!0;else if(Pe.type===ps)se=!0;else if(Pe.type===Ou)ae=!0;else if(Pe.type===qa){ae=!0;var Ge=Pe.data;Ge>=1&&(se=!0),Ge>=2&&(Le=!0)}else Pe.type===Ka&&(ae=ae||Pe.data.thisDep,se=se||Pe.data.contextDep,Le=Le||Pe.data.propDep)}return new Hr(ae,se,Le,T)}else return new Hr(G===Ou,G===ps,G===Mi,T)}}var qu=new Hr(!1,!1,!1,function(){});function Ku(h,T,G,fe,me,ae,se,Le,De,Pe,Ge,Be,We,Ce,ke){var K=Pe.Record,oe={add:32774,subtract:32778,"reverse subtract":32779};G.ext_blend_minmax&&(oe.min=Ii,oe.max=Wd);var Oe=G.angle_instanced_arrays,rt=G.webgl_draw_buffers,Se=G.oes_vertex_array_object,Qe={dirty:!0,profile:ke.profile},je={},pt=[],xe={},ge={};function ut(R){return R.replace(".","_")}function Ve(R,y,H){var j=ut(R);pt.push(R),je[j]=Qe[j]=!!H,xe[j]=y}function Ie(R,y,H){var j=ut(R);pt.push(R),Array.isArray(H)?(Qe[j]=H.slice(),je[j]=H.slice()):Qe[j]=je[j]=H,ge[j]=y}Ve(pn,Ss),Ve(ms,zd),Ie(Iu,"blendColor",[0,0,0,0]),Ie(ii,"blendEquationSeparate",[Zu,Zu]),Ie(_f,"blendFuncSeparate",[$u,no,$u,no]),Ve(pf,bc,!0),Ie(pa,"depthFunc",$d),Ie(Fu,"depthRange",[0,1]),Ie(Mn,"depthMask",!0),Ie(mf,mf,[!0,!0,!0,!0]),Ve(cc,ai),Ie(hc,"cullFace",ba),Ie(ku,ku,In),Ie(gf,gf,1),Ve(dc,Kn),Ie(ja,"polygonOffset",[0,0]),Ve(Nu,xa),Ve(vc,zu),Ie(Pu,"sampleCoverage",[1,!1]),Ve(Io,Hu),Ie(_c,"stencilMask",-1),Ie(Bu,"stencilFunc",[Vd,0,-1]),Ie(yf,"stencilOpSeparate",[Lf,wi,wi,wi]),Ie(Fo,"stencilOpSeparate",[ba,wi,wi,wi]),Ve(pc,wc),Ie(gs,"scissor",[0,0,h.drawingBufferWidth,h.drawingBufferHeight]),Ie(ji,ji,[0,0,h.drawingBufferWidth,h.drawingBufferHeight]);var $e={gl:h,context:We,strings:T,next:je,current:Qe,draw:Be,elements:ae,buffer:me,shader:Ge,attributes:Pe.state,vao:Pe,uniforms:De,framebuffer:Le,extensions:G,timer:Ce,isBufferArgs:ao},qe={primTypes:Wi,compareFuncs:io,blendFuncs:Zn,blendEquations:oe,stencilOps:Ji,glTypes:ka,orientationType:Ds};E.optional(function(){$e.isArrayLike=Nr}),rt&&(qe.backBuffer=[ba],qe.drawBuffer=at(fe.maxDrawbuffers,function(R){return R===0?[0]:at(R,function(y){return zo+y})}));var Mt=0;function Lt(){var R=Za(),y=R.link,H=R.global;R.id=Mt++,R.batchId="0";var j=y($e),Q=R.shared={props:"a0"};Object.keys($e).forEach(function(P){Q[P]=H.def(j,".",P)}),E.optional(function(){R.CHECK=y(E),R.commandStr=E.guessCommand(),R.command=y(R.commandStr),R.assert=function(P,I,re){P("if(!(",I,"))",this.CHECK,".commandRaise(",y(re),",",this.command,");")},qe.invalidBlendCombinations=Sc});var W=R.next={},Y=R.current={};Object.keys(ge).forEach(function(P){Array.isArray(Qe[P])&&(W[P]=H.def(Q.next,".",P),Y[P]=H.def(Q.current,".",P))});var X=R.constants={};Object.keys(qe).forEach(function(P){X[P]=H.def(JSON.stringify(qe[P]))}),R.invoke=function(P,I){switch(I.type){case qa:var re=["this",Q.context,Q.props,R.batchId];return P.def(y(I.data),".call(",re.slice(0,Math.max(I.data.length+1,4)),")");case Mi:return P.def(Q.props,I.data);case ps:return P.def(Q.context,I.data);case Ou:return P.def("this",I.data);case Ka:return I.data.append(R,P),I.data.ref;case lc:return I.data.toString();case Mu:return I.data.map(function(ee){return R.invoke(P,ee)})}},R.attribCache={};var O={};return R.scopeAttrib=function(P){var I=T.id(P);if(I in O)return O[I];var re=Pe.scope[I];re||(re=Pe.scope[I]=new K);var ee=O[I]=y(re);return ee},R}function Ke(R){var y=R.static,H=R.dynamic,j;if(ko in y){var Q=!!y[ko];j=zr(function(Y,X){return Q}),j.enable=Q}else if(ko in H){var W=H[ko];j=An(W,function(Y,X){return Y.invoke(X,W)})}return j}function Je(R,y){var H=R.static,j=R.dynamic;if(Qi in H){var Q=H[Qi];return Q?(Q=Le.getFramebuffer(Q),E.command(Q,"invalid framebuffer object"),zr(function(Y,X){var O=Y.link(Q),P=Y.shared;X.set(P.framebuffer,".next",O);var I=P.context;return X.set(I,"."+eo,O+".width"),X.set(I,"."+Po,O+".height"),O})):zr(function(Y,X){var O=Y.shared;X.set(O.framebuffer,".next","null");var P=O.context;return X.set(P,"."+eo,P+"."+gc),X.set(P,"."+Po,P+"."+ws),"null"})}else if(Qi in j){var W=j[Qi];return An(W,function(Y,X){var O=Y.invoke(X,W),P=Y.shared,I=P.framebuffer,re=X.def(I,".getFramebuffer(",O,")");E.optional(function(){Y.assert(X,"!"+O+"||"+re,"invalid framebuffer object")}),X.set(I,".next",re);var ee=P.context;return X.set(ee,"."+eo,re+"?"+re+".width:"+ee+"."+gc),X.set(ee,"."+Po,re+"?"+re+".height:"+ee+"."+ws),re})}else return null}function wt(R,y,H){var j=R.static,Q=R.dynamic;function W(O){if(O in j){var P=j[O];E.commandType(P,"object","invalid "+O,H.commandStr);var I=!0,re=P.x|0,ee=P.y|0,_e,be;return"width"in P?(_e=P.width|0,E.command(_e>=0,"invalid "+O,H.commandStr)):I=!1,"height"in P?(be=P.height|0,E.command(be>=0,"invalid "+O,H.commandStr)):I=!1,new Hr(!I&&y&&y.thisDep,!I&&y&&y.contextDep,!I&&y&&y.propDep,function(yt,ot){var Ae=yt.shared.context,he=_e;"width"in P||(he=ot.def(Ae,".",eo,"-",re));var ht=be;return"height"in P||(ht=ot.def(Ae,".",Po,"-",ee)),[re,ee,he,ht]})}else if(O in Q){var Ye=Q[O],Dt=An(Ye,function(yt,ot){var Ae=yt.invoke(ot,Ye);E.optional(function(){yt.assert(ot,Ae+"&&typeof "+Ae+'==="object"',"invalid "+O)});var he=yt.shared.context,ht=ot.def(Ae,".x|0"),ct=ot.def(Ae,".y|0"),Tt=ot.def('"width" in ',Ae,"?",Ae,".width|0:","(",he,".",eo,"-",ht,")"),dr=ot.def('"height" in ',Ae,"?",Ae,".height|0:","(",he,".",Po,"-",ct,")");return E.optional(function(){yt.assert(ot,Tt+">=0&&"+dr+">=0","invalid "+O)}),[ht,ct,Tt,dr]});return y&&(Dt.thisDep=Dt.thisDep||y.thisDep,Dt.contextDep=Dt.contextDep||y.contextDep,Dt.propDep=Dt.propDep||y.propDep),Dt}else return y?new Hr(y.thisDep,y.contextDep,y.propDep,function(yt,ot){var Ae=yt.shared.context;return[0,0,ot.def(Ae,".",eo),ot.def(Ae,".",Po)]}):null}var Y=W(ji);if(Y){var X=Y;Y=new Hr(Y.thisDep,Y.contextDep,Y.propDep,function(O,P){var I=X.append(O,P),re=O.shared.context;return P.set(re,"."+Uu,I[2]),P.set(re,"."+mc,I[3]),I})}return{viewport:Y,scissor_box:W(gs)}}function Ct(R,y){var H=R.static,j=typeof H[Qa]=="string"&&typeof H[xf]=="string";if(j){if(Object.keys(y.dynamic).length>0)return null;var Q=y.static,W=Object.keys(Q);if(W.length>0&&typeof Q[W[0]]=="number"){for(var Y=[],X=0;X<W.length;++X)E(typeof Q[W[X]]=="number","must specify all vertex attribute locations when using vaos"),Y.push([Q[W[X]]|0,W[X]]);return Y}}return null}function Vt(R,y,H){var j=R.static,Q=R.dynamic;function W(I){if(I in j){var re=T.id(j[I]);E.optional(function(){Ge.shader(Rf[I],re,E.guessCommand())});var ee=zr(function(){return re});return ee.id=re,ee}else if(I in Q){var _e=Q[I];return An(_e,function(be,Ye){var Dt=be.invoke(Ye,_e),yt=Ye.def(be.shared.strings,".id(",Dt,")");return E.optional(function(){Ye(be.shared.shader,".shader(",Rf[I],",",yt,",",be.command,");")}),yt})}return null}var Y=W(Qa),X=W(xf),O=null,P;return wa(Y)&&wa(X)?(O=Ge.program(X.id,Y.id,null,H),P=zr(function(I,re){return I.link(O)})):P=new Hr(Y&&Y.thisDep||X&&X.thisDep,Y&&Y.contextDep||X&&X.contextDep,Y&&Y.propDep||X&&X.propDep,function(I,re){var ee=I.shared.shader,_e;Y?_e=Y.append(I,re):_e=re.def(ee,".",Qa);var be;X?be=X.append(I,re):be=re.def(ee,".",xf);var Ye=ee+".program("+be+","+_e;return E.optional(function(){Ye+=","+I.command}),re.def(Ye+")")}),{frag:Y,vert:X,progVar:P,program:O}}function Mr(R,y){var H=R.static,j=R.dynamic,Q={},W=!1;function Y(){if(No in H){var ot=H[No];return ot!==null&&Pe.getVAO(ot)===null&&(ot=Pe.createVAO(ot)),W=!0,Q.vao=ot,zr(function(he){var ht=Pe.getVAO(ot);return ht?he.link(ht):"null"})}else if(No in j){W=!0;var Ae=j[No];return An(Ae,function(he,ht){var ct=he.invoke(ht,Ae);return ht.def(he.shared.vao+".getVAO("+ct+")")})}return null}var X=Y(),O=!1;function P(){if(ma in H){var ot=H[ma];if(Q.elements=ot,ao(ot)){var Ae=Q.elements=ae.create(ot,!0);ot=ae.getElements(Ae),O=!0}else ot&&(ot=ae.getElements(ot),O=!0,E.command(ot,"invalid elements",y.commandStr));var he=zr(function(ct,Tt){if(ot){var dr=ct.link(ot);return ct.ELEMENTS=dr,dr}return ct.ELEMENTS=null,null});return he.value=ot,he}else if(ma in j){O=!0;var ht=j[ma];return An(ht,function(ct,Tt){var dr=ct.shared,yn=dr.isBufferArgs,fo=dr.elements,ta=ct.invoke(Tt,ht),ki=Tt.def("null"),Aa=Tt.def(yn,"(",ta,")"),so=ct.cond(Aa).then(ki,"=",fo,".createStream(",ta,");").else(ki,"=",fo,".getElements(",ta,");");return E.optional(function(){ct.assert(so.else,"!"+ta+"||"+ki,"invalid elements")}),Tt.entry(so),Tt.exit(ct.cond(Aa).then(fo,".destroyStream(",ki,");")),ct.ELEMENTS=ki,ki})}else if(W)return new Hr(X.thisDep,X.contextDep,X.propDep,function(ct,Tt){return Tt.def(ct.shared.vao+".currentVAO?"+ct.shared.elements+".getElements("+ct.shared.vao+".currentVAO.elements):null")});return null}var I=P();function re(){if(ga in H){var ot=H[ga];return Q.primitive=ot,E.commandParameter(ot,Wi,"invalid primitve",y.commandStr),zr(function(he,ht){return Wi[ot]})}else if(ga in j){var Ae=j[ga];return An(Ae,function(he,ht){var ct=he.constants.primTypes,Tt=he.invoke(ht,Ae);return E.optional(function(){he.assert(ht,Tt+" in "+ct,"invalid primitive, must be one of "+Object.keys(Wi))}),ht.def(ct,"[",Tt,"]")})}else{if(O)return wa(I)?I.value?zr(function(he,ht){return ht.def(he.ELEMENTS,".primType")}):zr(function(){return Es}):new Hr(I.thisDep,I.contextDep,I.propDep,function(he,ht){var ct=he.ELEMENTS;return ht.def(ct,"?",ct,".primType:",Es)});if(W)return new Hr(X.thisDep,X.contextDep,X.propDep,function(he,ht){return ht.def(he.shared.vao+".currentVAO?"+he.shared.vao+".currentVAO.primitive:"+Es)})}return null}function ee(ot,Ae){if(ot in H){var he=H[ot]|0;return Ae?Q.offset=he:Q.instances=he,E.command(!Ae||he>=0,"invalid "+ot,y.commandStr),zr(function(ct,Tt){return Ae&&(ct.OFFSET=he),he})}else if(ot in j){var ht=j[ot];return An(ht,function(ct,Tt){var dr=ct.invoke(Tt,ht);return Ae&&(ct.OFFSET=dr,E.optional(function(){ct.assert(Tt,dr+">=0","invalid "+ot)})),dr})}else if(Ae){if(O)return zr(function(ct,Tt){return ct.OFFSET=0,0});if(W)return new Hr(X.thisDep,X.contextDep,X.propDep,function(ct,Tt){return Tt.def(ct.shared.vao+".currentVAO?"+ct.shared.vao+".currentVAO.offset:0")})}else if(W)return new Hr(X.thisDep,X.contextDep,X.propDep,function(ct,Tt){return Tt.def(ct.shared.vao+".currentVAO?"+ct.shared.vao+".currentVAO.instances:-1")});return null}var _e=ee(Ja,!0);function be(){if(ya in H){var ot=H[ya]|0;return Q.count=ot,E.command(typeof ot=="number"&&ot>=0,"invalid vertex count",y.commandStr),zr(function(){return ot})}else if(ya in j){var Ae=j[ya];return An(Ae,function(Tt,dr){var yn=Tt.invoke(dr,Ae);return E.optional(function(){Tt.assert(dr,"typeof "+yn+'==="number"&&'+yn+">=0&&"+yn+"===("+yn+"|0)","invalid vertex count")}),yn})}else if(O)if(wa(I)){if(I)return _e?new Hr(_e.thisDep,_e.contextDep,_e.propDep,function(Tt,dr){var yn=dr.def(Tt.ELEMENTS,".vertCount-",Tt.OFFSET);return E.optional(function(){Tt.assert(dr,yn+">=0","invalid vertex offset/element buffer too small")}),yn}):zr(function(Tt,dr){return dr.def(Tt.ELEMENTS,".vertCount")});var he=zr(function(){return-1});return E.optional(function(){he.MISSING=!0}),he}else{var ht=new Hr(I.thisDep||_e.thisDep,I.contextDep||_e.contextDep,I.propDep||_e.propDep,function(Tt,dr){var yn=Tt.ELEMENTS;return Tt.OFFSET?dr.def(yn,"?",yn,".vertCount-",Tt.OFFSET,":-1"):dr.def(yn,"?",yn,".vertCount:-1")});return E.optional(function(){ht.DYNAMIC=!0}),ht}else if(W){var ct=new Hr(X.thisDep,X.contextDep,X.propDep,function(Tt,dr){return dr.def(Tt.shared.vao,".currentVAO?",Tt.shared.vao,".currentVAO.count:-1")});return ct}return null}var Ye=re(),Dt=be(),yt=ee(ys,!1);return{elements:I,primitive:Ye,count:Dt,instances:yt,offset:_e,vao:X,vaoActive:W,elementsActive:O,static:Q}}function Lr(R,y){var H=R.static,j=R.dynamic,Q={};return pt.forEach(function(W){var Y=ut(W);function X(O,P){if(W in H){var I=O(H[W]);Q[Y]=zr(function(){return I})}else if(W in j){var re=j[W];Q[Y]=An(re,function(ee,_e){return P(ee,_e,ee.invoke(_e,re))})}}switch(W){case cc:case ms:case pn:case Io:case pf:case pc:case dc:case Nu:case vc:case Mn:return X(function(O){return E.commandType(O,"boolean",W,y.commandStr),O},function(O,P,I){return E.optional(function(){O.assert(P,"typeof "+I+'==="boolean"',"invalid flag "+W,O.commandStr)}),I});case pa:return X(function(O){return E.commandParameter(O,io,"invalid "+W,y.commandStr),io[O]},function(O,P,I){var re=O.constants.compareFuncs;return E.optional(function(){O.assert(P,I+" in "+re,"invalid "+W+", must be one of "+Object.keys(io))}),P.def(re,"[",I,"]")});case Fu:return X(function(O){return E.command(Nr(O)&&O.length===2&&typeof O[0]=="number"&&typeof O[1]=="number"&&O[0]<=O[1],"depth range is 2d array",y.commandStr),O},function(O,P,I){E.optional(function(){O.assert(P,O.shared.isArrayLike+"("+I+")&&"+I+".length===2&&typeof "+I+'[0]==="number"&&typeof '+I+'[1]==="number"&&'+I+"[0]<="+I+"[1]","depth range must be a 2d array")});var re=P.def("+",I,"[0]"),ee=P.def("+",I,"[1]");return[re,ee]});case _f:return X(function(O){E.commandType(O,"object","blend.func",y.commandStr);var P="srcRGB"in O?O.srcRGB:O.src,I="srcAlpha"in O?O.srcAlpha:O.src,re="dstRGB"in O?O.dstRGB:O.dst,ee="dstAlpha"in O?O.dstAlpha:O.dst;return E.commandParameter(P,Zn,Y+".srcRGB",y.commandStr),E.commandParameter(I,Zn,Y+".srcAlpha",y.commandStr),E.commandParameter(re,Zn,Y+".dstRGB",y.commandStr),E.commandParameter(ee,Zn,Y+".dstAlpha",y.commandStr),E.command(Sc.indexOf(P+", "+re)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+P+", "+re+")",y.commandStr),[Zn[P],Zn[re],Zn[I],Zn[ee]]},function(O,P,I){var re=O.constants.blendFuncs;E.optional(function(){O.assert(P,I+"&&typeof "+I+'==="object"',"invalid blend func, must be an object")});function ee(Ae,he){var ht=P.def('"',Ae,he,'" in ',I,"?",I,".",Ae,he,":",I,".",Ae);return E.optional(function(){O.assert(P,ht+" in "+re,"invalid "+W+"."+Ae+he+", must be one of "+Object.keys(Zn))}),ht}var _e=ee("src","RGB"),be=ee("dst","RGB");E.optional(function(){var Ae=O.constants.invalidBlendCombinations;O.assert(P,Ae+".indexOf("+_e+'+", "+'+be+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var Ye=P.def(re,"[",_e,"]"),Dt=P.def(re,"[",ee("src","Alpha"),"]"),yt=P.def(re,"[",be,"]"),ot=P.def(re,"[",ee("dst","Alpha"),"]");return[Ye,yt,Dt,ot]});case ii:return X(function(O){if(typeof O=="string")return E.commandParameter(O,oe,"invalid "+W,y.commandStr),[oe[O],oe[O]];if(typeof O=="object")return E.commandParameter(O.rgb,oe,W+".rgb",y.commandStr),E.commandParameter(O.alpha,oe,W+".alpha",y.commandStr),[oe[O.rgb],oe[O.alpha]];E.commandRaise("invalid blend.equation",y.commandStr)},function(O,P,I){var re=O.constants.blendEquations,ee=P.def(),_e=P.def(),be=O.cond("typeof ",I,'==="string"');return E.optional(function(){function Ye(Dt,yt,ot){O.assert(Dt,ot+" in "+re,"invalid "+yt+", must be one of "+Object.keys(oe))}Ye(be.then,W,I),O.assert(be.else,I+"&&typeof "+I+'==="object"',"invalid "+W),Ye(be.else,W+".rgb",I+".rgb"),Ye(be.else,W+".alpha",I+".alpha")}),be.then(ee,"=",_e,"=",re,"[",I,"];"),be.else(ee,"=",re,"[",I,".rgb];",_e,"=",re,"[",I,".alpha];"),P(be),[ee,_e]});case Iu:return X(function(O){return E.command(Nr(O)&&O.length===4,"blend.color must be a 4d array",y.commandStr),at(4,function(P){return+O[P]})},function(O,P,I){return E.optional(function(){O.assert(P,O.shared.isArrayLike+"("+I+")&&"+I+".length===4","blend.color must be a 4d array")}),at(4,function(re){return P.def("+",I,"[",re,"]")})});case _c:return X(function(O){return E.commandType(O,"number",Y,y.commandStr),O|0},function(O,P,I){return E.optional(function(){O.assert(P,"typeof "+I+'==="number"',"invalid stencil.mask")}),P.def(I,"|0")});case Bu:return X(function(O){E.commandType(O,"object",Y,y.commandStr);var P=O.cmp||"keep",I=O.ref||0,re="mask"in O?O.mask:-1;return E.commandParameter(P,io,W+".cmp",y.commandStr),E.commandType(I,"number",W+".ref",y.commandStr),E.commandType(re,"number",W+".mask",y.commandStr),[io[P],I,re]},function(O,P,I){var re=O.constants.compareFuncs;E.optional(function(){function Ye(){O.assert(P,Array.prototype.join.call(arguments,""),"invalid stencil.func")}Ye(I+"&&typeof ",I,'==="object"'),Ye('!("cmp" in ',I,")||(",I,".cmp in ",re,")")});var ee=P.def('"cmp" in ',I,"?",re,"[",I,".cmp]",":",wi),_e=P.def(I,".ref|0"),be=P.def('"mask" in ',I,"?",I,".mask|0:-1");return[ee,_e,be]});case yf:case Fo:return X(function(O){E.commandType(O,"object",Y,y.commandStr);var P=O.fail||"keep",I=O.zfail||"keep",re=O.zpass||"keep";return E.commandParameter(P,Ji,W+".fail",y.commandStr),E.commandParameter(I,Ji,W+".zfail",y.commandStr),E.commandParameter(re,Ji,W+".zpass",y.commandStr),[W===Fo?ba:Lf,Ji[P],Ji[I],Ji[re]]},function(O,P,I){var re=O.constants.stencilOps;E.optional(function(){O.assert(P,I+"&&typeof "+I+'==="object"',"invalid "+W)});function ee(_e){return E.optional(function(){O.assert(P,'!("'+_e+'" in '+I+")||("+I+"."+_e+" in "+re+")","invalid "+W+"."+_e+", must be one of "+Object.keys(Ji))}),P.def('"',_e,'" in ',I,"?",re,"[",I,".",_e,"]:",wi)}return[W===Fo?ba:Lf,ee("fail"),ee("zfail"),ee("zpass")]});case ja:return X(function(O){E.commandType(O,"object",Y,y.commandStr);var P=O.factor|0,I=O.units|0;return E.commandType(P,"number",Y+".factor",y.commandStr),E.commandType(I,"number",Y+".units",y.commandStr),[P,I]},function(O,P,I){E.optional(function(){O.assert(P,I+"&&typeof "+I+'==="object"',"invalid "+W)});var re=P.def(I,".factor|0"),ee=P.def(I,".units|0");return[re,ee]});case hc:return X(function(O){var P=0;return O==="front"?P=Lf:O==="back"&&(P=ba),E.command(!!P,Y,y.commandStr),P},function(O,P,I){return E.optional(function(){O.assert(P,I+'==="front"||'+I+'==="back"',"invalid cull.face")}),P.def(I,'==="front"?',Lf,":",ba)});case gf:return X(function(O){return E.command(typeof O=="number"&&O>=fe.lineWidthDims[0]&&O<=fe.lineWidthDims[1],"invalid line width, must be a positive number between "+fe.lineWidthDims[0]+" and "+fe.lineWidthDims[1],y.commandStr),O},function(O,P,I){return E.optional(function(){O.assert(P,"typeof "+I+'==="number"&&'+I+">="+fe.lineWidthDims[0]+"&&"+I+"<="+fe.lineWidthDims[1],"invalid line width")}),I});case ku:return X(function(O){return E.commandParameter(O,Ds,Y,y.commandStr),Ds[O]},function(O,P,I){return E.optional(function(){O.assert(P,I+'==="cw"||'+I+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),P.def(I+'==="cw"?'+Vu+":"+In)});case mf:return X(function(O){return E.command(Nr(O)&&O.length===4,"color.mask must be length 4 array",y.commandStr),O.map(function(P){return!!P})},function(O,P,I){return E.optional(function(){O.assert(P,O.shared.isArrayLike+"("+I+")&&"+I+".length===4","invalid color.mask")}),at(4,function(re){return"!!"+I+"["+re+"]"})});case Pu:return X(function(O){E.command(typeof O=="object"&&O,Y,y.commandStr);var P="value"in O?O.value:1,I=!!O.invert;return E.command(typeof P=="number"&&P>=0&&P<=1,"sample.coverage.value must be a number between 0 and 1",y.commandStr),[P,I]},function(O,P,I){E.optional(function(){O.assert(P,I+"&&typeof "+I+'==="object"',"invalid sample.coverage")});var re=P.def('"value" in ',I,"?+",I,".value:1"),ee=P.def("!!",I,".invert");return[re,ee]})}}),Q}function Xt(R,y){var H=R.static,j=R.dynamic,Q={};return Object.keys(H).forEach(function(W){var Y=H[W],X;if(typeof Y=="number"||typeof Y=="boolean")X=zr(function(){return Y});else if(typeof Y=="function"){var O=Y._reglType;O==="texture2d"||O==="textureCube"?X=zr(function(P){return P.link(Y)}):O==="framebuffer"||O==="framebufferCube"?(E.command(Y.color.length>0,'missing color attachment for framebuffer sent to uniform "'+W+'"',y.commandStr),X=zr(function(P){return P.link(Y.color[0])})):E.commandRaise('invalid data for uniform "'+W+'"',y.commandStr)}else Nr(Y)?X=zr(function(P){var I=P.global.def("[",at(Y.length,function(re){return E.command(typeof Y[re]=="number"||typeof Y[re]=="boolean","invalid uniform "+W,P.commandStr),Y[re]}),"]");return I}):E.commandRaise('invalid or missing data for uniform "'+W+'"',y.commandStr);X.value=Y,Q[W]=X}),Object.keys(j).forEach(function(W){var Y=j[W];Q[W]=An(Y,function(X,O){return X.invoke(O,Y)})}),Q}function Er(R,y){var H=R.static,j=R.dynamic,Q={};return Object.keys(H).forEach(function(W){var Y=H[W],X=T.id(W),O=new K;if(ao(Y))O.state=Xa,O.buffer=me.getBuffer(me.create(Y,Bo,!1,!0)),O.type=0;else{var P=me.getBuffer(Y);if(P)O.state=Xa,O.buffer=P,O.type=0;else if(E.command(typeof Y=="object"&&Y,"invalid data for attribute "+W,y.commandStr),"constant"in Y){var I=Y.constant;O.buffer="null",O.state=_s,typeof I=="number"?O.x=I:(E.command(Nr(I)&&I.length>0&&I.length<=4,"invalid constant for attribute "+W,y.commandStr),Sn.forEach(function(yt,ot){ot<I.length&&(O[yt]=I[ot])}))}else{ao(Y.buffer)?P=me.getBuffer(me.create(Y.buffer,Bo,!1,!0)):P=me.getBuffer(Y.buffer),E.command(!!P,'missing buffer for attribute "'+W+'"',y.commandStr);var re=Y.offset|0;E.command(re>=0,'invalid offset for attribute "'+W+'"',y.commandStr);var ee=Y.stride|0;E.command(ee>=0&&ee<256,'invalid stride for attribute "'+W+'", must be integer betweeen [0, 255]',y.commandStr);var _e=Y.size|0;E.command(!("size"in Y)||_e>0&&_e<=4,'invalid size for attribute "'+W+'", must be 1,2,3,4',y.commandStr);var be=!!Y.normalized,Ye=0;"type"in Y&&(E.commandParameter(Y.type,ka,"invalid type for attribute "+W,y.commandStr),Ye=ka[Y.type]);var Dt=Y.divisor|0;E.optional(function(){"divisor"in Y&&(E.command(Dt===0||Oe,'cannot specify divisor for attribute "'+W+'", instancing not supported',y.commandStr),E.command(Dt>=0,'invalid divisor for attribute "'+W+'"',y.commandStr));var yt=y.commandStr,ot=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(Y).forEach(function(Ae){E.command(ot.indexOf(Ae)>=0,'unknown parameter "'+Ae+'" for attribute pointer "'+W+'" (valid parameters are '+ot+")",yt)})}),O.buffer=P,O.state=Xa,O.size=_e,O.normalized=be,O.type=Ye||P.dtype,O.offset=re,O.stride=ee,O.divisor=Dt}}Q[W]=zr(function(yt,ot){var Ae=yt.attribCache;if(X in Ae)return Ae[X];var he={isStream:!1};return Object.keys(O).forEach(function(ht){he[ht]=O[ht]}),O.buffer&&(he.buffer=yt.link(O.buffer),he.type=he.type||he.buffer+".dtype"),Ae[X]=he,he})}),Object.keys(j).forEach(function(W){var Y=j[W];function X(O,P){var I=O.invoke(P,Y),re=O.shared,ee=O.constants,_e=re.isBufferArgs,be=re.buffer;E.optional(function(){O.assert(P,I+"&&(typeof "+I+'==="object"||typeof '+I+'==="function")&&('+_e+"("+I+")||"+be+".getBuffer("+I+")||"+be+".getBuffer("+I+".buffer)||"+_e+"("+I+'.buffer)||("constant" in '+I+"&&(typeof "+I+'.constant==="number"||'+re.isArrayLike+"("+I+".constant))))",'invalid dynamic attribute "'+W+'"')});var Ye={isStream:P.def(!1)},Dt=new K;Dt.state=Xa,Object.keys(Dt).forEach(function(he){Ye[he]=P.def(""+Dt[he])});var yt=Ye.buffer,ot=Ye.type;P("if(",_e,"(",I,")){",Ye.isStream,"=true;",yt,"=",be,".createStream(",Bo,",",I,");",ot,"=",yt,".dtype;","}else{",yt,"=",be,".getBuffer(",I,");","if(",yt,"){",ot,"=",yt,".dtype;",'}else if("constant" in ',I,"){",Ye.state,"=",_s,";","if(typeof "+I+'.constant === "number"){',Ye[Sn[0]],"=",I,".constant;",Sn.slice(1).map(function(he){return Ye[he]}).join("="),"=0;","}else{",Sn.map(function(he,ht){return Ye[he]+"="+I+".constant.length>"+ht+"?"+I+".constant["+ht+"]:0;"}).join(""),"}}else{","if(",_e,"(",I,".buffer)){",yt,"=",be,".createStream(",Bo,",",I,".buffer);","}else{",yt,"=",be,".getBuffer(",I,".buffer);","}",ot,'="type" in ',I,"?",ee.glTypes,"[",I,".type]:",yt,".dtype;",Ye.normalized,"=!!",I,".normalized;");function Ae(he){P(Ye[he],"=",I,".",he,"|0;")}return Ae("size"),Ae("offset"),Ae("stride"),Ae("divisor"),P("}}"),P.exit("if(",Ye.isStream,"){",be,".destroyStream(",yt,");","}"),Ye}Q[W]=An(Y,X)}),Q}function _r(R){var y=R.static,H=R.dynamic,j={};return Object.keys(y).forEach(function(Q){var W=y[Q];j[Q]=zr(function(Y,X){return typeof W=="number"||typeof W=="boolean"?""+W:Y.link(W)})}),Object.keys(H).forEach(function(Q){var W=H[Q];j[Q]=An(W,function(Y,X){return Y.invoke(X,W)})}),j}function qr(R,y,H,j,Q){var W=R.static,Y=R.dynamic;E.optional(function(){var Ae=[Qi,xf,Qa,ma,ga,Ja,ya,ys,ko,No].concat(pt);function he(ht){Object.keys(ht).forEach(function(ct){E.command(Ae.indexOf(ct)>=0,'unknown parameter "'+ct+'"',Q.commandStr)})}he(W),he(Y)});var X=Ct(R,y),O=Je(R),P=wt(R,O,Q),I=Mr(R,Q),re=Lr(R,Q),ee=Vt(R,Q,X);function _e(Ae){var he=P[Ae];he&&(re[Ae]=he)}_e(ji),_e(ut(gs));var be=Object.keys(re).length>0,Ye={framebuffer:O,draw:I,shader:ee,state:re,dirty:be,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Ye.profile=Ke(R),Ye.uniforms=Xt(H,Q),Ye.drawVAO=Ye.scopeVAO=I.vao,!Ye.drawVAO&&ee.program&&!X&&G.angle_instanced_arrays&&I.static.elements){var Dt=!0,yt=ee.program.attributes.map(function(Ae){var he=y.static[Ae];return Dt=Dt&&!!he,he});if(Dt&&yt.length>0){var ot=Pe.getVAO(Pe.createVAO({attributes:yt,elements:I.static.elements}));Ye.drawVAO=new Hr(null,null,null,function(Ae,he){return Ae.link(ot)}),Ye.useVAO=!0}}return X?Ye.useVAO=!0:Ye.attributes=Er(y,Q),Ye.context=_r(j),Ye}function Kr(R,y,H){var j=R.shared,Q=j.context,W=R.scope();Object.keys(H).forEach(function(Y){y.save(Q,"."+Y);var X=H[Y],O=X.append(R,y);Array.isArray(O)?W(Q,".",Y,"=[",O.join(),"];"):W(Q,".",Y,"=",O,";")}),y(W)}function en(R,y,H,j){var Q=R.shared,W=Q.gl,Y=Q.framebuffer,X;rt&&(X=y.def(Q.extensions,".webgl_draw_buffers"));var O=R.constants,P=O.drawBuffer,I=O.backBuffer,re;H?re=H.append(R,y):re=y.def(Y,".next"),j||y("if(",re,"!==",Y,".cur){"),y("if(",re,"){",W,".bindFramebuffer(",Xu,",",re,".framebuffer);"),rt&&y(X,".drawBuffersWEBGL(",P,"[",re,".colorAttachments.length]);"),y("}else{",W,".bindFramebuffer(",Xu,",null);"),rt&&y(X,".drawBuffersWEBGL(",I,");"),y("}",Y,".cur=",re,";"),j||y("}")}function un(R,y,H){var j=R.shared,Q=j.gl,W=R.current,Y=R.next,X=j.current,O=j.next,P=R.cond(X,".dirty");pt.forEach(function(I){var re=ut(I);if(!(re in H.state)){var ee,_e;if(re in Y){ee=Y[re],_e=W[re];var be=at(Qe[re].length,function(Dt){return P.def(ee,"[",Dt,"]")});P(R.cond(be.map(function(Dt,yt){return Dt+"!=="+_e+"["+yt+"]"}).join("||")).then(Q,".",ge[re],"(",be,");",be.map(function(Dt,yt){return _e+"["+yt+"]="+Dt}).join(";"),";"))}else{ee=P.def(O,".",re);var Ye=R.cond(ee,"!==",X,".",re);P(Ye),re in xe?Ye(R.cond(ee).then(Q,".enable(",xe[re],");").else(Q,".disable(",xe[re],");"),X,".",re,"=",ee,";"):Ye(Q,".",ge[re],"(",ee,");",X,".",re,"=",ee,";")}}}),Object.keys(H.state).length===0&&P(X,".dirty=false;"),y(P)}function mn(R,y,H,j){var Q=R.shared,W=R.current,Y=Q.current,X=Q.gl;Ls(Object.keys(H)).forEach(function(O){var P=H[O];if(!(j&&!j(P))){var I=P.append(R,y);if(xe[O]){var re=xe[O];wa(P)?I?y(X,".enable(",re,");"):y(X,".disable(",re,");"):y(R.cond(I).then(X,".enable(",re,");").else(X,".disable(",re,");")),y(Y,".",O,"=",I,";")}else if(Nr(I)){var ee=W[O];y(X,".",ge[O],"(",I,");",I.map(function(_e,be){return ee+"["+be+"]="+_e}).join(";"),";")}else y(X,".",ge[O],"(",I,");",Y,".",O,"=",I,";")}})}function Wr(R,y){Oe&&(R.instancing=y.def(R.shared.extensions,".angle_instanced_arrays"))}function Ut(R,y,H,j,Q){var W=R.shared,Y=R.stats,X=W.current,O=W.timer,P=H.profile;function I(){return typeof performance>"u"?"Date.now()":"performance.now()"}var re,ee;function _e(Ae){re=y.def(),Ae(re,"=",I(),";"),typeof Q=="string"?Ae(Y,".count+=",Q,";"):Ae(Y,".count++;"),Ce&&(j?(ee=y.def(),Ae(ee,"=",O,".getNumPendingQueries();")):Ae(O,".beginQuery(",Y,");"))}function be(Ae){Ae(Y,".cpuTime+=",I(),"-",re,";"),Ce&&(j?Ae(O,".pushScopeStats(",ee,",",O,".getNumPendingQueries(),",Y,");"):Ae(O,".endQuery();"))}function Ye(Ae){var he=y.def(X,".profile");y(X,".profile=",Ae,";"),y.exit(X,".profile=",he,";")}var Dt;if(P){if(wa(P)){P.enable?(_e(y),be(y.exit),Ye("true")):Ye("false");return}Dt=P.append(R,y),Ye(Dt)}else Dt=y.def(X,".profile");var yt=R.block();_e(yt),y("if(",Dt,"){",yt,"}");var ot=R.block();be(ot),y.exit("if(",Dt,"){",ot,"}")}function gn(R,y,H,j,Q){var W=R.shared;function Y(O){switch(O){case to:case Uo:case bi:return 2;case wf:case Yo:case Sf:return 3;case Go:case xi:case Af:return 4;default:return 1}}function X(O,P,I){var re=W.gl,ee=y.def(O,".location"),_e=y.def(W.attributes,"[",ee,"]"),be=I.state,Ye=I.buffer,Dt=[I.x,I.y,I.z,I.w],yt=["buffer","normalized","offset","stride"];function ot(){y("if(!",_e,".buffer){",re,".enableVertexAttribArray(",ee,");}");var he=I.type,ht;if(I.size?ht=y.def(I.size,"||",P):ht=P,y("if(",_e,".type!==",he,"||",_e,".size!==",ht,"||",yt.map(function(Tt){return _e+"."+Tt+"!=="+I[Tt]}).join("||"),"){",re,".bindBuffer(",Bo,",",Ye,".buffer);",re,".vertexAttribPointer(",[ee,ht,he,I.normalized,I.stride,I.offset],");",_e,".type=",he,";",_e,".size=",ht,";",yt.map(function(Tt){return _e+"."+Tt+"="+I[Tt]+";"}).join(""),"}"),Oe){var ct=I.divisor;y("if(",_e,".divisor!==",ct,"){",R.instancing,".vertexAttribDivisorANGLE(",[ee,ct],");",_e,".divisor=",ct,";}")}}function Ae(){y("if(",_e,".buffer){",re,".disableVertexAttribArray(",ee,");",_e,".buffer=null;","}if(",Sn.map(function(he,ht){return _e+"."+he+"!=="+Dt[ht]}).join("||"),"){",re,".vertexAttrib4f(",ee,",",Dt,");",Sn.map(function(he,ht){return _e+"."+he+"="+Dt[ht]+";"}).join(""),"}")}be===Xa?ot():be===_s?Ae():(y("if(",be,"===",Xa,"){"),ot(),y("}else{"),Ae(),y("}"))}j.forEach(function(O){var P=O.name,I=H.attributes[P],re;if(I){if(!Q(I))return;re=I.append(R,y)}else{if(!Q(qu))return;var ee=R.scopeAttrib(P);E.optional(function(){R.assert(y,ee+".state","missing attribute "+P)}),re={},Object.keys(new K).forEach(function(_e){re[_e]=y.def(ee,".",_e)})}X(R.link(O),Y(O.info.type),re)})}function cr(R,y,H,j,Q,W){for(var Y=R.shared,X=Y.gl,O={},P,I=0;I<j.length;++I){var re=j[I],ee=re.name,_e=re.info.type,be=re.info.size,Ye=H.uniforms[ee];if(be>1){if(!Ye)continue;var Dt=ee.replace("[0]","");if(O[Dt])continue;O[Dt]=1}var yt=R.link(re),ot=yt+".location",Ae;if(Ye){if(!Q(Ye))continue;if(wa(Ye)){var he=Ye.value;if(E.command(he!==null&&typeof he<"u",'missing uniform "'+ee+'"',R.commandStr),_e===Df||_e===Ho){E.command(typeof he=="function"&&(_e===Df&&(he._reglType==="texture2d"||he._reglType==="framebuffer")||_e===Ho&&(he._reglType==="textureCube"||he._reglType==="framebufferCube")),"invalid texture for uniform "+ee,R.commandStr);var ht=R.link(he._texture||he.color[0]._texture);y(X,".uniform1i(",ot,",",ht+".bind());"),y.exit(ht,".unbind();")}else if(_e===ro||_e===Tf||_e===Ef){E.optional(function(){E.command(Nr(he),"invalid matrix for uniform "+ee,R.commandStr),E.command(_e===ro&&he.length===4||_e===Tf&&he.length===9||_e===Ef&&he.length===16,"invalid length for matrix uniform "+ee,R.commandStr)});var ct=R.global.def("new Float32Array(["+Array.prototype.slice.call(he)+"])"),Tt=2;_e===Tf?Tt=3:_e===Ef&&(Tt=4),y(X,".uniformMatrix",Tt,"fv(",ot,",false,",ct,");")}else{switch(_e){case As:be===1?E.commandType(he,"number","uniform "+ee,R.commandStr):E.command(Nr(he)&&he.length===be,"uniform "+ee,R.commandStr),P="1f";break;case to:E.command(Nr(he)&&he.length&&he.length%2===0&&he.length<=be*2,"uniform "+ee,R.commandStr),P="2f";break;case wf:E.command(Nr(he)&&he.length&&he.length%3===0&&he.length<=be*3,"uniform "+ee,R.commandStr),P="3f";break;case Go:E.command(Nr(he)&&he.length&&he.length%4===0&&he.length<=be*4,"uniform "+ee,R.commandStr),P="4f";break;case Wu:be===1?E.commandType(he,"boolean","uniform "+ee,R.commandStr):E.command(Nr(he)&&he.length===be,"uniform "+ee,R.commandStr),P="1i";break;case Ts:be===1?E.commandType(he,"number","uniform "+ee,R.commandStr):E.command(Nr(he)&&he.length===be,"uniform "+ee,R.commandStr),P="1i";break;case bi:E.command(Nr(he)&&he.length&&he.length%2===0&&he.length<=be*2,"uniform "+ee,R.commandStr),P="2i";break;case Uo:E.command(Nr(he)&&he.length&&he.length%2===0&&he.length<=be*2,"uniform "+ee,R.commandStr),P="2i";break;case Sf:E.command(Nr(he)&&he.length&&he.length%3===0&&he.length<=be*3,"uniform "+ee,R.commandStr),P="3i";break;case Yo:E.command(Nr(he)&&he.length&&he.length%3===0&&he.length<=be*3,"uniform "+ee,R.commandStr),P="3i";break;case Af:E.command(Nr(he)&&he.length&&he.length%4===0&&he.length<=be*4,"uniform "+ee,R.commandStr),P="4i";break;case xi:E.command(Nr(he)&&he.length&&he.length%4===0&&he.length<=be*4,"uniform "+ee,R.commandStr),P="4i";break}be>1?(P+="v",he=R.global.def("["+Array.prototype.slice.call(he)+"]")):he=Nr(he)?Array.prototype.slice.call(he):he,y(X,".uniform",P,"(",ot,",",he,");")}continue}else Ae=Ye.append(R,y)}else{if(!Q(qu))continue;Ae=y.def(Y.uniforms,"[",T.id(ee),"]")}_e===Df?(E(!Array.isArray(Ae),"must specify a scalar prop for textures"),y("if(",Ae,"&&",Ae,'._reglType==="framebuffer"){',Ae,"=",Ae,".color[0];","}")):_e===Ho&&(E(!Array.isArray(Ae),"must specify a scalar prop for cube maps"),y("if(",Ae,"&&",Ae,'._reglType==="framebufferCube"){',Ae,"=",Ae,".color[0];","}")),E.optional(function(){function jn(Fn,Cf){R.assert(y,Fn,'bad data or missing for uniform "'+ee+'". '+Cf)}function uo(Fn,Cf){Cf===1&&E(!Array.isArray(Ae),"must not specify an array type for uniform"),jn("Array.isArray("+Ae+") && typeof "+Ae+'[0]===" '+Fn+'" || typeof '+Ae+'==="'+Fn+'"',"invalid type, expected "+Fn)}function oi(Fn,Cf,Ms){Array.isArray(Ae)?E(Ae.length&&Ae.length%Fn===0&&Ae.length<=Fn*Ms,"must have length of "+(Ms===1?"":"n * ")+Fn):jn(Y.isArrayLike+"("+Ae+")&&"+Ae+".length && "+Ae+".length % "+Fn+" === 0 && "+Ae+".length<="+Fn*Ms,"invalid vector, should have length of "+(Ms===1?"":"n * ")+Fn,R.commandStr)}function Lc(Fn){E(!Array.isArray(Ae),"must not specify a value type"),jn("typeof "+Ae+'==="function"&&'+Ae+'._reglType==="texture'+(Fn===xc?"2d":"Cube")+'"',"invalid texture type",R.commandStr)}switch(_e){case Ts:uo("number",be);break;case Uo:oi(2,"number",be);break;case Yo:oi(3,"number",be);break;case xi:oi(4,"number",be);break;case As:uo("number",be);break;case to:oi(2,"number",be);break;case wf:oi(3,"number",be);break;case Go:oi(4,"number",be);break;case Wu:uo("boolean",be);break;case bi:oi(2,"boolean",be);break;case Sf:oi(3,"boolean",be);break;case Af:oi(4,"boolean",be);break;case ro:oi(4,"number",be);break;case Tf:oi(9,"number",be);break;case Ef:oi(16,"number",be);break;case Df:Lc(xc);break;case Ho:Lc(Hd);break}});var dr=1;switch(_e){case Df:case Ho:var yn=y.def(Ae,"._texture");y(X,".uniform1i(",ot,",",yn,".bind());"),y.exit(yn,".unbind();");continue;case Ts:case Wu:P="1i";break;case Uo:case bi:P="2i",dr=2;break;case Yo:case Sf:P="3i",dr=3;break;case xi:case Af:P="4i",dr=4;break;case As:P="1f";break;case to:P="2f",dr=2;break;case wf:P="3f",dr=3;break;case Go:P="4f",dr=4;break;case ro:P="Matrix2fv";break;case Tf:P="Matrix3fv";break;case Ef:P="Matrix4fv";break}if(P.indexOf("Matrix")===-1&&be>1&&(P+="v",dr=1),P.charAt(0)==="M"){y(X,".uniform",P,"(",ot,",");var fo=Math.pow(_e-ro+2,2),ta=R.global.def("new Float32Array(",fo,")");Array.isArray(Ae)?y("false,(",at(fo,function(jn){return ta+"["+jn+"]="+Ae[jn]}),",",ta,")"):y("false,(Array.isArray(",Ae,")||",Ae," instanceof Float32Array)?",Ae,":(",at(fo,function(jn){return ta+"["+jn+"]="+Ae+"["+jn+"]"}),",",ta,")"),y(");")}else if(dr>1){for(var ki=[],Aa=[],so=0;so<dr;++so)Array.isArray(Ae)?Aa.push(Ae[so]):Aa.push(y.def(Ae+"["+so+"]")),W&&ki.push(y.def());W&&y("if(!",R.batchId,"||",ki.map(function(jn,uo){return jn+"!=="+Aa[uo]}).join("||"),"){",ki.map(function(jn,uo){return jn+"="+Aa[uo]+";"}).join("")),y(X,".uniform",P,"(",ot,",",Aa.join(","),");"),W&&y("}")}else{if(E(!Array.isArray(Ae),"uniform value must not be an array"),W){var Dc=y.def();y("if(!",R.batchId,"||",Dc,"!==",Ae,"){",Dc,"=",Ae,";")}y(X,".uniform",P,"(",ot,",",Ae,");"),W&&y("}")}}}function At(R,y,H,j){var Q=R.shared,W=Q.gl,Y=Q.draw,X=j.draw;function O(){var ht=X.elements,ct,Tt=y;return ht?((ht.contextDep&&j.contextDynamic||ht.propDep)&&(Tt=H),ct=ht.append(R,Tt),X.elementsActive&&Tt("if("+ct+")"+W+".bindBuffer("+Yu+","+ct+".buffer.buffer);")):(ct=Tt.def(),Tt(ct,"=",Y,".",ma,";","if(",ct,"){",W,".bindBuffer(",Yu,",",ct,".buffer.buffer);}","else if(",Q.vao,".currentVAO){",ct,"=",R.shared.elements+".getElements("+Q.vao,".currentVAO.elements);",Se?"":"if("+ct+")"+W+".bindBuffer("+Yu+","+ct+".buffer.buffer);","}")),ct}function P(){var ht=X.count,ct,Tt=y;return ht?((ht.contextDep&&j.contextDynamic||ht.propDep)&&(Tt=H),ct=ht.append(R,Tt),E.optional(function(){ht.MISSING&&R.assert(y,"false","missing vertex count"),ht.DYNAMIC&&R.assert(Tt,ct+">=0","missing vertex count")})):(ct=Tt.def(Y,".",ya),E.optional(function(){R.assert(Tt,ct+">=0","missing vertex count")})),ct}var I=O();function re(ht){var ct=X[ht];return ct?ct.contextDep&&j.contextDynamic||ct.propDep?ct.append(R,H):ct.append(R,y):y.def(Y,".",ht)}var ee=re(ga),_e=re(Ja),be=P();if(typeof be=="number"){if(be===0)return}else H("if(",be,"){"),H.exit("}");var Ye,Dt;Oe&&(Ye=re(ys),Dt=R.instancing);var yt=I+".type",ot=X.elements&&wa(X.elements)&&!X.vaoActive;function Ae(){function ht(){H(Dt,".drawElementsInstancedANGLE(",[ee,be,yt,_e+"<<(("+yt+"-"+uc+")>>1)",Ye],");")}function ct(){H(Dt,".drawArraysInstancedANGLE(",[ee,_e,be,Ye],");")}I&&I!=="null"?ot?ht():(H("if(",I,"){"),ht(),H("}else{"),ct(),H("}")):ct()}function he(){function ht(){H(W+".drawElements("+[ee,be,yt,_e+"<<(("+yt+"-"+uc+")>>1)"]+");")}function ct(){H(W+".drawArrays("+[ee,_e,be]+");")}I&&I!=="null"?ot?ht():(H("if(",I,"){"),ht(),H("}else{"),ct(),H("}")):ct()}Oe&&(typeof Ye!="number"||Ye>=0)?typeof Ye=="string"?(H("if(",Ye,">0){"),Ae(),H("}else if(",Ye,"<0){"),he(),H("}")):Ae():he()}function qt(R,y,H,j,Q){var W=Lt(),Y=W.proc("body",Q);return E.optional(function(){W.commandStr=y.commandStr,W.command=W.link(y.commandStr)}),Oe&&(W.instancing=Y.def(W.shared.extensions,".angle_instanced_arrays")),R(W,Y,H,j),W.compile().body}function er(R,y,H,j){Wr(R,y),H.useVAO?H.drawVAO?y(R.shared.vao,".setVAO(",H.drawVAO.append(R,y),");"):y(R.shared.vao,".setVAO(",R.shared.vao,".targetVAO);"):(y(R.shared.vao,".setVAO(null);"),gn(R,y,H,j.attributes,function(){return!0})),cr(R,y,H,j.uniforms,function(){return!0},!1),At(R,y,y,H)}function Vr(R,y){var H=R.proc("draw",1);Wr(R,H),Kr(R,H,y.context),en(R,H,y.framebuffer),un(R,H,y),mn(R,H,y.state),Ut(R,H,y,!1,!0);var j=y.shader.progVar.append(R,H);if(H(R.shared.gl,".useProgram(",j,".program);"),y.shader.program)er(R,H,y,y.shader.program);else{H(R.shared.vao,".setVAO(null);");var Q=R.global.def("{}"),W=H.def(j,".id"),Y=H.def(Q,"[",W,"]");H(R.cond(Y).then(Y,".call(this,a0);").else(Y,"=",Q,"[",W,"]=",R.link(function(X){return qt(er,R,y,X,1)}),"(",j,");",Y,".call(this,a0);"))}Object.keys(y.state).length>0&&H(R.shared.current,".dirty=true;"),R.shared.vao&&H(R.shared.vao,".setVAO(null);")}function Si(R,y,H,j){R.batchId="a1",Wr(R,y);function Q(){return!0}gn(R,y,H,j.attributes,Q),cr(R,y,H,j.uniforms,Q,!1),At(R,y,y,H)}function Sa(R,y,H,j){Wr(R,y);var Q=H.contextDep,W=y.def(),Y="a0",X="a1",O=y.def();R.shared.props=O,R.batchId=W;var P=R.scope(),I=R.scope();y(P.entry,"for(",W,"=0;",W,"<",X,";++",W,"){",O,"=",Y,"[",W,"];",I,"}",P.exit);function re(yt){return yt.contextDep&&Q||yt.propDep}function ee(yt){return!re(yt)}if(H.needsContext&&Kr(R,I,H.context),H.needsFramebuffer&&en(R,I,H.framebuffer),mn(R,I,H.state,re),H.profile&&re(H.profile)&&Ut(R,I,H,!1,!0),j)H.useVAO?H.drawVAO?re(H.drawVAO)?I(R.shared.vao,".setVAO(",H.drawVAO.append(R,I),");"):P(R.shared.vao,".setVAO(",H.drawVAO.append(R,P),");"):P(R.shared.vao,".setVAO(",R.shared.vao,".targetVAO);"):(P(R.shared.vao,".setVAO(null);"),gn(R,P,H,j.attributes,ee),gn(R,I,H,j.attributes,re)),cr(R,P,H,j.uniforms,ee,!1),cr(R,I,H,j.uniforms,re,!0),At(R,P,I,H);else{var _e=R.global.def("{}"),be=H.shader.progVar.append(R,I),Ye=I.def(be,".id"),Dt=I.def(_e,"[",Ye,"]");I(R.shared.gl,".useProgram(",be,".program);","if(!",Dt,"){",Dt,"=",_e,"[",Ye,"]=",R.link(function(yt){return qt(Si,R,H,yt,2)}),"(",be,");}",Dt,".call(this,a0[",W,"],",W,");")}}function k(R,y){var H=R.proc("batch",2);R.batchId="0",Wr(R,H);var j=!1,Q=!0;Object.keys(y.context).forEach(function(_e){j=j||y.context[_e].propDep}),j||(Kr(R,H,y.context),Q=!1);var W=y.framebuffer,Y=!1;W?(W.propDep?j=Y=!0:W.contextDep&&j&&(Y=!0),Y||en(R,H,W)):en(R,H,null),y.state.viewport&&y.state.viewport.propDep&&(j=!0);function X(_e){return _e.contextDep&&j||_e.propDep}un(R,H,y),mn(R,H,y.state,function(_e){return!X(_e)}),(!y.profile||!X(y.profile))&&Ut(R,H,y,!1,"a1"),y.contextDep=j,y.needsContext=Q,y.needsFramebuffer=Y;var O=y.shader.progVar;if(O.contextDep&&j||O.propDep)Sa(R,H,y,null);else{var P=O.append(R,H);if(H(R.shared.gl,".useProgram(",P,".program);"),y.shader.program)Sa(R,H,y,y.shader.program);else{H(R.shared.vao,".setVAO(null);");var I=R.global.def("{}"),re=H.def(P,".id"),ee=H.def(I,"[",re,"]");H(R.cond(ee).then(ee,".call(this,a0,a1);").else(ee,"=",I,"[",re,"]=",R.link(function(_e){return qt(Sa,R,y,_e,2)}),"(",P,");",ee,".call(this,a0,a1);"))}}Object.keys(y.state).length>0&&H(R.shared.current,".dirty=true;"),R.shared.vao&&H(R.shared.vao,".setVAO(null);")}function ue(R,y){var H=R.proc("scope",3);R.batchId="a2";var j=R.shared,Q=j.current;Kr(R,H,y.context),y.framebuffer&&y.framebuffer.append(R,H),Ls(Object.keys(y.state)).forEach(function(Y){var X=y.state[Y],O=X.append(R,H);Nr(O)?O.forEach(function(P,I){H.set(R.next[Y],"["+I+"]",P)}):H.set(j.next,"."+Y,O)}),Ut(R,H,y,!0,!0),[ma,Ja,ya,ys,ga].forEach(function(Y){var X=y.draw[Y];!X||H.set(j.draw,"."+Y,""+X.append(R,H))}),Object.keys(y.uniforms).forEach(function(Y){var X=y.uniforms[Y].append(R,H);Array.isArray(X)&&(X="["+X.join()+"]"),H.set(j.uniforms,"["+T.id(Y)+"]",X)}),Object.keys(y.attributes).forEach(function(Y){var X=y.attributes[Y].append(R,H),O=R.scopeAttrib(Y);Object.keys(new K).forEach(function(P){H.set(O,"."+P,X[P])})}),y.scopeVAO&&H.set(j.vao,".targetVAO",y.scopeVAO.append(R,H));function W(Y){var X=y.shader[Y];X&&H.set(j.shader,"."+Y,X.append(R,H))}W(xf),W(Qa),Object.keys(y.state).length>0&&(H(Q,".dirty=true;"),H.exit(Q,".dirty=true;")),H("a1(",R.shared.context,",a0,",R.batchId,");")}function ne(R){if(!(typeof R!="object"||Nr(R))){for(var y=Object.keys(R),H=0;H<y.length;++H)if(Z.isDynamic(R[y[H]]))return!0;return!1}}function st(R,y,H){var j=y.static[H];if(!j||!ne(j))return;var Q=R.global,W=Object.keys(j),Y=!1,X=!1,O=!1,P=R.global.def("{}");W.forEach(function(re){var ee=j[re];if(Z.isDynamic(ee)){typeof ee=="function"&&(ee=j[re]=Z.unbox(ee));var _e=An(ee,null);Y=Y||_e.thisDep,O=O||_e.propDep,X=X||_e.contextDep}else{switch(Q(P,".",re,"="),typeof ee){case"number":Q(ee);break;case"string":Q('"',ee,'"');break;case"object":Array.isArray(ee)&&Q("[",ee.join(),"]");break;default:Q(R.link(ee));break}Q(";")}});function I(re,ee){W.forEach(function(_e){var be=j[_e];if(!!Z.isDynamic(be)){var Ye=re.invoke(ee,be);ee(P,".",_e,"=",Ye,";")}})}y.dynamic[H]=new Z.DynamicVariable(Ka,{thisDep:Y,contextDep:X,propDep:O,ref:P,append:I}),delete y.static[H]}function zt(R,y,H,j,Q){var W=Lt();W.stats=W.link(Q),Object.keys(y.static).forEach(function(X){st(W,y,X)}),rr.forEach(function(X){st(W,R,X)});var Y=qr(R,y,H,j,W);return Vr(W,Y),ue(W,Y),k(W,Y),o(W.compile(),{destroy:function(){Y.shader.program.destroy()}})}return{next:je,current:Qe,procs:function(){var R=Lt(),y=R.proc("poll"),H=R.proc("refresh"),j=R.block();y(j),H(j);var Q=R.shared,W=Q.gl,Y=Q.next,X=Q.current;j(X,".dirty=false;"),en(R,y),en(R,H,null,!0);var O;Oe&&(O=R.link(Oe)),G.oes_vertex_array_object&&H(R.link(G.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var P=0;P<fe.maxAttributes;++P){var I=H.def(Q.attributes,"[",P,"]"),re=R.cond(I,".buffer");re.then(W,".enableVertexAttribArray(",P,");",W,".bindBuffer(",Bo,",",I,".buffer.buffer);",W,".vertexAttribPointer(",P,",",I,".size,",I,".type,",I,".normalized,",I,".stride,",I,".offset);").else(W,".disableVertexAttribArray(",P,");",W,".vertexAttrib4f(",P,",",I,".x,",I,".y,",I,".z,",I,".w);",I,".buffer=null;"),H(re),Oe&&H(O,".vertexAttribDivisorANGLE(",P,",",I,".divisor);")}return H(R.shared.vao,".currentVAO=null;",R.shared.vao,".setVAO(",R.shared.vao,".targetVAO);"),Object.keys(xe).forEach(function(ee){var _e=xe[ee],be=j.def(Y,".",ee),Ye=R.block();Ye("if(",be,"){",W,".enable(",_e,")}else{",W,".disable(",_e,")}",X,".",ee,"=",be,";"),H(Ye),y("if(",be,"!==",X,".",ee,"){",Ye,"}")}),Object.keys(ge).forEach(function(ee){var _e=ge[ee],be=Qe[ee],Ye,Dt,yt=R.block();if(yt(W,".",_e,"("),Nr(be)){var ot=be.length;Ye=R.global.def(Y,".",ee),Dt=R.global.def(X,".",ee),yt(at(ot,function(Ae){return Ye+"["+Ae+"]"}),");",at(ot,function(Ae){return Dt+"["+Ae+"]="+Ye+"["+Ae+"];"}).join("")),y("if(",at(ot,function(Ae){return Ye+"["+Ae+"]!=="+Dt+"["+Ae+"]"}).join("||"),"){",yt,"}")}else Ye=j.def(Y,".",ee),Dt=j.def(X,".",ee),yt(Ye,");",X,".",ee,"=",Ye,";"),y("if(",Ye,"!==",Dt,"){",yt,"}");H(yt)}),R.compile()}(),compile:zt}}function Zd(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var Ac=34918,ea=34919,ju=35007,Tc=function(h,T){if(!T.ext_disjoint_timer_query)return null;var G=[];function fe(){return G.pop()||T.ext_disjoint_timer_query.createQueryEXT()}function me(Oe){G.push(Oe)}var ae=[];function se(Oe){var rt=fe();T.ext_disjoint_timer_query.beginQueryEXT(ju,rt),ae.push(rt),Ce(ae.length-1,ae.length,Oe)}function Le(){T.ext_disjoint_timer_query.endQueryEXT(ju)}function De(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var Pe=[];function Ge(){return Pe.pop()||new De}function Be(Oe){Pe.push(Oe)}var We=[];function Ce(Oe,rt,Se){var Qe=Ge();Qe.startQueryIndex=Oe,Qe.endQueryIndex=rt,Qe.sum=0,Qe.stats=Se,We.push(Qe)}var ke=[],K=[];function oe(){var Oe,rt,Se=ae.length;if(Se!==0){K.length=Math.max(K.length,Se+1),ke.length=Math.max(ke.length,Se+1),ke[0]=0,K[0]=0;var Qe=0;for(Oe=0,rt=0;rt<ae.length;++rt){var je=ae[rt];T.ext_disjoint_timer_query.getQueryObjectEXT(je,ea)?(Qe+=T.ext_disjoint_timer_query.getQueryObjectEXT(je,Ac),me(je)):ae[Oe++]=je,ke[rt+1]=Qe,K[rt+1]=Oe}for(ae.length=Oe,Oe=0,rt=0;rt<We.length;++rt){var pt=We[rt],xe=pt.startQueryIndex,ge=pt.endQueryIndex;pt.sum+=ke[ge]-ke[xe];var ut=K[xe],Ve=K[ge];Ve===ut?(pt.stats.gpuTime+=pt.sum/1e6,Be(pt)):(pt.startQueryIndex=ut,pt.endQueryIndex=Ve,We[Oe++]=pt)}We.length=Oe}}return{beginQuery:se,endQuery:Le,pushScopeStats:Ce,update:oe,getNumPendingQueries:function(){return ae.length},clear:function(){G.push.apply(G,ae);for(var Oe=0;Oe<G.length;Oe++)T.ext_disjoint_timer_query.deleteQueryEXT(G[Oe]);ae.length=0,G.length=0},restore:function(){ae.length=0,G.length=0}}},Xd=16384,Ec=256,qd=1024,Kd=34962,Fi="webglcontextlost",Rs="webglcontextrestored",Cs=1,Qu=2,Os=3;function oo(h,T){for(var G=0;G<h.length;++G)if(h[G]===T)return G;return-1}function Bt(h){var T=ce(h);if(!T)return null;var G=T.gl,fe=G.getContextAttributes(),me=G.isContextLost(),ae=Et(G,T);if(!ae)return null;var se=He(),Le=Zd(),De=ae.extensions,Pe=Tc(G,De),Ge=m(),Be=G.drawingBufferWidth,We=G.drawingBufferHeight,Ce={tick:0,time:0,viewportWidth:Be,viewportHeight:We,framebufferWidth:Be,framebufferHeight:We,drawingBufferWidth:Be,drawingBufferHeight:We,pixelRatio:T.pixelRatio},ke={},K={elements:null,primitive:4,count:-1,offset:0,instances:-1},oe=Js(G,De),Oe=bn(G,Le,T,Qe),rt=Br(G,De,Oe,Le),Se=Pd(G,De,oe,Le,Oe,rt,K);function Qe(At){return Se.destroyBuffer(At)}var je=Cu(G,se,Le,T),pt=Cn(G,De,oe,function(){ut.procs.poll()},Ce,Le,T),xe=bd(G,De,oe,Le,T),ge=Nd(G,De,oe,pt,xe,Le),ut=Ku(G,se,De,oe,Oe,rt,pt,ge,ke,Se,je,K,Ce,Pe,T),Ve=Yd(G,ge,ut.procs.poll,Ce,fe,De,oe),Ie=ut.next,$e=G.canvas,qe=[],Mt=[],Lt=[],Ke=[T.onDestroy],Je=null;function wt(){if(qe.length===0){Pe&&Pe.update(),Je=null;return}Je=we.next(wt),mn();for(var At=qe.length-1;At>=0;--At){var qt=qe[At];qt&&qt(Ce,null,0)}G.flush(),Pe&&Pe.update()}function Ct(){!Je&&qe.length>0&&(Je=we.next(wt))}function Vt(){Je&&(we.cancel(wt),Je=null)}function Mr(At){At.preventDefault(),me=!0,Vt(),Mt.forEach(function(qt){qt()})}function Lr(At){G.getError(),me=!1,ae.restore(),je.restore(),Oe.restore(),pt.restore(),xe.restore(),ge.restore(),Se.restore(),Pe&&Pe.restore(),ut.procs.refresh(),Ct(),Lt.forEach(function(qt){qt()})}$e&&($e.addEventListener(Fi,Mr,!1),$e.addEventListener(Rs,Lr,!1));function Xt(){qe.length=0,Vt(),$e&&($e.removeEventListener(Fi,Mr),$e.removeEventListener(Rs,Lr)),je.clear(),ge.clear(),xe.clear(),Se.clear(),pt.clear(),rt.clear(),Oe.clear(),Pe&&Pe.clear(),Ke.forEach(function(At){At()})}function Er(At){E(!!At,"invalid args to regl({...})"),E.type(At,"object","invalid args to regl({...})");function qt(Q){var W=o({},Q);delete W.uniforms,delete W.attributes,delete W.context,delete W.vao,"stencil"in W&&W.stencil.op&&(W.stencil.opBack=W.stencil.opFront=W.stencil.op,delete W.stencil.op);function Y(X){if(X in W){var O=W[X];delete W[X],Object.keys(O).forEach(function(P){W[X+"."+P]=O[P]})}}return Y("blend"),Y("depth"),Y("cull"),Y("stencil"),Y("polygonOffset"),Y("scissor"),Y("sample"),"vao"in Q&&(W.vao=Q.vao),W}function er(Q,W){var Y={},X={};return Object.keys(Q).forEach(function(O){var P=Q[O];if(Z.isDynamic(P)){X[O]=Z.unbox(P,O);return}else if(W&&Array.isArray(P)){for(var I=0;I<P.length;++I)if(Z.isDynamic(P[I])){X[O]=Z.unbox(P,O);return}}Y[O]=P}),{dynamic:X,static:Y}}var Vr=er(At.context||{},!0),Si=er(At.uniforms||{},!0),Sa=er(At.attributes||{},!1),k=er(qt(At),!1),ue={gpuTime:0,cpuTime:0,count:0},ne=ut.compile(k,Sa,Si,Vr,ue),st=ne.draw,zt=ne.batch,R=ne.scope,y=[];function H(Q){for(;y.length<Q;)y.push(null);return y}function j(Q,W){var Y;if(me&&E.raise("context lost"),typeof Q=="function")return R.call(this,null,Q,0);if(typeof W=="function")if(typeof Q=="number")for(Y=0;Y<Q;++Y)R.call(this,null,W,Y);else if(Array.isArray(Q))for(Y=0;Y<Q.length;++Y)R.call(this,Q[Y],W,Y);else return R.call(this,Q,W,0);else if(typeof Q=="number"){if(Q>0)return zt.call(this,H(Q|0),Q|0)}else if(Array.isArray(Q)){if(Q.length)return zt.call(this,Q,Q.length)}else return st.call(this,Q)}return o(j,{stats:ue,destroy:function(){ne.destroy()}})}var _r=ge.setFBO=Er({framebuffer:Z.define.call(null,Cs,"framebuffer")});function qr(At,qt){var er=0;ut.procs.poll();var Vr=qt.color;Vr&&(G.clearColor(+Vr[0]||0,+Vr[1]||0,+Vr[2]||0,+Vr[3]||0),er|=Xd),"depth"in qt&&(G.clearDepth(+qt.depth),er|=Ec),"stencil"in qt&&(G.clearStencil(qt.stencil|0),er|=qd),E(!!er,"called regl.clear with no buffer specified"),G.clear(er)}function Kr(At){if(E(typeof At=="object"&&At,"regl.clear() takes an object as input"),"framebuffer"in At)if(At.framebuffer&&At.framebuffer_reglType==="framebufferCube")for(var qt=0;qt<6;++qt)_r(o({framebuffer:At.framebuffer.faces[qt]},At),qr);else _r(At,qr);else qr(null,At)}function en(At){E.type(At,"function","regl.frame() callback must be a function"),qe.push(At);function qt(){var er=oo(qe,At);E(er>=0,"cannot cancel a frame twice");function Vr(){var Si=oo(qe,Vr);qe[Si]=qe[qe.length-1],qe.length-=1,qe.length<=0&&Vt()}qe[er]=Vr}return Ct(),{cancel:qt}}function un(){var At=Ie.viewport,qt=Ie.scissor_box;At[0]=At[1]=qt[0]=qt[1]=0,Ce.viewportWidth=Ce.framebufferWidth=Ce.drawingBufferWidth=At[2]=qt[2]=G.drawingBufferWidth,Ce.viewportHeight=Ce.framebufferHeight=Ce.drawingBufferHeight=At[3]=qt[3]=G.drawingBufferHeight}function mn(){Ce.tick+=1,Ce.time=Ut(),un(),ut.procs.poll()}function Wr(){pt.refresh(),un(),ut.procs.refresh(),Pe&&Pe.update()}function Ut(){return(m()-Ge)/1e3}Wr();function gn(At,qt){E.type(qt,"function","listener callback must be a function");var er;switch(At){case"frame":return en(qt);case"lost":er=Mt;break;case"restore":er=Lt;break;case"destroy":er=Ke;break;default:E.raise("invalid event, must be one of frame,lost,restore,destroy")}return er.push(qt),{cancel:function(){for(var Vr=0;Vr<er.length;++Vr)if(er[Vr]===qt){er[Vr]=er[er.length-1],er.pop();return}}}}var cr=o(Er,{clear:Kr,prop:Z.define.bind(null,Cs),context:Z.define.bind(null,Qu),this:Z.define.bind(null,Os),draw:Er({}),buffer:function(At){return Oe.create(At,Kd,!1,!1)},elements:function(At){return rt.create(At,!1)},texture:pt.create2D,cube:pt.createCube,renderbuffer:xe.create,framebuffer:ge.create,framebufferCube:ge.createCube,vao:Se.createVAO,attributes:fe,frame:en,on:gn,limits:oe,hasExtension:function(At){return oe.extensions.indexOf(At.toLowerCase())>=0},read:Ve,destroy:Xt,_gl:G,_refresh:Wr,poll:function(){mn(),Pe&&Pe.update()},now:Ut,stats:Le});return T.onDone(null,cr),cr}return Bt})})(Nv);const yy=Nv.exports,xy=[0,0,0,0],by=1024,wy=1496e8,Sy=40075016686e-3,Ay=695508e3,Ty=.017453292519943295,Ey=.0333334,Dy=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,Ly=/(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/ig;function Pv(){const t=new Uint8Array([170,187]);return new Uint16Array(t.buffer)[0]===48042}function Bv(...t){if(t.length===1){const[n]=t;return new Array(n).fill(void 0).map((i,o)=>o)}else{const[n,i,o=1]=t;if(o===0)throw new Error("Argument step must be nonzero.");const s=[];for(let f=n;o>0?f<i:f>i;f+=o)s.push(f);return s}}async function Gv(t,n,i){return new Promise((o,s)=>{const f=new XMLHttpRequest;f.open("GET",t,!0),f.responseType="arraybuffer",f.addEventListener("load",()=>{o(f.response)}),f.addEventListener("error",s),f.send(null)}).then(o=>{const s=wh.exports.decode(o),f=wh.exports.toRGBA8(s)[0];return new Uint8Array(f)}).catch(()=>Fh(n,i))}function Ry(t,n){return t.byteLength!==n.byteLength?!1:t.every((i,o)=>i===n[o])}function Cy(t,n){const i=2/t,o=-2/n;return[i,0,0,0,0,o,0,0,0,0,1,0,-1,1,0,1]}function Oy(t){const[{x:n,y:i},{x:o,y:s}]=t;return[[n,i],[o,i],[n,s],[o,s]]}const Fh=Yf.exports.memoize((t,n=256)=>{const i=new Float32Array(n*n);return i.fill(t),new Uint8Array(i.buffer)});function My(t,n){return`${Object.keys(n).map(o=>`#define ${o} ${n[o]}
|
|
44
|
+
`).join("")}
|
|
45
|
+
${t}`}const Iy=t=>{const n=t.length===9,i=n?24:16,o=parseInt(t.slice(1),16),s=o>>i&255,f=o>>i-8&255,u=o>>i-16&255,d=n?o>>i-24&255:255;return[s,f,u,d]};function Fy(t){if(t==="transparent")return[0,0,0,0];const n=t.match(Dy),i=t.match(Ly);if(n!==null){const[,o,s,f]=n;return[+o,+s,+f,255]}else{if(i!==null)return Iy(t);throw new Error(`'${t}' is not a valid RGB or hex color expression.`)}}const ky=t=>{const n=[];let i=[];for(let d=0;d<t.length;d++){n.push(t[d].offset);const v=Fy(t[d].color);i=i.concat(v)}const o=new Float32Array(n),s=new Uint8Array(o.buffer),f=Array.from(s);return i.concat(f)};function Tl(t,n){const i=ky(t);let o;return t.length===0?o=n.texture({shape:[2,2]}):o=n.texture({width:t.length,height:2,data:i}),o}class Uv{constructor(n,i=256,o,s=!1,f="rgba",u="uint8"){const d=Math.floor(o/i),v=d*i,M=d*d,B=n.texture({width:v,height:v,flipY:s,format:f,type:u}),p=new Map,U=this.allTextureCoordinates(d,i);Object.assign(this,{tileSize:i,tilesAcross:d,pixelsAcross:v,tileCapacity:M,texture:B,contents:p,available:U})}addTile(n,i){const{available:o,contents:s,texture:f,tileSize:u}=this,d=this.hashTileCoordinates(n);if(s.has(d)){const p=s.get(d);return s.delete(d),s.set(d,p),this.formatOutputTextureCoordinates(p)}if(Yf.exports.isEmpty(o)){const p=s.keys().next().value;this.removeByHashKey(p)}const v=o.pop();s.set(d,v);const{x:M,y:B}=v;return f.subimage({data:i,width:u,height:u},M,B),this.formatOutputTextureCoordinates(v)}removeTile(n){this.removeByHashKey(this.hashTileCoordinates(n))}clearTiles(){for(const n of Array.from(this.contents.keys()))this.removeByHashKey(n)}destroy(){this.texture.destroy()}removeByHashKey(n){if(this.contents.has(n)){const i=this.contents.get(n);this.contents.delete(n),this.available.push(i)}}formatOutputTextureCoordinates(n){const{x:i,y:o}=n,{pixelsAcross:s,tileSize:f}=this;return[{x:i/s,y:o/s},{x:(i+f)/s,y:(o+f)/s}]}hashTileCoordinates({x:n,y:i,z:o}){return`${n}:${i}:${o}`}getTextureCoordinates(n){const i=this.hashTileCoordinates(n),o=this.contents.get(i);return this.formatOutputTextureCoordinates(o)}allTextureCoordinates(n,i){return Yf.exports.flatMap(Bv(n),o=>Bv(n).map(s=>({x:o*i,y:s*i})))}}var Yv=typeof Float32Array<"u"?Float32Array:Array,Hv=Math.random;Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});function jo(){var t=new Yv(3);return Yv!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ny(t,n,i){return t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function Py(t,n,i){return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t}function zv(t,n){var i=n[0],o=n[1],s=n[2],f=i*i+o*o+s*s;return f>0&&(f=1/Math.sqrt(f)),t[0]=n[0]*f,t[1]=n[1]*f,t[2]=n[2]*f,t}function Wv(t,n){n=n||1;var i=Hv()*2*Math.PI,o=Hv()*2-1,s=Math.sqrt(1-o*o)*n;return t[0]=Math.cos(i)*s,t[1]=Math.sin(i)*s,t[2]=o*n,t}(function(){var t=jo();return function(n,i,o,s,f,u){var d,v;for(i||(i=3),o||(o=0),s?v=Math.min(s*i+o,n.length):v=n.length,d=o;d<v;d+=i)t[0]=n[d],t[1]=n[d+1],t[2]=n[d+2],f(t,t,u),n[d]=t[0],n[d+1]=t[1],n[d+2]=t[2];return n}})();const By=`#define GLSLIFY 1
|
|
46
|
+
uniform mat4 transformMatrix;
|
|
47
|
+
|
|
48
|
+
attribute vec2 position;
|
|
49
|
+
attribute vec2 texCoord;
|
|
50
|
+
|
|
51
|
+
varying vec2 vTexCoord;
|
|
52
|
+
|
|
53
|
+
void main() {
|
|
54
|
+
vTexCoord = texCoord;
|
|
55
|
+
gl_Position = transformMatrix * vec4(position, 0.0, 1.0);
|
|
56
|
+
}`,Gy=`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
57
|
+
precision highp float;
|
|
58
|
+
#else
|
|
59
|
+
precision mediump float;
|
|
60
|
+
#define GLSLIFY 1
|
|
61
|
+
#endif
|
|
62
|
+
|
|
63
|
+
#ifndef RELATIVE_TOLERANCE
|
|
64
|
+
#define RELATIVE_TOLERANCE 0.0001
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
bool isCloseEnough_1(float a, float b) {
|
|
68
|
+
return abs(a - b) <= max(abs(a), abs(b)) * RELATIVE_TOLERANCE;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// #pragma glslify: rgbaToFloat = require(glsl-rgba-to-float)
|
|
72
|
+
// From https://stackoverflow.com/questions/63827836/is-it-possible-to-do-a-rgba-to-float-and-back-round-trip-and-read-the-pixels-in
|
|
73
|
+
|
|
74
|
+
// note: the 0.1s here and there are voodoo related to precision
|
|
75
|
+
float rgbaToFloat_0(vec4 v, bool littleEndian) {
|
|
76
|
+
if (!littleEndian) {
|
|
77
|
+
v = v.abgr;
|
|
78
|
+
}
|
|
79
|
+
vec4 bits = v * 255.0;
|
|
80
|
+
float sign = mix(-1.0, 1.0, step(bits[3], 128.0));
|
|
81
|
+
float expo = floor(mod(bits[3] + 0.1, 128.0)) * 2.0 +
|
|
82
|
+
floor((bits[2] + 0.1) / 128.0) - 127.0;
|
|
83
|
+
float sig = bits[0] +
|
|
84
|
+
bits[1] * 256.0 +
|
|
85
|
+
floor(mod(bits[2] + 0.1, 128.0)) * 256.0 * 256.0;
|
|
86
|
+
return sign * (1.0 + sig / 8388607.0) * pow(2.0, expo);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
float getTexelValue_0(sampler2D texture, vec2 pos, bool littleEndian) {
|
|
90
|
+
vec4 texelRgba = texture2D(texture, pos);
|
|
91
|
+
float texelFloat = rgbaToFloat_0(texelRgba, littleEndian);
|
|
92
|
+
return texelFloat;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
#ifndef DEFAULT_COLOR
|
|
96
|
+
#define DEFAULT_COLOR vec4(0.0)
|
|
97
|
+
#endif
|
|
98
|
+
|
|
99
|
+
#ifndef SCALE_MAX_LENGTH
|
|
100
|
+
#define SCALE_MAX_LENGTH 16
|
|
101
|
+
#endif
|
|
102
|
+
|
|
103
|
+
#ifndef SENTINEL_MAX_LENGTH
|
|
104
|
+
#define SENTINEL_MAX_LENGTH 16
|
|
105
|
+
#endif
|
|
106
|
+
|
|
107
|
+
vec4 computeColor(
|
|
108
|
+
float inputVal,
|
|
109
|
+
sampler2D scaleColormap,
|
|
110
|
+
sampler2D sentinelColormap,
|
|
111
|
+
int scaleLength,
|
|
112
|
+
int sentinelLength,
|
|
113
|
+
bool littleEndian
|
|
114
|
+
) {
|
|
115
|
+
|
|
116
|
+
// vertical texture coordinate to find color and offset
|
|
117
|
+
float colorRow = 0.25;
|
|
118
|
+
float offsetRow = 0.75;
|
|
119
|
+
|
|
120
|
+
// Compare the value against any sentinel values, if defined.
|
|
121
|
+
if (sentinelLength > 0) {
|
|
122
|
+
for (int i = 0; i < SENTINEL_MAX_LENGTH; ++i) {
|
|
123
|
+
if (i == sentinelLength) {
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
float i_f = float(i);
|
|
128
|
+
float sentinelLengthFloat = float(sentinelLength);
|
|
129
|
+
// retrieve the offset from the colormap
|
|
130
|
+
float sentinelOffset = getTexelValue_0(sentinelColormap, vec2((i_f + 0.5) / sentinelLengthFloat, offsetRow), littleEndian);
|
|
131
|
+
if (isCloseEnough_1(inputVal, sentinelOffset)) {
|
|
132
|
+
// retrieve the color from the colormap
|
|
133
|
+
vec2 colormapCoord = vec2((i_f + 0.5) / sentinelLengthFloat, colorRow);
|
|
134
|
+
return texture2D(sentinelColormap, colormapCoord);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Do linear interpolation using the color scale, if defined.
|
|
140
|
+
if (scaleLength > 0) {
|
|
141
|
+
// If value below color scale range, clamp to lowest color stop.
|
|
142
|
+
float scaleOffsetLowest = getTexelValue_0(scaleColormap, vec2(0.0, offsetRow), littleEndian);
|
|
143
|
+
float scaleOffsetHighest = getTexelValue_0(scaleColormap, vec2(1.0, offsetRow), littleEndian);
|
|
144
|
+
if (inputVal < scaleOffsetLowest) {
|
|
145
|
+
return texture2D(scaleColormap, vec2(0.0, colorRow));
|
|
146
|
+
} else if (inputVal > scaleOffsetHighest) {
|
|
147
|
+
return texture2D(scaleColormap, vec2(1.0, colorRow));
|
|
148
|
+
} else {
|
|
149
|
+
for (int i = 0; i < SCALE_MAX_LENGTH; ++i) {
|
|
150
|
+
float i_f = float(i);
|
|
151
|
+
float scaleLengthFloat = float(scaleLength);
|
|
152
|
+
|
|
153
|
+
// If value above color scale range, clamp to highest color stop.
|
|
154
|
+
if (i == scaleLength) {
|
|
155
|
+
return texture2D(sentinelColormap, vec2((scaleLengthFloat - 0.5) / scaleLengthFloat, colorRow));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
float scaleOffsetNext = getTexelValue_0(scaleColormap, vec2((i_f + 1.0 + 0.5) / scaleLengthFloat, offsetRow), littleEndian);
|
|
159
|
+
|
|
160
|
+
if (inputVal <= scaleOffsetNext) {
|
|
161
|
+
float scaleOffset = getTexelValue_0(scaleColormap, vec2((i_f + 0.5) / scaleLengthFloat, offsetRow), littleEndian);
|
|
162
|
+
float percent = (inputVal - scaleOffset)
|
|
163
|
+
/ (scaleOffsetNext - scaleOffset);
|
|
164
|
+
vec4 colorLow = texture2D(scaleColormap, vec2((i_f + 0.5) / scaleLengthFloat, colorRow));
|
|
165
|
+
vec4 colorHigh = texture2D(scaleColormap, vec2((i_f + 1.0 + 0.5) / scaleLengthFloat, colorRow));
|
|
166
|
+
return mix(colorLow, colorHigh, percent);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return DEFAULT_COLOR;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
#ifndef RELATIVE_TOLERANCE
|
|
176
|
+
#define RELATIVE_TOLERANCE 0.0001
|
|
177
|
+
#endif
|
|
178
|
+
|
|
179
|
+
bool isCloseEnough_0(float a, float b) {
|
|
180
|
+
return abs(a - b) <= max(abs(a), abs(b)) * RELATIVE_TOLERANCE;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// #pragma glslify: rgbaToFloat = require(glsl-rgba-to-float)
|
|
184
|
+
// From https://stackoverflow.com/questions/63827836/is-it-possible-to-do-a-rgba-to-float-and-back-round-trip-and-read-the-pixels-in
|
|
185
|
+
|
|
186
|
+
// note: the 0.1s here and there are voodoo related to precision
|
|
187
|
+
float rgbaToFloat_1(vec4 v, bool littleEndian) {
|
|
188
|
+
if (!littleEndian) {
|
|
189
|
+
v = v.abgr;
|
|
190
|
+
}
|
|
191
|
+
vec4 bits = v * 255.0;
|
|
192
|
+
float sign = mix(-1.0, 1.0, step(bits[3], 128.0));
|
|
193
|
+
float expo = floor(mod(bits[3] + 0.1, 128.0)) * 2.0 +
|
|
194
|
+
floor((bits[2] + 0.1) / 128.0) - 127.0;
|
|
195
|
+
float sig = bits[0] +
|
|
196
|
+
bits[1] * 256.0 +
|
|
197
|
+
floor(mod(bits[2] + 0.1, 128.0)) * 256.0 * 256.0;
|
|
198
|
+
return sign * (1.0 + sig / 8388607.0) * pow(2.0, expo);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
float getTexelValue_1(sampler2D texture, vec2 pos, bool littleEndian) {
|
|
202
|
+
vec4 texelRgba = texture2D(texture, pos);
|
|
203
|
+
float texelFloat = rgbaToFloat_1(texelRgba, littleEndian);
|
|
204
|
+
return texelFloat;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
uniform int scaleLength;
|
|
208
|
+
uniform int sentinelLength;
|
|
209
|
+
uniform sampler2D scaleColormap;
|
|
210
|
+
uniform sampler2D sentinelColormap;
|
|
211
|
+
|
|
212
|
+
uniform float nodataValue;
|
|
213
|
+
uniform sampler2D texture;
|
|
214
|
+
uniform bool littleEndian;
|
|
215
|
+
uniform bool enableSimpleHillshade;
|
|
216
|
+
|
|
217
|
+
uniform float textureSize;
|
|
218
|
+
uniform float tileSize;
|
|
219
|
+
uniform vec4 textureBounds;
|
|
220
|
+
varying vec2 vTexCoord;
|
|
221
|
+
|
|
222
|
+
uniform float offset;
|
|
223
|
+
uniform float slopescale;
|
|
224
|
+
uniform float slopeFactor;
|
|
225
|
+
uniform float deg2rad;
|
|
226
|
+
uniform float azimuth;
|
|
227
|
+
uniform float altitude;
|
|
228
|
+
|
|
229
|
+
float getRelativeHeight(vec2 pos, float v, vec4 textureBounds) {
|
|
230
|
+
float pixelFloatValue = getTexelValue_1(texture, pos, littleEndian);
|
|
231
|
+
float test = step(0.0, pixelFloatValue);
|
|
232
|
+
float testReturn = ((test * pixelFloatValue) + ((1.0 - test) * v)) * (slopescale*slopeFactor);
|
|
233
|
+
return testReturn;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
float hillshade(vec2 pos, float v, float offset, vec4 textureBounds) {
|
|
237
|
+
float cv = v * (slopescale * slopeFactor);
|
|
238
|
+
vec4 nv = vec4(
|
|
239
|
+
getRelativeHeight(vec2(pos.x + offset, pos.y), v, textureBounds),
|
|
240
|
+
getRelativeHeight(vec2(pos.x - offset, pos.y), v, textureBounds),
|
|
241
|
+
getRelativeHeight(vec2(pos.x, pos.y + offset), v, textureBounds),
|
|
242
|
+
getRelativeHeight(vec2(pos.x, pos.y - offset), v, textureBounds)
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
vec2 grad = vec2(
|
|
246
|
+
(nv[0] - cv) / 2.0 + (cv - nv[1]) / 2.0,
|
|
247
|
+
(nv[2] - cv) / 2.0 + (cv - nv[3]) / 2.0
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
float slope = max(3.141593 / 2.0 - atan(sqrt(dot(grad, grad))), 0.0);
|
|
251
|
+
float aspect = atan(-grad.y, grad.x);
|
|
252
|
+
|
|
253
|
+
float hs = sin(altitude * deg2rad) * sin(slope) +
|
|
254
|
+
cos(altitude * deg2rad) * cos(slope) *
|
|
255
|
+
cos((azimuth * deg2rad) - aspect);
|
|
256
|
+
|
|
257
|
+
return clamp(hs, 0.0, 1.0);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
void main() {
|
|
261
|
+
float texelFloat = getTexelValue_1(texture, vTexCoord, littleEndian);
|
|
262
|
+
|
|
263
|
+
if (isCloseEnough_0(texelFloat, nodataValue)) {
|
|
264
|
+
discard;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
vec4 clr = computeColor(
|
|
268
|
+
texelFloat,
|
|
269
|
+
scaleColormap,
|
|
270
|
+
sentinelColormap,
|
|
271
|
+
scaleLength,
|
|
272
|
+
sentinelLength,
|
|
273
|
+
littleEndian
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
if (enableSimpleHillshade) {
|
|
277
|
+
float hs = hillshade(vTexCoord, texelFloat, offset, textureBounds);
|
|
278
|
+
clr.rgb = clr.rgb * hs;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
gl_FragColor = clr;
|
|
282
|
+
}`;function Uy(t,n,i){return t({...n,vert:By,frag:My(Gy,i),uniforms:{...n.uniforms,scaleLength:t.prop("scaleLength"),sentinelLength:t.prop("sentinelLength"),scaleColormap:t.prop("scaleColormap"),sentinelColormap:t.prop("sentinelColormap"),texture:(o,{texture:s})=>s,enableSimpleHillshade:(o,{enableSimpleHillshade:s})=>s,offset:0,azimuth:0,altitude:0,slopescale:0,deg2rad:Ty,slopeFactor:Ey,tileSize:0,textureSize:0,textureBounds:[0,0,0,0]},attributes:{...n.attributes,texCoord:(o,{textureBounds:s})=>Oy(s)}})}Pv();const Yy=Pv();function Hy(t,n){return{uniforms:{nodataValue:n,littleEndian:Yy,transformMatrix:({viewportWidth:i,viewportHeight:o})=>Cy(i,o)},attributes:{position:(i,{canvasCoordinates:o})=>{const[s,f]=o,[u,d]=[s+t,f+t];return[[s,f],[u,f],[s,d],[u,d]]}},depth:{enable:!1},primitive:"triangle strip",count:4,viewport:(i,{canvasSize:[o,s]})=>({width:o,height:s})}}class Vv{constructor(n,i,o,s,f,u,d){const v=document.createElement("canvas");let M=by,B=1024;const p=yy({canvas:v,optionalExtensions:["OES_texture_float","WEBGL_color_buffer_float"],onDone:function(D,pe){if(D){console.log(D);return}else pe.limits.maxTextureSize>2048&&(M=2048),pe.limits.maxTextureSize>4096&&(M=4096),pe.limits.maxTextureSize>8192&&(M=8192),B=M;pe.limits.maxFragmentUniforms===261&&console.warn("Software rendering detected. Many features of this plugin will fail. If you have a GPU, check if drivers are installed ok?")}}),U=Hy(i,o),q={SCALE_MAX_LENGTH:u,SENTINEL_MAX_LENGTH:d};Object.assign(this,{gloperations:n,canvas:v,regl:p,tileSize:i,nodataValue:o,maxTextureDimension:M,normalTextureDimension:B,scaleInput:s,sentinelInput:f,scaleColormap:Tl(s,p),sentinelColormap:Tl(f,p),textureManager:new Uv(p,i,B,!1),drawTile:Uy(p,U,q)})}renderTile({coords:n,pixelData:i},o,s){const{regl:f,textureManager:u,tileSize:d}=this;this.setCanvasSize(d,d);const v=u.addTile(n,i);f.clear({color:xy});const M=o.hsSimpleZoomdelta||0,p=Math.max(.5,2**(s+M)/2048)/u.texture.width;return o.hillshadeType==="none"?this.drawTile({canvasSize:[d,d],canvasCoordinates:[0,0],textureBounds:v,texture:u.texture,scaleLength:this.scaleInput.length,sentinelLength:this.sentinelInput.length,scaleColormap:this.scaleColormap,sentinelColormap:this.sentinelColormap,enableSimpleHillshade:!1}):o.hillshadeType==="simple"&&this.drawTileHsSimple({scaleLength:this.scaleInput.length,sentinelLength:this.sentinelInput.length,scaleColormap:this.scaleColormap,sentinelColormap:this.sentinelColormap,canvasSize:[d,d],canvasCoordinates:[0,0],textureBounds:v,texture:u.texture,textureSize:u.texture.width,tileSize:d,offset:p,enableSimpleHillshade:!0,azimuth:o.hsSimpleAzimuth,altitude:o.hsSimpleAltitude,slopescale:o.hsSimpleSlopescale}),[0,0]}setCanvasSize(n,i){Object.assign(this.canvas,{width:n,height:i})}generateAmbientDirections(n){const i=[];for(let o=0;o<n;o++){const s=Wv(jo(),Math.random());i.push(s)}this.ambientDirections=i}generateSunDirections(n,i){const o=[];for(let s=0;s<n;s++){const f=zv(jo(),Ny(jo(),Py(jo(),zv(jo(),[1,1,1]),wy),Wv(jo(),Ay*i)));o.push(f)}this.sunDirections=o}updateColorscale(n){this.scaleInputPrevious=this.scaleInput,this.scaleInput=n,this.scaleColormapPrevious=this.scaleColormap,this.scaleColormap=Tl(n,this.regl)}updateSentinels(n){this.sentinelInputPrevious=this.sentinelInput,this.sentinelInput=n,this.sentinelColormapPrevious=this.sentinelColormap,this.sentinelColormap=Tl(n,this.regl)}setMaxTextureDimension(n){const{textureManager:i,tileSize:o,regl:s}=this;i.destroy(),Object.assign(this,{maxTextureDimension:n,textureManager:new Uv(s,o,n,!1)})}}class zy{constructor(n){this.options=Object.assign({},sy,n),this._checkColorScaleAndSentinels(),this.setHillshadeOptions();const{nodataValue:i,tileSize:o}=this.options;this._renderer=new Vv(this,o,i,this.options.colorScale,this.options.sentinelValues,this.options.colorscaleMaxLength,this.options.sentinelMaxLength),this._renderer.generateAmbientDirections(this.options.hsAdvAmbientIterations),this._renderer.generateSunDirections(this.options.hsAdvSoftIterations,this.options.hsAdvSunRadiusMultiplier)}updateOptions(n){const{url:i,glOperation:o,operationUrlA:s,operationUrlB:f,operationUrlC:u,operationUrlD:d,operationUrlE:v,operationUrlF:M,colorScale:B,sentinelValues:p,filterLowA:U,filterHighA:q,filterLowB:D,filterHighB:pe,filterLowC:le,filterHighC:x,filterLowD:A,filterHighD:g,filterLowE:b,filterHighE:N,filterLowF:F,filterHighF:J,multiplierA:Te,multiplierB:nt,multiplierC:lt,multiplierD:it,multiplierE:ft,multiplierF:tt,multiLayers:Re,hsPregenUrl:Ot,hillshadeType:xt,hsAdvValueScale:Me,hsAdvPixelScale:Ze,hsSimpleSlopescale:St,hsSimpleAzimuth:$t,hsSimpleAltitude:Wt,hsAdvSoftIterations:Qt,hsAdvAmbientIterations:or,hsAdvSunRadiusMultiplier:xr,hsAdvFinalSoftMultiplier:sr,hsAdvFinalAmbientMultiplier:Kt,hsAdvBaselayerUrl:br,hsAdvSmoothInput:Gt,hsAdvSmoothInputKernel:It,contourInterval:hn,contourIndexInterval:jr,contourLineColor:kt,contourLineWeight:Pr,contourLineIndexWeight:Fr,contourType:Zr,contourSmoothLines:Qr,contourSmoothInput:ir,contourSmoothInputKernel:Nt,contourIlluminatedHighlightColor:Tn,contourIlluminatedShadowColor:En,contourIlluminatedShadowSize:Jr,contourHypso:an,contourHypsoDomain:E,contourHypsoColors:di,contourBathy:dn,contourBathyDomain:zi,contourBathyColors:Pn,contourBathyShadowColor:Ar,contourBathyHighlightColor:Dn,contourIndexLabels:Bn,contourLabelFont:C,contourLabelDistance:Ue,colorscaleMaxLength:Xe,sentinelMaxLength:dt}=this.options;if(Object.assign(this.options,n),this.options.colorscaleMaxLength!==Xe||this.options.sentinelMaxLength!==dt){const Z=this._tileSizeAsNumber(),we=new Vv(this,Z,this.options.nodataValue,this.options.colorScale,this.options.sentinelValues,this.options.colorscaleMaxLength,this.options.sentinelMaxLength);this._renderer.regl.destroy(),delete this._renderer,Object.assign(this,{_renderer:we})}this._checkColorScaleAndSentinels(),this.options.colorScale!==B&&this._renderer.updateColorscale(this.options.colorScale),this.options.sentinelValues!==p&&this._renderer.updateSentinels(this.options.sentinelValues),this.options.hsAdvAmbientIterations!==or&&this._renderer.generateAmbientDirections(this.options.hsAdvAmbientIterations),(this.options.hsAdvSoftIterations!==Qt||this.options.hsAdvSunRadiusMultiplier!==xr)&&this._renderer.generateSunDirections(this.options.hsAdvSoftIterations,this.options.hsAdvSunRadiusMultiplier),this.setHillshadeOptions(),this.options.extraPixelLayers>0&&this.options.glOperation==="none"&&this._maybeLoadExtraLayers(s,f,u,d),this.options.hillshadeType!==xt&&(this.options.hillshadeType==="simple"?this._renderer.setMaxTextureDimension(this._tileSizeAsNumber()):xt==="simple"&&this._renderer.setMaxTextureDimension(this._renderer.findMaxTextureDimension())),this.options.url!==i&&this._renderer.textureManager.clearTiles(),this.options.hsAdvBaselayerUrl!==br&&this._renderer.textureManagerHillshade.clearTiles()}createTile(n){const{extraPixelLayers:i,tileSize:o,url:s,hsPregenUrl:f,operationUrlA:u,operationUrlB:d,operationUrlC:v,operationUrlD:M,operationUrlE:B,operationUrlF:p,filterLowA:U,filterHighA:q,filterLowB:D,filterHighB:pe,filterLowC:le,filterHighC:x,filterLowD:A,filterHighD:g,filterLowE:b,filterHighE:N,filterLowF:F,filterHighF:J,multiplierA:Te,multiplierB:nt,multiplierC:lt,multiplierD:it,multiplierE:ft,multiplierF:tt}=this.options,Re=document.createElement("canvas");return Object.assign(Re,{className:"gl-tile",width:o,height:o}),new Promise((Ot,xt)=>{this.options.glOperation==="none"?(i===1&&this._fetchTileData(n,u).then(Me=>{this.options.debug&&console.log("createTile - extraPixelLayers === 1"),Re.pixelDataA=Me}),this._fetchTileData(n,s).then(Me=>{this.options.debug&&console.log("_fetchTileData with no operation");let[Ze,St]=this._renderer.renderTile({coords:n,pixelData:Me},this.options._hillshadeOptions,n.z);Re.pixelData=Me,this._copyToTileCanvas(Re,Ze,St),Ot(Re)})):this.options.glOperation==="diff"?Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with diff");const Ze=Me[0],St=Me[1],[$t,Wt,Qt]=this._renderer.renderTileDiff({coords:n,pixelData:Ze},{coords:n,pixelData:St});Re.pixelData=Qt,Re.pixelDataA=Ze,Re.pixelDataB=St,this._copyToTileCanvas(Re,$t,Wt)}):this.options.glOperation==="multi"&&this.options.multiLayers===1?Promise.all([this._fetchTileData(n,u)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],[St,$t,Wt]=this._renderer.renderTileMulti1({coords:n,pixelData:Ze},U,q,Te);Re.pixelData=Wt,Re.pixelDataA=Ze,this._copyToTileCanvas(Re,St,$t)}):this.options.glOperation==="multi"&&this.options.multiLayers===2?Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],St=Me[1],[$t,Wt,Qt]=this._renderer.renderTileMulti2({coords:n,pixelData:Ze},{coords:n,pixelData:St},U,q,D,pe,Te,nt);Re.pixelData=Qt,Re.pixelDataA=Ze,Re.pixelDataB=St,this._copyToTileCanvas(Re,$t,Wt)}):this.options.glOperation==="multi"&&this.options.multiLayers===3?Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d),this._fetchTileData(n,v)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],St=Me[1],$t=Me[2],[Wt,Qt,or]=this._renderer.renderTileMulti3({coords:n,pixelData:Ze},{coords:n,pixelData:St},{coords:n,pixelData:$t},U,q,D,pe,le,x,Te,nt,lt);Re.pixelData=or,Re.pixelDataA=Ze,Re.pixelDataB=St,Re.pixelDataC=$t,this._copyToTileCanvas(Re,Wt,Qt)}):this.options.glOperation==="multi"&&this.options.multiLayers===4?Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d),this._fetchTileData(n,v),this._fetchTileData(n,M)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],St=Me[1],$t=Me[2],Wt=Me[3],[Qt,or,xr]=this._renderer.renderTileMulti4({coords:n,pixelData:Ze},{coords:n,pixelData:St},{coords:n,pixelData:$t},{coords:n,pixelData:Wt},U,q,D,pe,le,x,A,g,Te,nt,lt,it);Re.pixelData=xr,Re.pixelDataA=Ze,Re.pixelDataB=St,Re.pixelDataC=$t,Re.pixelDataD=Wt,this._copyToTileCanvas(Re,Qt,or)}):this.options.glOperation==="multi"&&this.options.multiLayers===5?Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d),this._fetchTileData(n,v),this._fetchTileData(n,M),this._fetchTileData(n,B)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],St=Me[1],$t=Me[2],Wt=Me[3],Qt=Me[4],[or,xr,sr]=this._renderer.renderTileMulti5({coords:n,pixelData:Ze},{coords:n,pixelData:St},{coords:n,pixelData:$t},{coords:n,pixelData:Wt},{coords:n,pixelData:Qt},U,q,D,pe,le,x,A,g,b,N,Te,nt,lt,it,ft);Re.pixelData=sr,Re.pixelDataA=Ze,Re.pixelDataB=St,Re.pixelDataC=$t,Re.pixelDataD=Wt,Re.pixelDataE=Qt,this._copyToTileCanvas(Re,or,xr)}):this.options.glOperation==="multi"&&this.options.multiLayers===6&&Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d),this._fetchTileData(n,v),this._fetchTileData(n,M),this._fetchTileData(n,B),this._fetchTileData(n,p)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],St=Me[1],$t=Me[2],Wt=Me[3],Qt=Me[4],or=Me[5],[xr,sr,Kt]=this._renderer.renderTileMulti6({coords:n,pixelData:Ze},{coords:n,pixelData:St},{coords:n,pixelData:$t},{coords:n,pixelData:Wt},{coords:n,pixelData:Qt},{coords:n,pixelData:or},U,q,D,pe,le,x,A,g,b,N,F,J,Te,nt,lt,it,ft,tt);Re.pixelData=Kt,Re.pixelDataA=Ze,Re.pixelDataB=St,Re.pixelDataC=$t,Re.pixelDataD=Wt,Re.pixelDataE=Qt,Re.pixelDataF=or,this._copyToTileCanvas(Re,xr,sr)})})}_checkColorScaleAndSentinels(){const{colorScale:n,sentinelValues:i,colorscaleMaxLength:o,sentinelMaxLength:s}=this.options;if(n.length===0&&i.length===0)throw new Error("Either `colorScale` or `sentinelValues` must be of non-zero length.");if(n.length>o)throw new Error(`Color scale length ${n.length} exceeds the maximum, ${o}.`);if(i.length>s)throw new Error(`Sentinel values length ${i.length} exceeds the maximum, ${s}.`)}setHillshadeOptions(){this.options._hillshadeOptions={hillshadeType:this.options.hillshadeType,hsAdvValueScale:this.options.hsAdvValueScale,hsAdvPixelScale:this.options.hsAdvPixelScale,hsSimpleSlopescale:this.options.hsSimpleSlopescale,hsSimpleAzimuth:this.options.hsSimpleAzimuth,hsSimpleAltitude:this.options.hsSimpleAltitude,hsSimpleZoomdelta:this.options.hsSimpleZoomdelta,hsAdvSoftIterations:this.options.hsAdvSoftIterations,hsAdvAmbientIterations:this.options.hsAdvAmbientIterations,hsAdvSunRadiusMultiplier:this.options.hsAdvSunRadiusMultiplier,hsAdvFinalSoftMultiplier:this.options.hsAdvFinalSoftMultiplier,hsAdvFinalAmbientMultiplier:this.options.hsAdvFinalAmbientMultiplier,hsAdvBaselayerUrl:this.options.hsAdvBaselayerUrl,hsAdvSmoothInput:this.options.hsAdvSmoothInput,hsAdvSmoothInputKernel:this.options.hsAdvSmoothInputKernel,hsPregenUrl:this.options.hsPregenUrl}}_tileSizeAsNumber(){return this.options.tileSize}async _fetchTileData(n,i,o=this.options.tileFormat){if(o==="float32"||o==="image")return Gv(this.getTileUrl(n,i),this.options.nodataValue,this._tileSizeAsNumber());if(o==="dem"){const s=Fh(this.options.nodataValue,this._tileSizeAsNumber()),f=await Gv(this.getTileUrl(n,i),this.options.nodataValue,this._tileSizeAsNumber());return Ry(f,s)?f:this._renderer.renderConvertDem(f)}return Fh(this.options.nodataValue,this._tileSizeAsNumber())}_copyToTileCanvas(n,i,o){const s=this._tileSizeAsNumber(),f=n.getContext("2d");if(f===null)throw new Error("Tile canvas 2D context is null.");f.clearRect(0,0,s,s),f.drawImage(this._renderer.canvas,i,o,s,s,0,0,s,s)}getTileUrl(n,i){return i.replace(/{z}/g,String(n.z)).replace(/{x}/g,String(n.x)).replace(/{y}/g,String(n.y))}_getPixelScale(n){let{bbox:{east:i,south:o,west:s,north:f},z:u}=n,d=1,v=(o+f)/2;return this.options.hsAdvPixelScale==="auto"?d=Sy*Math.abs(Math.cos(v/180*Math.PI))/Math.pow(2,u+8):typeof this.options.hsAdvPixelScale=="number"&&(d=this.options.hsAdvPixelScale/(this._tileSizeAsNumber()*2**u)),d}}Dr.Event=fy,Dr.GLOperations=zy,Dr.addIcons2Map=ay,Dr.cameras=ph,Dr.diffLayers=qg,Dr.downloadImage=Jg,Dr.findNodeInTree=Al,Dr.formatDate=Wg,Dr.formatFileSize=$g,Dr.formatLocalDate=Vg,Dr.generateId=zg,Dr.getAnnotationFeature=ry,Dr.getAnnotationName=ny,Dr.getBeforeId=Kg,Dr.getDataType=Qg,Dr.getGeoCoordOperator=gh,Dr.getGeometryType=ey,Dr.getLineLabelFeature=iy,Dr.getPhotoInfo=Zg,Dr.getPhotoMeta=Xg,Dr.getPhotoTags=Bc,Dr.isTokenExpired=jg,Dr.project=xh,Dr.rgbaToFloat=ty,Dr.toRadian=yh,Object.defineProperties(Dr,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|