123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922 |
- import {
- a as a3,
- c as c2,
- f,
- g,
- p as p2,
- r as r2,
- s as s4
- } from "./chunk-TDS6IBMU.js";
- import {
- p as p3,
- v,
- y as y3,
- z
- } from "./chunk-NDUYF7XW.js";
- import {
- l as l2
- } from "./chunk-X4SA4ELJ.js";
- import {
- a as a2
- } from "./chunk-ZLNEXZAN.js";
- import {
- s as s3
- } from "./chunk-HZRKBTHJ.js";
- import {
- w,
- w2
- } from "./chunk-6T6G6LCQ.js";
- import {
- k2 as k
- } from "./chunk-PQFTYGF5.js";
- import {
- e,
- l3 as l,
- n5 as n,
- y3 as y2
- } from "./chunk-2Z2TG5CU.js";
- import {
- a,
- p
- } from "./chunk-V6P2MAQQ.js";
- import {
- s2 as s,
- s3 as s2
- } from "./chunk-E5O6P5I2.js";
- import {
- y
- } from "./chunk-SPWQ3AWG.js";
- import {
- c,
- e as e2,
- r,
- t
- } from "./chunk-YXWMMD76.js";
- // node_modules/@arcgis/core/chunks/Zlib.js
- var t2;
- var e3;
- var r3;
- var i = { exports: {} };
- e3 = i, void 0 !== (t2 = function() {
- function t7() {
- this.pos = 0, this.bufferLength = 0, this.eof = false, this.buffer = null;
- }
- return t7.prototype = { ensureBuffer: function(t8) {
- var e8 = this.buffer, r11 = e8 ? e8.byteLength : 0;
- if (t8 < r11)
- return e8;
- for (var i7 = 512; i7 < t8; )
- i7 <<= 1;
- for (var s9 = new Uint8Array(i7), f7 = 0; f7 < r11; ++f7)
- s9[f7] = e8[f7];
- return this.buffer = s9;
- }, getByte: function() {
- for (var t8 = this.pos; this.bufferLength <= t8; ) {
- if (this.eof)
- return null;
- this.readBlock();
- }
- return this.buffer[this.pos++];
- }, getBytes: function(t8) {
- var e8 = this.pos;
- if (t8) {
- this.ensureBuffer(e8 + t8);
- for (var r11 = e8 + t8; !this.eof && this.bufferLength < r11; )
- this.readBlock();
- var i7 = this.bufferLength;
- r11 > i7 && (r11 = i7);
- } else {
- for (; !this.eof; )
- this.readBlock();
- r11 = this.bufferLength;
- }
- return this.pos = r11, this.buffer.subarray(e8, r11);
- }, lookChar: function() {
- for (var t8 = this.pos; this.bufferLength <= t8; ) {
- if (this.eof)
- return null;
- this.readBlock();
- }
- return String.fromCharCode(this.buffer[this.pos]);
- }, getChar: function() {
- for (var t8 = this.pos; this.bufferLength <= t8; ) {
- if (this.eof)
- return null;
- this.readBlock();
- }
- return String.fromCharCode(this.buffer[this.pos++]);
- }, makeSubStream: function(t8, e8, r11) {
- for (var i7 = t8 + e8; this.bufferLength <= i7 && !this.eof; )
- this.readBlock();
- return new Stream(this.buffer, t8, e8, r11);
- }, skip: function(t8) {
- t8 || (t8 = 1), this.pos += t8;
- }, reset: function() {
- this.pos = 0;
- } }, t7;
- }(), r3 = function() {
- if (!self || !self.Uint32Array)
- return null;
- var e8 = new Uint32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), r11 = new Uint32Array([3, 4, 5, 6, 7, 8, 9, 10, 65547, 65549, 65551, 65553, 131091, 131095, 131099, 131103, 196643, 196651, 196659, 196667, 262211, 262227, 262243, 262259, 327811, 327843, 327875, 327907, 258, 258, 258]), i7 = new Uint32Array([1, 2, 3, 4, 65541, 65543, 131081, 131085, 196625, 196633, 262177, 262193, 327745, 327777, 393345, 393409, 459009, 459137, 524801, 525057, 590849, 591361, 657409, 658433, 724993, 727041, 794625, 798721, 868353, 876545]), s9 = [new Uint32Array([459008, 524368, 524304, 524568, 459024, 524400, 524336, 590016, 459016, 524384, 524320, 589984, 524288, 524416, 524352, 590048, 459012, 524376, 524312, 589968, 459028, 524408, 524344, 590032, 459020, 524392, 524328, 59e4, 524296, 524424, 524360, 590064, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590024, 459018, 524388, 524324, 589992, 524292, 524420, 524356, 590056, 459014, 524380, 524316, 589976, 459030, 524412, 524348, 590040, 459022, 524396, 524332, 590008, 524300, 524428, 524364, 590072, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590020, 459017, 524386, 524322, 589988, 524290, 524418, 524354, 590052, 459013, 524378, 524314, 589972, 459029, 524410, 524346, 590036, 459021, 524394, 524330, 590004, 524298, 524426, 524362, 590068, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590028, 459019, 524390, 524326, 589996, 524294, 524422, 524358, 590060, 459015, 524382, 524318, 589980, 459031, 524414, 524350, 590044, 459023, 524398, 524334, 590012, 524302, 524430, 524366, 590076, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590018, 459016, 524385, 524321, 589986, 524289, 524417, 524353, 590050, 459012, 524377, 524313, 589970, 459028, 524409, 524345, 590034, 459020, 524393, 524329, 590002, 524297, 524425, 524361, 590066, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590026, 459018, 524389, 524325, 589994, 524293, 524421, 524357, 590058, 459014, 524381, 524317, 589978, 459030, 524413, 524349, 590042, 459022, 524397, 524333, 590010, 524301, 524429, 524365, 590074, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590022, 459017, 524387, 524323, 589990, 524291, 524419, 524355, 590054, 459013, 524379, 524315, 589974, 459029, 524411, 524347, 590038, 459021, 524395, 524331, 590006, 524299, 524427, 524363, 590070, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590030, 459019, 524391, 524327, 589998, 524295, 524423, 524359, 590062, 459015, 524383, 524319, 589982, 459031, 524415, 524351, 590046, 459023, 524399, 524335, 590014, 524303, 524431, 524367, 590078, 459008, 524368, 524304, 524568, 459024, 524400, 524336, 590017, 459016, 524384, 524320, 589985, 524288, 524416, 524352, 590049, 459012, 524376, 524312, 589969, 459028, 524408, 524344, 590033, 459020, 524392, 524328, 590001, 524296, 524424, 524360, 590065, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590025, 459018, 524388, 524324, 589993, 524292, 524420, 524356, 590057, 459014, 524380, 524316, 589977, 459030, 524412, 524348, 590041, 459022, 524396, 524332, 590009, 524300, 524428, 524364, 590073, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590021, 459017, 524386, 524322, 589989, 524290, 524418, 524354, 590053, 459013, 524378, 524314, 589973, 459029, 524410, 524346, 590037, 459021, 524394, 524330, 590005, 524298, 524426, 524362, 590069, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590029, 459019, 524390, 524326, 589997, 524294, 524422, 524358, 590061, 459015, 524382, 524318, 589981, 459031, 524414, 524350, 590045, 459023, 524398, 524334, 590013, 524302, 524430, 524366, 590077, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590019, 459016, 524385, 524321, 589987, 524289, 524417, 524353, 590051, 459012, 524377, 524313, 589971, 459028, 524409, 524345, 590035, 459020, 524393, 524329, 590003, 524297, 524425, 524361, 590067, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590027, 459018, 524389, 524325, 589995, 524293, 524421, 524357, 590059, 459014, 524381, 524317, 589979, 459030, 524413, 524349, 590043, 459022, 524397, 524333, 590011, 524301, 524429, 524365, 590075, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590023, 459017, 524387, 524323, 589991, 524291, 524419, 524355, 590055, 459013, 524379, 524315, 589975, 459029, 524411, 524347, 590039, 459021, 524395, 524331, 590007, 524299, 524427, 524363, 590071, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590031, 459019, 524391, 524327, 589999, 524295, 524423, 524359, 590063, 459015, 524383, 524319, 589983, 459031, 524415, 524351, 590047, 459023, 524399, 524335, 590015, 524303, 524431, 524367, 590079]), 9], f7 = [new Uint32Array([327680, 327696, 327688, 327704, 327684, 327700, 327692, 327708, 327682, 327698, 327690, 327706, 327686, 327702, 327694, 0, 327681, 327697, 327689, 327705, 327685, 327701, 327693, 327709, 327683, 327699, 327691, 327707, 327687, 327703, 327695, 0]), 5];
- function o5(t7) {
- throw new Error(t7);
- }
- function n10(e9) {
- var r12 = 0, i8 = e9[r12++], s10 = e9[r12++];
- -1 != i8 && -1 != s10 || o5("Invalid header in flate stream"), 8 != (15 & i8) && o5("Unknown compression method in flate stream"), ((i8 << 8) + s10) % 31 != 0 && o5("Bad FCHECK in flate stream"), 32 & s10 && o5("FDICT bit set in flate stream"), this.bytes = e9, this.bytesPos = r12, this.codeSize = 0, this.codeBuf = 0, t2.call(this);
- }
- return n10.prototype = Object.create(t2.prototype), n10.prototype.getBits = function(t7) {
- for (var e9, r12 = this.codeSize, i8 = this.codeBuf, s10 = this.bytes, f8 = this.bytesPos; r12 < t7; )
- void 0 === (e9 = s10[f8++]) && o5("Bad encoding in flate stream"), i8 |= e9 << r12, r12 += 8;
- return e9 = i8 & (1 << t7) - 1, this.codeBuf = i8 >> t7, this.codeSize = r12 -= t7, this.bytesPos = f8, e9;
- }, n10.prototype.getCode = function(t7) {
- for (var e9 = t7[0], r12 = t7[1], i8 = this.codeSize, s10 = this.codeBuf, f8 = this.bytes, n11 = this.bytesPos; i8 < r12; ) {
- var h5;
- void 0 === (h5 = f8[n11++]) && o5("Bad encoding in flate stream"), s10 |= h5 << i8, i8 += 8;
- }
- var a11 = e9[s10 & (1 << r12) - 1], u6 = a11 >> 16, l8 = 65535 & a11;
- return (0 == i8 || i8 < u6 || 0 == u6) && o5("Bad encoding in flate stream"), this.codeBuf = s10 >> u6, this.codeSize = i8 - u6, this.bytesPos = n11, l8;
- }, n10.prototype.generateHuffmanTable = function(t7) {
- for (var e9 = t7.length, r12 = 0, i8 = 0; i8 < e9; ++i8)
- t7[i8] > r12 && (r12 = t7[i8]);
- for (var s10 = 1 << r12, f8 = new Uint32Array(s10), o6 = 1, n11 = 0, h5 = 2; o6 <= r12; ++o6, n11 <<= 1, h5 <<= 1)
- for (var a11 = 0; a11 < e9; ++a11)
- if (t7[a11] == o6) {
- var u6 = 0, l8 = n11;
- for (i8 = 0; i8 < o6; ++i8)
- u6 = u6 << 1 | 1 & l8, l8 >>= 1;
- for (i8 = u6; i8 < s10; i8 += h5)
- f8[i8] = o6 << 16 | a11;
- ++n11;
- }
- return [f8, r12];
- }, n10.prototype.readBlock = function() {
- function t7(t8, e9, r12, i8, s10) {
- for (var f8 = t8.getBits(r12) + i8; f8-- > 0; )
- e9[b3++] = s10;
- }
- var n11 = this.getBits(3);
- if (1 & n11 && (this.eof = true), 0 != (n11 >>= 1)) {
- var h5, a11;
- if (1 == n11)
- h5 = s9, a11 = f7;
- else if (2 == n11) {
- for (var u6 = this.getBits(5) + 257, l8 = this.getBits(5) + 1, c7 = this.getBits(4) + 4, d4 = Array(e8.length), b3 = 0; b3 < c7; )
- d4[e8[b3++]] = this.getBits(3);
- for (var v4 = this.generateHuffmanTable(d4), g6 = 0, B2 = (b3 = 0, u6 + l8), p8 = new Array(B2); b3 < B2; ) {
- var y6 = this.getCode(v4);
- 16 == y6 ? t7(this, p8, 2, 3, g6) : 17 == y6 ? t7(this, p8, 3, 3, g6 = 0) : 18 == y6 ? t7(this, p8, 7, 11, g6 = 0) : p8[b3++] = g6 = y6;
- }
- h5 = this.generateHuffmanTable(p8.slice(0, u6)), a11 = this.generateHuffmanTable(p8.slice(u6, B2));
- } else
- o5("Unknown block type in flate stream");
- for (var m5 = (x4 = this.buffer) ? x4.length : 0, k5 = this.bufferLength; ; ) {
- var w5 = this.getCode(h5);
- if (w5 < 256)
- k5 + 1 >= m5 && (m5 = (x4 = this.ensureBuffer(k5 + 1)).length), x4[k5++] = w5;
- else {
- if (256 == w5)
- return void (this.bufferLength = k5);
- var C4 = (w5 = r11[w5 -= 257]) >> 16;
- C4 > 0 && (C4 = this.getBits(C4)), g6 = (65535 & w5) + C4, w5 = this.getCode(a11), (C4 = (w5 = i7[w5]) >> 16) > 0 && (C4 = this.getBits(C4));
- var L3 = (65535 & w5) + C4;
- k5 + g6 >= m5 && (m5 = (x4 = this.ensureBuffer(k5 + g6)).length);
- for (var S4 = 0; S4 < g6; ++S4, ++k5)
- x4[k5] = x4[k5 - L3];
- }
- }
- } else {
- var A3, U3 = this.bytes, P3 = this.bytesPos;
- void 0 === (A3 = U3[P3++]) && o5("Bad block header in flate stream");
- var z2 = A3;
- void 0 === (A3 = U3[P3++]) && o5("Bad block header in flate stream"), z2 |= A3 << 8, void 0 === (A3 = U3[P3++]) && o5("Bad block header in flate stream");
- var H = A3;
- void 0 === (A3 = U3[P3++]) && o5("Bad block header in flate stream"), (H |= A3 << 8) != (65535 & ~z2) && o5("Bad uncompressed block length in flate stream"), this.codeBuf = 0, this.codeSize = 0;
- var T4 = this.bufferLength, x4 = this.ensureBuffer(T4 + z2), E3 = T4 + z2;
- this.bufferLength = E3;
- for (var F2 = T4; F2 < E3; ++F2) {
- if (void 0 === (A3 = U3[P3++])) {
- this.eof = true;
- break;
- }
- x4[F2] = A3;
- }
- this.bytesPos = P3;
- }
- }, n10;
- }()) && (e3.exports = r3);
- var s5 = i.exports;
- // node_modules/@arcgis/core/layers/support/rasterFormats/ImageCanvasDecoder.js
- var i2 = class {
- constructor(t7) {
- this._canvas = null, this._ctx = null, t7 && (this._canvas = t7.canvas, this._ctx = t7.ctx || t7.canvas && t7.canvas.getContext("2d"));
- }
- decode(n10, s9, r11) {
- if (!n10 || n10.byteLength < 10)
- throw new s2("imagecanvasdecoder: decode", "required a valid encoded data as input.");
- let { width: c7 = 0, height: h5 = 0, format: o5 } = s9;
- const { applyJpegMask: l8 } = s9;
- if (l8 && (!c7 || !h5))
- throw new s2("imagecanvasdecoder: decode", "image width and height are needed to apply jpeg mask directly to canvas");
- return new Promise((t7, d4) => {
- let g6 = null;
- "jpg" === o5 && l8 && (g6 = i2._getMask(n10, { width: c7, height: h5 }));
- const w5 = new Blob([new Uint8Array(n10)], { type: "image/" + o5 == "jpg" ? "jpeg" : o5 }), v4 = URL.createObjectURL(w5), m5 = new Image();
- let _3;
- m5.src = v4, m5.onload = () => {
- if (URL.revokeObjectURL(v4), p(r11))
- return void d4(a());
- c7 = m5.width, h5 = m5.height, this._canvas && this._ctx ? (this._canvas.width === c7 && this._canvas.height === h5 || (this._canvas.width = c7, this._canvas.height = h5), this._ctx.clearRect(0, 0, c7, h5)) : (this._canvas = document.createElement("canvas"), this._canvas.width = c7, this._canvas.height = h5, this._ctx = this._canvas.getContext("2d")), this._ctx.drawImage(m5, 0, 0);
- const n11 = this._ctx.getImageData(0, 0, c7, h5);
- let i7;
- if (_3 = n11.data, s9.renderOnCanvas) {
- if (g6)
- for (i7 = 0; i7 < g6.length; i7++)
- g6[i7] ? _3[4 * i7 + 3] = 255 : _3[4 * i7 + 3] = 0;
- return this._ctx.putImageData(n11, 0, 0), void t7(null);
- }
- const o6 = c7 * h5, l9 = new Uint8Array(o6), w6 = new Uint8Array(o6), p8 = new Uint8Array(o6);
- if (g6)
- for (i7 = 0; i7 < o6; i7++)
- l9[i7] = _3[4 * i7], w6[i7] = _3[4 * i7 + 1], p8[i7] = _3[4 * i7 + 2];
- else
- for (g6 = new Uint8Array(o6), i7 = 0; i7 < o6; i7++)
- l9[i7] = _3[4 * i7], w6[i7] = _3[4 * i7 + 1], p8[i7] = _3[4 * i7 + 2], g6[i7] = _3[4 * i7 + 3];
- t7({ width: c7, height: h5, pixels: [l9, w6, p8], mask: g6, pixelType: "u8" });
- }, m5.onerror = () => {
- URL.revokeObjectURL(v4), d4("cannot load image");
- };
- });
- }
- static _getMask(t7, e8) {
- let a11 = null;
- try {
- const i7 = new Uint8Array(t7), s9 = Math.ceil(i7.length / 2);
- let r11 = 0;
- const c7 = i7.length - 2;
- for (r11 = s9; r11 < c7 && (255 !== i7[r11] || 217 !== i7[r11 + 1]); r11++)
- ;
- if (r11 += 2, r11 < i7.length - 1) {
- const t8 = new s5(i7.subarray(r11)).getBytes();
- a11 = new Uint8Array(e8.width * e8.height);
- let s10 = 0;
- for (let e9 = 0; e9 < t8.length; e9++)
- for (let n10 = 7; n10 >= 0; n10--)
- a11[s10++] = t8[e9] >> n10 & 1;
- }
- } catch (i7) {
- }
- return a11;
- }
- };
- // node_modules/@arcgis/core/chunks/Jpg.js
- var e4;
- var n2;
- var r4;
- var o = { exports: {} };
- e4 = o, n2 = function() {
- var e8 = function() {
- function e9(e10) {
- this.message = "JPEG error: " + e10;
- }
- return e9.prototype = new Error(), e9.prototype.name = "JpegError", e9.constructor = e9, e9;
- }();
- return function() {
- if (!self || !self.Uint8ClampedArray)
- return null;
- var n10 = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]), r11 = 4017, o5 = 799, a11 = 3406, t7 = 2276, i7 = 1567, s9 = 3784, c7 = 5793, f7 = 2896;
- function l8() {
- this.decodeTransform = null, this.colorTransform = -1;
- }
- function u6(e9, n11) {
- for (var r12, o6, a12 = 0, t8 = [], i8 = 16; i8 > 0 && !e9[i8 - 1]; )
- i8--;
- t8.push({ children: [], index: 0 });
- var s10, c8 = t8[0];
- for (r12 = 0; r12 < i8; r12++) {
- for (o6 = 0; o6 < e9[r12]; o6++) {
- for ((c8 = t8.pop()).children[c8.index] = n11[a12]; c8.index > 0; )
- c8 = t8.pop();
- for (c8.index++, t8.push(c8); t8.length <= r12; )
- t8.push(s10 = { children: [], index: 0 }), c8.children[c8.index] = s10.children, c8 = s10;
- a12++;
- }
- r12 + 1 < i8 && (t8.push(s10 = { children: [], index: 0 }), c8.children[c8.index] = s10.children, c8 = s10);
- }
- return t8[0].children;
- }
- function h5(e9, n11, r12) {
- return 64 * ((e9.blocksPerLine + 1) * n11 + r12);
- }
- function v4(r12, o6, a12, t8, i8, s10, c8, f8, l9) {
- var u7 = a12.mcusPerLine, v5 = a12.progressive, m6 = o6, d5 = 0, p8 = 0;
- function k5() {
- if (p8 > 0)
- return p8--, d5 >> p8 & 1;
- if (255 === (d5 = r12[o6++])) {
- var n11 = r12[o6++];
- if (n11)
- throw new e8("unexpected marker " + (d5 << 8 | n11).toString(16));
- }
- return p8 = 7, d5 >>> 7;
- }
- function g6(n11) {
- for (var r13 = n11; ; ) {
- if ("number" == typeof (r13 = r13[k5()]))
- return r13;
- if ("object" != typeof r13)
- throw new e8("invalid huffman sequence");
- }
- }
- function C4(e9) {
- for (var n11 = 0; e9 > 0; )
- n11 = n11 << 1 | k5(), e9--;
- return n11;
- }
- function w5(e9) {
- if (1 === e9)
- return 1 === k5() ? 1 : -1;
- var n11 = C4(e9);
- return n11 >= 1 << e9 - 1 ? n11 : n11 + (-1 << e9) + 1;
- }
- function x4(e9, r13) {
- var o7 = g6(e9.huffmanTableDC), a13 = 0 === o7 ? 0 : w5(o7);
- e9.blockData[r13] = e9.pred += a13;
- for (var t9 = 1; t9 < 64; ) {
- var i9 = g6(e9.huffmanTableAC), s11 = 15 & i9, c9 = i9 >> 4;
- if (0 !== s11) {
- var f9 = n10[t9 += c9];
- e9.blockData[r13 + f9] = w5(s11), t9++;
- } else {
- if (c9 < 15)
- break;
- t9 += 16;
- }
- }
- }
- function y6(e9, n11) {
- var r13 = g6(e9.huffmanTableDC), o7 = 0 === r13 ? 0 : w5(r13) << l9;
- e9.blockData[n11] = e9.pred += o7;
- }
- function D4(e9, n11) {
- e9.blockData[n11] |= k5() << l9;
- }
- var T4 = 0;
- function P3(e9, r13) {
- if (T4 > 0)
- T4--;
- else
- for (var o7 = s10, a13 = c8; o7 <= a13; ) {
- var t9 = g6(e9.huffmanTableAC), i9 = 15 & t9, f9 = t9 >> 4;
- if (0 !== i9) {
- var u8 = n10[o7 += f9];
- e9.blockData[r13 + u8] = w5(i9) * (1 << l9), o7++;
- } else {
- if (f9 < 15) {
- T4 = C4(f9) + (1 << f9) - 1;
- break;
- }
- o7 += 16;
- }
- }
- }
- var L3, A3 = 0;
- function _3(r13, o7) {
- for (var a13, t9, i9 = s10, f9 = c8, u8 = 0; i9 <= f9; ) {
- var h6 = n10[i9];
- switch (A3) {
- case 0:
- if (u8 = (t9 = g6(r13.huffmanTableAC)) >> 4, 0 == (a13 = 15 & t9))
- u8 < 15 ? (T4 = C4(u8) + (1 << u8), A3 = 4) : (u8 = 16, A3 = 1);
- else {
- if (1 !== a13)
- throw new e8("invalid ACn encoding");
- L3 = w5(a13), A3 = u8 ? 2 : 3;
- }
- continue;
- case 1:
- case 2:
- r13.blockData[o7 + h6] ? r13.blockData[o7 + h6] += k5() << l9 : 0 == --u8 && (A3 = 2 === A3 ? 3 : 0);
- break;
- case 3:
- r13.blockData[o7 + h6] ? r13.blockData[o7 + h6] += k5() << l9 : (r13.blockData[o7 + h6] = L3 << l9, A3 = 0);
- break;
- case 4:
- r13.blockData[o7 + h6] && (r13.blockData[o7 + h6] += k5() << l9);
- }
- i9++;
- }
- 4 === A3 && 0 == --T4 && (A3 = 0);
- }
- function U3(e9, n11, r13, o7, a13) {
- var t9 = r13 % u7;
- n11(e9, h5(e9, (r13 / u7 | 0) * e9.v + o7, t9 * e9.h + a13));
- }
- function z2(e9, n11, r13) {
- n11(e9, h5(e9, r13 / e9.blocksPerLine | 0, r13 % e9.blocksPerLine));
- }
- var I3, M3, Y, q, S4, R2, H = t8.length;
- R2 = v5 ? 0 === s10 ? 0 === f8 ? y6 : D4 : 0 === f8 ? P3 : _3 : x4;
- var E3, J, V2, j, B2 = 0;
- for (J = 1 === H ? t8[0].blocksPerLine * t8[0].blocksPerColumn : u7 * a12.mcusPerColumn; B2 < J; ) {
- var N2 = i8 ? Math.min(J - B2, i8) : J;
- for (M3 = 0; M3 < H; M3++)
- t8[M3].pred = 0;
- if (T4 = 0, 1 === H)
- for (I3 = t8[0], S4 = 0; S4 < N2; S4++)
- z2(I3, R2, B2), B2++;
- else
- for (S4 = 0; S4 < N2; S4++) {
- for (M3 = 0; M3 < H; M3++)
- for (V2 = (I3 = t8[M3]).h, j = I3.v, Y = 0; Y < j; Y++)
- for (q = 0; q < V2; q++)
- U3(I3, R2, B2, Y, q);
- B2++;
- }
- p8 = 0, (E3 = b3(r12, o6)) && E3.invalid && (console.log("decodeScan - unexpected MCU data, next marker is: " + E3.invalid), o6 = E3.offset);
- var G2 = E3 && E3.marker;
- if (!G2 || G2 <= 65280)
- throw new e8("marker was not found");
- if (!(G2 >= 65488 && G2 <= 65495))
- break;
- o6 += 2;
- }
- return (E3 = b3(r12, o6)) && E3.invalid && (console.log("decodeScan - unexpected Scan data, next marker is: " + E3.invalid), o6 = E3.offset), o6 - m6;
- }
- function m5(n11, l9, u7) {
- var h6, v5, m6, d5, b4, p8, k5, g6, C4, w5, x4, y6, D4, T4, P3, L3, A3, _3 = n11.quantizationTable, U3 = n11.blockData;
- if (!_3)
- throw new e8("missing required Quantization Table.");
- for (var z2 = 0; z2 < 64; z2 += 8)
- C4 = U3[l9 + z2], w5 = U3[l9 + z2 + 1], x4 = U3[l9 + z2 + 2], y6 = U3[l9 + z2 + 3], D4 = U3[l9 + z2 + 4], T4 = U3[l9 + z2 + 5], P3 = U3[l9 + z2 + 6], L3 = U3[l9 + z2 + 7], C4 *= _3[z2], 0 != (w5 | x4 | y6 | D4 | T4 | P3 | L3) ? (w5 *= _3[z2 + 1], x4 *= _3[z2 + 2], y6 *= _3[z2 + 3], D4 *= _3[z2 + 4], T4 *= _3[z2 + 5], P3 *= _3[z2 + 6], L3 *= _3[z2 + 7], v5 = (h6 = (h6 = c7 * C4 + 128 >> 8) + (v5 = c7 * D4 + 128 >> 8) + 1 >> 1) - v5, A3 = (m6 = x4) * s9 + (d5 = P3) * i7 + 128 >> 8, m6 = m6 * i7 - d5 * s9 + 128 >> 8, k5 = (b4 = (b4 = f7 * (w5 - L3) + 128 >> 8) + (k5 = T4 << 4) + 1 >> 1) - k5, p8 = (g6 = (g6 = f7 * (w5 + L3) + 128 >> 8) + (p8 = y6 << 4) + 1 >> 1) - p8, d5 = (h6 = h6 + (d5 = A3) + 1 >> 1) - d5, m6 = (v5 = v5 + m6 + 1 >> 1) - m6, A3 = b4 * t7 + g6 * a11 + 2048 >> 12, b4 = b4 * a11 - g6 * t7 + 2048 >> 12, g6 = A3, A3 = p8 * o5 + k5 * r11 + 2048 >> 12, p8 = p8 * r11 - k5 * o5 + 2048 >> 12, k5 = A3, u7[z2] = h6 + g6, u7[z2 + 7] = h6 - g6, u7[z2 + 1] = v5 + k5, u7[z2 + 6] = v5 - k5, u7[z2 + 2] = m6 + p8, u7[z2 + 5] = m6 - p8, u7[z2 + 3] = d5 + b4, u7[z2 + 4] = d5 - b4) : (A3 = c7 * C4 + 512 >> 10, u7[z2] = A3, u7[z2 + 1] = A3, u7[z2 + 2] = A3, u7[z2 + 3] = A3, u7[z2 + 4] = A3, u7[z2 + 5] = A3, u7[z2 + 6] = A3, u7[z2 + 7] = A3);
- for (var I3 = 0; I3 < 8; ++I3)
- C4 = u7[I3], 0 != ((w5 = u7[I3 + 8]) | (x4 = u7[I3 + 16]) | (y6 = u7[I3 + 24]) | (D4 = u7[I3 + 32]) | (T4 = u7[I3 + 40]) | (P3 = u7[I3 + 48]) | (L3 = u7[I3 + 56])) ? (v5 = (h6 = 4112 + ((h6 = c7 * C4 + 2048 >> 12) + (v5 = c7 * D4 + 2048 >> 12) + 1 >> 1)) - v5, A3 = (m6 = x4) * s9 + (d5 = P3) * i7 + 2048 >> 12, m6 = m6 * i7 - d5 * s9 + 2048 >> 12, d5 = A3, k5 = (b4 = (b4 = f7 * (w5 - L3) + 2048 >> 12) + (k5 = T4) + 1 >> 1) - k5, p8 = (g6 = (g6 = f7 * (w5 + L3) + 2048 >> 12) + (p8 = y6) + 1 >> 1) - p8, A3 = b4 * t7 + g6 * a11 + 2048 >> 12, b4 = b4 * a11 - g6 * t7 + 2048 >> 12, g6 = A3, A3 = p8 * o5 + k5 * r11 + 2048 >> 12, p8 = p8 * r11 - k5 * o5 + 2048 >> 12, C4 = (C4 = (h6 = h6 + d5 + 1 >> 1) + g6) < 16 ? 0 : C4 >= 4080 ? 255 : C4 >> 4, w5 = (w5 = (v5 = v5 + m6 + 1 >> 1) + (k5 = A3)) < 16 ? 0 : w5 >= 4080 ? 255 : w5 >> 4, x4 = (x4 = (m6 = v5 - m6) + p8) < 16 ? 0 : x4 >= 4080 ? 255 : x4 >> 4, y6 = (y6 = (d5 = h6 - d5) + b4) < 16 ? 0 : y6 >= 4080 ? 255 : y6 >> 4, D4 = (D4 = d5 - b4) < 16 ? 0 : D4 >= 4080 ? 255 : D4 >> 4, T4 = (T4 = m6 - p8) < 16 ? 0 : T4 >= 4080 ? 255 : T4 >> 4, P3 = (P3 = v5 - k5) < 16 ? 0 : P3 >= 4080 ? 255 : P3 >> 4, L3 = (L3 = h6 - g6) < 16 ? 0 : L3 >= 4080 ? 255 : L3 >> 4, U3[l9 + I3] = C4, U3[l9 + I3 + 8] = w5, U3[l9 + I3 + 16] = x4, U3[l9 + I3 + 24] = y6, U3[l9 + I3 + 32] = D4, U3[l9 + I3 + 40] = T4, U3[l9 + I3 + 48] = P3, U3[l9 + I3 + 56] = L3) : (A3 = (A3 = c7 * C4 + 8192 >> 14) < -2040 ? 0 : A3 >= 2024 ? 255 : A3 + 2056 >> 4, U3[l9 + I3] = A3, U3[l9 + I3 + 8] = A3, U3[l9 + I3 + 16] = A3, U3[l9 + I3 + 24] = A3, U3[l9 + I3 + 32] = A3, U3[l9 + I3 + 40] = A3, U3[l9 + I3 + 48] = A3, U3[l9 + I3 + 56] = A3);
- }
- function d4(e9, n11) {
- for (var r12 = n11.blocksPerLine, o6 = n11.blocksPerColumn, a12 = new Int16Array(64), t8 = 0; t8 < o6; t8++)
- for (var i8 = 0; i8 < r12; i8++)
- m5(n11, h5(n11, t8, i8), a12);
- return n11.blockData;
- }
- function b3(e9, n11, r12) {
- function o6(n12) {
- return e9[n12] << 8 | e9[n12 + 1];
- }
- var a12 = e9.length - 1, t8 = r12 < n11 ? r12 : n11;
- if (n11 >= a12)
- return null;
- var i8 = o6(n11);
- if (i8 >= 65472 && i8 <= 65534)
- return { invalid: null, marker: i8, offset: n11 };
- for (var s10 = o6(t8); !(s10 >= 65472 && s10 <= 65534); ) {
- if (++t8 >= a12)
- return null;
- s10 = o6(t8);
- }
- return { invalid: i8.toString(16), marker: s10, offset: t8 };
- }
- return l8.prototype = { parse: function(r12) {
- function o6() {
- var e9 = r12[c8] << 8 | r12[c8 + 1];
- return c8 += 2, e9;
- }
- function a12() {
- var e9 = o6(), n11 = c8 + e9 - 2, a13 = b3(r12, n11, c8);
- a13 && a13.invalid && (console.log("readDataBlock - incorrect length, next marker is: " + a13.invalid), n11 = a13.offset);
- var t9 = r12.subarray(c8, n11);
- return c8 += t9.length, t9;
- }
- function t8(e9) {
- for (var n11 = Math.ceil(e9.samplesPerLine / 8 / e9.maxH), r13 = Math.ceil(e9.scanLines / 8 / e9.maxV), o7 = 0; o7 < e9.components.length; o7++) {
- H = e9.components[o7];
- var a13 = Math.ceil(Math.ceil(e9.samplesPerLine / 8) * H.h / e9.maxH), t9 = Math.ceil(Math.ceil(e9.scanLines / 8) * H.v / e9.maxV), i9 = n11 * H.h, s11 = r13 * H.v * 64 * (i9 + 1);
- H.blockData = new Int16Array(s11), H.blocksPerLine = a13, H.blocksPerColumn = t9;
- }
- e9.mcusPerLine = n11, e9.mcusPerColumn = r13;
- }
- var i8, s10, c8 = 0, f8 = null, l9 = null, h6 = [], m6 = [], p8 = [], k5 = o6();
- if (65496 !== k5)
- throw new e8("SOI not found");
- for (k5 = o6(); 65497 !== k5; ) {
- var g6, C4, w5;
- switch (k5) {
- case 65504:
- case 65505:
- case 65506:
- case 65507:
- case 65508:
- case 65509:
- case 65510:
- case 65511:
- case 65512:
- case 65513:
- case 65514:
- case 65515:
- case 65516:
- case 65517:
- case 65518:
- case 65519:
- case 65534:
- var x4 = a12();
- 65504 === k5 && 74 === x4[0] && 70 === x4[1] && 73 === x4[2] && 70 === x4[3] && 0 === x4[4] && (f8 = { version: { major: x4[5], minor: x4[6] }, densityUnits: x4[7], xDensity: x4[8] << 8 | x4[9], yDensity: x4[10] << 8 | x4[11], thumbWidth: x4[12], thumbHeight: x4[13], thumbData: x4.subarray(14, 14 + 3 * x4[12] * x4[13]) }), 65518 === k5 && 65 === x4[0] && 100 === x4[1] && 111 === x4[2] && 98 === x4[3] && 101 === x4[4] && (l9 = { version: x4[5] << 8 | x4[6], flags0: x4[7] << 8 | x4[8], flags1: x4[9] << 8 | x4[10], transformCode: x4[11] });
- break;
- case 65499:
- for (var y6 = o6() + c8 - 2; c8 < y6; ) {
- var D4 = r12[c8++], T4 = new Uint16Array(64);
- if (D4 >> 4 == 0)
- for (C4 = 0; C4 < 64; C4++)
- T4[n10[C4]] = r12[c8++];
- else {
- if (D4 >> 4 != 1)
- throw new e8("DQT - invalid table spec");
- for (C4 = 0; C4 < 64; C4++)
- T4[n10[C4]] = o6();
- }
- h6[15 & D4] = T4;
- }
- break;
- case 65472:
- case 65473:
- case 65474:
- if (i8)
- throw new e8("Only single frame JPEGs supported");
- o6(), (i8 = {}).extended = 65473 === k5, i8.progressive = 65474 === k5, i8.precision = r12[c8++], i8.scanLines = o6(), i8.samplesPerLine = o6(), i8.components = [], i8.componentIds = {};
- var P3, L3 = r12[c8++], A3 = 0, _3 = 0;
- for (g6 = 0; g6 < L3; g6++) {
- P3 = r12[c8];
- var U3 = r12[c8 + 1] >> 4, z2 = 15 & r12[c8 + 1];
- A3 < U3 && (A3 = U3), _3 < z2 && (_3 = z2);
- var I3 = r12[c8 + 2];
- w5 = i8.components.push({ h: U3, v: z2, quantizationId: I3, quantizationTable: null }), i8.componentIds[P3] = w5 - 1, c8 += 3;
- }
- i8.maxH = A3, i8.maxV = _3, t8(i8);
- break;
- case 65476:
- var M3 = o6();
- for (g6 = 2; g6 < M3; ) {
- var Y = r12[c8++], q = new Uint8Array(16), S4 = 0;
- for (C4 = 0; C4 < 16; C4++, c8++)
- S4 += q[C4] = r12[c8];
- var R2 = new Uint8Array(S4);
- for (C4 = 0; C4 < S4; C4++, c8++)
- R2[C4] = r12[c8];
- g6 += 17 + S4, (Y >> 4 == 0 ? p8 : m6)[15 & Y] = u6(q, R2);
- }
- break;
- case 65501:
- o6(), s10 = o6();
- break;
- case 65498:
- o6();
- var H, E3 = r12[c8++], J = [];
- for (g6 = 0; g6 < E3; g6++) {
- var V2 = i8.componentIds[r12[c8++]];
- H = i8.components[V2];
- var j = r12[c8++];
- H.huffmanTableDC = p8[j >> 4], H.huffmanTableAC = m6[15 & j], J.push(H);
- }
- var B2 = r12[c8++], N2 = r12[c8++], G2 = r12[c8++], O4 = v4(r12, c8, i8, J, s10, B2, N2, G2 >> 4, 15 & G2);
- c8 += O4;
- break;
- case 65535:
- 255 !== r12[c8] && c8--;
- break;
- default:
- if (255 === r12[c8 - 3] && r12[c8 - 2] >= 192 && r12[c8 - 2] <= 254) {
- c8 -= 3;
- break;
- }
- throw new e8("unknown marker " + k5.toString(16));
- }
- k5 = o6();
- }
- for (this.width = i8.samplesPerLine, this.height = i8.scanLines, this.jfif = f8, this.eof = c8, this.adobe = l9, this.components = [], g6 = 0; g6 < i8.components.length; g6++) {
- var Q = h6[(H = i8.components[g6]).quantizationId];
- Q && (H.quantizationTable = Q), this.components.push({ output: d4(i8, H), scaleX: H.h / i8.maxH, scaleY: H.v / i8.maxV, blocksPerLine: H.blocksPerLine, blocksPerColumn: H.blocksPerColumn });
- }
- this.numComponents = this.components.length;
- }, _getLinearizedBlockData: function(e9, n11) {
- var r12, o6, a12, t8, i8, s10, c8, f8, l9, u7, h6, v5 = this.width / e9, m6 = this.height / n11, d5 = 0, b4 = this.components.length, p8 = e9 * n11 * b4, k5 = new Uint8ClampedArray(p8), g6 = new Uint32Array(e9), C4 = 4294967288;
- for (c8 = 0; c8 < b4; c8++) {
- for (o6 = (r12 = this.components[c8]).scaleX * v5, a12 = r12.scaleY * m6, d5 = c8, h6 = r12.output, t8 = r12.blocksPerLine + 1 << 3, i8 = 0; i8 < e9; i8++)
- f8 = 0 | i8 * o6, g6[i8] = (f8 & C4) << 3 | 7 & f8;
- for (s10 = 0; s10 < n11; s10++)
- for (u7 = t8 * ((f8 = 0 | s10 * a12) & C4) | (7 & f8) << 3, i8 = 0; i8 < e9; i8++)
- k5[d5] = h6[u7 + g6[i8]], d5 += b4;
- }
- var w5 = this.decodeTransform;
- if (w5)
- for (c8 = 0; c8 < p8; )
- for (f8 = 0, l9 = 0; f8 < b4; f8++, c8++, l9 += 2)
- k5[c8] = (k5[c8] * w5[l9] >> 8) + w5[l9 + 1];
- return k5;
- }, _isColorConversionNeeded: function() {
- return this.adobe ? !!this.adobe.transformCode : 3 === this.numComponents ? 0 !== this.colorTransform : 1 === this.colorTransform;
- }, _convertYccToRgb: function(e9) {
- for (var n11, r12, o6, a12 = 0, t8 = e9.length; a12 < t8; a12 += 3)
- n11 = e9[a12], r12 = e9[a12 + 1], o6 = e9[a12 + 2], e9[a12] = n11 - 179.456 + 1.402 * o6, e9[a12 + 1] = n11 + 135.459 - 0.344 * r12 - 0.714 * o6, e9[a12 + 2] = n11 - 226.816 + 1.772 * r12;
- return e9;
- }, _convertYcckToRgb: function(e9) {
- for (var n11, r12, o6, a12, t8 = 0, i8 = 0, s10 = e9.length; i8 < s10; i8 += 4)
- n11 = e9[i8], r12 = e9[i8 + 1], o6 = e9[i8 + 2], a12 = e9[i8 + 3], e9[t8++] = r12 * (-660635669420364e-19 * r12 + 437130475926232e-18 * o6 - 54080610064599e-18 * n11 + 48449797120281e-17 * a12 - 0.154362151871126) - 122.67195406894 + o6 * (-957964378445773e-18 * o6 + 817076911346625e-18 * n11 - 0.00477271405408747 * a12 + 1.53380253221734) + n11 * (961250184130688e-18 * n11 - 0.00266257332283933 * a12 + 0.48357088451265) + a12 * (-336197177618394e-18 * a12 + 0.484791561490776), e9[t8++] = 107.268039397724 + r12 * (219927104525741e-19 * r12 - 640992018297945e-18 * o6 + 659397001245577e-18 * n11 + 426105652938837e-18 * a12 - 0.176491792462875) + o6 * (-778269941513683e-18 * o6 + 0.00130872261408275 * n11 + 770482631801132e-18 * a12 - 0.151051492775562) + n11 * (0.00126935368114843 * n11 - 0.00265090189010898 * a12 + 0.25802910206845) + a12 * (-318913117588328e-18 * a12 - 0.213742400323665), e9[t8++] = r12 * (-570115196973677e-18 * r12 - 263409051004589e-19 * o6 + 0.0020741088115012 * n11 - 0.00288260236853442 * a12 + 0.814272968359295) - 20.810012546947 + o6 * (-153496057440975e-19 * o6 - 132689043961446e-18 * n11 + 560833691242812e-18 * a12 - 0.195152027534049) + n11 * (0.00174418132927582 * n11 - 0.00255243321439347 * a12 + 0.116935020465145) + a12 * (-343531996510555e-18 * a12 + 0.24165260232407);
- return e9;
- }, _convertYcckToCmyk: function(e9) {
- for (var n11, r12, o6, a12 = 0, t8 = e9.length; a12 < t8; a12 += 4)
- n11 = e9[a12], r12 = e9[a12 + 1], o6 = e9[a12 + 2], e9[a12] = 434.456 - n11 - 1.402 * o6, e9[a12 + 1] = 119.541 - n11 + 0.344 * r12 + 0.714 * o6, e9[a12 + 2] = 481.816 - n11 - 1.772 * r12;
- return e9;
- }, _convertCmykToRgb: function(e9) {
- for (var n11, r12, o6, a12, t8 = 0, i8 = 1 / 255, s10 = 0, c8 = e9.length; s10 < c8; s10 += 4)
- n11 = e9[s10] * i8, r12 = e9[s10 + 1] * i8, o6 = e9[s10 + 2] * i8, a12 = e9[s10 + 3] * i8, e9[t8++] = 255 + n11 * (-4.387332384609988 * n11 + 54.48615194189176 * r12 + 18.82290502165302 * o6 + 212.25662451639585 * a12 - 285.2331026137004) + r12 * (1.7149763477362134 * r12 - 5.6096736904047315 * o6 - 17.873870861415444 * a12 - 5.497006427196366) + o6 * (-2.5217340131683033 * o6 - 21.248923337353073 * a12 + 17.5119270841813) - a12 * (21.86122147463605 * a12 + 189.48180835922747), e9[t8++] = 255 + n11 * (8.841041422036149 * n11 + 60.118027045597366 * r12 + 6.871425592049007 * o6 + 31.159100130055922 * a12 - 79.2970844816548) + r12 * (-15.310361306967817 * r12 + 17.575251261109482 * o6 + 131.35250912493976 * a12 - 190.9453302588951) + o6 * (4.444339102852739 * o6 + 9.8632861493405 * a12 - 24.86741582555878) - a12 * (20.737325471181034 * a12 + 187.80453709719578), e9[t8++] = 255 + n11 * (0.8842522430003296 * n11 + 8.078677503112928 * r12 + 30.89978309703729 * o6 - 0.23883238689178934 * a12 - 14.183576799673286) + r12 * (10.49593273432072 * r12 + 63.02378494754052 * o6 + 50.606957656360734 * a12 - 112.23884253719248) + o6 * (0.03296041114873217 * o6 + 115.60384449646641 * a12 - 193.58209356861505) - a12 * (22.33816807309886 * a12 + 180.12613974708367);
- return e9;
- }, getData: function(n11, r12, o6) {
- if (this.numComponents > 4)
- throw new e8("Unsupported color mode");
- var a12 = this._getLinearizedBlockData(n11, r12);
- if (1 === this.numComponents && o6) {
- for (var t8 = a12.length, i8 = new Uint8ClampedArray(3 * t8), s10 = 0, c8 = 0; c8 < t8; c8++) {
- var f8 = a12[c8];
- i8[s10++] = f8, i8[s10++] = f8, i8[s10++] = f8;
- }
- return i8;
- }
- if (3 === this.numComponents && this._isColorConversionNeeded())
- return this._convertYccToRgb(a12);
- if (4 === this.numComponents) {
- if (this._isColorConversionNeeded())
- return o6 ? this._convertYcckToRgb(a12) : this._convertYcckToCmyk(a12);
- if (o6)
- return this._convertCmykToRgb(a12);
- }
- return a12;
- } }, l8;
- }();
- }, void 0 !== (r4 = n2()) && (e4.exports = r4);
- var a4 = o.exports;
- // node_modules/@arcgis/core/layers/support/rasterFormats/JpgPlus.js
- var r5 = class {
- static decode(r11, n10 = false) {
- const s9 = new Uint8Array(r11), o5 = new a4();
- o5.parse(s9);
- const { width: a11, height: i7, numComponents: h5, eof: l8 } = o5, f7 = o5.getData(a11, i7, true), c7 = a11 * i7;
- let g6, p8 = null, u6 = 0, m5 = 0, w5 = 0;
- if (!n10 && l8 < s9.length - 1)
- try {
- const t7 = new s5(s9.subarray(l8)).getBytes();
- p8 = new Uint8Array(c7);
- let r12 = 0;
- for (u6 = 0; u6 < t7.length; u6++)
- for (w5 = 7; w5 >= 0; w5--)
- p8[r12++] = t7[u6] >> w5 & 1;
- } catch {
- }
- if (1 === h5 && f7.length === a11 * i7)
- g6 = [f7, f7, f7];
- else {
- for (g6 = [], u6 = 0; u6 < 3; u6++)
- g6.push(new Uint8Array(c7));
- for (w5 = 0, m5 = 0; m5 < c7; m5++)
- for (u6 = 0; u6 < 3; u6++)
- g6[u6][m5] = f7[w5++];
- }
- return { width: a11, height: i7, pixels: g6, mask: p8 };
- }
- };
- // node_modules/@arcgis/core/layers/support/rasterFormats/Lerc.js
- var t3 = [{ pixelType: "S8", size: 1, ctor: Int8Array, range: [-128, 128] }, { pixelType: "U8", size: 1, ctor: Uint8Array, range: [0, 255] }, { pixelType: "S16", size: 2, ctor: Int16Array, range: [-32768, 32767] }, { pixelType: "U16", size: 2, ctor: Uint16Array, range: [0, 65536] }, { pixelType: "S32", size: 4, ctor: Int32Array, range: [-2147483648, 2147483647] }, { pixelType: "U32", size: 4, ctor: Uint32Array, range: [0, 4294967296] }, { pixelType: "F32", size: 4, ctor: Float32Array, range: [-34027999387901484e22, 34027999387901484e22] }, { pixelType: "F64", size: 8, ctor: Float64Array, range: [-17976931348623157e292, 17976931348623157e292] }];
- var n3 = null;
- var r6 = false;
- function a5() {
- return n3 || (n3 = import("./lerc-wasm-JMHVUN5O.js").then((e8) => e8.l).then(({ default: t7 }) => t7({ locateFile: (t8) => a2(`esri/layers/support/rasterFormats/${t8}`) })).then((e8) => {
- u(e8), r6 = true;
- }), n3);
- }
- var l3 = { getBlobInfo: null, decode: null };
- function s6(e8) {
- return 16 + (e8 >> 3 << 3);
- }
- function i3(e8, t7, n10) {
- n10.set(e8.slice(t7, t7 + n10.length));
- }
- function u(e8) {
- const { _malloc: n10, _free: r11, _lerc_getBlobInfo: a11, _lerc_getDataRanges: o5, _lerc_decode_4D: u6, asm: f7 } = e8;
- let c7;
- const h5 = Object.values(f7).find((t7) => t7 && "buffer" in t7 && t7.buffer === e8.HEAPU8.buffer), y6 = (e9) => {
- const t7 = e9.map((e10) => s6(e10)), r12 = t7.reduce((e10, t8) => e10 + t8), a12 = n10(r12);
- c7 = new Uint8Array(h5.buffer);
- let o6 = t7[0];
- t7[0] = a12;
- for (let n11 = 1; n11 < t7.length; n11++) {
- const e10 = t7[n11];
- t7[n11] = t7[n11 - 1] + o6, o6 = e10;
- }
- return t7;
- };
- l3.getBlobInfo = (e9) => {
- const t7 = 12, n11 = 3, l8 = new Uint8Array(4 * t7), s9 = new Uint8Array(8 * n11), [u7, f8, p8] = y6([e9.length, l8.length, s9.length]);
- c7.set(e9, u7), c7.set(l8, f8), c7.set(s9, p8);
- let g6 = a11(u7, e9.length, f8, p8, t7, n11);
- if (g6)
- throw r11(u7), `lerc-getBlobInfo: error code is ${g6}`;
- c7 = new Uint8Array(h5.buffer), i3(c7, f8, l8), i3(c7, p8, s9);
- const d4 = new Uint32Array(l8.buffer), b3 = new Float64Array(s9.buffer), [A3, w5, , m5, U3, x4, C4, T4, V2, z2, F2] = d4, I3 = { version: A3, depthCount: z2, width: m5, height: U3, validPixelCount: C4, bandCount: x4, blobSize: T4, maskCount: V2, dataType: w5, minValue: b3[0], maxValue: b3[1], maxZerror: b3[2], statistics: [], bandCountWithNoData: F2 };
- if (F2)
- return I3;
- if (1 === z2 && 1 === x4)
- return r11(u7), I3.statistics.push({ minValue: b3[0], maxValue: b3[1] }), I3;
- const D4 = z2 * x4 * 8, _3 = new Uint8Array(D4), k5 = new Uint8Array(D4);
- let B2 = u7, S4 = 0, v4 = 0, O4 = false;
- if (c7.byteLength < u7 + 2 * D4 ? (r11(u7), O4 = true, [B2, S4, v4] = y6([e9.length, D4, D4]), c7.set(e9, B2)) : [S4, v4] = y6([D4, D4]), c7.set(_3, S4), c7.set(k5, v4), g6 = o5(B2, e9.length, z2, x4, S4, v4), g6)
- throw r11(B2), O4 || r11(S4), `lerc-getDataRanges: error code is ${g6}`;
- c7 = new Uint8Array(h5.buffer), i3(c7, S4, _3), i3(c7, v4, k5);
- const $ = new Float64Array(_3.buffer), j = new Float64Array(k5.buffer), M3 = I3.statistics;
- for (let r12 = 0; r12 < x4; r12++)
- if (z2 > 1) {
- const e10 = $.slice(r12 * z2, (r12 + 1) * z2), t8 = j.slice(r12 * z2, (r12 + 1) * z2), n12 = Math.min.apply(null, e10), a12 = Math.max.apply(null, t8);
- M3.push({ minValue: n12, maxValue: a12, depthStats: { minValues: e10, maxValues: t8 } });
- } else
- M3.push({ minValue: $[r12], maxValue: j[r12] });
- return r11(B2), O4 || r11(S4), I3;
- }, l3.decode = (e9, n11) => {
- const { maskCount: a12, depthCount: o6, bandCount: l8, width: s9, height: f8, dataType: p8, bandCountWithNoData: g6 } = n11, d4 = t3[p8], b3 = s9 * f8, A3 = new Uint8Array(b3 * l8), w5 = b3 * o6 * l8 * d4.size, m5 = new Uint8Array(w5), U3 = new Uint8Array(l8), x4 = new Uint8Array(8 * l8), [C4, T4, V2, z2, F2] = y6([e9.length, A3.length, m5.length, U3.length, x4.length]);
- c7.set(e9, C4), c7.set(A3, T4), c7.set(m5, V2), c7.set(U3, z2), c7.set(x4, F2);
- const I3 = u6(C4, e9.length, a12, T4, o6, s9, f8, l8, p8, V2, z2, F2);
- if (I3)
- throw r11(C4), `lerc-decode: error code is ${I3}`;
- c7 = new Uint8Array(h5.buffer), i3(c7, V2, m5), i3(c7, T4, A3);
- let D4 = null;
- if (g6) {
- i3(c7, z2, U3), i3(c7, F2, x4), D4 = [];
- const e10 = new Float64Array(x4.buffer);
- for (let t7 = 0; t7 < U3.length; t7++)
- D4.push(U3[t7] ? e10[t7] : null);
- }
- return r11(C4), { data: m5, maskData: A3, noDataValues: D4 };
- };
- }
- function f2(e8, t7, n10, r11, a11) {
- if (n10 < 2)
- return e8;
- const o5 = new r11(t7 * n10);
- if (a11)
- for (let l8 = 0, s9 = 0; l8 < t7; l8++)
- for (let r12 = 0, a12 = l8; r12 < n10; r12++, a12 += t7)
- o5[a12] = e8[s9++];
- else
- for (let l8 = 0, s9 = 0; l8 < t7; l8++)
- for (let r12 = 0, a12 = l8; r12 < n10; r12++, a12 += t7)
- o5[s9++] = e8[a12];
- return o5;
- }
- function c3(e8, n10 = {}) {
- var _a;
- const r11 = (_a = n10.inputOffset) != null ? _a : 0, a11 = e8 instanceof Uint8Array ? e8.subarray(r11) : new Uint8Array(e8, r11), o5 = l3.getBlobInfo(a11), { data: s9, maskData: i7 } = l3.decode(a11, o5), { width: u6, height: c7, bandCount: h5, depthCount: y6, dataType: p8, maskCount: g6, statistics: d4 } = o5, b3 = t3[p8], A3 = new b3.ctor(s9.buffer), w5 = [], m5 = [], U3 = u6 * c7, x4 = U3 * y6;
- for (let t7 = 0; t7 < h5; t7++) {
- const e9 = A3.subarray(t7 * x4, (t7 + 1) * x4);
- if (n10.returnInterleaved)
- w5.push(e9);
- else {
- const t8 = f2(e9, U3, y6, b3.ctor, true);
- w5.push(t8);
- }
- m5.push(i7.subarray(t7 * x4, (t7 + 1) * x4));
- }
- const C4 = 0 === g6 ? null : 1 === g6 ? m5[0] : new Uint8Array(U3);
- if (g6 > 1) {
- C4.set(m5[0]);
- for (let e9 = 1; e9 < m5.length; e9++) {
- const t7 = m5[e9];
- for (let e10 = 0; e10 < U3; e10++)
- C4[e10] = C4[e10] & t7[e10];
- }
- }
- const { noDataValue: T4 } = n10, V2 = null != T4 && b3.range[0] <= T4 && b3.range[1] >= T4;
- if (g6 > 0 && V2)
- for (let t7 = 0; t7 < h5; t7++) {
- const e9 = w5[t7], n11 = m5[t7] || C4;
- for (let t8 = 0; t8 < U3; t8++)
- 0 === n11[t8] && (e9[t8] = T4);
- }
- const z2 = g6 === h5 && h5 > 1 ? m5 : null, { pixelType: F2 } = b3;
- return { width: u6, height: c7, bandCount: h5, pixelType: F2, depthCount: y6, statistics: d4, pixels: w5, mask: C4, bandMasks: z2 };
- }
- // node_modules/@arcgis/core/layers/support/rasterFormats/Lzw.js
- function e5(e8, n10, t7, r11 = true) {
- if (n10 % 4 != 0 || t7 % 4 != 0) {
- const i7 = new ArrayBuffer(4 * Math.ceil(t7 / 4)), l8 = new Uint8Array(i7), o5 = new Uint8Array(e8, n10, t7);
- if (r11)
- for (let e9 = 0; e9 < l8.length; e9 += 4)
- l8[e9] = o5[e9 + 3], l8[e9 + 1] = o5[e9 + 2], l8[e9 + 2] = o5[e9 + 1], l8[e9 + 3] = o5[e9];
- else
- l8.set(o5);
- return new Uint32Array(l8.buffer);
- }
- if (r11) {
- const r12 = new Uint8Array(e8, n10, t7), i7 = new Uint8Array(r12.length);
- for (let e9 = 0; e9 < i7.length; e9 += 4)
- i7[e9] = r12[e9 + 3], i7[e9 + 1] = r12[e9 + 2], i7[e9 + 2] = r12[e9 + 1], i7[e9 + 3] = r12[e9];
- return new Uint32Array(i7.buffer);
- }
- return new Uint32Array(e8, n10, t7 / 4);
- }
- function n4() {
- const e8 = [];
- for (let n10 = 0; n10 <= 257; n10++)
- e8[n10] = [n10];
- return e8;
- }
- function t4(e8, n10) {
- for (let t7 = 0; t7 < n10.length; t7++)
- e8.push(n10[t7]);
- }
- var r7 = /* @__PURE__ */ new Set();
- function i4(i7, l8, o5, f7 = true) {
- const s9 = e5(i7, l8, o5, f7);
- let a11 = 9, c7 = n4(), u6 = 32, h5 = c7.length, d4 = [], g6 = 1, w5 = s9[0], y6 = 0;
- const A3 = s9.length, U3 = 8 * (4 * A3 - o5), p8 = [];
- for (; null != w5; ) {
- if (u6 >= a11)
- u6 -= a11, y6 = w5 >>> 32 - a11, w5 <<= a11;
- else {
- y6 = w5 >>> 32 - u6, w5 = s9[g6++];
- const e9 = a11 - u6;
- u6 = 32 - e9, y6 = (y6 << e9) + (w5 >>> u6), w5 <<= e9;
- }
- if (257 === y6)
- break;
- if (256 === y6) {
- a11 = 9, c7 = n4(), h5 = c7.length, d4 = [];
- continue;
- }
- const e8 = c7[y6];
- if (null == e8) {
- if (y6 > c7.length)
- throw "data integrity issue: code does not exist on code page";
- d4.push(d4[0]), c7[h5++] = d4.slice(), t4(p8, d4);
- } else
- t4(p8, e8), d4.push(e8[0]), d4.length > 1 && (c7[h5++] = d4.slice()), d4 = e8.slice();
- if (r7.has(h5) && a11++, 0 === u6 && (w5 = s9[g6++], u6 = 32), g6 > A3 || g6 === A3 && u6 <= U3)
- break;
- }
- return new Uint8Array(p8);
- }
- r7.add(511), r7.add(1023), r7.add(2047), r7.add(4095), r7.add(8191);
- // node_modules/@arcgis/core/layers/support/rasterFormats/Raw.js
- var e6 = (e8, r11) => {
- const a11 = r11.width * r11.height, n10 = r11.pixelType;
- return Math.floor(e8.byteLength / (a11 * t5(n10)));
- };
- var t5 = (e8) => {
- let t7 = 1;
- switch (e8) {
- case Uint8Array:
- case Int8Array:
- t7 = 1;
- break;
- case Uint16Array:
- case Int16Array:
- t7 = 2;
- break;
- case Uint32Array:
- case Int32Array:
- case Float32Array:
- t7 = 4;
- break;
- case Float64Array:
- t7 = 8;
- }
- return t7;
- };
- var r8 = (e8, t7) => {
- if (8 * e8.byteLength < t7)
- return null;
- const r11 = new Uint8Array(e8, 0, Math.ceil(t7 / 8)), a11 = new Uint8Array(t7);
- let n10 = 0, s9 = 0, l8 = 0, i7 = 0;
- for (l8 = 0; l8 < r11.length - 1; l8++)
- for (s9 = r11[l8], i7 = 7; i7 >= 0; i7--)
- a11[n10++] = s9 >> i7 & 1;
- for (i7 = 7; n10 < t7 - 1; )
- s9 = r11[r11.length - 1], a11[n10++] = s9 >> i7 & 1, i7--;
- return a11;
- };
- var a6 = class {
- static decode(a11, n10) {
- const s9 = n10.pixelType, l8 = [], i7 = n10.width * n10.height, h5 = e6(a11, n10), { bandIds: c7, format: y6 } = n10, o5 = c7 && c7.length || e6(a11, n10), b3 = a11.byteLength - a11.byteLength % (i7 * t5(s9)), f7 = new s9(a11, 0, i7 * h5);
- let u6, g6, A3, p8, d4 = null;
- if ("bip" === y6)
- for (u6 = 0; u6 < o5; u6++) {
- for (A3 = new s9(i7), p8 = c7 ? c7[u6] : u6, g6 = 0; g6 < i7; g6++)
- A3[g6] = f7[g6 * h5 + p8];
- l8.push(A3);
- }
- else if ("bsq" === y6)
- for (u6 = 0; u6 < o5; u6++)
- p8 = c7 ? c7[u6] : u6, l8.push(f7.subarray(p8 * i7, (p8 + 1) * i7));
- return b3 < a11.byteLength - 1 && (d4 = r8(a11.slice(b3), i7)), { pixels: l8, mask: d4 };
- }
- };
- // node_modules/@arcgis/core/layers/support/rasterDatasets/byteStreamUtils.js
- function r9(r11, t7) {
- let n10 = 0, o5 = "", e8 = 0, f7 = 0;
- const c7 = r11.length;
- for (; n10 < c7; )
- f7 = r11[n10++], e8 = f7 >> 4, e8 < 8 ? e8 = 1 : 15 === e8 ? (e8 = 4, f7 = (7 & f7) << 18 | (63 & r11[n10++]) << 12 | (63 & r11[n10++]) << 6 | 63 & r11[n10++]) : 14 === e8 ? (e8 = 3, f7 = (15 & f7) << 12 | (63 & r11[n10++]) << 6 | 63 & r11[n10++]) : (e8 = 2, f7 = (31 & f7) << 6 | 63 & r11[n10++]), (0 !== f7 || t7) && (o5 += String.fromCharCode(f7));
- return o5;
- }
- // node_modules/@arcgis/core/layers/support/rasterFormats/TiffTags.js
- var e7 = (() => {
- const e8 = [];
- return e8[254] = "NEWSUBFILETYPE", e8[255] = "SUBFILETYPE", e8[256] = "IMAGEWIDTH", e8[257] = "IMAGELENGTH", e8[258] = "BITSPERSAMPLE", e8[259] = "COMPRESSION", e8[262] = "PHOTOMETRICINTERPRETATION", e8[263] = "THRESHHOLDING", e8[264] = "CELLWIDTH", e8[265] = "CELLLENGTH", e8[266] = "FILLORDER", e8[269] = "DOCUMENTNAME", e8[270] = "IMAGEDESCRIPTION", e8[271] = "MAKE", e8[272] = "MODEL", e8[273] = "STRIPOFFSETS", e8[274] = "ORIENTATION", e8[277] = "SAMPLESPERPIXEL", e8[278] = "ROWSPERSTRIP", e8[279] = "STRIPBYTECOUNTS", e8[280] = "MINSAMPLEVALUE", e8[281] = "MAXSAMPLEVALUE", e8[282] = "XRESOLUTION", e8[283] = "YRESOLUTION", e8[284] = "PLANARCONFIGURATION", e8[285] = "PAGENAME", e8[286] = "XPOSITION", e8[287] = "YPOSITION", e8[288] = "FREEOFFSETS", e8[289] = "FREEBYTECOUNTS", e8[290] = "GRAYRESPONSEUNIT", e8[291] = "GRAYRESPONSECURVE", e8[292] = "T4OPTIONS", e8[293] = "T6OPTIONS", e8[296] = "RESOLUTIONUNIT", e8[297] = "PAGENUMBER", e8[300] = "COLORRESPONSEUNIT", e8[301] = "TRANSFERFUNCTION", e8[305] = "SOFTWARE", e8[306] = "DATETIME", e8[315] = "ARTIST", e8[316] = "HOSTCOMPUTER", e8[317] = "PREDICTOR", e8[318] = "WHITEPOINT", e8[319] = "PRIMARYCHROMATICITIES", e8[320] = "COLORMAP", e8[321] = "HALFTONEHINTS", e8[322] = "TILEWIDTH", e8[323] = "TILELENGTH", e8[324] = "TILEOFFSETS", e8[325] = "TILEBYTECOUNTS", e8[326] = "BADFAXLINES", e8[327] = "CLEANFAXDATA", e8[328] = "CONSECUTIVEBADFAXLINES", e8[330] = "SUBIFD", e8[332] = "INKSET", e8[333] = "INKNAMES", e8[334] = "NUMBEROFINKS", e8[336] = "DOTRANGE", e8[337] = "TARGETPRINTER", e8[338] = "EXTRASAMPLES", e8[339] = "SAMPLEFORMAT", e8[340] = "SMINSAMPLEVALUE", e8[341] = "SMAXSAMPLEVALUE", e8[342] = "TRANSFERRANGE", e8[347] = "JPEGTABLES", e8[512] = "JPEGPROC", e8[513] = "JPEGIFOFFSET", e8[514] = "JPEGIFBYTECOUNT", e8[515] = "JPEGRESTARTINTERVAL", e8[517] = "JPEGLOSSLESSPREDICTORS", e8[518] = "JPEGPOINTTRANSFORM", e8[519] = "JPEGQTABLES", e8[520] = "JPEGDCTABLES", e8[521] = "JPEGACTABLES", e8[529] = "YCBCRCOEFFICIENTS", e8[530] = "YCBCRSUBSAMPLING", e8[531] = "YCBCRPOSITIONING", e8[532] = "REFERENCEBLACKWHITE", e8[700] = "XMP", e8[33550] = "GEOPIXELSCALE", e8[33922] = "GEOTIEPOINTS", e8[33432] = "COPYRIGHT", e8[42112] = "GDAL_METADATA", e8[42113] = "GDAL_NODATA", e8[50844] = "RPCCOEFFICIENT", e8[34264] = "GEOTRANSMATRIX", e8[34735] = "GEOKEYDIRECTORY", e8[34736] = "GEODOUBLEPARAMS", e8[34737] = "GEOASCIIPARAMS", e8[34665] = "EXIFIFD", e8[34853] = "GPSIFD", e8[40965] = "INTEROPERABILITYIFD", e8;
- })();
- var i5 = (() => {
- const i7 = e7.slice();
- return i7[36864] = "ExifVersion", i7[40960] = "FlashpixVersion", i7[40961] = "ColorSpace", i7[42240] = "Gamma", i7[37121] = "ComponentsConfiguration", i7[37122] = "CompressedBitsPerPixel", i7[40962] = "PixelXDimension", i7[40963] = "PixelYDimension", i7[37500] = "MakerNote", i7[37510] = "UserComment", i7[40964] = "RelatedSoundFile", i7[36867] = "DateTimeOriginal", i7[36868] = "DateTimeDigitized", i7[36880] = "OffsetTime", i7[36881] = "OffsetTimeOriginal", i7[36882] = "OffsetTimeDigitized", i7[37520] = "SubSecTime", i7[37521] = "SubSecTimeOriginal", i7[37522] = "SubSecTimeDigitized", i7[37888] = "Temperature", i7[37889] = "Humidity", i7[37890] = "Pressure", i7[37891] = "WaterDepth", i7[37892] = "Acceleration", i7[37893] = "CameraElevationAngle", i7[42016] = "ImageUniqueID", i7[42032] = "CameraOwnerName", i7[42033] = "BodySerialNumber", i7[42034] = "LensSpecification", i7[42035] = "LensMake", i7[42036] = "LensModel", i7[42037] = "LensSerialNumber", i7[33434] = "ExposureTime", i7[33437] = "FNumber", i7[34850] = "ExposureProgram", i7[34852] = "SpectralSensitivity", i7[34855] = "PhotographicSensitivity", i7[34856] = "OECF", i7[34864] = "SensitivityType", i7[34865] = "StandardOutputSensitivity", i7[34866] = "RecommendedExposureIndex", i7[34867] = "ISOSpeed", i7[34868] = "ISOSpeedLatitudeyyy", i7[34869] = "ISOSpeedLatitudezzz", i7[37377] = "ShutterSpeedValue", i7[37378] = "ApertureValue", i7[37379] = "BrightnessValue", i7[37380] = "ExposureBiasValue", i7[37381] = "MaxApertureValue", i7[37382] = "SubjectDistance", i7[37383] = "MeteringMode", i7[37384] = "LightSource", i7[37385] = "Flash", i7[37386] = "FocalLength", i7[37396] = "SubjectArea", i7[41483] = "FlashEnergy", i7[41484] = "SpatialFrequencyResponse", i7[41486] = "FocalPlaneXResolution", i7[41487] = "FocalPlaneYResolution", i7[41488] = "FocalPlaneResolutionUnit", i7[41492] = "SubjectLocation", i7[41493] = "ExposureIndex", i7[41495] = "SensingMethod", i7[41728] = "FileSource", i7[41729] = "SceneType", i7[41730] = "CFAPattern", i7[41985] = "CustomRendered", i7[41986] = "ExposureMode", i7[41987] = "WhiteBalance", i7[41988] = "DigitalZoomRatio", i7[41989] = "FocalLengthIn35mmFilm", i7[41990] = "SceneCaptureType", i7[41991] = "GainControl", i7[41992] = "Contrast", i7[41993] = "Saturation", i7[41994] = "Sharpness", i7[41995] = "DeviceSettingDescription", i7[41996] = "SubjectDistanceRange", i7;
- })();
- var t6 = ["GPSVersionID", "GPSLatitudeRef", "GPSLatitude", "GPSLongitudeRef", "GPSLongitude", "GPSAltitudeRef", "GPSAltitude", "GPSTimeStamp", "GPSSatellites", "GPSStatus", "GPSMeasureMode", "GPSDOP", "GPSSpeedRef", "GPSSpeed", "GPSTrackRef", "GPSTrack", "GPSImgDirectionRef", "GPSImgDirection", "GPSMapDatum", "GPSDestLatitudeRef", "GPSDestLatitude", "GPSDestLongitudeRef", "GPSDestLongitude", "GPSDestBearingRef", "GPSDestBearing", "GPSDestDistanceRef", "GPSDestDistance", "GPSProcessingMethod", "GPSAreaInformation", "GPSDateStamp", "GPSDifferential", "GPSHPositioningError"];
- var o2 = (() => {
- const e8 = [];
- return e8[1024] = "GTModelTypeGeoKey", e8[1025] = "GTRasterTypeGeoKey", e8[1026] = "GTCitationGeoKey", e8[2048] = "GeographicTypeGeoKey", e8[2049] = "GeogCitationGeoKey", e8[2050] = "GeogGeodeticDatumGeoKey", e8[2051] = "GeogPrimeMeridianGeoKey", e8[2052] = "GeogLinearUnitsGeoKey", e8[2053] = "GeogLinearUnitSizeGeoKey", e8[2054] = "GeogAngularUnitsGeoKey", e8[2055] = "GeogAngularUnitSizeGeoKey", e8[2056] = "GeogEllipsoidGeoKey", e8[2057] = "GeogSemiMajorAxisGeoKey", e8[2058] = "GeogSemiMinorAxisGeoKey", e8[2059] = "GeogInvFlatteningGeoKey", e8[2061] = "GeogPrimeMeridianLongGeoKey", e8[2060] = "GeogAzimuthUnitsGeoKey", e8[3072] = "ProjectedCSTypeGeoKey", e8[3073] = "PCSCitationGeoKey", e8[3074] = "ProjectionGeoKey", e8[3075] = "ProjCoordTransGeoKey", e8[3076] = "ProjLinearUnitsGeoKey", e8[3077] = "ProjLinearUnitSizeGeoKey", e8[3078] = "ProjStdParallel1GeoKey", e8[3079] = "ProjStdParallel2GeoKey", e8[3080] = "ProjNatOriginLongGeoKey", e8[3081] = "ProjNatOriginLatGeoKey", e8[3082] = "ProjFalseEastingGeoKey", e8[3083] = "ProjFalseNorthingGeoKey", e8[3084] = "ProjFalseOriginLongGeoKey", e8[3085] = "ProjFalseOriginLatGeoKey", e8[3086] = "ProjFalseOriginEastingGeoKey", e8[3087] = "ProjFalseOriginNorthingGeoKey", e8[3088] = "ProjCenterLongGeoKey", e8[3090] = "ProjCenterEastingGeoKey", e8[3091] = "ProjCenterNorthingGeoKey", e8[3092] = "ProjScaleAtNatOriginGeoKey", e8[3093] = "ProjScaleAtCenterGeoKey", e8[3094] = "ProjAzimuthAngleGeoKey", e8[3095] = "ProjStraightVertPoleLongGeoKey", e8[4096] = "VerticalCSTypeGeoKey", e8[4097] = "VerticalCitationGeoKey", e8[4098] = "VerticalDatumGeoKey", e8[4099] = "VerticalUnitsGeoKey", e8;
- })();
- var S = (i7, t7) => {
- let o5 = (t7 || e7)[i7];
- return void 0 === o5 && (o5 = "unknown" + String(i7)), o5;
- };
- var E = /* @__PURE__ */ new Map();
- E.set("EXIFIFD", i5), E.set("GPSIFD", t6);
- var n5 = { TIFF_TAGS: e7, ifdTags: E, GEO_KEYS: o2, getTagName: S };
- // node_modules/@arcgis/core/layers/support/rasterFormats/utils.js
- var r10 = (() => {
- const r11 = new ArrayBuffer(4), n10 = new Uint8Array(r11);
- return new Uint32Array(r11)[0] = 1, 1 === n10[0];
- })();
- // node_modules/@arcgis/core/layers/support/rasterFormats/TiffDecoder.js
- var f3 = [0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, -1, -1, -1, 8, 8, 8];
- var u2 = 4294967296;
- var c4 = /* @__PURE__ */ new Set([1, 5, 6, 7, 8, 34712, 34887]);
- function h(e8, t7) {
- let n10 = "unknown";
- return 3 === e8 ? n10 = 64 === t7 ? "f64" : "f32" : 1 === e8 ? 1 === t7 ? n10 = "u1" : 2 === t7 ? n10 = "u2" : 4 === t7 ? n10 = "u4" : t7 <= 8 ? n10 = "u8" : t7 <= 16 ? n10 = "u16" : t7 <= 32 && (n10 = "u32") : 2 === e8 && (t7 <= 8 ? n10 = "s8" : t7 <= 16 ? n10 = "s16" : t7 <= 32 && (n10 = "s32")), n10;
- }
- function g2(e8) {
- let t7 = null;
- switch (e8 ? e8.toLowerCase() : "f32") {
- case "u1":
- case "u2":
- case "u4":
- case "u8":
- t7 = Uint8Array;
- break;
- case "u16":
- t7 = Uint16Array;
- break;
- case "u32":
- t7 = Uint32Array;
- break;
- case "s8":
- t7 = Int8Array;
- break;
- case "s16":
- t7 = Int16Array;
- break;
- case "s32":
- t7 = Int32Array;
- break;
- case "f64":
- t7 = Float64Array;
- break;
- default:
- t7 = Float32Array;
- }
- return t7;
- }
- function w3(e8, t7) {
- return { x: t7[0] * e8.x + t7[1] * e8.y + t7[2], y: t7[3] * e8.x + t7[4] * e8.y + t7[5] };
- }
- function p4(e8, t7) {
- var _a;
- return (_a = e8.get(t7)) == null ? void 0 : _a.values;
- }
- function d(e8, t7) {
- var _a;
- return (_a = e8.get(t7)) == null ? void 0 : _a.values;
- }
- function I(e8, t7) {
- var _a, _b;
- return (_b = (_a = e8.get(t7)) == null ? void 0 : _a.values) == null ? void 0 : _b[0];
- }
- function T(e8, t7) {
- var _a, _b;
- return (_b = (_a = e8.get(t7)) == null ? void 0 : _a.values) == null ? void 0 : _b[0];
- }
- function E2(e8, t7, n10, a11 = 0, i7 = n5.TIFF_TAGS, s9 = 4) {
- const l8 = 8 === s9, o5 = l8 ? L(new DataView(e8, n10, 8), 0, t7) : new DataView(e8, n10, 2).getUint16(0, t7), f7 = 4 + 2 * s9, u6 = l8 ? 8 : 2, c7 = u6 + o5 * f7;
- if (n10 + c7 > e8.byteLength)
- return { success: false, ifd: null, nextIFD: null, requiredBufferSize: c7 };
- const h5 = n10 + c7 + 4 <= e8.byteLength ? k2(new DataView(e8, n10 + c7, 8 === s9 ? 8 : 4), 0, t7, 8 === s9) : null, g6 = n10 + u6, w5 = /* @__PURE__ */ new Map();
- let p8, d4, I3, T4, E3, y6 = 0, m5 = 0;
- for (let A3 = 0; A3 < o5; A3++) {
- d4 = new DataView(e8, g6 + f7 * A3, f7), I3 = d4.getUint16(0, t7), E3 = d4.getUint16(2, t7), T4 = n5.getTagName(I3, i7);
- const n11 = [];
- 2 === s9 ? (y6 = d4.getUint16(4, t7), m5 = d4.getUint16(6, t7)) : 4 === s9 ? (y6 = d4.getUint32(4, t7), m5 = d4.getUint32(8, t7)) : 8 === s9 && (y6 = k2(d4, 4, t7, true), m5 = k2(d4, 12, t7, true), n11.push(d4.getUint32(12, t7)), n11.push(d4.getUint32(16, t7))), p8 = { id: I3, type: E3, valueCount: y6, valueOffset: m5, valueOffsets: n11, values: null }, b(e8, t7, p8, a11, false, s9), w5.set(T4, p8);
- }
- return { success: true, ifd: w5, nextIFD: h5, requiredBufferSize: c7 };
- }
- var y4 = (e8, t7) => c3(e8, { inputOffset: t7 }).pixels[0];
- async function m(t7, i7, r11, f7, u6) {
- var _a, _b;
- const c7 = r10 === i7, w5 = T(r11, "BITSPERSAMPLE"), p8 = h((_a = T(r11, "SAMPLEFORMAT")) != null ? _a : 1, w5), d4 = (_b = T(r11, "COMPRESSION")) != null ? _b : 1, I3 = g2(p8);
- let E3, m5, A3, S4, M3, x4, b3;
- if (34887 === d4)
- return await a5(), y4(t7, f7);
- if (1 === d4)
- b3 = t7.slice(f7, f7 + u6), A3 = new Uint8Array(b3);
- else if (8 === d4 || 32946 === d4)
- A3 = new Uint8Array(t7, f7, u6), M3 = new s5(A3), x4 = M3.getBytes(), b3 = new ArrayBuffer(x4.length), A3 = new Uint8Array(b3), A3.set(x4);
- else if (6 === d4) {
- A3 = new Uint8Array(t7, f7, u6);
- const e8 = new a4();
- e8.parse(A3);
- const a11 = e8.getData(e8.width, e8.height, true);
- b3 = new ArrayBuffer(a11.length), A3 = new Uint8Array(b3), A3.set(a11);
- } else if (7 === d4) {
- const e8 = r11.get("JPEGTABLES").values, a11 = e8.length - 2;
- A3 = new Uint8Array(a11 + u6 - 2);
- for (let t8 = 0; t8 < a11; t8++)
- A3[t8] = e8[t8];
- const i8 = new Uint8Array(t7, f7 + 2, u6 - 2);
- for (let t8 = 0; t8 < i8.length; t8++)
- A3[a11 + t8] = i8[t8];
- const s9 = new a4();
- s9.parse(A3);
- const l8 = s9.getData(s9.width, s9.height, true);
- b3 = new ArrayBuffer(l8.length), A3 = new Uint8Array(b3), A3.set(l8);
- } else
- 5 === d4 && (A3 = i4(t7, f7, u6, i7), b3 = A3.buffer);
- if ("u8" === p8 || "s8" === p8 || c7)
- m5 = new I3(b3);
- else {
- switch (c(A3), b3 = new ArrayBuffer(A3.length), S4 = new Uint8Array(b3), p8) {
- case "u16":
- case "s16":
- for (E3 = 0; E3 < A3.length; E3 += 2)
- S4[E3] = A3[E3 + 1], S4[E3 + 1] = A3[E3];
- break;
- case "u32":
- case "s32":
- case "f32":
- for (E3 = 0; E3 < A3.length; E3 += 4)
- S4[E3] = A3[E3 + 3], S4[E3 + 1] = A3[E3 + 2], S4[E3 + 2] = A3[E3 + 1], S4[E3 + 3] = A3[E3];
- }
- m5 = new I3(b3);
- }
- return m5;
- }
- async function A(e8, t7, n10) {
- var _a;
- const a11 = d(n10, "TILEOFFSETS");
- if (void 0 === a11)
- return null;
- const i7 = d(n10, "TILEBYTECOUNTS"), { width: s9, height: r11, pixelType: l8, tileWidth: o5, tileHeight: f7 } = D([n10]), u6 = O(n10, t7), c7 = t7.planes, h5 = s9 * r11, w5 = T(n10, "BITSPERSAMPLE"), p8 = 34887 === ((_a = T(n10, "COMPRESSION")) != null ? _a : 1), I3 = g2(l8), E3 = [];
- for (let g6 = 0; g6 < c7; g6++)
- E3.push(new I3(h5));
- let y6, A3, S4, M3, x4, b3, U3, L3, P3, k5, N2, G2, R2;
- const C4 = Math.ceil(s9 / o5);
- if (w5 % 8 == 0) {
- if (p8 && u6 && c7 > 1) {
- const l9 = Math.round(a11.length / c7);
- for (y6 = 0; y6 < l9; y6++) {
- b3 = Math.floor(y6 / C4) * f7, U3 = y6 % C4 * o5, L3 = b3 * s9 + U3;
- for (let l10 = 0; l10 < c7; l10++) {
- const u7 = y6 * c7 + l10;
- if (0 !== i7[u7])
- for (S4 = await m(e8, t7.littleEndian, n10, a11[u7], i7[u7]), k5 = 0, P3 = L3, G2 = Math.min(o5, s9 - U3), N2 = Math.min(f7, r11 - b3), R2 = E3[l10], M3 = 0; M3 < N2; M3++)
- for (P3 = L3 + M3 * s9, k5 = M3 * o5, x4 = 0; x4 < G2; x4++, P3++, k5++)
- R2[P3] = S4[k5];
- }
- }
- } else
- for (y6 = 0; y6 < a11.length; y6++)
- if (0 !== i7[y6])
- for (b3 = Math.floor(y6 / C4) * f7, U3 = y6 % C4 * o5, L3 = b3 * s9 + U3, S4 = await m(e8, t7.littleEndian, n10, a11[y6], i7[y6]), k5 = 0, P3 = L3, G2 = Math.min(o5, s9 - U3), N2 = Math.min(f7, r11 - b3), A3 = 0; A3 < c7; A3++)
- if (R2 = E3[A3], u6 || p8)
- for (M3 = 0; M3 < N2; M3++)
- for (P3 = L3 + M3 * s9, k5 = o5 * f7 * A3 + M3 * o5, x4 = 0; x4 < G2; x4++, P3++, k5++)
- R2[P3] = S4[k5];
- else
- for (M3 = 0; M3 < N2; M3++)
- for (P3 = L3 + M3 * s9, k5 = M3 * o5 * c7 + A3, x4 = 0; x4 < G2; x4++, P3++, k5 += c7)
- R2[P3] = S4[k5];
- }
- return { width: s9, height: r11, pixelType: l8, pixels: E3 };
- }
- var S2 = (t7, a11, i7) => {
- var _a;
- const r11 = r10 === a11.littleEndian, f7 = d(i7, "STRIPOFFSETS");
- if (void 0 === f7)
- return null;
- const { width: u6, height: c7, pixelType: h5 } = D([i7]), w5 = a11.planes, p8 = u6 * c7, I3 = T(i7, "BITSPERSAMPLE"), E3 = g2(h5), y6 = new E3(p8 * w5), m5 = d(i7, "STRIPBYTECOUNTS"), A3 = T(i7, "ROWSPERSTRIP"), S4 = (_a = T(i7, "COMPRESSION")) != null ? _a : 1;
- let M3, x4, b3, O4, U3, L3, P3, k5, N2, G2, R2, C4 = A3;
- if (I3 % 8 == 0)
- for (M3 = 0; M3 < f7.length; M3++) {
- if (U3 = M3 * (A3 * u6) * w5, C4 = (M3 + 1) * A3 > c7 ? c7 - M3 * A3 : A3, "u8" === h5 || "s8" === h5 || r11) {
- if (8 === S4 || 32946 === S4)
- P3 = new Uint8Array(t7, f7[M3], m5[M3]), G2 = new s5(P3), R2 = G2.getBytes(), L3 = new ArrayBuffer(R2.length), P3 = new Uint8Array(L3), P3.set(R2), P3.length !== C4 * u6 * w5 * I3 / 8 && console.log("strip byte counts is different than expected");
- else if (6 === S4) {
- P3 = new Uint8Array(t7, f7[M3], m5[M3]);
- const e8 = new a4();
- e8.parse(P3);
- const a12 = e8.getData(e8.width, e8.height, true);
- L3 = new ArrayBuffer(a12.length), P3 = new Uint8Array(L3), P3.set(a12);
- } else
- 5 === S4 ? (P3 = i4(t7, f7[M3], m5[M3], a11.littleEndian), L3 = P3.buffer) : (m5[M3] !== C4 * u6 * w5 * I3 / 8 && console.log("strip byte counts is different than expected"), L3 = t7.slice(f7[M3], f7[M3] + m5[M3]));
- O4 = new E3(L3);
- } else {
- switch (6 === S4 || 8 === S4 || 32946 === S4 ? (P3 = new Uint8Array(t7, f7[M3], m5[M3]), G2 = new s5(P3), P3 = G2.getBytes(), L3 = new ArrayBuffer(P3.length), k5 = new Uint8Array(L3), P3.length !== C4 * u6 * w5 * I3 / 8 && console.log("strip byte counts is different than expected")) : (m5[M3] !== C4 * u6 * w5 * I3 / 8 && console.log("strip byte counts is different than expected"), L3 = new ArrayBuffer(m5[M3]), P3 = new Uint8Array(t7, f7[M3], m5[M3]), k5 = new Uint8Array(L3)), h5) {
- case "u16":
- case "s16":
- for (b3 = 0; b3 < P3.length; b3 += 2)
- k5[b3] = P3[b3 + 1], k5[b3 + 1] = P3[b3];
- break;
- case "u32":
- case "s32":
- case "f32":
- for (b3 = 0; b3 < P3.length; b3 += 4)
- k5[b3] = P3[b3 + 3], k5[b3 + 1] = P3[b3 + 2], k5[b3 + 2] = P3[b3 + 1], k5[b3 + 3] = P3[b3];
- }
- c(L3), O4 = new E3(L3);
- }
- y6.set(O4, U3);
- }
- const F2 = [];
- if (1 === w5)
- F2.push(y6);
- else
- for (M3 = 0; M3 < w5; M3++) {
- for (N2 = new E3(p8), x4 = 0; x4 < p8; x4++)
- N2[x4] = y6[x4 * w5 + M3];
- F2.push(N2);
- }
- return { width: u6, height: c7, pixelType: h5, pixels: F2 };
- };
- var M = (e8, t7, n10) => {
- if (!(e8 && e8.length > 0 && t7 && n10))
- return null;
- let a11, i7, s9;
- const r11 = e8[0].length, l8 = e8.length, o5 = new Uint8Array(r11);
- for (let f7 = 0; f7 < l8; f7++)
- if (a11 = e8[f7], i7 = t7[f7], s9 = n10[f7], 0 === f7)
- for (let e9 = 0; e9 < r11; e9++)
- o5[e9] = a11[e9] < i7 || a11[e9] > s9 ? 0 : 1;
- else
- for (let e9 = 0; e9 < r11; e9++)
- o5[e9] && (o5[e9] = a11[e9] < i7 || a11[e9] > s9 ? 0 : 1);
- return o5;
- };
- var x = (e8) => {
- if (!e8)
- return null;
- const t7 = e8.match(/<Item(.*?)Item>/gi);
- if (!t7 || 0 === t7.length)
- return null;
- const n10 = /* @__PURE__ */ new Map();
- let a11, i7, s9, r11, l8;
- for (let I3 = 0; I3 < t7.length; I3++)
- a11 = t7[I3], i7 = a11.slice("<Item ".length, a11.indexOf(">")), r11 = a11.indexOf("sample="), r11 > -1 && (l8 = a11.slice(r11 + 'sample="'.length, a11.indexOf('"', r11 + 'sample="'.length))), r11 = a11.indexOf("name="), r11 > -1 && (i7 = a11.slice(r11 + 'name="'.length, a11.indexOf('"', r11 + 'name="'.length))), i7 && (s9 = a11.slice(a11.indexOf(">") + 1, a11.indexOf("</Item>")).trim(), null != l8 ? n10.has(i7) ? n10.get(i7)[l8] = s9 : n10.set(i7, [s9]) : n10.set(i7, s9)), l8 = null;
- const o5 = n10.get("STATISTICS_MINIMUM"), f7 = n10.get("STATISTICS_MAXIMUM"), u6 = n10.get("STATISTICS_MEAN"), c7 = n10.get("STATISTICS_STDDEV");
- let h5 = null;
- if (o5 && f7) {
- h5 = [];
- for (let e9 = 0; e9 < o5.length; e9++)
- h5.push({ min: parseFloat(o5[e9]), max: parseFloat(f7[e9]), avg: u6 && parseFloat(u6[e9]), stddev: c7 && parseFloat(c7[e9]) });
- }
- const g6 = n10.get("BandName"), w5 = n10.get("WavelengthMin"), p8 = n10.get("WavelengthMax");
- let d4 = null;
- if (g6) {
- d4 = [];
- for (let e9 = 0; e9 < g6.length; e9++)
- d4.push({ BandName: g6[e9], WavelengthMin: w5 && parseFloat(w5[e9]), WavelengthMax: p8 && parseFloat(p8[e9]) });
- }
- return { statistics: h5, bandProperties: d4, dataType: n10.get("DataType"), rawMetadata: n10 };
- };
- function b(e8, t7, n10, a11 = 0, i7 = false, s9 = 4) {
- if (n10.values)
- return true;
- const r11 = n10.type, l8 = n10.valueCount;
- let o5 = n10.valueOffset, c7 = [];
- const h5 = f3[r11], g6 = 8 * h5, w5 = l8 * h5, p8 = l8 * f3[r11] * 8;
- let d4, I3;
- const T4 = 8 === s9 ? 64 : 32, E3 = n10.valueOffsets;
- if (p8 > T4) {
- if (w5 > (i7 ? e8.byteLength : e8 ? e8.byteLength - o5 + a11 : 0))
- return n10.offlineOffsetSize = [o5, w5], n10.values = null, false;
- }
- if (p8 <= T4) {
- if (!t7)
- if (T4 <= 32)
- o5 >>>= 32 - p8;
- else {
- const e9 = (E3 == null ? void 0 : E3.length) ? E3[0] : o5 >>> 0, t8 = (E3 == null ? void 0 : E3.length) ? E3[1] : Math.round((o5 - e9) / u2);
- p8 <= 32 ? (o5 = e9 >>> 32 - p8, E3[0] = o5) : (o5 = e9 * 2 ** (32 - p8) + (t8 >>> 32 - p8), E3[0] = e9, E3[1] = t8 >>> 32 - p8);
- }
- if (1 === l8 && g6 === T4)
- c7 = [o5];
- else if (64 === T4) {
- const e9 = (E3 == null ? void 0 : E3.length) ? E3[0] : o5 >>> 0, t8 = (E3 == null ? void 0 : E3.length) ? E3[1] : Math.round((o5 - e9) / u2);
- let n11 = e9, a12 = 32;
- for (I3 = 1; I3 <= l8; I3++) {
- const e10 = 32 - g6 * I3 % 32;
- if (a12 < g6) {
- const i8 = n11 << e10 >>> 32 - a12, s10 = t8 << 32 - a12 >>> 32 - a12;
- n11 = t8, c7.push(i8 + s10 * 2 ** (g6 - a12)), a12 -= 32 - (g6 - a12);
- } else
- c7.push(n11 << e10 >>> 32 - g6), a12 -= g6;
- 0 === a12 && (a12 = 32, n11 = t8);
- }
- } else
- for (I3 = 1; I3 <= l8; I3++) {
- const e9 = 32 - g6 * I3;
- c7.push(o5 << e9 >>> 32 - g6);
- }
- } else {
- o5 -= a11, i7 && (o5 = 0);
- for (let n11 = o5; n11 < o5 + w5; n11 += h5) {
- switch (r11) {
- case 1:
- case 2:
- case 7:
- d4 = new DataView(e8, n11, 1).getUint8(0);
- break;
- case 3:
- d4 = new DataView(e8, n11, 2).getUint16(0, t7);
- break;
- case 4:
- case 13:
- d4 = new DataView(e8, n11, 4).getUint32(0, t7);
- break;
- case 5:
- d4 = new DataView(e8, n11, 4).getUint32(0, t7) / new DataView(e8, n11 + 4, 4).getUint32(0, t7);
- break;
- case 6:
- d4 = new DataView(e8, n11, 1).getInt8(0);
- break;
- case 8:
- d4 = new DataView(e8, n11, 2).getInt16(0, t7);
- break;
- case 9:
- d4 = new DataView(e8, n11, 4).getInt32(0, t7);
- break;
- case 10:
- d4 = new DataView(e8, n11, 4).getInt32(0, t7) / new DataView(e8, n11 + 4, 4).getInt32(0, t7);
- break;
- case 11:
- d4 = new DataView(e8, n11, 4).getFloat32(0, t7);
- break;
- case 12:
- d4 = new DataView(e8, n11, 8).getFloat64(0, t7);
- break;
- case 16:
- case 18:
- d4 = L(new DataView(e8, n11, 8), 0, t7);
- break;
- case 17:
- d4 = P(new DataView(e8, n11, 8), 0, t7);
- break;
- default:
- d4 = null;
- }
- c7.push(d4);
- }
- }
- if (2 === r11) {
- let e9 = "";
- const t8 = c7;
- for (c7 = [], I3 = 0; I3 < t8.length; I3++)
- 0 === t8[I3] && "" !== e9 ? (c7.push(e9), e9 = "") : e9 += String.fromCharCode(t8[I3]);
- "" === e9 && 0 !== c7.length || c7.push(e9);
- }
- return n10.values = c7, true;
- }
- function D(e8) {
- var _a, _b;
- const t7 = e8[0], n10 = T(t7, "TILEWIDTH"), a11 = T(t7, "TILELENGTH"), i7 = T(t7, "IMAGEWIDTH"), s9 = T(t7, "IMAGELENGTH"), r11 = T(t7, "BITSPERSAMPLE"), l8 = T(t7, "SAMPLESPERPIXEL"), o5 = (_a = T(t7, "SAMPLEFORMAT")) != null ? _a : 1, f7 = h(o5, r11), u6 = O(t7), g6 = p4(t7, "GDAL_NODATA");
- let E3 = null;
- (g6 == null ? void 0 : g6.length) && (E3 = g6.map((e9) => parseFloat(e9)), E3.some((e9) => isNaN(e9)) && (E3 = null));
- const y6 = (_b = T(t7, "COMPRESSION")) != null ? _b : 1;
- let m5;
- switch (y6) {
- case 1:
- m5 = "NONE";
- break;
- case 2:
- case 3:
- case 4:
- case 32771:
- m5 = "CCITT";
- break;
- case 5:
- m5 = "LZW";
- break;
- case 6:
- case 7:
- m5 = "JPEG";
- break;
- case 32773:
- m5 = "PACKBITS";
- break;
- case 8:
- case 32946:
- m5 = "DEFLATE";
- break;
- case 34712:
- m5 = "JPEG2000";
- break;
- case 34887:
- m5 = "LERC";
- break;
- default:
- m5 = String(y6);
- }
- let A3 = true, S4 = "";
- c4.has(y6) || (A3 = false, S4 += "unsupported tag compression " + y6), o5 > 3 && (A3 = false, S4 += "unsupported tag sampleFormat " + o5), r11 % 8 != 0 && (A3 = false, S4 += "unsupported tag bitsPerSample " + r11);
- const M3 = I(t7, "GEOASCIIPARAMS");
- let b3;
- if (M3) {
- const e9 = M3.split("|").find((e10) => e10.includes("ESRI PE String = ")), t8 = e9 ? e9.replace("ESRI PE String = ", "") : "";
- b3 = t8.startsWith("COMPD_CS") || t8.startsWith("PROJCS") || t8.startsWith("GEOGCS") ? { wkid: null, wkt: t8 } : null;
- }
- const D4 = d(t7, "GEOTIEPOINTS"), U3 = d(t7, "GEOPIXELSCALE"), L3 = d(t7, "GEOTRANSMATRIX"), P3 = t7.has("GEOKEYDIRECTORY") ? t7.get("GEOKEYDIRECTORY").data : null;
- let k5, N2, G2 = false;
- if (P3) {
- G2 = 2 === T(P3, "GTRasterTypeGeoKey");
- const e9 = T(P3, "GTModelTypeGeoKey");
- if (2 === e9) {
- const e10 = T(P3, "GeographicTypeGeoKey");
- e10 >= 1024 && e10 <= 32766 && (b3 = { wkid: e10 });
- } else if (1 === e9) {
- const e10 = T(P3, "ProjectedCSTypeGeoKey");
- e10 >= 1024 && e10 <= 32766 && (b3 = { wkid: e10 });
- }
- }
- if (U3 && D4 && D4.length >= 6 ? (k5 = [U3[0], 0, D4[3] - D4[0] * U3[0], 0, -Math.abs(U3[1]), D4[4] - D4[1] * U3[1]], G2 && (k5[2] -= 0.5 * k5[0] + 0.5 * k5[1], k5[5] -= 0.5 * k5[3] + 0.5 * k5[4])) : L3 && 16 === L3.length && (k5 = G2 ? [L3[0], L3[1], L3[3] - 0.5 * L3[0], L3[4], L3[5], L3[7] - 0.5 * L3[5]] : [L3[0], L3[1], L3[3], L3[4], L3[5], L3[7]]), k5) {
- const e9 = [{ x: 0, y: s9 }, { x: 0, y: 0 }, { x: i7, y: s9 }, { x: i7, y: 0 }];
- let t8, n11 = Number.POSITIVE_INFINITY, a12 = Number.POSITIVE_INFINITY, r12 = Number.NEGATIVE_INFINITY, l9 = Number.NEGATIVE_INFINITY;
- for (let i8 = 0; i8 < e9.length; i8++)
- t8 = w3(e9[i8], k5), n11 = t8.x > n11 ? n11 : t8.x, r12 = t8.x < r12 ? r12 : t8.x, a12 = t8.y > a12 ? a12 : t8.y, l9 = t8.y < l9 ? l9 : t8.y;
- N2 = { xmin: n11, xmax: r12, ymin: a12, ymax: l9, spatialReference: b3 };
- } else
- N2 = { xmin: -0.5, ymin: 0.5 - s9, xmax: i7 - 0.5, ymax: 0.5, spatialReference: b3 };
- const C4 = e8.filter((e9) => 1 === I(e9, "NEWSUBFILETYPE"));
- let F2, v4, B2, V2, W;
- if (C4.length > 0) {
- B2 = Math.round(Math.log(i7 / T(C4[0], "IMAGEWIDTH")) / Math.LN2);
- const e9 = C4[C4.length - 1];
- V2 = Math.round(Math.log(i7 / T(e9, "IMAGEWIDTH")) / Math.LN2), F2 = T(e9, "TILEWIDTH"), v4 = T(e9, "TILELENGTH");
- }
- F2 = null != V2 && V2 > 0 ? F2 || n10 : null, v4 = null != V2 && V2 > 0 ? v4 || a11 : null, n10 && (W = [{ maxCol: Math.ceil(i7 / n10) - 1, maxRow: Math.ceil(s9 / a11) - 1, minRow: 0, minCol: 0 }], C4.forEach((e9) => {
- W.push({ maxCol: Math.ceil(T(e9, "IMAGEWIDTH") / T(e9, "TILEWIDTH")) - 1, maxRow: Math.ceil(T(e9, "IMAGELENGTH") / T(e9, "TILELENGTH")) - 1, minRow: 0, minCol: 0 });
- }));
- const H = I(e8[0], "GDAL_METADATA"), Y = x(H);
- return S4 += " " + R({ width: i7, height: s9, tileWidth: n10, tileHeight: a11, planes: l8, ifds: e8 }), { width: i7, height: s9, tileWidth: n10, tileHeight: a11, planes: l8, isBSQ: u6, pixelType: f7, compression: m5, noData: E3, isSupported: A3, message: S4, extent: N2, affine: U3 ? null : k5, firstPyramidLevel: B2, maximumPyramidLevel: V2, pyramidBlockWidth: F2, pyramidBlockHeight: v4, tileBoundary: W, metadata: Y };
- }
- function O(e8, t7) {
- const n10 = p4(e8, "PLANARCONFIGURATION");
- return n10 ? 2 === n10[0] : !!t7 && t7.isBSQ;
- }
- function U(e8) {
- const { littleEndian: t7, isBigTiff: n10, firstIFDPos: a11 } = N(e8);
- let i7 = a11;
- const s9 = [];
- do {
- const a12 = G(e8, t7, i7, 0, n5.TIFF_TAGS, n10 ? 8 : 4);
- if (!a12.success)
- break;
- s9.push(a12.ifd), i7 = a12.nextIFD;
- } while (i7 > 0);
- return { ...D(s9), littleEndian: t7, isBigTiff: n10, ifds: s9 };
- }
- function L(e8, t7, n10) {
- const a11 = e8.getUint32(t7, n10), i7 = e8.getUint32(t7 + 4, n10);
- return n10 ? i7 * u2 + a11 : a11 * u2 + i7;
- }
- function P(e8, t7, n10) {
- let a11 = n10 ? e8.getInt32(t7, n10) : e8.getUint32(t7, n10), i7 = n10 ? e8.getUint32(t7 + 4, n10) : e8.getInt32(t7 + 4, n10);
- const s9 = (n10 ? a11 : i7) >= 0 ? 1 : -1;
- n10 ? a11 *= s9 : i7 *= s9;
- return s9 * (n10 ? i7 * u2 + a11 : a11 * u2 + i7);
- }
- function k2(e8, t7, n10, a11) {
- return a11 ? L(e8, t7, n10) : e8.getUint32(t7, n10);
- }
- function N(e8) {
- const t7 = new DataView(e8, 0, 16), n10 = t7.getUint16(0, false);
- let a11 = null;
- if (18761 === n10)
- a11 = true;
- else {
- if (19789 !== n10)
- throw "unexpected endianess byte";
- a11 = false;
- }
- const i7 = t7.getUint16(2, a11);
- if (42 !== i7 && 43 !== i7)
- throw "unexpected tiff identifier";
- let s9 = 4;
- const r11 = 43 === i7;
- if (r11) {
- const e9 = t7.getUint16(s9, a11);
- if (s9 += 2, 8 !== e9)
- throw "unsupported bigtiff version";
- if (0 !== t7.getUint16(s9, a11))
- throw "unsupported bigtiff version";
- s9 += 2;
- }
- return { littleEndian: a11, isBigTiff: r11, firstIFDPos: k2(t7, s9, a11, r11) };
- }
- function G(e8, n10, a11, i7 = 0, s9 = n5.TIFF_TAGS, l8 = 4) {
- const o5 = E2(e8, n10, a11, i7, s9, l8);
- let f7;
- const u6 = o5.ifd;
- if (u6) {
- if (n5.ifdTags.forEach((t7, a12) => {
- u6.has(a12) && (f7 = u6.get(a12), f7.data = E2(e8, n10, f7.valueOffset - i7, i7, t7).ifd);
- }), u6.has("GEOKEYDIRECTORY")) {
- f7 = u6.get("GEOKEYDIRECTORY");
- const t7 = f7.values;
- if (t7 && t7.length > 4) {
- const a12 = t7[0] + "." + t7[1] + "." + t7[2];
- f7.data = E2(e8, n10, f7.valueOffset + 6 - i7, i7, n5.GEO_KEYS, 2).ifd, f7.data && f7.data.set("GEOTIFFVersion", { id: 0, type: 2, valueCount: 1, valueOffset: null, values: [a12] });
- }
- }
- if (u6.has("XMP")) {
- f7 = u6.get("XMP");
- const e9 = f7.values;
- "number" == typeof e9[0] && 7 === f7.type && (f7.values = [r9(new Uint8Array(e9))]);
- }
- }
- return o5;
- }
- function R(e8) {
- const { width: t7, height: n10, tileHeight: a11, tileWidth: i7 } = e8, s9 = e8.planes, r11 = i7 ? i7 * a11 : t7 * n10, l8 = T(e8.ifds[0], "BITSPERSAMPLE");
- let o5 = "";
- return r11 * s9 > 2 ** 30 / (l8 > 8 ? l8 / 8 : 1) && (o5 = i7 ? "tiled tiff exceeding 1 gigabits per tile is not supported" : "scanline tiff exceeding 1 gigabits is not supported"), o5;
- }
- async function C(e8, t7) {
- var _a;
- const { headerInfo: n10, ifd: a11, offsets: i7, sizes: s9 } = t7, r11 = [];
- for (let g6 = 0; g6 < i7.length; g6++) {
- const t8 = await m(e8, n10.littleEndian, a11, i7[g6], s9[g6] || e8.byteLength);
- r11.push(t8);
- }
- const l8 = O(a11, n10), { pixelType: o5, planes: f7 } = n10, u6 = g2(o5), c7 = T(a11, "TILEWIDTH"), h5 = T(a11, "TILELENGTH"), w5 = (_a = T(a11, "COMPRESSION")) != null ? _a : 1, p8 = c7 * h5;
- let d4;
- const I3 = [];
- let E3 = r11[0];
- const y6 = 34887 === w5;
- for (let g6 = 0; g6 < f7; g6++) {
- if (d4 = new u6(p8), l8 && y6) {
- if (E3 = r11[g6], E3.length)
- for (let e9 = 0; e9 < p8; e9++)
- d4[e9] = E3[g6][e9 + g6];
- } else if (E3.length)
- if (l8 || y6 && !l8)
- d4 = E3.slice(p8 * g6, p8 * (g6 + 1));
- else
- for (let e9 = 0; e9 < p8; e9++)
- d4[e9] = E3[e9 * f7 + g6];
- I3.push(d4);
- }
- const A3 = n10.noData ? n10.noData[0] : t7.noDataValue, S4 = n10.metadata ? n10.metadata.statistics : null, x4 = S4 ? S4.map((e9) => e9.min) : null, b3 = S4 ? S4.map((e9) => e9.max) : null;
- let D4, U3 = null;
- if (null != A3)
- if (U3 = new Uint8Array(p8), Math.abs(A3) > 1e24)
- for (D4 = 0; D4 < p8; D4++)
- Math.abs((I3[0][D4] - A3) / A3) < 1e-6 ? U3[D4] = 0 : U3[D4] = 1;
- else
- for (D4 = 0; D4 < p8; D4++)
- I3[0][D4] === A3 ? U3[D4] = 0 : U3[D4] = 1;
- else
- x4 && b3 && t7.applyMinMaxConstraint && (U3 = M(I3, x4, b3));
- return { pixelType: o5, width: c7, height: h5, pixels: I3, mask: U3, noDataValue: A3 };
- }
- async function F(t7, n10 = {}) {
- const a11 = n10.pyramidLevel || 0, i7 = n10.headerInfo || U(t7), { ifds: s9, noData: r11 } = i7;
- if (0 === s9.length)
- throw "no valid image file directory";
- const l8 = R(i7);
- if (l8)
- throw l8;
- let o5, f7 = null;
- const u6 = -1 === a11 ? s9[s9.length - 1] : s9[a11], c7 = r11 ? r11[0] : n10.noDataValue;
- if (f7 = i7.tileWidth ? await A(t7, i7, u6) : await S2(t7, i7, u6), null != c7) {
- if (c(f7), f7.mask = new Uint8Array(f7.width * f7.height), Math.abs(c7) > 1e24)
- for (o5 = 0; o5 < f7.width * f7.height; o5++)
- Math.abs((f7.pixels[0][o5] - c7) / c7) < 1e-6 ? f7.mask[o5] = 0 : f7.mask[o5] = 1;
- else
- for (o5 = 0; o5 < f7.width * f7.height; o5++)
- f7.pixels[0][o5] === c7 ? f7.mask[o5] = 0 : f7.mask[o5] = 1;
- f7.noDataValue = c7;
- }
- return f7;
- }
- // node_modules/@arcgis/core/layers/support/rasterFormats/RasterCodec.js
- var f4 = function(t7) {
- var e8, i7, a11, s9, r11, n10;
- function o5(t8) {
- var e9, i8, a12, s10, r12, n11, o6, h5, c7, p8, l8, d4, u6;
- for (this.data = t8, this.pos = 8, this.palette = [], this.imgData = [], this.transparency = {}, this.animation = null, this.text = {}, r12 = null; ; ) {
- switch (e9 = this.readUInt32(), h5 = function() {
- var t9, e10;
- for (e10 = [], t9 = 0; t9 < 4; ++t9)
- e10.push(String.fromCharCode(this.data[this.pos++]));
- return e10;
- }.call(this).join(""), h5) {
- case "IHDR":
- this.width = this.readUInt32(), this.height = this.readUInt32(), this.bits = this.data[this.pos++], this.colorType = this.data[this.pos++], this.compressionMethod = this.data[this.pos++], this.filterMethod = this.data[this.pos++], this.interlaceMethod = this.data[this.pos++];
- break;
- case "acTL":
- this.animation = { numFrames: this.readUInt32(), numPlays: this.readUInt32() || 1 / 0, frames: [] };
- break;
- case "PLTE":
- this.palette = this.read(e9);
- break;
- case "fcTL":
- r12 && this.animation.frames.push(r12), this.pos += 4, r12 = { width: this.readUInt32(), height: this.readUInt32(), xOffset: this.readUInt32(), yOffset: this.readUInt32() }, s10 = this.readUInt16(), a12 = this.readUInt16() || 100, r12.delay = 1e3 * s10 / a12, r12.disposeOp = this.data[this.pos++], r12.blendOp = this.data[this.pos++], r12.data = [];
- break;
- case "IDAT":
- case "fdAT":
- for ("fdAT" === h5 && (this.pos += 4, e9 -= 4), t8 = (null != r12 ? r12.data : void 0) || this.imgData, l8 = 0; 0 <= e9 ? l8 < e9 : l8 > e9; 0 <= e9 ? ++l8 : --l8)
- t8.push(this.data[this.pos++]);
- break;
- case "tRNS":
- switch (this.transparency = {}, this.colorType) {
- case 3:
- if (this.transparency.indexed = this.read(e9), (c7 = 255 - this.transparency.indexed.length) > 0)
- for (d4 = 0; 0 <= c7 ? d4 < c7 : d4 > c7; 0 <= c7 ? ++d4 : --d4)
- this.transparency.indexed.push(255);
- break;
- case 0:
- this.transparency.grayscale = this.read(e9)[0];
- break;
- case 2:
- this.transparency.rgb = this.read(e9);
- }
- break;
- case "tEXt":
- n11 = (p8 = this.read(e9)).indexOf(0), o6 = String.fromCharCode.apply(String, p8.slice(0, n11)), this.text[o6] = String.fromCharCode.apply(String, p8.slice(n11 + 1));
- break;
- case "IEND":
- return r12 && this.animation.frames.push(r12), this.colors = function() {
- switch (this.colorType) {
- case 0:
- case 3:
- case 4:
- return 1;
- case 2:
- case 6:
- return 3;
- }
- }.call(this), this.hasAlphaChannel = 4 === (u6 = this.colorType) || 6 === u6, i8 = this.colors + (this.hasAlphaChannel ? 1 : 0), this.pixelBitlength = this.bits * i8, this.colorSpace = function() {
- switch (this.colors) {
- case 1:
- return "DeviceGray";
- case 3:
- return "DeviceRGB";
- }
- }.call(this), void (this.imgData = new Uint8Array(this.imgData));
- default:
- this.pos += e9;
- }
- if (this.pos += 4, this.pos > this.data.length)
- throw new Error("Incomplete or corrupt PNG file");
- }
- }
- return o5.load = function(t8, e9, i8) {
- var a12;
- return "function" == typeof e9 && (i8 = e9), (a12 = new XMLHttpRequest()).open("GET", t8, true), a12.responseType = "arraybuffer", a12.onload = function() {
- var t9;
- return t9 = new o5(new Uint8Array(a12.response || a12.mozResponseArrayBuffer)), "function" == typeof (null != e9 ? e9.getContext : void 0) && t9.render(e9), "function" == typeof i8 ? i8(t9) : void 0;
- }, a12.send(null);
- }, i7 = 1, a11 = 2, e8 = 0, o5.prototype.read = function(t8) {
- var e9, i8;
- for (i8 = [], e9 = 0; 0 <= t8 ? e9 < t8 : e9 > t8; 0 <= t8 ? ++e9 : --e9)
- i8.push(this.data[this.pos++]);
- return i8;
- }, o5.prototype.readUInt32 = function() {
- return this.data[this.pos++] << 24 | this.data[this.pos++] << 16 | this.data[this.pos++] << 8 | this.data[this.pos++];
- }, o5.prototype.readUInt16 = function() {
- return this.data[this.pos++] << 8 | this.data[this.pos++];
- }, o5.prototype.decodePixels = function(t8) {
- var e9, i8, a12, s10, r12, n11, o6, h5, p8, l8, d4, u6, f7, m5, g6, w5, y6, x4, b3, k5, I3, T4, v4;
- if (null == t8 && (t8 = this.imgData), 0 === t8.length)
- return new Uint8Array(0);
- for (t8 = (t8 = new s5(t8)).getBytes(), w5 = (u6 = this.pixelBitlength / 8) * this.width, f7 = new Uint8Array(w5 * this.height), n11 = t8.length, g6 = 0, m5 = 0, i8 = 0; m5 < n11; ) {
- switch (t8[m5++]) {
- case 0:
- for (s10 = b3 = 0; b3 < w5; s10 = b3 += 1)
- f7[i8++] = t8[m5++];
- break;
- case 1:
- for (s10 = k5 = 0; k5 < w5; s10 = k5 += 1)
- e9 = t8[m5++], r12 = s10 < u6 ? 0 : f7[i8 - u6], f7[i8++] = (e9 + r12) % 256;
- break;
- case 2:
- for (s10 = I3 = 0; I3 < w5; s10 = I3 += 1)
- e9 = t8[m5++], a12 = (s10 - s10 % u6) / u6, y6 = g6 && f7[(g6 - 1) * w5 + a12 * u6 + s10 % u6], f7[i8++] = (y6 + e9) % 256;
- break;
- case 3:
- for (s10 = T4 = 0; T4 < w5; s10 = T4 += 1)
- e9 = t8[m5++], a12 = (s10 - s10 % u6) / u6, r12 = s10 < u6 ? 0 : f7[i8 - u6], y6 = g6 && f7[(g6 - 1) * w5 + a12 * u6 + s10 % u6], f7[i8++] = (e9 + Math.floor((r12 + y6) / 2)) % 256;
- break;
- case 4:
- for (s10 = v4 = 0; v4 < w5; s10 = v4 += 1)
- e9 = t8[m5++], a12 = (s10 - s10 % u6) / u6, r12 = s10 < u6 ? 0 : f7[i8 - u6], 0 === g6 ? y6 = x4 = 0 : (y6 = f7[(g6 - 1) * w5 + a12 * u6 + s10 % u6], x4 = a12 && f7[(g6 - 1) * w5 + (a12 - 1) * u6 + s10 % u6]), o6 = r12 + y6 - x4, h5 = Math.abs(o6 - r12), l8 = Math.abs(o6 - y6), d4 = Math.abs(o6 - x4), p8 = h5 <= l8 && h5 <= d4 ? r12 : l8 <= d4 ? y6 : x4, f7[i8++] = (e9 + p8) % 256;
- break;
- default:
- throw new Error("Invalid filter algorithm: " + t8[m5 - 1]);
- }
- g6++;
- }
- return f7;
- }, o5.prototype.decodePalette = function() {
- var t8, e9, i8, a12, s10, r12, n11, o6, h5;
- for (i8 = this.palette, r12 = this.transparency.indexed || [], s10 = new Uint8Array((r12.length || 0) + i8.length), a12 = 0, i8.length, t8 = 0, e9 = n11 = 0, o6 = i8.length; n11 < o6; e9 = n11 += 3)
- s10[a12++] = i8[e9], s10[a12++] = i8[e9 + 1], s10[a12++] = i8[e9 + 2], s10[a12++] = null != (h5 = r12[t8++]) ? h5 : 255;
- return s10;
- }, o5.prototype.copyToImageData = function(t8, e9) {
- var i8, a12, s10, r12, n11, o6, h5, c7, p8, l8, d4;
- if (a12 = this.colors, p8 = null, i8 = this.hasAlphaChannel, this.palette.length && (p8 = null != (d4 = this._decodedPalette) ? d4 : this._decodedPalette = this.decodePalette(), a12 = 4, i8 = true), c7 = (s10 = t8.data || t8).length, n11 = p8 || e9, r12 = o6 = 0, 1 === a12)
- for (; r12 < c7; )
- h5 = p8 ? 4 * e9[r12 / 4] : o6, l8 = n11[h5++], s10[r12++] = l8, s10[r12++] = l8, s10[r12++] = l8, s10[r12++] = i8 ? n11[h5++] : this.transparency.grayscale && this.transparency.grayscale === l8 ? 0 : 255, o6 = h5;
- else
- for (; r12 < c7; )
- h5 = p8 ? 4 * e9[r12 / 4] : o6, s10[r12++] = n11[h5++], s10[r12++] = n11[h5++], s10[r12++] = n11[h5++], s10[r12++] = i8 ? n11[h5++] : this.transparency.rgb && this.transparency.rgb[1] === n11[h5 - 3] && this.transparency.rgb[3] === n11[h5 - 2] && this.transparency.rgb[5] === n11[h5 - 1] ? 0 : 255, o6 = h5;
- }, o5.prototype.decode = function() {
- var t8;
- return t8 = new Uint8Array(this.width * this.height * 4), this.copyToImageData(t8, this.decodePixels()), t8;
- }, r11 = t7.document && t7.document.createElement("canvas"), n10 = r11 && r11.getContext("2d"), s9 = function(t8) {
- var e9;
- return n10.width = t8.width, n10.height = t8.height, n10.clearRect(0, 0, t8.width, t8.height), n10.putImageData(t8, 0, 0), (e9 = new Image()).src = r11.toDataURL(), e9;
- }, o5.prototype.decodeFrames = function(t8) {
- var e9, i8, a12, r12, n11, o6, h5, c7;
- if (this.animation) {
- for (c7 = [], i8 = n11 = 0, o6 = (h5 = this.animation.frames).length; n11 < o6; i8 = ++n11)
- e9 = h5[i8], a12 = t8.createImageData(e9.width, e9.height), r12 = this.decodePixels(new Uint8Array(e9.data)), this.copyToImageData(a12, r12), e9.imageData = a12, c7.push(e9.image = s9(a12));
- return c7;
- }
- }, o5.prototype.renderFrame = function(t8, s10) {
- var r12, n11, o6;
- return r12 = (n11 = this.animation.frames)[s10], o6 = n11[s10 - 1], 0 === s10 && t8.clearRect(0, 0, this.width, this.height), (null != o6 ? o6.disposeOp : void 0) === i7 ? t8.clearRect(o6.xOffset, o6.yOffset, o6.width, o6.height) : (null != o6 ? o6.disposeOp : void 0) === a11 && t8.putImageData(o6.imageData, o6.xOffset, o6.yOffset), r12.blendOp === e8 && t8.clearRect(r12.xOffset, r12.yOffset, r12.width, r12.height), t8.drawImage(r12.image, r12.xOffset, r12.yOffset);
- }, o5.prototype.animate = function(t8) {
- var e9, i8, a12, s10, r12, n11, o6 = this;
- return i8 = 0, n11 = this.animation, s10 = n11.numFrames, a12 = n11.frames, r12 = n11.numPlays, (e9 = function() {
- var n12, h5;
- if (n12 = i8++ % s10, h5 = a12[n12], o6.renderFrame(t8, n12), s10 > 1 && i8 / s10 < r12)
- return o6.animation._timeout = setTimeout(e9, h5.delay);
- })();
- }, o5.prototype.stopAnimation = function() {
- var t8;
- return clearTimeout(null != (t8 = this.animation) ? t8._timeout : void 0);
- }, o5.prototype.render = function(t8) {
- var e9, i8;
- return t8._png && t8._png.stopAnimation(), t8._png = this, t8.width = this.width, t8.height = this.height, e9 = t8.getContext("2d"), this.animation ? (this.decodeFrames(e9), this.animate(e9)) : (i8 = e9.createImageData(this.width, this.height), this.copyToImageData(i8, this.decodePixels()), e9.putImageData(i8, 0, 0));
- }, o5;
- }(self);
- var m2 = /* @__PURE__ */ new Set(["jpg", "png", "bmp", "gif"]);
- async function g3(e8, i7) {
- if (!r10)
- throw new s2("rasterCoded:decode", "lerc decoder is not supported on big endian platform");
- await a5();
- const { offset: s9, noDataValue: r11 } = i7, { width: h5, height: c7, pixelType: p8, statistics: l8, pixels: d4, mask: f7 } = c3(e8, { inputOffset: s9, noDataValue: r11, returnInterleaved: i7.returnInterleaved });
- return new g({ width: h5, height: c7, pixelType: p8.toLowerCase(), pixels: d4, mask: f7, statistics: l8 });
- }
- async function w4(t7, e8) {
- const s9 = await F(t7, e8);
- c(s9);
- const r11 = new g({ width: s9.width, height: s9.height, pixels: s9.pixels, pixelType: s9.pixelType.toLowerCase(), mask: s9.mask, statistics: null });
- return r11.updateStatistics(), r11;
- }
- async function y5(t7, e8) {
- const i7 = await C(t7, e8.customOptions), s9 = new g({ width: i7.width, height: i7.height, pixels: i7.pixels, pixelType: i7.pixelType.toLowerCase(), mask: i7.mask, statistics: null });
- return s9.updateStatistics(), s9;
- }
- function x2(t7, e8) {
- const i7 = e8.pixelType || "u8", s9 = g.getPixelArrayConstructor(i7), r11 = "u8" === i7 ? t7 : new s9(t7.buffer), n10 = [], o5 = e8.planes || 1;
- if (1 === o5)
- n10.push(r11);
- else
- for (let a11 = 0; a11 < o5; a11++) {
- const i8 = (e8.width || 1) * (e8.height || t7.length), h6 = new s9(i8);
- for (let t8 = 0; t8 < i8; t8++)
- h6[t8] = r11[t8 * o5 + a11];
- n10.push(h6);
- }
- const h5 = new g({ width: e8.width || 1, height: e8.height || t7.length, pixels: n10, pixelType: i7, statistics: null });
- return h5.updateStatistics(), h5;
- }
- function b2(t7, e8) {
- return x2(new s5(new Uint8Array(t7)).getBytes(), e8);
- }
- function k3(t7, e8) {
- return x2(i4(t7, e8.offset, e8.eof, !e8.isInputBigEndian), e8);
- }
- function I2(t7, e8, i7) {
- const { pixelTypeCtor: s9 } = D2(e8.pixelType), r11 = (0, a6.decode)(t7, { width: e8.width, height: e8.height, pixelType: s9, format: i7 }), n10 = new g({ width: e8.width, height: e8.height, pixels: r11.pixels, pixelType: e8.pixelType, mask: r11.mask, statistics: null });
- return n10.updateStatistics(), n10;
- }
- function T2(t7, e8) {
- var _a;
- const i7 = r5.decode(t7, (_a = e8.hasNoZlibMask) != null ? _a : void 0), s9 = new g({ width: i7.width, height: i7.height, pixels: i7.pixels, pixelType: "U8", mask: i7.mask, statistics: null });
- return s9.updateStatistics(), s9;
- }
- function v2(t7, e8) {
- const i7 = new Uint8Array(t7), s9 = new f4(i7), { width: r11, height: n10 } = e8, o5 = r11 * n10, h5 = s9.decode();
- let c7, p8 = 0, l8 = 0;
- const d4 = new Uint8Array(o5);
- for (p8 = 0; p8 < o5; p8++)
- d4[p8] = h5[4 * p8 + 3];
- const u6 = new g({ width: r11, height: n10, pixels: [], pixelType: "U8", mask: d4, statistics: [] });
- for (p8 = 0; p8 < 3; p8++) {
- for (c7 = new Uint8Array(o5), l8 = 0; l8 < o5; l8++)
- c7[l8] = h5[4 * l8 + p8];
- u6.addData({ pixels: c7 });
- }
- return u6.updateStatistics(), u6;
- }
- async function U2(t7, e8, i7, r11) {
- const n10 = new i2(), o5 = { applyJpegMask: false, format: e8, ...i7 }, h5 = await n10.decode(t7, o5, r11), c7 = new g(h5);
- return c7.updateStatistics(), c7;
- }
- function A2(e8) {
- if (null == e8)
- throw new s2("rasterCodec:decode", "parameter encodeddata is required.");
- const i7 = new Uint8Array(e8, 0, 10);
- let a11 = "";
- return 255 === i7[0] && 216 === i7[1] ? a11 = "jpg" : 137 === i7[0] && 80 === i7[1] && 78 === i7[2] && 71 === i7[3] ? a11 = "png" : 67 === i7[0] && 110 === i7[1] && 116 === i7[2] && 90 === i7[3] && 73 === i7[4] && 109 === i7[5] && 97 === i7[6] && 103 === i7[7] && 101 === i7[8] && 32 === i7[9] ? a11 = "lerc" : 76 === i7[0] && 101 === i7[1] && 114 === i7[2] && 99 === i7[3] && 50 === i7[4] && 32 === i7[5] ? a11 = "lerc2" : 73 === i7[0] && 73 === i7[1] && 42 === i7[2] && 0 === i7[3] || 77 === i7[0] && 77 === i7[1] && 0 === i7[2] && 42 === i7[3] || 73 === i7[0] && 73 === i7[1] && 43 === i7[2] && 0 === i7[3] || 77 === i7[0] && 77 === i7[1] && 0 === i7[2] && 43 === i7[3] ? a11 = "tiff" : 71 === i7[0] && 73 === i7[1] && 70 === i7[2] ? a11 = "gif" : 66 === i7[0] && 77 === i7[1] ? a11 = "bmp" : String.fromCharCode.apply(null, i7).toLowerCase().includes("error") && (a11 = "error"), a11;
- }
- function C2(e8) {
- let i7 = null;
- switch (e8) {
- case "lerc":
- case "lerc2":
- i7 = g3;
- break;
- case "jpg":
- i7 = T2;
- break;
- case "png":
- i7 = v2;
- break;
- case "bsq":
- case "bip":
- i7 = (t7, i8) => I2(t7, i8, e8);
- break;
- case "tiff":
- i7 = w4;
- break;
- case "deflate":
- i7 = b2;
- break;
- case "lzw":
- i7 = k3;
- break;
- case "error":
- i7 = () => {
- throw new s2("rasterCodec:decode", "input data contains error");
- };
- break;
- default:
- i7 = () => {
- throw new s2("rasterCodec:decode", "unsupported raster format");
- };
- }
- return i7;
- }
- function D2(t7) {
- let e8 = null, i7 = null;
- switch (t7 ? t7.toLowerCase() : "f32") {
- case "u1":
- case "u2":
- case "u4":
- case "u8":
- i7 = 255, e8 = Uint8Array;
- break;
- case "u16":
- i7 = i7 || 65535, e8 = Uint16Array;
- break;
- case "u32":
- i7 = i7 || 2 ** 32 - 1, e8 = Uint32Array;
- break;
- case "s8":
- i7 = i7 || -128, e8 = Int8Array;
- break;
- case "s16":
- i7 = i7 || -32768, e8 = Int16Array;
- break;
- case "s32":
- i7 = i7 || 0 - 2 ** 31, e8 = Int32Array;
- break;
- default:
- e8 = Float32Array;
- }
- return { pixelTypeCtor: e8, noDataValue: i7 };
- }
- function O2(t7, i7 = 1) {
- if (!t7)
- return;
- const { pixels: s9, width: r11, height: n10, mask: o5 } = t7;
- if (!s9 || 0 === s9.length)
- return;
- const h5 = s9.length, c7 = r11 - 1, p8 = n10 - 1, l8 = [];
- let d4, u6, f7, m5, g6, w5, y6 = null;
- const x4 = g.getPixelArrayConstructor(t7.pixelType);
- if (0 === i7) {
- for (d4 = 0; d4 < h5; d4++) {
- for (g6 = s9[d4], w5 = new x4(c7 * p8), u6 = 0; u6 < p8; u6++)
- for (m5 = u6 * r11, f7 = 0; f7 < c7; f7++)
- w5[u6 * c7 + f7] = g6[m5 + f7];
- l8.push(w5);
- }
- if (r(o5))
- for (y6 = new Uint8Array(c7 * p8), u6 = 0; u6 < p8; u6++)
- for (m5 = u6 * r11, f7 = 0; f7 < c7; f7++)
- y6[u6 * c7 + f7] = o5[m5 + f7];
- } else {
- for (d4 = 0; d4 < h5; d4++) {
- for (g6 = s9[d4], w5 = new x4(c7 * p8), u6 = 0; u6 < p8; u6++)
- for (m5 = u6 * r11, f7 = 0; f7 < c7; f7++)
- w5[u6 * c7 + f7] = (g6[m5 + f7] + g6[m5 + f7 + 1] + g6[m5 + r11 + f7] + g6[m5 + r11 + f7 + 1]) / 4;
- l8.push(w5);
- }
- if (o5)
- for (y6 = new Uint8Array(c7 * p8), u6 = 0; u6 < p8; u6++)
- for (m5 = u6 * r11, f7 = 0; f7 < c7; f7++)
- y6[u6 * c7 + f7] = Math.min.apply(null, [o5[m5 + f7], o5[m5 + f7 + 1], o5[m5 + r11 + f7], o5[m5 + r11 + f7 + 1]]);
- }
- t7.width = c7, t7.height = p8, t7.mask = y6, t7.pixels = l8;
- }
- function P2(t7) {
- let e8 = A2(t7);
- return "lerc2" === e8 ? e8 = "lerc" : "error" === e8 && (e8 = ""), e8;
- }
- async function S3(e8, i7 = {}, a11) {
- if (null == e8)
- throw new s2("rasterCodec:decode", "missing encodeddata parameter.");
- let s9, r11, n10 = i7.format && i7.format.toLowerCase();
- if (!("bsq" !== n10 && "bip" !== n10 || null != i7.width && null != i7.height))
- throw new s2("rasterCodec:decode", "requires width and height in options parameter.");
- return "tiff" === n10 && i7.customOptions ? y5(e8, i7) : ((!n10 || "bsq" !== n10 && "bip" !== n10 && "deflate" !== n10 && "lzw" !== n10) && (n10 = A2(e8)), i7.useCanvas && m2.has(n10) ? r11 = await U2(e8, n10, i7, a11) : (s9 = C2(n10), i7.isPoint && (null != (i7 = { ...i7 }).width && i7.width++, null != i7.height && i7.height++), r11 = await s9(e8, i7), i7.isPoint && O2(r11)), r11);
- }
- // node_modules/@arcgis/core/renderers/support/stretchRendererUtils.js
- var n6 = new s3({ none: "none", standardDeviation: "standard-deviation", histogramEqualization: "histogram-equalization", minMax: "min-max", percentClip: "percent-clip", sigmoid: "sigmoid" });
- var a7 = { 0: "none", 3: "standardDeviation", 4: "histogramEqualization", 5: "minMax", 6: "percentClip", 9: "sigmoid" };
- // node_modules/@arcgis/core/layers/support/rasterFunctions/stretchUtils.js
- var o3 = { u1: [0, 1], u2: [0, 3], u4: [0, 15], u8: [0, 255], s8: [-128, 127], u16: [0, 65535], s16: [-32768, 32767], u32: [0, 4294967295], s32: [-2147483648, 2147483647], f32: [-34e38, 34e38], f64: [-Number.MAX_VALUE, Number.MAX_VALUE] };
- var a8 = 1;
- var f5 = [0.299, 0.587, 0.114];
- function l4(t7, e8 = 256) {
- e8 = Math.min(e8, 256);
- const { size: n10, counts: i7 } = t7, r11 = new Uint8Array(n10), s9 = i7.reduce((t8, n11) => t8 + n11 / e8, 0);
- let o5 = 0, a11 = 0, f7 = 0, l8 = s9;
- for (let u6 = 0; u6 < n10; u6++)
- if (f7 += i7[u6], !(u6 < n10 - 1 && f7 + i7[u6 + 1] < l8)) {
- for (; o5 < e8 - 1 && l8 < f7; )
- o5++, l8 += s9;
- for (let t8 = a11; t8 <= u6; t8++)
- r11[t8] = o5;
- a11 = u6 + 1;
- }
- for (let u6 = a11; u6 < n10; u6++)
- r11[u6] = e8 - 1;
- return r11;
- }
- function u3(t7) {
- const { minCutOff: e8, maxCutOff: n10, gamma: i7, pixelType: r11 } = t7, s9 = t7.outMin || 0, o5 = t7.outMax || 255;
- if (!["u8", "u16", "s8", "s16"].includes(r11))
- return null;
- const a11 = e8.length;
- let f7, l8, u6 = 0;
- "s8" === r11 ? u6 = -127 : "s16" === r11 && (u6 = -32767);
- let c7 = 256;
- ["u16", "s16"].includes(r11) && (c7 = 65536);
- const h5 = [], p8 = o5 - s9;
- for (f7 = 0; f7 < a11; f7++)
- h5[f7] = n10[f7] - e8[f7], n10[f7], e8[f7];
- const g6 = i7 && i7.length >= a11, x4 = [];
- if (g6)
- for (f7 = 0; f7 < a11; f7++)
- i7[f7] > 1 ? i7[f7] > 2 ? x4[f7] = 6.5 + (i7[f7] - 2) ** 2.5 : x4[f7] = 6.5 + 100 * (2 - i7[f7]) ** 4 : x4[f7] = 1;
- let M3;
- const d4 = [];
- let y6, b3, O4;
- if (g6)
- for (f7 = 0; f7 < a11; f7++) {
- for (O4 = [], l8 = 0; l8 < c7; l8++)
- y6 = l8 + u6, M3 = (y6 - e8[f7]) / h5[f7], b3 = 1, i7[f7] > 1 && (b3 -= (1 / p8) ** (M3 * x4[f7])), y6 < n10[f7] && y6 > e8[f7] ? O4[l8] = Math.floor(b3 * p8 * M3 ** (1 / i7[f7])) + s9 : y6 >= n10[f7] ? O4[l8] = o5 : O4[l8] = s9;
- d4[f7] = O4;
- }
- else
- for (f7 = 0; f7 < a11; f7++) {
- for (O4 = [], l8 = 0; l8 < c7; l8++)
- y6 = l8 + u6, y6 <= e8[f7] ? O4[l8] = s9 : y6 >= n10[f7] ? O4[l8] = o5 : O4[l8] = Math.floor((y6 - e8[f7]) / h5[f7] * p8) + s9;
- d4[f7] = O4;
- }
- if (null != t7.contrastOffset) {
- const e9 = m3(t7.contrastOffset, t7.brightnessOffset);
- for (f7 = 0; f7 < a11; f7++)
- for (O4 = d4[f7], l8 = 0; l8 < c7; l8++)
- O4[l8] = e9[O4[l8]];
- }
- return { lut: d4, offset: u6 };
- }
- function m3(t7, e8) {
- const n10 = Math.min(Math.max(t7, -100), 100), i7 = Math.min(Math.max(e8 != null ? e8 : 0, -100), 100), r11 = 255, s9 = 128;
- let o5 = 0, a11 = 0;
- const f7 = new Uint8Array(256);
- for (o5 = 0; o5 < 256; o5++)
- n10 > 0 && n10 < 100 ? a11 = (200 * o5 - 100 * r11 + 2 * r11 * i7) / (2 * (100 - n10)) + s9 : n10 <= 0 && n10 > -100 ? a11 = (200 * o5 - 100 * r11 + 2 * r11 * i7) * (100 + n10) / 2e4 + s9 : 100 === n10 ? (a11 = 200 * o5 - 100 * r11 + (r11 + 1) * (100 - n10) + 2 * r11 * i7, a11 = a11 > 0 ? r11 : 0) : -100 === n10 && (a11 = s9), f7[o5] = a11 > r11 ? r11 : a11 < 0 ? 0 : a11;
- return f7;
- }
- function c5(t7, e8, n10) {
- const i7 = [];
- for (let r11 = 0; r11 < e8.length; r11++) {
- let s9 = 0, o5 = 0, a11 = 0;
- "min" in e8[r11] ? { min: s9, max: o5, avg: a11 } = e8[r11] : [s9, o5, a11] = e8[r11];
- let l8 = a11 != null ? a11 : 0;
- "u8" !== t7 && (l8 = 255 * (l8 - s9) / (o5 - s9)), n10 && (l8 *= f5[r11]), i7.push(h2(l8));
- }
- return i7;
- }
- function h2(t7) {
- if (t7 <= 0 || t7 >= 255)
- return a8;
- let e8 = 0;
- 150 !== t7 && (e8 = t7 <= 150 ? 45 * Math.cos(0.01047 * t7) : 17 * Math.sin(0.021 * t7));
- const n10 = 255, i7 = t7 + e8, r11 = Math.log(t7 / n10), s9 = Math.log(i7 / n10);
- if (0 === s9)
- return a8;
- const o5 = r11 / s9;
- return isNaN(o5) ? a8 : Math.min(9.9, Math.max(0.01, o5));
- }
- function p5(n10) {
- var _a;
- if (t(n10) || !((_a = n10.pixels) == null ? void 0 : _a.length))
- return null;
- n10.statistics || n10.updateStatistics();
- const { pixels: i7, mask: r11, pixelType: s9, statistics: o5 } = n10, a11 = n10.width * n10.height, f7 = i7.length;
- let l8, u6, m5, c7, h5;
- const p8 = [], g6 = [];
- let x4, M3, d4, y6, b3, O4, C4, k5, z2, A3;
- const v4 = 256;
- for (c7 = 0; c7 < f7; c7++) {
- if (x4 = new Uint32Array(v4), d4 = i7[c7], "u8" === s9)
- if (l8 = -0.5, u6 = 255.5, r11)
- for (h5 = 0; h5 < a11; h5++)
- r11[h5] && x4[d4[h5]]++;
- else
- for (h5 = 0; h5 < a11; h5++)
- x4[d4[h5]]++;
- else {
- if (c(o5), l8 = o5[c7].minValue, u6 = o5[c7].maxValue, m5 = (u6 - l8) / v4, M3 = new Uint32Array(v4 + 1), r11)
- for (h5 = 0; h5 < a11; h5++)
- r11[h5] && M3[Math.floor((d4[h5] - l8) / m5)]++;
- else
- for (h5 = 0; h5 < a11; h5++)
- M3[Math.floor((d4[h5] - l8) / m5)]++;
- for (h5 = 0; h5 < 255; h5++)
- x4[h5] = M3[h5];
- x4[255] = M3[255] + M3[256];
- }
- for (p8.push({ min: l8, max: u6, size: v4, counts: x4 }), y6 = 0, b3 = 0, k5 = 0, h5 = 0; h5 < v4; h5++)
- y6 += x4[h5], b3 += h5 * x4[h5];
- for (z2 = b3 / y6, h5 = 0; h5 < v4; h5++)
- k5 += x4[h5] * (h5 - z2) ** 2;
- A3 = Math.sqrt(k5 / (y6 - 1)), m5 = (u6 - l8) / v4, O4 = (z2 + 0.5) * m5 + l8, C4 = A3 * m5, g6.push({ min: l8, max: u6, avg: O4, stddev: C4 });
- }
- return { statistics: g6, histograms: p8 };
- }
- function g4(t7) {
- const e8 = [];
- for (let n10 = 0; n10 < t7.length; n10++) {
- const { min: i7, max: r11, size: s9, counts: o5 } = t7[n10];
- let a11 = 0, f7 = 0;
- for (let t8 = 0; t8 < s9; t8++)
- a11 += o5[t8], f7 += t8 * o5[t8];
- const l8 = f7 / a11;
- let u6 = 0;
- for (let t8 = 0; t8 < s9; t8++)
- u6 += o5[t8] * (t8 - l8) ** 2;
- const m5 = (r11 - i7) / s9, c7 = (l8 + 0.5) * m5 + i7, h5 = Math.sqrt(u6 / (a11 - 1)) * m5;
- e8.push({ min: i7, max: r11, avg: c7, stddev: h5 });
- }
- return e8;
- }
- function x3(t7, r11) {
- var _a;
- const { pixelBlock: a11, bandIds: f7, returnHistogramLut: u6, rasterInfo: m5 } = r11;
- let c7 = null, h5 = null, g6 = t7.stretchType;
- if ("number" == typeof g6 && (g6 = a7[g6]), t7.dra)
- if ("minMax" === g6 && r(a11) && a11.statistics)
- c7 = a11.statistics.map((t8) => [t8.minValue, t8.maxValue, 0, 0]);
- else {
- const t8 = p5(a11);
- c7 = r(t8) ? t8.statistics : null, h5 = r(t8) ? t8.histograms : null;
- }
- else
- c7 = ((_a = t7.statistics) == null ? void 0 : _a.length) > 0 ? t7.statistics : e2(m5.statistics), h5 = t7.histograms || e2(m5.histograms);
- "percentClip" !== g6 && "histogramEqualization" !== g6 || (h5 == null ? void 0 : h5.length) || (g6 = "minMax");
- const x4 = (c7 == null ? void 0 : c7.length) || (h5 == null ? void 0 : h5.length) || m5.bandCount, d4 = [], y6 = [];
- let b3, O4, C4, k5, z2, A3, v4, w5, U3, E3, L3, T4;
- switch (c7 && !Array.isArray(c7[0]) && (c7 = c7.map((t8) => [t8.min, t8.max, t8.avg, t8.stddev])), g6) {
- case "none":
- {
- const t8 = o3[m5.pixelType] || o3.f32;
- for (w5 = 0; w5 < x4; w5++)
- d4[w5] = t8[0], y6[w5] = t8[1];
- }
- break;
- case "minMax":
- for (c(c7), w5 = 0; w5 < x4; w5++)
- d4[w5] = c7[w5][0], y6[w5] = c7[w5][1];
- break;
- case "standardDeviation":
- for (c(c7), w5 = 0; w5 < x4; w5++)
- d4[w5] = c7[w5][2] - t7.numberOfStandardDeviations * c7[w5][3], y6[w5] = c7[w5][2] + t7.numberOfStandardDeviations * c7[w5][3], d4[w5] < c7[w5][0] && (d4[w5] = c7[w5][0]), y6[w5] > c7[w5][1] && (y6[w5] = c7[w5][1]);
- break;
- case "histogramEqualization":
- for (c(h5), w5 = 0; w5 < x4; w5++)
- d4[w5] = h5[w5].min, y6[w5] = h5[w5].max;
- break;
- case "percentClip":
- for (c(h5), w5 = 0; w5 < h5.length; w5++) {
- for (b3 = h5[w5], z2 = new Uint32Array(b3.size), k5 = [...b3.counts], k5.length >= 20 && (k5[0] = k5[1] = k5[2] = k5[k5.length - 1] = k5[k5.length - 2] = 0), C4 = 0, O4 = (b3.max - b3.min) / b3.size, v4 = -0.5 === b3.min && 1 === O4 ? 0.5 : 0, U3 = 0; U3 < b3.size; U3++)
- C4 += k5[U3], z2[U3] = C4;
- for (A3 = (t7.minPercent || 0) * C4 / 100, U3 = 0; U3 < b3.size; U3++)
- if (z2[U3] > A3) {
- d4[w5] = b3.min + O4 * (U3 + v4);
- break;
- }
- for (A3 = (1 - (t7.maxPercent || 0) / 100) * C4, U3 = b3.size - 2; U3 >= 0; U3--)
- if (z2[U3] < A3) {
- y6[w5] = b3.min + O4 * (U3 + 2 - v4);
- break;
- }
- }
- break;
- default:
- for (c(c7), w5 = 0; w5 < x4; w5++)
- d4[w5] = c7[w5][0], y6[w5] = c7[w5][1];
- }
- "histogramEqualization" === g6 ? (c(h5), L3 = h5[0].size || 256, E3 = 0, u6 && (T4 = h5.map((t8) => l4(t8)))) : (L3 = t7.max || 255, E3 = t7.min || 0);
- return M2({ minCutOff: d4, maxCutOff: y6, outMax: L3, outMin: E3, histogramLut: T4 }, f7);
- }
- function M2(t7, e8) {
- if (null == e8 || 0 === e8.length)
- return t7;
- const n10 = Math.max.apply(null, e8), { minCutOff: i7, maxCutOff: r11, outMin: s9, outMax: o5, histogramLut: a11 } = t7;
- return i7.length === e8.length || i7.length <= n10 ? t7 : { minCutOff: e8.map((t8) => i7[t8]), maxCutOff: e8.map((t8) => r11[t8]), histogramLut: a11 ? e8.map((t8) => a11[t8]) : null, outMin: s9, outMax: o5 };
- }
- function d2(e8, n10) {
- var _a;
- if (t(e8) || !((_a = e8.pixels) == null ? void 0 : _a.length))
- return e8;
- const { mask: i7, width: s9, height: o5, pixels: a11 } = e8, { minCutOff: f7, maxCutOff: l8, gamma: u6 } = n10, m5 = n10.outMin || 0, c7 = n10.outMax || 255, h5 = s9 * o5, p8 = n10.outputPixelType || "u8", g6 = e8.pixels.map(() => g.createEmptyBand(p8, h5)), x4 = g6.length;
- let M3, d4, y6, b3, O4;
- const C4 = c7 - m5, k5 = [];
- for (M3 = 0; M3 < x4; M3++)
- k5[M3] = l8[M3] - f7[M3], l8[M3], f7[M3];
- const z2 = u6 && u6.length >= x4, A3 = [];
- if (z2)
- for (M3 = 0; M3 < x4; M3++)
- u6[M3] > 1 ? u6[M3] > 2 ? A3[M3] = 6.5 + (u6[M3] - 2) ** 2.5 : A3[M3] = 6.5 + 100 * (2 - u6[M3]) ** 4 : A3[M3] = 1;
- if (z2)
- if (null != i7) {
- for (d4 = 0; d4 < h5; d4++)
- if (i7[d4])
- for (M3 = 0; M3 < x4; M3++)
- y6 = a11[M3][d4], O4 = (y6 - f7[M3]) / k5[M3], b3 = 1, u6[M3] > 1 && (b3 -= (1 / C4) ** (O4 * A3[M3])), y6 < l8[M3] && y6 > f7[M3] ? g6[M3][d4] = Math.floor(b3 * C4 * O4 ** (1 / u6[M3])) + m5 : y6 >= l8[M3] ? g6[M3][d4] = c7 : g6[M3][d4] = m5;
- } else
- for (d4 = 0; d4 < h5; d4++)
- for (M3 = 0; M3 < x4; M3++)
- y6 = a11[M3][d4], O4 = (y6 - f7[M3]) / k5[M3], b3 = 1, u6[M3] > 1 && (b3 -= (1 / C4) ** (O4 * A3[M3])), y6 < l8[M3] && y6 > f7[M3] ? g6[M3][d4] = Math.floor(b3 * C4 * O4 ** (1 / u6[M3])) + m5 : y6 >= l8[M3] ? g6[M3][d4] = c7 : g6[M3][d4] = m5;
- else if (null != i7) {
- for (d4 = 0; d4 < h5; d4++)
- if (i7[d4])
- for (M3 = 0; M3 < x4; M3++)
- y6 = a11[M3][d4], y6 < l8[M3] && y6 > f7[M3] ? g6[M3][d4] = Math.floor((y6 - f7[M3]) / k5[M3] * C4) + m5 : y6 >= l8[M3] ? g6[M3][d4] = c7 : g6[M3][d4] = m5;
- } else
- for (d4 = 0; d4 < h5; d4++)
- for (M3 = 0; M3 < x4; M3++)
- y6 = a11[M3][d4], y6 < l8[M3] && y6 > f7[M3] ? g6[M3][d4] = Math.floor((y6 - f7[M3]) / k5[M3] * C4) + m5 : y6 >= l8[M3] ? g6[M3][d4] = c7 : g6[M3][d4] = m5;
- const v4 = new g({ width: s9, height: o5, mask: i7, pixels: g6, pixelType: p8 });
- return v4.updateStatistics(), v4;
- }
- // node_modules/@arcgis/core/layers/support/RasterStorageInfo.js
- var p6;
- var l5 = p6 = class extends l {
- constructor() {
- super(...arguments), this.blockWidth = void 0, this.blockHeight = void 0, this.compression = null, this.origin = null, this.firstPyramidLevel = null, this.maximumPyramidLevel = null, this.pyramidScalingFactor = 2, this.pyramidBlockWidth = null, this.pyramidBlockHeight = null, this.isVirtualTileInfo = false, this.tileInfo = null, this.transposeInfo = null, this.blockBoundary = null;
- }
- clone() {
- return new p6({ blockWidth: this.blockWidth, blockHeight: this.blockHeight, compression: this.compression, origin: y(this.origin), firstPyramidLevel: this.firstPyramidLevel, maximumPyramidLevel: this.maximumPyramidLevel, pyramidResolutions: y(this.pyramidResolutions), pyramidScalingFactor: this.pyramidScalingFactor, pyramidBlockWidth: this.pyramidBlockWidth, pyramidBlockHeight: this.pyramidBlockHeight, isVirtualTileInfo: this.isVirtualTileInfo, tileInfo: y(this.tileInfo), transposeInfo: y(this.transposeInfo), blockBoundary: y(this.blockBoundary) });
- }
- };
- e([y2({ type: Number, json: { write: true } })], l5.prototype, "blockWidth", void 0), e([y2({ type: Number, json: { write: true } })], l5.prototype, "blockHeight", void 0), e([y2({ type: String, json: { write: true } })], l5.prototype, "compression", void 0), e([y2({ type: w, json: { write: true } })], l5.prototype, "origin", void 0), e([y2({ type: Number, json: { write: true } })], l5.prototype, "firstPyramidLevel", void 0), e([y2({ type: Number, json: { write: true } })], l5.prototype, "maximumPyramidLevel", void 0), e([y2({ json: { write: true } })], l5.prototype, "pyramidResolutions", void 0), e([y2({ type: Number, json: { write: true } })], l5.prototype, "pyramidScalingFactor", void 0), e([y2({ type: Number, json: { write: true } })], l5.prototype, "pyramidBlockWidth", void 0), e([y2({ type: Number, json: { write: true } })], l5.prototype, "pyramidBlockHeight", void 0), e([y2({ type: Boolean, json: { write: true } })], l5.prototype, "isVirtualTileInfo", void 0), e([y2({ json: { write: true } })], l5.prototype, "tileInfo", void 0), e([y2()], l5.prototype, "transposeInfo", void 0), e([y2()], l5.prototype, "blockBoundary", void 0), l5 = p6 = e([n("esri.layers.support.RasterStorageInfo")], l5);
- var n7 = l5;
- // node_modules/@arcgis/core/layers/support/RasterInfo.js
- var l6;
- var h3 = l6 = class extends l {
- constructor(t7) {
- super(t7), this.attributeTable = null, this.bandCount = null, this.colormap = null, this.extent = null, this.format = void 0, this.height = null, this.width = null, this.histograms = null, this.keyProperties = {}, this.multidimensionalInfo = null, this.noDataValue = null, this.pixelSize = null, this.pixelType = null, this.isPseudoSpatialReference = false, this.spatialReference = null, this.statistics = null, this.storageInfo = null, this.transform = null;
- }
- get dataType() {
- var _a, _b, _c;
- const t7 = (_c = (_b = (_a = this.keyProperties) == null ? void 0 : _a.DataType) == null ? void 0 : _b.toLowerCase()) != null ? _c : "generic";
- return "stdtime" === t7 ? "standard-time" : t7;
- }
- get nativeExtent() {
- return this._get("nativeExtent") || this.extent;
- }
- set nativeExtent(t7) {
- t7 && this._set("nativeExtent", t7);
- }
- get nativePixelSize() {
- if (t(this.transform) || !this.transform.affectsPixelSize)
- return this.pixelSize;
- const t7 = this.nativeExtent;
- return { x: t7.width / this.width, y: t7.height / this.height };
- }
- get hasMultidimensionalTranspose() {
- var _a;
- return !!((_a = this.storageInfo) == null ? void 0 : _a.transposeInfo);
- }
- clone() {
- return new l6({ attributeTable: y(this.attributeTable), bandCount: this.bandCount, colormap: y(this.colormap), extent: y(this.extent), nativePixelSize: y(this.nativePixelSize), format: this.format, height: this.height, width: this.width, histograms: y(this.histograms), keyProperties: y(this.keyProperties), multidimensionalInfo: y(this.multidimensionalInfo), noDataValue: this.noDataValue, pixelSize: y(this.pixelSize), pixelType: this.pixelType, isPseudoSpatialReference: this.isPseudoSpatialReference, spatialReference: y(this.spatialReference), statistics: y(this.statistics), storageInfo: y(this.storageInfo), transform: y(this.transform) });
- }
- };
- e([y2({ json: { write: true } })], h3.prototype, "attributeTable", void 0), e([y2({ json: { write: true } })], h3.prototype, "bandCount", void 0), e([y2({ json: { write: true } })], h3.prototype, "colormap", void 0), e([y2({ type: String, readOnly: true })], h3.prototype, "dataType", null), e([y2({ type: w2, json: { write: true } })], h3.prototype, "extent", void 0), e([y2({ type: w2, json: { write: true } })], h3.prototype, "nativeExtent", null), e([y2({ json: { write: true } })], h3.prototype, "nativePixelSize", null), e([y2({ json: { write: true } })], h3.prototype, "format", void 0), e([y2({ json: { write: true } })], h3.prototype, "height", void 0), e([y2({ json: { write: true } })], h3.prototype, "width", void 0), e([y2({ json: { write: true } })], h3.prototype, "hasMultidimensionalTranspose", null), e([y2({ json: { write: true } })], h3.prototype, "histograms", void 0), e([y2({ json: { write: true } })], h3.prototype, "keyProperties", void 0), e([y2({ json: { write: true } })], h3.prototype, "multidimensionalInfo", void 0), e([y2({ json: { write: true } })], h3.prototype, "noDataValue", void 0), e([y2({ json: { write: true } })], h3.prototype, "pixelSize", void 0), e([y2({ json: { write: true } })], h3.prototype, "pixelType", void 0), e([y2()], h3.prototype, "isPseudoSpatialReference", void 0), e([y2({ type: k, json: { write: true } })], h3.prototype, "spatialReference", void 0), e([y2({ json: { write: true } })], h3.prototype, "statistics", void 0), e([y2({ type: n7, json: { write: true } })], h3.prototype, "storageInfo", void 0), e([y2({ json: { write: true } })], h3.prototype, "transform", void 0), h3 = l6 = e([n("esri.layers.support.RasterInfo")], h3);
- var u4 = h3;
- // node_modules/@arcgis/core/layers/support/rasterFunctions/surfaceUtils.js
- function n8(t7) {
- let { altitude: e8, azimuth: i7 } = t7;
- const { hillshadeType: n10, pixelSizePower: l8 = 1, pixelSizeFactor: s9 = 1, scalingType: a11, isGCS: o5, resolution: r11 } = t7, c7 = "multi-directional" === n10 ? 2 * t7.zFactor : t7.zFactor, { x: h5, y: f7 } = r11;
- let u6 = c7 / (8 * h5), p8 = c7 / (8 * f7);
- if (o5 && c7 > 1e-3 && (u6 /= 111e3, p8 /= 111e3), "adjusted" === a11)
- if (o5) {
- const t8 = 111e3 * h5, e9 = 111e3 * f7;
- u6 = (c7 + t8 ** l8 * s9) / (8 * t8), p8 = (c7 + e9 ** l8 * s9) / (8 * e9);
- } else
- u6 = (c7 + h5 ** l8 * s9) / (8 * h5), p8 = (c7 + f7 ** l8 * s9) / (8 * f7);
- let x4 = (90 - e8) * Math.PI / 180, d4 = Math.cos(x4), m5 = (360 - i7 + 90) * Math.PI / 180, w5 = Math.sin(x4) * Math.cos(m5), y6 = Math.sin(x4) * Math.sin(m5);
- const M3 = [315, 270, 225, 360, 180, 0], A3 = [60, 60, 60, 60, 60, 90], g6 = new Float32Array([3, 5, 3, 2, 1, 4]), k5 = g6.reduce((t8, e9) => t8 + e9), P3 = g6.map((t8) => t8 / k5), Z = "multi-directional" === n10 ? M3.length : 1, C4 = new Float32Array(6), F2 = new Float32Array(6), b3 = new Float32Array(6);
- if ("multi-directional" === n10)
- for (let z2 = 0; z2 < Z; z2++)
- e8 = A3[z2], i7 = M3[z2], x4 = (90 - e8) * Math.PI / 180, d4 = Math.cos(x4), m5 = (360 - i7 + 90) * Math.PI / 180, w5 = Math.sin(x4) * Math.cos(m5), y6 = Math.sin(x4) * Math.sin(m5), C4[z2] = d4, F2[z2] = w5, b3[z2] = y6;
- else
- C4.fill(d4), F2.fill(w5), b3.fill(y6);
- return { resolution: r11, factor: [u6, p8], sinZcosA: w5, sinZsinA: y6, cosZ: d4, sinZcosAs: F2, sinZsinAs: b3, cosZs: C4, weights: P3, hillshadeType: ["traditional", "multi-directional"].indexOf(n10) };
- }
- function l7(l8, s9) {
- if (!r2(l8))
- return l8;
- const { width: a11, height: o5, mask: r11 } = l8, c7 = new Uint8Array(a11 * o5);
- let h5 = 1;
- if (r(r11)) {
- for (let t7 = 0; t7 < r11.length; t7++)
- if (r11[t7]) {
- h5 = r11[t7];
- break;
- }
- c7.set(r11);
- }
- const { factor: f7, sinZcosA: u6, sinZsinA: p8, cosZ: x4, sinZcosAs: d4, sinZsinAs: m5, cosZs: w5, weights: y6 } = n8(s9), [M3, A3] = f7, { hillshadeType: g6 } = s9, k5 = l8.pixels[0], P3 = new Uint8Array(a11 * o5);
- let Z, C4, F2, b3, z2, T4, U3, S4;
- const v4 = 1, V2 = r(r11);
- for (let t7 = v4; t7 < o5 - v4; t7++) {
- const e8 = t7 * a11;
- for (let t8 = v4; t8 < a11 - v4; t8++) {
- if (r11 && !r11[e8 + t8]) {
- P3[e8 + t8] = 0;
- continue;
- }
- let i7 = 8;
- if (V2 && (i7 = (r11[e8 - a11 + t8 - 1] + r11[e8 - a11 + t8] + r11[e8 - a11 + t8 + 1] + r11[e8 + t8 - 1] + r11[e8 + t8 + 1] + r11[e8 + a11 + t8 - 1] + r11[e8 + a11 + t8] + r11[e8 + a11 + t8 + 1]) / h5, i7 < 7)) {
- P3[e8 + t8] = 0, c7[e8 + t8] = 0;
- continue;
- }
- r11 && 7 === i7 ? (Z = r11[e8 - a11 + t8 - 1] ? k5[e8 - a11 + t8 - 1] : k5[e8 + t8], C4 = r11[e8 - a11 + t8] ? k5[e8 - a11 + t8] : k5[e8 + t8], F2 = r11[e8 - a11 + t8 + 1] ? k5[e8 - a11 + t8 + 1] : k5[e8 + t8], b3 = r11[e8 + t8 - 1] ? k5[e8 + t8 - 1] : k5[e8 + t8], z2 = r11[e8 + t8 + 1] ? k5[e8 + t8 + 1] : k5[e8 + t8], T4 = r11[e8 + a11 + t8 - 1] ? k5[e8 + a11 + t8 - 1] : k5[e8 + t8], U3 = r11[e8 + a11 + t8] ? k5[e8 + a11 + t8] : k5[e8 + t8], S4 = r11[e8 + a11 + t8 + 1] ? k5[e8 + a11 + t8 + 1] : k5[e8 + t8]) : (Z = k5[e8 - a11 + t8 - 1], C4 = k5[e8 - a11 + t8], F2 = k5[e8 - a11 + t8 + 1], b3 = k5[e8 + t8 - 1], z2 = k5[e8 + t8 + 1], T4 = k5[e8 + a11 + t8 - 1], U3 = k5[e8 + a11 + t8], S4 = k5[e8 + a11 + t8 + 1]);
- const n10 = (F2 + z2 + z2 + S4 - (Z + b3 + b3 + T4)) * M3, l9 = (T4 + U3 + U3 + S4 - (Z + C4 + C4 + F2)) * A3, s10 = Math.sqrt(1 + n10 * n10 + l9 * l9);
- let o6 = 0;
- if ("traditional" === g6) {
- let t9 = 255 * (x4 + p8 * l9 - u6 * n10) / s10;
- t9 < 0 && (t9 = 0), o6 = t9;
- } else {
- const t9 = m5.length;
- for (let e9 = 0; e9 < t9; e9++) {
- let t10 = 255 * (w5[e9] + m5[e9] * l9 - d4[e9] * n10) / s10;
- t10 < 0 && (t10 = 0), o6 += t10 * y6[e9];
- }
- }
- P3[e8 + t8] = 255 & o6;
- }
- }
- for (let t7 = 0; t7 < o5; t7++)
- P3[t7 * a11] = P3[t7 * a11 + 1], P3[(t7 + 1) * a11 - 1] = P3[(t7 + 1) * a11 - 2];
- for (let t7 = 1; t7 < a11 - 1; t7++)
- P3[t7] = P3[t7 + a11], P3[t7 + (o5 - 1) * a11] = P3[t7 + (o5 - 2) * a11];
- return new g({ width: a11, height: o5, pixels: [P3], mask: r11 ? c7 : null, pixelType: "u8", validPixelCount: l8.validPixelCount, statistics: [{ minValue: 0, maxValue: 255 }] });
- }
- function s7(t7, e8, n10, l8) {
- if (!r2(t7) || !r2(e8))
- return;
- const { min: s9, max: a11 } = l8, o5 = t7.pixels[0], { pixels: r11, mask: c7 } = e8, h5 = r11[0], f7 = 255.00001 / (a11 - s9), u6 = new Uint8ClampedArray(h5.length), p8 = new Uint8ClampedArray(h5.length), x4 = new Uint8ClampedArray(h5.length), d4 = n10.length - 1;
- for (let i7 = 0; i7 < h5.length; i7++) {
- if (c7 && 0 === c7[i7])
- continue;
- const t8 = Math.floor((h5[i7] - s9) * f7), [e9, l9] = n10[t8 < 0 ? 0 : t8 > d4 ? d4 : t8], a12 = o5[i7], r12 = a12 * l9, m5 = r12 * (1 - Math.abs(e9 % 2 - 1)), w5 = a12 - r12;
- switch (Math.floor(e9)) {
- case 0:
- u6[i7] = r12 + w5, p8[i7] = m5 + w5, x4[i7] = w5;
- break;
- case 1:
- u6[i7] = m5 + w5, p8[i7] = r12 + w5, x4[i7] = w5;
- break;
- case 2:
- u6[i7] = w5, p8[i7] = r12 + w5, x4[i7] = m5 + w5;
- break;
- case 3:
- u6[i7] = w5, p8[i7] = m5 + w5, x4[i7] = r12 + w5;
- break;
- case 4:
- u6[i7] = m5 + w5, p8[i7] = w5, x4[i7] = r12 + w5;
- break;
- case 5:
- case 6:
- u6[i7] = r12 + w5, p8[i7] = w5, x4[i7] = m5 + w5;
- }
- }
- t7.pixels = [u6, p8, x4], t7.updateStatistics();
- }
- function a9(n10, l8) {
- var _a, _b;
- if (!r2(n10))
- return n10;
- const s9 = l8.zFactor, a11 = (_a = l8.pixelSizePower) != null ? _a : 1, o5 = (_b = l8.pixelSizeFactor) != null ? _b : 1, r11 = l8.slopeType, c7 = l8.isGCS, { width: h5, height: f7, mask: u6 } = n10, p8 = n10.pixels[0], x4 = new Uint8Array(h5 * f7);
- let d4 = 1;
- if (r(u6)) {
- for (let t7 = 0; t7 < u6.length; t7++)
- if (u6[t7]) {
- d4 = u6[t7];
- break;
- }
- x4.set(u6);
- }
- const m5 = new Float32Array(h5 * f7), { x: w5, y: y6 } = l8.resolution;
- let M3 = s9 / (8 * w5), A3 = s9 / (8 * y6);
- if (c7 && Math.abs(s9 - 1) < 1e-4 && (M3 /= 111e3, A3 /= 111e3), "adjusted" === r11)
- if (c7) {
- const t7 = 111e3 * w5, e8 = 111e3 * y6;
- M3 = (s9 + t7 ** a11 * o5) / (8 * t7), A3 = (s9 + e8 ** a11 * o5) / (8 * e8);
- } else
- M3 = (s9 + w5 ** a11 * o5) / (8 * w5), A3 = (s9 + y6 ** a11 * o5) / (8 * y6);
- const g6 = 1;
- let k5, P3, Z, C4, F2, b3, z2, T4;
- const U3 = r(u6);
- for (let t7 = g6; t7 < f7 - g6; t7++) {
- const e8 = t7 * h5;
- for (let t8 = g6; t8 < h5 - g6; t8++) {
- if (u6 && !u6[e8 + t8]) {
- m5[e8 + t8] = 0;
- continue;
- }
- let i7 = 0;
- if (U3 && (i7 = (u6[e8 - h5 + t8 - 1] + u6[e8 - h5 + t8] + u6[e8 - h5 + t8 + 1] + u6[e8 + t8 - 1] + u6[e8 + t8 + 1] + u6[e8 + h5 + t8 - 1] + u6[e8 + h5 + t8] + u6[e8 + h5 + t8 + 1]) / d4, i7 < 7)) {
- m5[e8 + t8] = 0, x4[e8 + t8] = 0;
- continue;
- }
- u6 && 7 === i7 ? (k5 = u6[e8 - h5 + t8 - 1] ? p8[e8 - h5 + t8 - 1] : p8[e8 + t8], P3 = u6[e8 - h5 + t8] ? p8[e8 - h5 + t8] : p8[e8 + t8], Z = u6[e8 - h5 + t8 + 1] ? p8[e8 - h5 + t8 + 1] : p8[e8 + t8], C4 = u6[e8 + t8 - 1] ? p8[e8 + t8 - 1] : p8[e8 + t8], F2 = u6[e8 + t8 + 1] ? p8[e8 + t8 + 1] : p8[e8 + t8], b3 = u6[e8 + h5 + t8 - 1] ? p8[e8 + h5 + t8 - 1] : p8[e8 + t8], z2 = u6[e8 + h5 + t8] ? p8[e8 + h5 + t8] : p8[e8 + t8], T4 = u6[e8 + h5 + t8 + 1] ? p8[e8 + h5 + t8 + 1] : p8[e8 + t8]) : (k5 = p8[e8 - h5 + t8 - 1], P3 = p8[e8 - h5 + t8], Z = p8[e8 - h5 + t8 + 1], C4 = p8[e8 + t8 - 1], F2 = p8[e8 + t8 + 1], b3 = p8[e8 + h5 + t8 - 1], z2 = p8[e8 + h5 + t8], T4 = p8[e8 + h5 + t8 + 1]);
- const n11 = (Z + F2 + F2 + T4 - (k5 + C4 + C4 + b3)) * M3, l9 = (b3 + z2 + z2 + T4 - (k5 + P3 + P3 + Z)) * A3, s10 = Math.sqrt(n11 * n11 + l9 * l9);
- m5[e8 + t8] = "percent-rise" === r11 ? 100 * s10 : 57.2957795 * Math.atan(s10);
- }
- }
- for (let t7 = 0; t7 < f7; t7++)
- m5[t7 * h5] = m5[t7 * h5 + 1], m5[(t7 + 1) * h5 - 1] = m5[(t7 + 1) * h5 - 2];
- for (let t7 = 1; t7 < h5 - 1; t7++)
- m5[t7] = m5[t7 + h5], m5[t7 + (f7 - 1) * h5] = m5[t7 + (f7 - 2) * h5];
- return new g({ width: h5, height: f7, pixels: [m5], mask: u6 ? x4 : null, pixelType: "f32", validPixelCount: n10.validPixelCount, statistics: [{ minValue: 0, maxValue: "percent-rise" === r11 ? 100 : 360 }] });
- }
- function o4(n10, l8 = {}) {
- if (!r2(n10))
- return n10;
- const { width: s9, height: a11, mask: o5 } = n10, r11 = n10.pixels[0], c7 = new Uint8Array(s9 * a11);
- r(o5) && c7.set(o5);
- const h5 = new Float32Array(s9 * a11), { resolution: f7 } = l8, u6 = f7 ? 1 / f7.x : 1, p8 = f7 ? 1 / f7.y : 1, x4 = 1;
- let d4, m5, w5, y6, M3, A3, g6, k5;
- const P3 = r(o5);
- for (let t7 = x4; t7 < a11 - x4; t7++) {
- const e8 = t7 * s9;
- for (let t8 = x4; t8 < s9 - x4; t8++) {
- if (o5 && !o5[e8 + t8]) {
- h5[e8 + t8] = 0;
- continue;
- }
- let i7 = 0;
- if (P3 && (i7 = o5[e8 - s9 + t8 - 1] + o5[e8 - s9 + t8] + o5[e8 - s9 + t8 + 1] + o5[e8 + t8 - 1] + o5[e8 + t8 + 1] + o5[e8 + s9 + t8 - 1] + o5[e8 + s9 + t8] + o5[e8 + s9 + t8 + 1], i7 < 7)) {
- h5[e8 + t8] = 0, c7[e8 + t8] = 0;
- continue;
- }
- o5 && 7 === i7 ? (d4 = o5[e8 - s9 + t8 - 1] ? r11[e8 - s9 + t8 - 1] : r11[e8 + t8], m5 = o5[e8 - s9 + t8] ? r11[e8 - s9 + t8] : r11[e8 + t8], w5 = o5[e8 - s9 + t8 + 1] ? r11[e8 - s9 + t8 + 1] : r11[e8 + t8], y6 = o5[e8 + t8 - 1] ? r11[e8 + t8 - 1] : r11[e8 + t8], M3 = o5[e8 + t8 + 1] ? r11[e8 + t8 + 1] : r11[e8 + t8], A3 = o5[e8 + s9 + t8 - 1] ? r11[e8 + s9 + t8 - 1] : r11[e8 + t8], g6 = o5[e8 + s9 + t8] ? r11[e8 + s9 + t8] : r11[e8 + t8], k5 = o5[e8 + s9 + t8 + 1] ? r11[e8 + s9 + t8 + 1] : r11[e8 + t8]) : (d4 = r11[e8 - s9 + t8 - 1], m5 = r11[e8 - s9 + t8], w5 = r11[e8 - s9 + t8 + 1], y6 = r11[e8 + t8 - 1], M3 = r11[e8 + t8 + 1], A3 = r11[e8 + s9 + t8 - 1], g6 = r11[e8 + s9 + t8], k5 = r11[e8 + s9 + t8 + 1]);
- const n11 = (w5 + M3 + M3 + k5 - (d4 + y6 + y6 + A3)) * u6, l9 = (A3 + g6 + g6 + k5 - (d4 + m5 + m5 + w5)) * p8;
- let a12 = -1;
- 0 === n11 && 0 === l9 || (a12 = 90 - 57.29578 * Math.atan2(l9, -n11), a12 < 0 && (a12 += 360), 360 === a12 ? a12 = 0 : a12 > 360 && (a12 %= 360)), h5[e8 + t8] = a12;
- }
- }
- for (let t7 = 0; t7 < a11; t7++)
- h5[t7 * s9] = h5[t7 * s9 + 1], h5[(t7 + 1) * s9 - 1] = h5[(t7 + 1) * s9 - 2];
- for (let t7 = 1; t7 < s9 - 1; t7++)
- h5[t7] = h5[t7 + s9], h5[t7 + (a11 - 1) * s9] = h5[t7 + (a11 - 2) * s9];
- return new g({ width: s9, height: a11, pixels: [h5], mask: o5 ? c7 : null, pixelType: "f32", validPixelCount: n10.validPixelCount, statistics: [{ minValue: 0, maxValue: 360 }] });
- }
- // node_modules/@arcgis/core/renderers/support/colorRampUtils.js
- var i6 = [{ id: "aspect_predefined", type: "multipart", colorRamps: [{ fromColor: [190, 190, 190], toColor: [255, 45, 8] }, { fromColor: [255, 45, 8], toColor: [255, 181, 61] }, { fromColor: [255, 181, 61], toColor: [255, 254, 52] }, { fromColor: [255, 254, 52], toColor: [0, 251, 50] }, { fromColor: [0, 251, 50], toColor: [255, 254, 52] }, { fromColor: [0, 253, 255], toColor: [0, 181, 255] }, { fromColor: [0, 181, 255], toColor: [26, 35, 253] }, { fromColor: [26, 35, 253], toColor: [255, 57, 251] }, { fromColor: [255, 57, 251], toColor: [255, 45, 8] }] }, { id: "blackToWhite_predefined", fromColor: [0, 0, 0], toColor: [255, 255, 255] }, { id: "blueBright_predefined", fromColor: [204, 204, 255], toColor: [0, 0, 224] }, { id: "blueLightToDark_predefined", fromColor: [211, 229, 232], toColor: [46, 100, 140] }, { id: "blueGreenBright_predefined", fromColor: [203, 245, 234], toColor: [48, 207, 146] }, { id: "blueGreenLightToDark_predefined", fromColor: [216, 242, 237], toColor: [21, 79, 74] }, { id: "brownLightToDark_predefined", fromColor: [240, 236, 170], toColor: [102, 72, 48] }, { id: "brownToBlueGreenDivergingBright_predefined", type: "multipart", colorRamps: [{ fromColor: [156, 85, 31], toColor: [255, 255, 191] }, { fromColor: [255, 255, 191], toColor: [33, 130, 145] }] }, { id: "brownToBlueGreenDivergingDark_predefined", type: "multipart", colorRamps: [{ fromColor: [110, 70, 45], toColor: [204, 204, 102] }, { fromColor: [204, 204, 102], toColor: [48, 100, 102] }] }, { id: "coefficientBias_predefined", fromColor: [214, 214, 255], toColor: [0, 57, 148] }, { id: "coldToHotDiverging_predefined", type: "multipart", colorRamps: [{ fromColor: [69, 117, 181], toColor: [255, 255, 191] }, { fromColor: [255, 255, 191], toColor: [214, 47, 39] }] }, { id: "conditionNumber_predefined", type: "multipart", colorRamps: [{ fromColor: [0, 97, 0], toColor: [255, 255, 0] }, { fromColor: [255, 255, 0], toColor: [255, 34, 0] }] }, { id: "cyanToPurple_predefined", type: "multipart", colorRamps: [{ fromColor: [0, 245, 245], toColor: [0, 0, 245] }, { fromColor: [0, 0, 245], toColor: [245, 0, 245] }] }, { id: "cyanLightToBlueDark_predefined", type: "multipart", colorRamps: [{ fromColor: [182, 237, 240], toColor: [31, 131, 224] }, { fromColor: [31, 131, 224], toColor: [9, 9, 145] }] }, { id: "distance_predefined", fromColor: [255, 200, 0], toColor: [0, 0, 255] }, { id: "elevation1_predefined", type: "multipart", colorRamps: [{ fromColor: [175, 240, 233], toColor: [255, 255, 179] }, { fromColor: [255, 255, 179], toColor: [0, 128, 64] }, { fromColor: [0, 128, 64], toColor: [252, 186, 3] }, { fromColor: [252, 186, 3], toColor: [128, 0, 0] }, { fromColor: [120, 0, 0], toColor: [105, 48, 13] }, { fromColor: [105, 48, 13], toColor: [171, 171, 171] }, { fromColor: [171, 171, 171], toColor: [255, 252, 255] }] }, { id: "elevation2_predefined", type: "multipart", colorRamps: [{ fromColor: [118, 219, 211], toColor: [255, 255, 199] }, { fromColor: [255, 255, 199], toColor: [255, 255, 128] }, { fromColor: [255, 255, 128], toColor: [217, 194, 121] }, { fromColor: [217, 194, 121], toColor: [135, 96, 38] }, { fromColor: [135, 96, 38], toColor: [150, 150, 181] }, { fromColor: [150, 150, 181], toColor: [181, 150, 181] }, { fromColor: [181, 150, 181], toColor: [255, 252, 255] }] }, { id: "errors_predefined", fromColor: [255, 235, 214], toColor: [196, 10, 10] }, { id: "grayLightToDark_predefined", fromColor: [219, 219, 219], toColor: [69, 69, 69] }, { id: "greenBright_predefined", fromColor: [204, 255, 204], toColor: [14, 204, 14] }, { id: "greenLightToDark_predefined", fromColor: [220, 245, 233], toColor: [34, 102, 51] }, { id: "greenToBlue_predefined", type: "multipart", colorRamps: [{ fromColor: [32, 204, 16], toColor: [0, 242, 242] }, { fromColor: [0, 242, 242], toColor: [2, 33, 227] }] }, { id: "orangeBright_predefined", fromColor: [255, 235, 204], toColor: [240, 118, 5] }, { id: "orangeLightToDark_predefined", fromColor: [250, 233, 212], toColor: [171, 65, 36] }, { id: "partialSpectrum_predefined", type: "multipart", colorRamps: [{ fromColor: [242, 241, 162], toColor: [255, 255, 0] }, { fromColor: [255, 255, 0], toColor: [255, 0, 0] }, { fromColor: [252, 3, 69], toColor: [176, 7, 237] }, { fromColor: [176, 7, 237], toColor: [2, 29, 173] }] }, { id: "partialSpectrum1Diverging_predefined", type: "multipart", colorRamps: [{ fromColor: [135, 38, 38], toColor: [240, 149, 12] }, { fromColor: [240, 149, 12], toColor: [255, 255, 191] }, { fromColor: [255, 255, 191], toColor: [74, 80, 181] }, { fromColor: [74, 80, 181], toColor: [39, 32, 122] }] }, { id: "partialSpectrum2Diverging_predefined", type: "multipart", colorRamps: [{ fromColor: [115, 77, 42], toColor: [201, 137, 52] }, { fromColor: [201, 137, 52], toColor: [255, 255, 191] }, { fromColor: [255, 255, 191], toColor: [91, 63, 176] }, { fromColor: [91, 63, 176], toColor: [81, 13, 97] }] }, { id: "pinkToYellowGreenDivergingBright_predefined", type: "multipart", colorRamps: [{ fromColor: [158, 30, 113], toColor: [255, 255, 191] }, { fromColor: [255, 255, 191], toColor: [99, 110, 45] }] }, { id: "pinkToYellowGreenDivergingDark_predefined", type: "multipart", colorRamps: [{ fromColor: [97, 47, 73], toColor: [204, 204, 102] }, { fromColor: [204, 204, 102], toColor: [22, 59, 15] }] }, { id: "precipitation_predefined", type: "multipart", colorRamps: [{ fromColor: [194, 82, 60], toColor: [237, 161, 19] }, { fromColor: [237, 161, 19], toColor: [255, 255, 0] }, { fromColor: [255, 255, 0], toColor: [0, 219, 0] }, { fromColor: [0, 219, 0], toColor: [32, 153, 143] }, { fromColor: [32, 153, 143], toColor: [11, 44, 122] }] }, { id: "prediction_predefined", type: "multipart", colorRamps: [{ fromColor: [40, 146, 199], toColor: [250, 250, 100] }, { fromColor: [250, 250, 100], toColor: [232, 16, 20] }] }, { id: "purpleBright_predefined", fromColor: [255, 204, 255], toColor: [199, 0, 199] }, { id: "purpleToGreenDivergingBright_predefined", type: "multipart", colorRamps: [{ fromColor: [77, 32, 150], toColor: [255, 255, 191] }, { fromColor: [255, 255, 191], toColor: [20, 122, 11] }] }, { id: "purpleToGreenDivergingDark_predefined", type: "multipart", colorRamps: [{ fromColor: [67, 14, 89], toColor: [204, 204, 102] }, { fromColor: [204, 204, 102], toColor: [24, 79, 15] }] }, { id: "purpleBlueBright_predefined", fromColor: [223, 184, 230], toColor: [112, 12, 242] }, { id: "purpleBlueLightToDark_predefined", fromColor: [229, 213, 242], toColor: [93, 44, 112] }, { id: "purpleRedBright_predefined", fromColor: [255, 204, 225], toColor: [199, 0, 99] }, { id: "purpleRedLightToDark_predefined", fromColor: [250, 215, 246], toColor: [143, 17, 57] }, { id: "redBright_predefined", fromColor: [255, 204, 204], toColor: [219, 0, 0] }, { id: "redLightToDark_predefined", fromColor: [255, 224, 224], toColor: [143, 10, 10] }, { id: "redToBlueDivergingBright_predefined", type: "multipart", colorRamps: [{ fromColor: [196, 69, 57], toColor: [255, 255, 191] }, { fromColor: [255, 255, 191], toColor: [48, 95, 207] }] }, { id: "redToBlueDivergingDark_predefined", type: "multipart", colorRamps: [{ fromColor: [107, 13, 13], toColor: [204, 204, 102] }, { fromColor: [204, 204, 102], toColor: [13, 53, 97] }] }, { id: "redToGreen_predefined", type: "multipart", colorRamps: [{ fromColor: [245, 0, 0], toColor: [245, 245, 0] }, { fromColor: [245, 245, 0], toColor: [0, 245, 0] }] }, { id: "redToGreenDivergingBright_predefined", type: "multipart", colorRamps: [{ fromColor: [186, 20, 20], toColor: [255, 255, 191] }, { fromColor: [255, 255, 191], toColor: [54, 145, 33] }] }, { id: "redToGreenDivergingDark_predefined", type: "multipart", colorRamps: [{ fromColor: [97, 21, 13], toColor: [204, 204, 102] }, { fromColor: [204, 204, 102], toColor: [16, 69, 16] }] }, { id: "slope_predefined", type: "multipart", colorRamps: [{ fromColor: [56, 168, 0], toColor: [255, 255, 0] }, { fromColor: [255, 255, 0], toColor: [255, 0, 0] }] }, { id: "spectrumFullBright_predefined", type: "multipart", colorRamps: [{ fromColor: [255, 0, 0], toColor: [255, 255, 0] }, { fromColor: [255, 255, 0], toColor: [0, 255, 255] }, { fromColor: [0, 255, 255], toColor: [0, 0, 255] }] }, { id: "spectrumFullDark_predefined", type: "multipart", colorRamps: [{ fromColor: [153, 0, 0], toColor: [153, 153, 0] }, { fromColor: [153, 153, 0], toColor: [0, 153, 153] }, { fromColor: [0, 153, 153], toColor: [0, 0, 153] }] }, { id: "spectrumFullLight_predefined", type: "multipart", colorRamps: [{ fromColor: [255, 153, 153], toColor: [255, 255, 153] }, { fromColor: [255, 255, 153], toColor: [153, 255, 255] }, { fromColor: [153, 255, 255], toColor: [153, 153, 255] }] }, { id: "surface_predefined", type: "multipart", colorRamps: [{ fromColor: [112, 153, 89], toColor: [242, 238, 162] }, { fromColor: [242, 238, 162], toColor: [242, 206, 133] }, { fromColor: [242, 206, 133], toColor: [194, 140, 124] }, { fromColor: [194, 140, 124], toColor: [255, 242, 255] }] }, { id: "temperature_predefined", type: "multipart", colorRamps: [{ fromColor: [255, 252, 255], toColor: [255, 0, 255] }, { fromColor: [255, 0, 255], toColor: [0, 0, 255] }, { fromColor: [0, 0, 255], toColor: [0, 255, 255] }, { fromColor: [0, 255, 255], toColor: [0, 255, 0] }, { fromColor: [0, 255, 0], toColor: [255, 255, 0] }, { fromColor: [255, 255, 0], toColor: [255, 128, 0] }, { fromColor: [255, 128, 0], toColor: [128, 0, 0] }] }, { id: "whiteToBlack_predefined", fromColor: [255, 255, 255], toColor: [0, 0, 0] }, { id: "yellowToDarkRed_predefined", type: "multipart", colorRamps: [{ fromColor: [255, 255, 128], toColor: [242, 167, 46] }, { fromColor: [242, 167, 46], toColor: [107, 0, 0] }] }, { id: "yellowToGreenToDarkBlue_predefined", type: "multipart", colorRamps: [{ fromColor: [255, 255, 128], toColor: [56, 224, 9] }, { fromColor: [56, 224, 9], toColor: [26, 147, 171] }, { fromColor: [26, 147, 171], toColor: [12, 16, 120] }] }, { id: "yellowToRed_predefined", fromColor: [245, 245, 0], toColor: [255, 0, 0] }, { id: "yellowGreenBright_predefined", fromColor: [236, 252, 204], toColor: [157, 204, 16] }, { id: "yellowGreenLightToDark_predefined", fromColor: [215, 240, 175], toColor: [96, 107, 45] }];
- var n9 = { aspect_predefined: "Aspect", blackToWhite_predefined: "Black to White", blueBright_predefined: "Blue Bright", blueLightToDark_predefined: "Blue Light to Dark", blueGreenBright_predefined: "Blue-Green Bright", blueGreenLightToDark_predefined: "Blue-Green Light to Dark", brownLightToDark_predefined: "Brown Light to Dark", brownToBlueGreenDivergingBright_predefined: "Brown to Blue Green Diverging, Bright", brownToBlueGreenDivergingDark_predefined: "Brown to Blue Green Diverging, Dark", coefficientBias_predefined: "Coefficient Bias", coldToHotDiverging_predefined: "Cold to Hot Diverging", conditionNumber_predefined: "Condition Number", cyanToPurple_predefined: "Cyan to Purple", cyanLightToBlueDark_predefined: "Cyan-Light to Blue-Dark", distance_predefined: "Distance", elevation1_predefined: "Elevation #1", elevation2_predefined: "Elevation #2", errors_predefined: "Errors", grayLightToDark_predefined: "Gray Light to Dark", greenBright_predefined: "Green Bright", greenLightToDark_predefined: "Green Light to Dark", greenToBlue_predefined: "Green to Blue", orangeBright_predefined: "Orange Bright", orangeLightToDark_predefined: "Orange Light to Dark", partialSpectrum_predefined: "Partial Spectrum", partialSpectrum1Diverging_predefined: "Partial Spectrum 1 Diverging", partialSpectrum2Diverging_predefined: "Partial Spectrum 2 Diverging", pinkToYellowGreenDivergingBright_predefined: "Pink to YellowGreen Diverging, Bright", pinkToYellowGreenDivergingDark_predefined: "Pink to YellowGreen Diverging, Dark", precipitation_predefined: "Precipitation", prediction_predefined: "Prediction", purpleBright_predefined: "Purple Bright", purpleToGreenDivergingBright_predefined: "Purple to Green Diverging, Bright", purpleToGreenDivergingDark_predefined: "Purple to Green Diverging, Dark", purpleBlueBright_predefined: "Purple-Blue Bright", purpleBlueLightToDark_predefined: "Purple-Blue Light to Dark", purpleRedBright_predefined: "Purple-Red Bright", purpleRedLightToDark_predefined: "Purple-Red Light to Dark", redBright_predefined: "Red Bright", redLightToDark_predefined: "Red Light to Dark", redToBlueDivergingBright_predefined: "Red to Blue Diverging, Bright", redToBlueDivergingDark_predefined: "Red to Blue Diverging, Dark", redToGreen_predefined: "Red to Green", redToGreenDivergingBright_predefined: "Red to Green Diverging, Bright", redToGreenDivergingDark_predefined: "Red to Green Diverging, Dark", slope_predefined: "Slope", spectrumFullBright_predefined: "Spectrum-Full Bright", spectrumFullDark_predefined: "Spectrum-Full Dark", spectrumFullLight_predefined: "Spectrum-Full Light", surface_predefined: "Surface", temperature_predefined: "Temperature", whiteToBlack_predefined: "White to Black", yellowToDarkRed_predefined: "Yellow to Dark Red", yellowToGreenToDarkBlue_predefined: "Yellow to Green to Dark Blue", yellowToRed_predefined: "Yellow to Red", yellowGreenBright_predefined: "Yellow-Green Bright", yellowGreenLightToDark_predefined: "Yellow-Green Light to Dark" };
- function d3(o5, r11) {
- if (!o5 || !r11 || o5.length !== r11.length)
- return false;
- for (let e8 = 0; e8 < o5.length; e8++)
- if (o5[e8] > r11[e8] + 2 || o5[e8] < r11[e8] - 2)
- return false;
- return true;
- }
- function p7(r11, e8) {
- if (!r11)
- return;
- const t7 = e8 || i6;
- let l8 = null;
- return "algorithmic" === r11.type ? t7.some((o5) => {
- if (d3(r11.fromColor.toRgb(), o5.fromColor) && d3(r11.toColor.toRgb(), o5.toColor))
- return l8 = o5.id, true;
- }) : "multipart" === r11.type && t7.some((e9) => {
- const t8 = r11.colorRamps, i7 = e9.colorRamps;
- if (t8 && i7 && t8.length === i7.length && !i7.some((r12, e10) => {
- if (!d3(t8[e10].fromColor.toRgb(), new l2(r12.fromColor).toRgb()) || !d3(t8[e10].toColor.toRgb(), new l2(r12.toColor).toRgb()))
- return true;
- })) {
- if (l8)
- return true;
- l8 = e9.id;
- }
- }), l8;
- }
- function f6(o5) {
- const r11 = p7(o5);
- return r11 ? n9[r11] : null;
- }
- function C3(o5) {
- const r11 = (o5 = o5 || {}).numColors || 256, e8 = o5.distanceOffset || 0, t7 = null != o5.isCustomInterval ? o5.isCustomInterval : null !== o5.distanceInterval && o5.distanceInterval !== 1 / (r11 - 1), l8 = o5.distanceInterval || 1 / (r11 - 1);
- return { ...o5, numColors: r11, distanceOffset: e8, interpolateAlpha: !!o5.interpolateAlpha, distanceInterval: l8, isCustomInterval: t7, weights: o5.weights };
- }
- function a10(o5, r11, e8) {
- const { numColors: t7, distanceOffset: l8, distanceInterval: i7, isCustomInterval: n10 } = C3(e8), d4 = 0 === o5.s, p8 = 0 === r11.s;
- let f7 = o5.h, a11 = r11.h;
- d4 && !p8 ? f7 = a11 : p8 && !d4 && (r11 = { ...r11, h: f7 }, a11 = f7);
- let m5, u6 = Math.abs(a11 - f7);
- const g6 = 360;
- u6 < g6 / 2 ? m5 = (a11 - f7) * i7 : (u6 = g6 - u6, m5 = f7 > a11 ? u6 * i7 : -u6 * i7);
- const s9 = (r11.s - o5.s) * i7, c7 = (r11.v - o5.v) * i7;
- let { s: h5, v: _3 } = o5, D4 = f7;
- if (l8) {
- const o6 = l8 / i7;
- D4 = (D4 + o6 * m5 + g6) % g6, h5 += o6 * s9, _3 += o6 * c7;
- }
- const B2 = [];
- for (let C4 = 0; C4 < t7 - 1; C4++)
- B2.push({ h: D4, s: h5, v: _3 }), D4 = (D4 + m5 + g6) % g6, h5 += s9, _3 += c7;
- return B2.push(n10 ? { h: D4, s: h5, v: _3 } : r11), B2;
- }
- function m4(o5, r11, e8) {
- const { numColors: t7, distanceOffset: l8, distanceInterval: i7, isCustomInterval: n10 } = C3(e8);
- let { l: d4, a: p8, b: f7 } = o5;
- const a11 = (r11.l - d4) * i7, m5 = (r11.a - p8) * i7, u6 = (r11.b - f7) * i7, g6 = [];
- if (l8) {
- const o6 = l8 / i7;
- d4 += o6 * a11, p8 += o6 * m5, f7 += o6 * u6;
- }
- for (let C4 = 0; C4 < t7 - 1; C4++)
- g6.push({ l: d4, a: p8, b: f7 }), d4 += a11, p8 += m5, f7 += u6;
- return g6.push(n10 ? { l: d4, a: p8, b: f7 } : r11), g6;
- }
- function u5(o5, r11, e8) {
- const { numColors: t7, distanceOffset: l8, distanceInterval: i7, isCustomInterval: n10 } = C3(e8), d4 = o5.h, p8 = r11.h, f7 = 2 * Math.PI;
- let a11;
- if (d4 <= p8) {
- const o6 = p8 - d4, r12 = p8 - d4 - f7;
- a11 = Math.abs(r12) < Math.abs(o6) ? r12 : o6;
- } else {
- const o6 = p8 + f7 - d4, r12 = p8 - d4;
- a11 = Math.abs(r12) < Math.abs(o6) ? r12 : o6;
- }
- const m5 = a11 * i7, u6 = (r11.l - o5.l) * i7, g6 = (r11.c - o5.c) * i7;
- let { l: s9, c: c7, h: h5 } = o5;
- if (l8) {
- const o6 = l8 / i7;
- s9 += o6 * u6, c7 += o6 * g6, h5 = (h5 + o6 * m5 + f7) % f7;
- }
- const _3 = [];
- for (let C4 = 0; C4 < t7 - 1; C4++)
- _3.push({ l: s9, c: c7, h: h5 }), s9 += u6, c7 += g6, h5 = (h5 + m5 + f7) % f7;
- return _3.push(n10 ? { l: s9, c: c7, h: h5 } : r11), _3;
- }
- function g5(o5, i7) {
- var _a, _b;
- let { fromColor: n10, toColor: d4 } = o5;
- 3 === n10.length && (n10 = n10.concat([255])), 3 === d4.length && (d4 = d4.concat([255]));
- const p8 = o5.algorithm || "esriCIELabAlgorithm", { numColors: f7, distanceOffset: g6, isCustomInterval: s9, interpolateAlpha: c7 } = C3(i7);
- if (1 === f7 && 0 === g6)
- return [n10];
- if (2 === f7 && 0 === g6 && !s9)
- return [n10, d4];
- const h5 = { r: n10[0], g: n10[1], b: n10[2] }, _3 = { r: d4[0], g: d4[1], b: d4[2] }, D4 = "esriCIELabAlgorithm" === p8 ? m4(z(h5), z(_3), i7) : "esriHSVAlgorithm" === p8 ? a10(y3(h5), y3(_3), i7) : u5(v(h5), v(_3), i7), B2 = [], k5 = (_a = n10[3]) != null ? _a : 255, v4 = (((_b = d4[3]) != null ? _b : 255) - k5) / (f7 - 1);
- for (let r11 = 0; r11 < f7; r11++) {
- const { r: o6, g: e8, b: t7 } = p3(D4[r11]), i8 = c7 ? Math.round(k5 + v4 * r11) : 255;
- B2.push([o6, e8, t7, i8]);
- }
- return B2;
- }
- function s8(o5, r11) {
- const { numColors: e8, interpolateAlpha: t7 } = C3(r11);
- let l8 = r11 == null ? void 0 : r11.weights;
- const { colorRamps: i7 } = o5;
- if (l8) {
- const o6 = l8.reduce((o7, r12) => o7 + r12);
- l8 = l8.map((r12) => r12 / o6);
- } else {
- l8 = [];
- for (let o6 = 0; o6 < i7.length; o6++)
- l8[o6] = 1 / i7.length;
- }
- const n10 = [];
- let d4 = 0, p8 = 0;
- const f7 = 1 / (e8 - 1);
- let a11 = false;
- for (let C4 = 0; C4 < i7.length; C4++) {
- let o6 = a11 ? 0 : d4 * f7 - p8, r12 = C4 === i7.length - 1 ? e8 - 1 - d4 : (l8[C4] - o6) / f7;
- if (a11 = Math.ceil(r12) === r12, r12 = Math.ceil(r12), 0 === r12)
- continue;
- o6 /= l8[C4];
- const m6 = g5(i7[C4], { numColors: r12, interpolateAlpha: t7, distanceOffset: o6, distanceInterval: f7 / l8[C4] });
- d4 += m6.length, n10.push(...m6), p8 += l8[C4];
- }
- const m5 = [...i7[i7.length - 1].toColor];
- return 3 === m5.length && m5.push(255), n10.push(m5), n10;
- }
- function c6(o5, r11 = 256, e8 = false) {
- const t7 = "toJSON" in o5 ? o5.toJSON() : o5, l8 = { numColors: r11, interpolateAlpha: e8 };
- return "multipart" === t7.type ? s8(t7, l8) : g5(t7, l8);
- }
- function h4(o5, r11 = 256, e8 = false) {
- const t7 = c6(o5, r11, e8);
- return t7.forEach((o6, r12) => {
- o6.unshift(r12), e8 || o6.pop();
- }), t7;
- }
- function _(o5) {
- const r11 = f6(o5);
- if (o5) {
- if ("algorithmic" === o5.type)
- return { ...D3(o5), Name: r11 };
- if (o5.colorRamps) {
- const e8 = o5.colorRamps.map(D3);
- return { type: "MultiPartColorRamp", NumColorRamps: e8.length, ArrayOfColorRamp: e8, Name: r11 };
- }
- }
- }
- function D3(o5) {
- var _a;
- if (!o5)
- return;
- return { Algorithm: ((_a = o5.toJSON()) == null ? void 0 : _a.Algorithm) || "esriHSVAlgorithm", type: "AlgorithmicColorRamp", FromColor: B(o5.fromColor), ToColor: B(o5.toColor) };
- }
- function B(o5) {
- const e8 = y3(o5);
- return { type: "HsvColor", Hue: e8.h, Saturation: e8.s, Value: e8.v, AlphaValue: 255 };
- }
- function k4(o5) {
- const r11 = o5.reverse().map((o6) => {
- const r12 = o6.toString(16);
- return r12.length < 2 ? "0" + r12 : r12;
- });
- return 4294967295 & Number.parseInt(r11.join(""), 16);
- }
- // node_modules/@arcgis/core/renderers/support/RasterSymbolizer.js
- function L2(e8, t7) {
- const { attributeTable: r11, bandCount: s9 } = e8;
- if (t(r11) || s9 > 1)
- return false;
- if (t7) {
- if (null == r11.fields.find((e9) => e9.name.toLowerCase() === t7.toLowerCase()))
- return false;
- }
- return true;
- }
- function _2(e8) {
- const { bandCount: t7, dataType: r11, pixelType: s9 } = e8;
- return "elevation" === r11 || "generic" === r11 && 1 === t7 && ("s16" === s9 || "f32" === s9 || "f64" === s9);
- }
- function V(e8) {
- const { bandCount: t7, colormap: r11 } = e8;
- return r(r11) && r11.length > 0 && 1 === t7;
- }
- var v3 = class extends l {
- constructor(e8) {
- super(e8);
- }
- bind() {
- const { rendererJSON: e8 } = this;
- if (!e8)
- return { success: false };
- let t7;
- switch (this.lookup = { rendererJSON: {} }, e8.type) {
- case "uniqueValue":
- t7 = this._updateUVRenderer(e8);
- break;
- case "rasterColormap":
- t7 = this._updateColormapRenderer(e8);
- break;
- case "rasterStretch":
- t7 = this._updateStretchRenderer(e8);
- break;
- case "classBreaks":
- t7 = this._updateClassBreaksRenderer(e8);
- break;
- case "rasterShadedRelief":
- t7 = this._updateShadedReliefRenderer(e8);
- break;
- case "vectorField":
- t7 = this._updateVectorFieldRenderer();
- break;
- case "flowRenderer":
- t7 = this._updateFlowRenderer();
- }
- return t7;
- }
- symbolize(e8) {
- let t7 = e8 && e8.pixelBlock;
- if (!O3(t7))
- return t7;
- if (e8.simpleStretchParams && "rasterStretch" === this.rendererJSON.type)
- return this.simpleStretch(t7, e8.simpleStretchParams);
- try {
- let r11;
- switch (t7.pixels.length > 3 && (t7 = s4(t7, [0, 1, 2])), this.rendererJSON.type) {
- case "uniqueValue":
- case "rasterColormap":
- r11 = this._symbolizeColormap(t7);
- break;
- case "classBreaks":
- r11 = this._symbolizeClassBreaks(t7);
- break;
- case "rasterStretch":
- r11 = this._symbolizeStretch(t7, e8.bandIds);
- break;
- case "rasterShadedRelief": {
- const s9 = e8.extent, a11 = s9.spatialReference.isGeographic, o5 = { x: (s9.xmax - s9.xmin) / t7.width, y: (s9.ymax - s9.ymin) / t7.height };
- r11 = this._symbolizeShadedRelief(t7, { isGCS: a11, resolution: o5 });
- break;
- }
- }
- return r11;
- } catch (r11) {
- return s.getLogger(this.declaredClass).error("symbolize", r11.message), t7;
- }
- }
- simpleStretch(e8, t7) {
- if (!O3(e8))
- return e8;
- try {
- return e8.pixels.length > 3 && (e8 = s4(e8, [0, 1, 2])), d2(e8, t7);
- } catch (r11) {
- return s.getLogger(this.declaredClass).error("symbolize", r11.message), e8;
- }
- }
- generateWebGLParameters(e8) {
- if (["uniqueValue", "rasterColormap", "classBreaks"].includes(this.rendererJSON.type)) {
- const { indexedColormap: e9, offset: t8 } = this.lookup.colormapLut || {};
- return { colormap: e9, colormapOffset: t8, type: "lut" };
- }
- const { pixelBlock: t7, isGCS: r11, resolution: s9, bandIds: a11 } = e8, { rendererJSON: o5 } = this;
- return "rasterStretch" === o5.type ? this._generateStretchWebGLParams(t7, o5, a11) : "rasterShadedRelief" === o5.type ? this._generateShadedReliefWebGLParams(o5, r11, s9) : "vectorField" === o5.type ? this._generateVectorFieldWebGLParams(o5) : null;
- }
- _isLUTChanged(e8) {
- if (!this.lookup || !this.lookup.rendererJSON)
- return true;
- if ("colorRamp" in this.rendererJSON) {
- const t7 = this.rendererJSON.colorRamp;
- return e8 ? JSON.stringify(t7) !== JSON.stringify(this.lookup.rendererJSON.colorRamp) : (this.rendererJSON, this.lookup.rendererJSON, JSON.stringify(this.rendererJSON) !== JSON.stringify(this.lookup.rendererJSON));
- }
- return JSON.stringify(this.rendererJSON) !== JSON.stringify(this.lookup.rendererJSON);
- }
- _symbolizeColormap(e8) {
- if (this._isLUTChanged()) {
- if (!this.bind().success)
- return e8;
- }
- return f(e8, this.lookup.colormapLut);
- }
- _symbolizeClassBreaks(e8) {
- var _a;
- const { canUseIndexedLUT: t7 } = this._analyzeClassBreaks(this.rendererJSON);
- if (this._isLUTChanged()) {
- if (!this.bind().success)
- return e8;
- }
- return t7 ? f(e8, this.lookup.colormapLut) : p2(e8, (_a = this.lookup.remapLut) != null ? _a : []);
- }
- _symbolizeStretch(e8, t7) {
- var _a, _b, _c;
- const { rasterInfo: r11 } = this, { pixelType: s9, bandCount: o5 } = r11, n10 = this.rendererJSON, i7 = ["u8", "u16", "s8", "s16"].includes(s9);
- let l8, u6;
- const { dra: c7 } = n10, { gamma: d4 } = this.lookup;
- if ("histogramEqualization" === n10.stretchType) {
- const s10 = c7 ? null : (_a = this.lookup) == null ? void 0 : _a.histogramLut, a11 = x3(n10, { rasterInfo: r11, pixelBlock: e8, bandIds: t7, returnHistogramLut: !s10 }), o6 = d2(e8, { ...a11, gamma: d4 });
- u6 = c2(o6, { lut: c7 ? a11.histogramLut : s10, offset: 0 });
- } else if (i7) {
- if (c7) {
- const a11 = x3(n10, { rasterInfo: r11, pixelBlock: e8, bandIds: t7 });
- l8 = u3({ pixelType: s9, ...a11, gamma: d4 });
- } else if (this._isLUTChanged()) {
- if (!this.bind().success)
- return e8;
- l8 = this.lookup ? this.lookup.stretchLut : null;
- } else
- l8 = this.lookup ? this.lookup.stretchLut : null;
- if (!l8)
- return e8;
- o5 > 1 && (t7 == null ? void 0 : t7.length) === ((_b = e2(e8)) == null ? void 0 : _b.pixels.length) && (l8 == null ? void 0 : l8.lut.length) === o5 && (l8 = { lut: t7.map((e9) => l8.lut[e9]), offset: l8.offset }), u6 = c2(e8, l8);
- } else {
- const s10 = x3(n10, { rasterInfo: r11, pixelBlock: e8, bandIds: t7 });
- u6 = d2(e8, { ...s10, gamma: d4 });
- }
- if (n10.colorRamp) {
- if (this._isLUTChanged(true)) {
- if (!this.bind().success)
- return e8;
- }
- u6 = f(u6, (_c = this.lookup) == null ? void 0 : _c.colormapLut);
- }
- return u6;
- }
- _symbolizeShadedRelief(e8, t7) {
- var _a, _b;
- const r11 = this.rendererJSON, s9 = { ...r11, ...t7 }, o5 = l7(e8, s9);
- if (!r11.colorRamp)
- return o5;
- let n10;
- if (this._isLUTChanged(true)) {
- if (!this.bind().success)
- return o5;
- n10 = this.lookup ? this.lookup.hsvMap : null;
- } else
- n10 = this.lookup ? this.lookup.hsvMap : null;
- if (!n10)
- return o5;
- const i7 = (_b = (_a = e2(this.rasterInfo.statistics)) == null ? void 0 : _a[0]) != null ? _b : { min: 0, max: 8e3 };
- return s7(o5, e8, n10, i7), o5;
- }
- _isVectorFieldData() {
- const { bandCount: e8, dataType: t7 } = this.rasterInfo;
- return 2 === e8 && ("vector-magdir" === t7 || "vector-uv" === t7);
- }
- _updateVectorFieldRenderer() {
- return this._isVectorFieldData() ? { success: true } : { success: false, error: `Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".` };
- }
- _updateFlowRenderer() {
- return this._isVectorFieldData() ? { success: true } : { success: false, error: `Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".` };
- }
- _updateUVRenderer(e8) {
- var _a;
- const { bandCount: t7, attributeTable: r11, pixelType: s9 } = this.rasterInfo, a11 = e8.field1;
- if (!a11)
- return { success: false, error: "Unsupported renderer; missing UniqueValueRenderer.field." };
- const n10 = e8.defaultSymbol, i7 = 1 === t7 && ["u8", "s8"].includes(s9);
- if (!L2(this.rasterInfo, a11) && !i7)
- return { success: false, error: "Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table." };
- const l8 = [];
- if (r(r11)) {
- const t8 = r11.fields.find((e9) => "value" === e9.name.toLowerCase());
- if (!t8)
- return { success: false, error: "Unsupported data; the data's raster attribute table does not have a value field." };
- r11.features.forEach((r12) => {
- var _a2, _b;
- const s10 = (_a2 = e8.uniqueValueInfos) == null ? void 0 : _a2.find((e9) => String(e9.value) === String(r12.attributes[a11])), o5 = (_b = s10 == null ? void 0 : s10.symbol) == null ? void 0 : _b.color;
- o5 ? l8.push([r12.attributes[t8.name]].concat(o5)) : n10 && l8.push([r12.attributes[t8.name]].concat(n10.color));
- });
- } else {
- if ("value" !== a11.toLowerCase())
- return { success: false, error: 'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.' };
- (_a = e8.uniqueValueInfos) == null ? void 0 : _a.forEach((e9) => {
- var _a2;
- const t8 = (_a2 = e9 == null ? void 0 : e9.symbol) == null ? void 0 : _a2.color;
- t8 ? l8.push([parseInt("" + e9.value, 10)].concat(t8)) : n10 && l8.push([parseInt("" + e9.value, 10)].concat(n10 == null ? void 0 : n10.color));
- });
- }
- if (0 === l8.length)
- return { success: false, error: "Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table." };
- const u6 = a3({ colormap: l8 });
- return this.lookup = { rendererJSON: e8, colormapLut: u6 }, this.canRenderInWebGL = true, { success: true };
- }
- _updateColormapRenderer(e8) {
- if (!V(this.rasterInfo))
- return { success: false, error: "Unsupported data; the data source does not have a colormap." };
- const t7 = e8.colormapInfos.map((e9) => [e9.value].concat(e9.color)).sort((e9, t8) => e9[0] - t8[0]);
- if (!t7 || 0 === t7.length)
- return { success: false, error: "Unsupported renderer; ColormapRenderer must have meaningful colormapInfos." };
- const r11 = a3({ colormap: t7 });
- return this.lookup = { rendererJSON: e8, colormapLut: r11 }, this.canRenderInWebGL = true, { success: true };
- }
- _updateShadedReliefRenderer(e8) {
- if (!_2(this.rasterInfo))
- return { success: false, error: `Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.` };
- if (e8.colorRamp) {
- const r11 = h4(e8.colorRamp, 256, true), s9 = a3({ colormap: r11 }), a11 = [], o5 = s9.indexedColormap;
- for (let e9 = 0; e9 < o5.length; e9 += 4) {
- const r12 = y3({ r: o5[e9], g: o5[e9 + 1], b: o5[e9 + 2] });
- a11.push([r12.h / 60, r12.s / 100, 255 * r12.v / 100]);
- }
- this.lookup = { rendererJSON: e8, colormapLut: s9, hsvMap: a11 };
- } else
- this.lookup = null;
- return this.canRenderInWebGL = true, { success: true };
- }
- _analyzeClassBreaks(e8) {
- const { attributeTable: t7, pixelType: r11 } = this.rasterInfo, s9 = r(t7) ? t7.fields.find((e9) => "value" === e9.name.toLowerCase()) : null, a11 = r(t7) ? t7.fields.find((t8) => t8.name.toLowerCase() === e8.field.toLowerCase()) : null, n10 = null != s9 && null !== a11;
- return { canUseIndexedLUT: ["u8", "u16", "s8", "s16"].includes(r11) || n10, tableValueField: s9, tableBreakField: a11 };
- }
- _updateClassBreaksRenderer(e8) {
- var _a;
- const { attributeTable: t7 } = this.rasterInfo, { canUseIndexedLUT: r11, tableValueField: s9, tableBreakField: a11 } = this._analyzeClassBreaks(e8), n10 = e8.classBreakInfos;
- if (!(n10 == null ? void 0 : n10.length))
- return { success: false, error: "Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos." };
- const i7 = n10.sort((e9, t8) => e9.classMaxValue - t8.classMaxValue), l8 = i7[i7.length - 1];
- let u6 = e8.minValue;
- if (!r11) {
- const t8 = [];
- for (let e9 = 0; e9 < i7.length; e9++)
- t8.push({ value: (_a = i7[e9].classMinValue) != null ? _a : u6, mappedColor: i7[e9].symbol.color }), u6 = i7[e9].classMaxValue;
- return t8.push({ value: l8.classMaxValue, mappedColor: l8.symbol.color }), this.lookup = { rendererJSON: e8, remapLut: t8 }, this.canRenderInWebGL = false, { success: true };
- }
- const c7 = [];
- if (r(t7) && null != s9 && null !== a11 && s9 !== a11) {
- const r12 = s9.name, o5 = a11.name, n11 = i7[i7.length - 1], { classMaxValue: l9 } = n11;
- u6 = e8.minValue;
- for (const e9 of t7.features) {
- const t8 = e9.attributes[r12], s10 = e9.attributes[o5], a12 = s10 === l9 ? n11 : s10 < u6 ? null : i7.find(({ classMaxValue: e10 }) => e10 > s10);
- a12 && c7.push([t8].concat(a12.symbol.color));
- }
- } else {
- u6 = Math.floor(e8.minValue);
- for (let e9 = 0; e9 < i7.length; e9++) {
- const t8 = i7[e9];
- for (let e10 = u6; e10 < t8.classMaxValue; e10++)
- c7.push([e10].concat(t8.symbol.color));
- u6 = Math.ceil(t8.classMaxValue);
- }
- l8.classMaxValue === u6 && c7.push([l8.classMaxValue].concat(l8.symbol.color));
- }
- const p8 = a3({ colormap: c7, fillUnspecified: false });
- return this.lookup = { rendererJSON: e8, colormapLut: p8 }, this.canRenderInWebGL = true, { success: true };
- }
- _isHistogramRequired(e8) {
- return "percentClip" === e8 || "histogramEqualization" === e8;
- }
- _isValidRasterStatistics(e8) {
- return r(e8) && e8.length > 0 && null != e8[0].min && null != e8[0].max;
- }
- _updateStretchRenderer(e8) {
- var _a, _b;
- let { stretchType: t7, dra: r11 } = e8;
- if (!("none" === t7 || ((_a = e8.statistics) == null ? void 0 : _a.length) || this._isValidRasterStatistics(this.rasterInfo.statistics) || r11))
- return { success: false, error: "Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used." };
- const s9 = e2(e8.histograms || this.rasterInfo.histograms);
- !this._isHistogramRequired(e8.stretchType) || (s9 == null ? void 0 : s9.length) || r11 || (t7 = "minMax");
- const { computeGamma: o5, useGamma: n10, colorRamp: i7 } = e8;
- let { gamma: l8 } = e8;
- if (n10 && o5 && !(l8 == null ? void 0 : l8.length)) {
- const t8 = ((_b = e8.statistics) == null ? void 0 : _b.length) ? e8.statistics : e2(this.rasterInfo.statistics);
- l8 = c5(this.rasterInfo.pixelType, t8);
- }
- const u6 = this.rasterInfo.pixelType, c7 = !r11 && ["u8", "u16", "s8", "s16"].includes(u6);
- if ("histogramEqualization" === t7) {
- const t8 = s9.map((e9) => l4(e9));
- this.lookup = { rendererJSON: e8, histogramLut: t8 };
- } else if (c7) {
- const t8 = x3(e8, { rasterInfo: this.rasterInfo }), r12 = u3({ pixelType: u6, ...t8, gamma: n10 ? l8 : null });
- this.lookup = { rendererJSON: e8, stretchLut: r12 };
- }
- if (i7) {
- const t8 = h4(i7, 256, true);
- this.lookup || (this.lookup = { rendererJSON: e8 }), this.lookup.colormapLut = a3({ colormap: t8 }), this.lookup.rendererJSON = e8;
- }
- return this.lookup.gamma = n10 && (l8 == null ? void 0 : l8.length) ? l8 : null, this.canRenderInWebGL = true, { success: true };
- }
- _generateStretchWebGLParams(e8, t7, r11) {
- let s9 = null, a11 = null;
- const n10 = this.lookup && this.lookup.colormapLut;
- t7.colorRamp && n10 && (s9 = n10.indexedColormap, a11 = n10.offset), "histogramEqualization" === t7.stretchType && (t7 = { ...t7, stretchType: "minMax" });
- const { gamma: i7 } = this.lookup, l8 = !!(t7.useGamma && i7 && i7.some((e9) => 1 !== e9)), { minCutOff: u6, maxCutOff: c7, outMin: p8, outMax: d4 } = x3(t7, { rasterInfo: this.rasterInfo, pixelBlock: e8, bandIds: r11 });
- let h5 = 0;
- r(e8) && (h5 = e8.getPlaneCount(), 2 === h5 && ((e8 = e8.clone()).statistics = [e8.statistics[0]], e8.pixels = [e8.pixels[0]]));
- const m5 = Math.min(3, (r11 == null ? void 0 : r11.length) || h5 || this.rasterInfo.bandCount), f7 = new Float32Array(m5), y6 = s9 || l8 ? 1 : 255;
- let g6;
- for (g6 = 0; g6 < m5; g6++)
- f7[g6] = (d4 - p8) / (c7[g6] - u6[g6]) / y6;
- const S4 = new Float32Array(m5);
- if (l8)
- for (g6 = 0; g6 < m5; g6++)
- i7[g6] > 1 ? i7[g6] > 2 ? S4[g6] = 6.5 + (i7[g6] - 2) ** 2.5 : S4[g6] = 6.5 + 100 * (2 - i7[g6]) ** 4 : S4[g6] = 1;
- return { bandCount: m5, outMin: p8 / y6, outMax: d4 / y6, minCutOff: u6, maxCutOff: c7, factor: f7, useGamma: l8, gamma: l8 ? i7 : [1, 1, 1], gammaCorrection: l8 ? S4 : [1, 1, 1], colormap: s9, colormapOffset: a11, stretchType: t7.stretchType, type: "stretch" };
- }
- _generateShadedReliefWebGLParams(e8, t7 = false, r11 = { x: 0, y: 0 }) {
- var _a, _b, _c;
- let s9 = null, o5 = null;
- const n10 = this.lookup && this.lookup.colormapLut;
- e8.colorRamp && n10 && (s9 = n10.indexedColormap, o5 = n10.offset);
- const i7 = { ...e8, isGCS: t7, resolution: r11 }, l8 = n8(i7), u6 = (_a = e2(this.rasterInfo.statistics)) == null ? void 0 : _a[0];
- return { ...l8, minValue: (_b = u6 == null ? void 0 : u6.min) != null ? _b : 0, maxValue: (_c = u6 == null ? void 0 : u6.max) != null ? _c : 8e3, hillshadeType: "traditional" === e8.hillshadeType ? 0 : 1, type: "hillshade", colormap: s9, colormapOffset: o5 };
- }
- _generateVectorFieldWebGLParams(e8) {
- var _a, _b, _c, _d, _e, _f, _g, _h;
- const { style: t7, inputUnit: r11, outputUnit: s9, visualVariables: a11, symbolTileSize: n10, flowRepresentation: i7 } = e8;
- let l8;
- const u6 = (_b = (_a = this.rasterInfo.statistics) == null ? void 0 : _a[0].min) != null ? _b : 0, c7 = (_d = (_c = this.rasterInfo.statistics) == null ? void 0 : _c[0].max) != null ? _d : 50, p8 = (_e = a11 == null ? void 0 : a11.find((e9) => "sizeInfo" === e9.type)) != null ? _e : { type: "sizeInfo", field: "Magnitude", maxDataValue: c7, maxSize: 0.8 * n10, minDataValue: u6, minSize: 0.2 * n10 }, d4 = (_f = p8.minDataValue) != null ? _f : u6, h5 = (_g = p8.maxDataValue) != null ? _g : c7, m5 = r(p8.maxSize) && r(p8.minSize) ? [p8.minSize / n10, p8.maxSize / n10] : [0.2, 0.8];
- if ("wind_speed" === t7) {
- const e9 = (m5[0] + m5[1]) / 2;
- m5[0] = m5[1] = e9;
- }
- const f7 = r(d4) && r(h5) ? [d4, h5] : null;
- if ("classified_arrow" === t7)
- if (r(d4) && r(h5) && r(p8)) {
- l8 = [];
- const e9 = (p8.maxDataValue - p8.minDataValue) / 5;
- for (let t8 = 0; t8 < 6; t8++)
- l8.push(p8.minDataValue + e9 * t8);
- } else
- l8 = [0, 1e-6, 3.5, 7, 10.5, 14];
- const y6 = "flow_to" === i7 === ("ocean_current_kn" === t7 || "ocean_current_m" === t7) ? 0 : Math.PI, b3 = a11 == null ? void 0 : a11.find((e9) => "rotationInfo" === e9.type);
- return { breakValues: l8, dataRange: f7, inputUnit: r11, outputUnit: s9, symbolTileSize: n10, symbolPercentRange: m5, style: t7 || "single_arrow", rotation: y6, rotationType: ((_h = this.rasterInfo.storageInfo) == null ? void 0 : _h.tileInfo) && "vector-uv" === this.rasterInfo.dataType ? "geographic" : (b3 == null ? void 0 : b3.rotationType) || e8.rotationType, type: "vectorField" };
- }
- };
- function O3(e8) {
- return r2(e8) && 0 !== e8.validPixelCount;
- }
- e([y2({ json: { write: true } })], v3.prototype, "rendererJSON", void 0), e([y2({ type: u4, json: { write: true } })], v3.prototype, "rasterInfo", void 0), e([y2({ json: { write: true } })], v3.prototype, "lookup", void 0), e([y2()], v3.prototype, "canRenderInWebGL", void 0), v3 = e([n("esri.renderers.support.RasterSymbolizer")], v3);
- var T3 = v3;
- export {
- r9 as r,
- n5 as n,
- r10 as r2,
- b,
- D,
- O,
- N,
- G,
- P2 as P,
- S3 as S,
- a9 as a,
- o4 as o,
- i6 as i,
- f6 as f,
- c6 as c,
- h4 as h,
- _,
- k4 as k,
- n6 as n2,
- a7 as a2,
- u3 as u,
- p5 as p,
- g4 as g,
- x3 as x,
- d2 as d,
- n7 as n3,
- u4 as u2,
- T3 as T
- };
- //# sourceMappingURL=chunk-3BKH6ISD.js.map
|