chunk-LC47RING.js 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216
  1. import {
  2. T
  3. } from "./chunk-L553EHL3.js";
  4. import {
  5. a,
  6. f,
  7. l as l2
  8. } from "./chunk-2GP5D74I.js";
  9. import {
  10. s
  11. } from "./chunk-R24MO4IV.js";
  12. import {
  13. b
  14. } from "./chunk-YQBYWPBD.js";
  15. import {
  16. X
  17. } from "./chunk-XO5VJRK4.js";
  18. import {
  19. t as t2
  20. } from "./chunk-4OM3EX6P.js";
  21. import {
  22. C
  23. } from "./chunk-3OFVLRSL.js";
  24. import {
  25. e
  26. } from "./chunk-5FHRTN6L.js";
  27. import {
  28. p,
  29. v,
  30. z
  31. } from "./chunk-NDUYF7XW.js";
  32. import {
  33. l
  34. } from "./chunk-X4SA4ELJ.js";
  35. import {
  36. t
  37. } from "./chunk-YXWMMD76.js";
  38. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/MemoryBuffer.js
  39. var t3 = class {
  40. constructor(t7) {
  41. this._array = [], t7 <= 0 && console.error("strideInBytes must be positive!"), this._stride = t7;
  42. }
  43. get array() {
  44. return this._array;
  45. }
  46. get index() {
  47. return 4 * this._array.length / this._stride;
  48. }
  49. get itemSize() {
  50. return this._stride;
  51. }
  52. get sizeInBytes() {
  53. return 4 * this._array.length;
  54. }
  55. reset() {
  56. this.array.length = 0;
  57. }
  58. toBuffer() {
  59. return new Uint32Array(this._array).buffer;
  60. }
  61. static i1616to32(t7, r2) {
  62. return 65535 & t7 | r2 << 16;
  63. }
  64. static i8888to32(t7, r2, e3, s2) {
  65. return 255 & t7 | (255 & r2) << 8 | (255 & e3) << 16 | s2 << 24;
  66. }
  67. static i8816to32(t7, r2, e3) {
  68. return 255 & t7 | (255 & r2) << 8 | e3 << 16;
  69. }
  70. };
  71. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/enums.js
  72. var N;
  73. var R;
  74. !function(N3) {
  75. N3[N3.R8_SIGNED = 0] = "R8_SIGNED", N3[N3.R8_UNSIGNED = 1] = "R8_UNSIGNED", N3[N3.R16_SIGNED = 2] = "R16_SIGNED", N3[N3.R16_UNSIGNED = 3] = "R16_UNSIGNED", N3[N3.R8G8_SIGNED = 4] = "R8G8_SIGNED", N3[N3.R8G8_UNSIGNED = 5] = "R8G8_UNSIGNED", N3[N3.R16G16_SIGNED = 6] = "R16G16_SIGNED", N3[N3.R16G16_UNSIGNED = 7] = "R16G16_UNSIGNED", N3[N3.R8G8B8A8_SIGNED = 8] = "R8G8B8A8_SIGNED", N3[N3.R8G8B8A8_UNSIGNED = 9] = "R8G8B8A8_UNSIGNED", N3[N3.R8G8B8A8_COLOR = 10] = "R8G8B8A8_COLOR", N3[N3.R16G16B16A16_DASHARRAY = 11] = "R16G16B16A16_DASHARRAY", N3[N3.R16G16B16A16_PATTERN = 12] = "R16G16B16A16_PATTERN";
  76. }(N || (N = {})), function(N3) {
  77. N3[N3.UNIFORM = 0] = "UNIFORM", N3[N3.DATA_DRIVEN = 1] = "DATA_DRIVEN", N3[N3.INTERPOLATED_DATA_DRIVEN = 2] = "INTERPOLATED_DATA_DRIVEN", N3[N3.UNUSED = 3] = "UNUSED";
  78. }(R || (R = {}));
  79. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLMaterial.js
  80. var i = class {
  81. constructor(t7) {
  82. this._locations = /* @__PURE__ */ new Map(), this._key = t7;
  83. }
  84. get key() {
  85. return this._key;
  86. }
  87. get type() {
  88. return 7 & this._key;
  89. }
  90. defines() {
  91. return [];
  92. }
  93. getStride() {
  94. return this._layoutInfo || this._buildAttributesInfo(), this._stride;
  95. }
  96. getAttributeLocations() {
  97. return 0 === this._locations.size && this._buildAttributesInfo(), this._locations;
  98. }
  99. getLayoutInfo() {
  100. return this._layoutInfo || this._buildAttributesInfo(), this._layoutInfo;
  101. }
  102. getEncodingInfos() {
  103. return this._propertyEncodingInfo || this._buildAttributesInfo(), this._propertyEncodingInfo;
  104. }
  105. getUniforms() {
  106. return this._uniforms || this._buildAttributesInfo(), this._uniforms;
  107. }
  108. getShaderHeader() {
  109. return this._shaderHeader || this._buildAttributesInfo(), this._shaderHeader;
  110. }
  111. getShaderMain() {
  112. return this._shaderMain || this._buildAttributesInfo(), this._shaderMain;
  113. }
  114. setDataUniforms(t7, e3, n2, o2, s2) {
  115. const r2 = this.getUniforms();
  116. for (const i5 of r2) {
  117. const { name: r3, type: a5, getValue: c5 } = i5, u2 = c5(n2, e3, o2, s2);
  118. if (null !== u2)
  119. switch (a5) {
  120. case "float":
  121. t7.setUniform1f(r3, u2);
  122. break;
  123. case "vec2":
  124. t7.setUniform2fv(r3, u2);
  125. break;
  126. case "vec4":
  127. t7.setUniform4fv(r3, u2);
  128. }
  129. }
  130. }
  131. encodeAttributes(t7, e3, o2, s2) {
  132. var _a;
  133. const r2 = this.attributesInfo(), i5 = this.getEncodingInfos(), a5 = [];
  134. let c5 = 0, u2 = 0;
  135. for (const f4 of Object.keys(i5)) {
  136. const _3 = i5[f4], { type: h2, precisionFactor: d4, isLayout: l6 } = r2[f4], y2 = l6 ? o2.getLayoutProperty(f4) : o2.getPaintProperty(f4), m2 = (_a = y2.interpolator) == null ? void 0 : _a.getInterpolationRange(e3);
  137. let I2 = 0;
  138. for (const o3 of _3) {
  139. const { offset: r3, bufferElementsToAdd: i6 } = o3;
  140. if (i6 > 0) {
  141. for (let t8 = 0; t8 < i6; t8++)
  142. a5.push(0);
  143. c5 += u2, u2 = o3.bufferElementsToAdd;
  144. }
  145. const f5 = s2 != null ? s2 : y2.getValue(m2 ? m2[I2] : e3, t7);
  146. switch (h2) {
  147. case N.R8_SIGNED:
  148. case N.R8_UNSIGNED:
  149. a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3);
  150. break;
  151. case N.R16_SIGNED:
  152. case N.R16_UNSIGNED:
  153. a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3);
  154. break;
  155. case N.R8G8_SIGNED:
  156. case N.R8G8_UNSIGNED:
  157. a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 8);
  158. break;
  159. case N.R16G16_SIGNED:
  160. case N.R16G16_UNSIGNED:
  161. a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3), a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3 + 16);
  162. break;
  163. case N.R8G8B8A8_SIGNED:
  164. case N.R8G8B8A8_UNSIGNED:
  165. a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 8), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 16), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 24);
  166. break;
  167. case N.R8G8B8A8_COLOR:
  168. a5[c5] = this._encodeColor(f5);
  169. break;
  170. case N.R16G16B16A16_DASHARRAY:
  171. case N.R16G16B16A16_PATTERN:
  172. this._encodePattern(c5, a5, f5);
  173. break;
  174. default:
  175. throw new Error("Unsupported encoding type");
  176. }
  177. I2++;
  178. }
  179. }
  180. return a5;
  181. }
  182. getAtributeState(t7) {
  183. let e3 = 0;
  184. const n2 = 3 + 2 * t7;
  185. return e3 |= this._bit(n2), e3 |= this._bit(n2 + 1) << 1, e3;
  186. }
  187. _buildAttributesInfo() {
  188. const t7 = [], e3 = {}, n2 = {};
  189. let r2 = -1;
  190. const a5 = this.attributesInfo(), c5 = this.attributes();
  191. let u2 = -1;
  192. for (const s2 of c5) {
  193. u2++;
  194. const c6 = this.getAtributeState(u2);
  195. if (c6 === R.UNIFORM || c6 === R.UNUSED)
  196. continue;
  197. const f5 = a5[s2], _4 = [];
  198. e3[s2] = _4;
  199. const h3 = f5.type;
  200. for (let e4 = 0; e4 < c6; e4++) {
  201. const { dataType: e5, bytesPerElement: o2, count: s3, normalized: a6 } = i._encodingInfo[h3], c7 = o2 * s3, u3 = `${e5}-${true === a6}`;
  202. let f6 = n2[u3], d4 = 0;
  203. if (!f6 || f6.count + s3 > 4)
  204. r2++, f6 = { dataIndex: r2, count: 0, offset: 0 }, 4 !== s3 && (n2[u3] = f6), t7.push({ location: -1, name: "a_data_" + r2, count: s3, type: e5, normalized: a6 }), d4 = Math.ceil(Math.max(c7 / 4, 1));
  205. else {
  206. const e6 = t7[f6.dataIndex];
  207. e6.count += s3;
  208. d4 = Math.ceil(Math.max(e6.count * o2 / 4, 1)) - Math.ceil(Math.max(f6.offset / 4, 1));
  209. }
  210. _4.push({ dataIndex: f6.dataIndex, offset: f6.offset, bufferElementsToAdd: d4 }), f6.offset += c7, f6.count += s3;
  211. }
  212. }
  213. for (const o2 of t7)
  214. switch (o2.type) {
  215. case C.BYTE:
  216. case C.UNSIGNED_BYTE:
  217. o2.count = 4;
  218. break;
  219. case C.SHORT:
  220. case C.UNSIGNED_SHORT:
  221. o2.count += o2.count % 2;
  222. }
  223. this._buildVertexBufferLayout(t7);
  224. let f4 = 0;
  225. const _3 = this._layoutInfo.geometry;
  226. for (const o2 of _3)
  227. this._locations.set(o2.name, f4++);
  228. const h2 = this._layoutInfo.opacity;
  229. if (h2)
  230. for (const o2 of h2)
  231. this._locations.set(o2.name, f4++);
  232. this._buildShaderInfo(t7, e3), this._propertyEncodingInfo = e3;
  233. }
  234. _buildVertexBufferLayout(t7) {
  235. const e3 = {}, n2 = this.geometryInfo();
  236. let o2 = n2[0].stride;
  237. if (0 === t7.length)
  238. e3.geometry = n2;
  239. else {
  240. const s2 = [];
  241. let i5 = o2;
  242. for (const e4 of t7)
  243. o2 += a2(e4.type) * e4.count;
  244. for (const t8 of n2)
  245. s2.push(new t2(t8.name, t8.count, t8.type, t8.offset, o2, t8.normalized));
  246. for (const e4 of t7)
  247. s2.push(new t2(e4.name, e4.count, e4.type, i5, o2, e4.normalized)), i5 += a2(e4.type) * e4.count;
  248. e3.geometry = s2;
  249. }
  250. this.opacityInfo() && (e3.opacity = this.opacityInfo()), this._layoutInfo = e3, this._stride = o2;
  251. }
  252. _buildShaderInfo(e3, s2) {
  253. let r2 = "\n", a5 = "\n";
  254. const u2 = [];
  255. for (const t7 of e3)
  256. r2 += `attribute ${this._getType(t7.count)} ${t7.name};
  257. `;
  258. const f4 = this.attributes(), _3 = this.attributesInfo();
  259. let h2 = -1;
  260. for (const d4 of f4) {
  261. h2++;
  262. const { name: e4, type: f5, precisionFactor: l6, isLayout: y2 } = _3[d4], m2 = l6 && 1 !== l6 ? " * " + 1 / l6 : "", { bytesPerElement: I2, count: E2 } = i._encodingInfo[f5], p2 = (t7) => `a_data_${t7.dataIndex}${c(E2, t7.offset, I2)}`;
  263. switch (this.getAtributeState(h2)) {
  264. case R.UNIFORM:
  265. {
  266. const o2 = this._getType(E2), s3 = `u_${e4}`;
  267. u2.push({ name: s3, type: o2, getValue: (e5, o3, s4, r3) => {
  268. const i5 = y2 ? e5.getLayoutValue(d4, o3) : e5.getPaintValue(d4, o3);
  269. if (f5 === N.R16G16B16A16_DASHARRAY) {
  270. const n2 = e5.getDashKey(i5, e5.getLayoutValue("line-cap", o3)), s5 = r3.getMosaicItemPosition(n2, false);
  271. if (t(s5))
  272. return null;
  273. const { tl: a6, br: c5 } = s5;
  274. return [a6[0], c5[1], c5[0], a6[1]];
  275. }
  276. if (f5 === N.R16G16B16A16_PATTERN) {
  277. const e6 = r3.getMosaicItemPosition(i5, !d4.includes("line-"));
  278. if (t(e6))
  279. return null;
  280. const { tl: n2, br: o4 } = e6;
  281. return [n2[0], o4[1], o4[0], n2[1]];
  282. }
  283. if (f5 === N.R8G8B8A8_COLOR) {
  284. const t7 = i5[3];
  285. return [t7 * i5[0], t7 * i5[1], t7 * i5[2], t7];
  286. }
  287. return i5;
  288. } }), r2 += `uniform ${o2} ${s3};
  289. `, a5 += `${o2} ${e4} = ${s3};
  290. `;
  291. }
  292. break;
  293. case R.DATA_DRIVEN:
  294. {
  295. const t7 = p2(s2[d4][0]);
  296. a5 += `${this._getType(E2)} ${e4} = ${t7}${m2};
  297. `;
  298. }
  299. break;
  300. case R.INTERPOLATED_DATA_DRIVEN: {
  301. const t7 = `u_t_${e4}`;
  302. u2.push({ name: t7, type: "float", getValue: (t8, e5, n3, o3) => (y2 ? t8.getLayoutProperty(d4) : t8.getPaintProperty(d4)).interpolator.interpolationUniformValue(n3, e5) }), r2 += `uniform float ${t7};
  303. `;
  304. const n2 = p2(s2[d4][0]), o2 = p2(s2[d4][1]);
  305. a5 += `${this._getType(E2)} ${e4} = mix(${n2}${m2}, ${o2}${m2}, ${t7});
  306. `;
  307. }
  308. }
  309. }
  310. this._shaderHeader = r2, this._shaderMain = a5, this._uniforms = u2;
  311. }
  312. _bit(t7) {
  313. return (this._key & 1 << t7) >> t7;
  314. }
  315. _getType(t7) {
  316. switch (t7) {
  317. case 1:
  318. return "float";
  319. case 2:
  320. return "vec2";
  321. case 3:
  322. return "vec3";
  323. case 4:
  324. return "vec4";
  325. }
  326. throw new Error("Invalid count");
  327. }
  328. _encodeColor(t7) {
  329. const n2 = 255 * t7[3];
  330. return t3.i8888to32(t7[0] * n2, t7[1] * n2, t7[2] * n2, n2);
  331. }
  332. _encodePattern(t7, e3, n2) {
  333. if (!n2 || !n2.rect)
  334. return;
  335. const o2 = 2, s2 = n2.rect, r2 = n2.width, i5 = n2.height;
  336. e3[t7] = this._encodeShort(s2.x + o2, 0), e3[t7] |= this._encodeShort(s2.y + o2 + i5, 16), e3[t7 + 1] = this._encodeShort(s2.x + o2 + r2, 0), e3[t7 + 1] |= this._encodeShort(s2.y + o2, 16);
  337. }
  338. _encodeByte(t7, e3) {
  339. return (255 & t7) << e3;
  340. }
  341. _encodeShort(t7, e3) {
  342. return (65535 & t7) << e3;
  343. }
  344. };
  345. i._encodingInfo = { [N.R8_SIGNED]: { dataType: C.BYTE, bytesPerElement: 1, count: 1, normalized: false }, [N.R8_UNSIGNED]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 1, normalized: false }, [N.R16_SIGNED]: { dataType: C.SHORT, bytesPerElement: 2, count: 1, normalized: false }, [N.R16_UNSIGNED]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 1, normalized: false }, [N.R8G8_SIGNED]: { dataType: C.BYTE, bytesPerElement: 1, count: 2, normalized: false }, [N.R8G8_UNSIGNED]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 2, normalized: false }, [N.R16G16_SIGNED]: { dataType: C.SHORT, bytesPerElement: 2, count: 2, normalized: false }, [N.R16G16_UNSIGNED]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 2, normalized: false }, [N.R8G8B8A8_SIGNED]: { dataType: C.BYTE, bytesPerElement: 1, count: 4, normalized: false }, [N.R8G8B8A8_UNSIGNED]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 4, normalized: false }, [N.R8G8B8A8_COLOR]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 4, normalized: true }, [N.R16G16B16A16_DASHARRAY]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 4, normalized: false }, [N.R16G16B16A16_PATTERN]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 4, normalized: false } };
  346. var a2 = (t7) => {
  347. switch (t7) {
  348. case C.FLOAT:
  349. case C.INT:
  350. case C.UNSIGNED_INT:
  351. return 4;
  352. case C.SHORT:
  353. case C.UNSIGNED_SHORT:
  354. return 2;
  355. case C.BYTE:
  356. case C.UNSIGNED_BYTE:
  357. return 1;
  358. }
  359. };
  360. var c = (t7, e3, n2) => {
  361. const o2 = e3 / n2;
  362. if (1 === t7)
  363. switch (o2) {
  364. case 0:
  365. return ".x";
  366. case 1:
  367. return ".y";
  368. case 2:
  369. return ".z";
  370. case 3:
  371. return ".w";
  372. }
  373. else if (2 === t7)
  374. switch (o2) {
  375. case 0:
  376. return ".xy";
  377. case 1:
  378. return ".yz";
  379. case 2:
  380. return ".zw";
  381. }
  382. else if (3 === t7)
  383. switch (o2) {
  384. case 0:
  385. return ".xyz";
  386. case 1:
  387. return ".yzw";
  388. }
  389. return "";
  390. };
  391. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js
  392. var T2 = class extends i {
  393. constructor(r2) {
  394. super(r2);
  395. }
  396. geometryInfo() {
  397. return T2.GEOMETRY_LAYOUT;
  398. }
  399. opacityInfo() {
  400. return null;
  401. }
  402. attributes() {
  403. return T2.ATTRIBUTES;
  404. }
  405. attributesInfo() {
  406. return T2.ATTRIBUTES_INFO;
  407. }
  408. };
  409. T2.ATTRIBUTES = [], T2.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.BYTE, 0, 2)], T2.ATTRIBUTES_INFO = {};
  410. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js
  411. var t4 = class extends i {
  412. constructor(r2) {
  413. super(r2);
  414. }
  415. geometryInfo() {
  416. return t4.GEOMETRY_LAYOUT;
  417. }
  418. opacityInfo() {
  419. return null;
  420. }
  421. attributes() {
  422. return t4.ATTRIBUTES;
  423. }
  424. attributesInfo() {
  425. return t4.ATTRIBUTES_INFO;
  426. }
  427. };
  428. t4.ATTRIBUTES = ["circle-radius", "circle-color", "circle-opacity", "circle-stroke-width", "circle-stroke-color", "circle-stroke-opacity", "circle-blur"], t4.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 4)], t4.ATTRIBUTES_INFO = { "circle-radius": { name: "radius", type: N.R8_UNSIGNED }, "circle-color": { name: "color", type: N.R8G8B8A8_COLOR }, "circle-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "circle-stroke-width": { name: "stroke_width", type: N.R8_UNSIGNED, precisionFactor: 4 }, "circle-stroke-color": { name: "stroke_color", type: N.R8G8B8A8_COLOR }, "circle-stroke-opacity": { name: "stroke_opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "circle-blur": { name: "blur", type: N.R8_UNSIGNED, precisionFactor: 32 } };
  429. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js
  430. var l3 = class extends i {
  431. constructor(o2) {
  432. super(o2);
  433. }
  434. geometryInfo() {
  435. return l3.GEOMETRY_LAYOUT;
  436. }
  437. opacityInfo() {
  438. return null;
  439. }
  440. attributes() {
  441. return l3.ATTRIBUTES;
  442. }
  443. attributesInfo() {
  444. return l3.ATTRIBUTES_INFO;
  445. }
  446. };
  447. l3.ATTRIBUTES = ["fill-color", "fill-opacity", "fill-pattern"], l3.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 4)], l3.ATTRIBUTES_INFO = { "fill-color": { name: "color", type: N.R8G8B8A8_COLOR }, "fill-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "fill-pattern": { name: "tlbr", type: N.R16G16B16A16_PATTERN, isOptional: true } };
  448. var T3 = class extends i {
  449. constructor(o2, t7) {
  450. super(o2), this._usefillColor = t7;
  451. }
  452. geometryInfo() {
  453. return T3.GEOMETRY_LAYOUT;
  454. }
  455. opacityInfo() {
  456. return null;
  457. }
  458. attributes() {
  459. return this._usefillColor ? T3.ATTRIBUTES_FILL : T3.ATTRIBUTES_OUTLINE;
  460. }
  461. attributesInfo() {
  462. return this._usefillColor ? T3.ATTRIBUTES_INFO_FILL : T3.ATTRIBUTES_INFO_OUTLINE;
  463. }
  464. };
  465. T3.ATTRIBUTES_OUTLINE = ["fill-outline-color", "fill-opacity"], T3.ATTRIBUTES_FILL = ["fill-color", "fill-opacity"], T3.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 8), new t2("a_offset", 2, C.BYTE, 4, 8), new t2("a_xnormal", 2, C.BYTE, 6, 8)], T3.ATTRIBUTES_INFO_OUTLINE = { "fill-outline-color": { name: "color", type: N.R8G8B8A8_COLOR }, "fill-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 } }, T3.ATTRIBUTES_INFO_FILL = { "fill-color": { name: "color", type: N.R8G8B8A8_COLOR }, "fill-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 } };
  466. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js
  467. var i2 = class extends i {
  468. constructor(e3) {
  469. super(e3);
  470. }
  471. geometryInfo() {
  472. return i2.GEOMETRY_LAYOUT;
  473. }
  474. opacityInfo() {
  475. return null;
  476. }
  477. attributes() {
  478. return i2.ATTRIBUTES;
  479. }
  480. attributesInfo() {
  481. return i2.ATTRIBUTES_INFO;
  482. }
  483. };
  484. i2.ATTRIBUTES = ["line-blur", "line-color", "line-gap-width", "line-offset", "line-opacity", "line-width", "line-pattern", "line-dasharray"], i2.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 16), new t2("a_extrude_offset", 4, C.BYTE, 4, 16), new t2("a_dir_normal", 4, C.BYTE, 8, 16), new t2("a_accumulatedDistance", 2, C.UNSIGNED_SHORT, 12, 16)], i2.ATTRIBUTES_INFO = { "line-width": { name: "width", type: N.R8_UNSIGNED, precisionFactor: 2 }, "line-gap-width": { name: "gap_width", type: N.R8_UNSIGNED, precisionFactor: 2 }, "line-offset": { name: "offset", type: N.R8_SIGNED, precisionFactor: 2 }, "line-color": { name: "color", type: N.R8G8B8A8_COLOR }, "line-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "line-blur": { name: "blur", type: N.R8_UNSIGNED, precisionFactor: 4 }, "line-pattern": { name: "tlbr", type: N.R16G16B16A16_PATTERN, isOptional: true }, "line-dasharray": { name: "tlbr", type: N.R16G16B16A16_DASHARRAY, isOptional: true } };
  485. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js
  486. var a3 = [new t2("a_pos", 2, C.SHORT, 0, 16), new t2("a_vertexOffset", 2, C.SHORT, 4, 16), new t2("a_texAngleRange", 4, C.UNSIGNED_BYTE, 8, 16), new t2("a_levelInfo", 4, C.UNSIGNED_BYTE, 12, 16)];
  487. var n = [new t2("a_opacityInfo", 1, C.UNSIGNED_BYTE, 0, 1)];
  488. var i3 = class extends i {
  489. constructor(o2) {
  490. super(o2);
  491. }
  492. geometryInfo() {
  493. return a3;
  494. }
  495. opacityInfo() {
  496. return n;
  497. }
  498. attributes() {
  499. return i3.ATTRIBUTES;
  500. }
  501. attributesInfo() {
  502. return i3.ATTRIBUTES_INFO;
  503. }
  504. };
  505. i3.ATTRIBUTES = ["icon-color", "icon-opacity", "icon-halo-blur", "icon-halo-color", "icon-halo-width", "icon-size"], i3.ATTRIBUTES_INFO = { "icon-color": { name: "color", type: N.R8G8B8A8_COLOR }, "icon-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "icon-halo-color": { name: "halo_color", type: N.R8G8B8A8_COLOR }, "icon-halo-width": { name: "halo_width", type: N.R8_UNSIGNED, precisionFactor: 4 }, "icon-halo-blur": { name: "halo_blur", type: N.R8_UNSIGNED, precisionFactor: 4 }, "icon-size": { name: "size", type: N.R8_UNSIGNED, precisionFactor: 32, isLayout: true } };
  506. var c2 = class extends i {
  507. constructor(o2) {
  508. super(o2);
  509. }
  510. geometryInfo() {
  511. return a3;
  512. }
  513. opacityInfo() {
  514. return n;
  515. }
  516. attributes() {
  517. return c2.ATTRIBUTES;
  518. }
  519. attributesInfo() {
  520. return c2.ATTRIBUTES_INFO;
  521. }
  522. };
  523. c2.ATTRIBUTES = ["text-color", "text-opacity", "text-halo-blur", "text-halo-color", "text-halo-width", "text-size"], c2.ATTRIBUTES_INFO = { "text-color": { name: "color", type: N.R8G8B8A8_COLOR }, "text-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "text-halo-color": { name: "halo_color", type: N.R8G8B8A8_COLOR }, "text-halo-width": { name: "halo_width", type: N.R8_UNSIGNED, precisionFactor: 4 }, "text-halo-blur": { name: "halo_blur", type: N.R8_UNSIGNED, precisionFactor: 4 }, "text-size": { name: "size", type: N.R8_UNSIGNED, isLayout: true } };
  524. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/expression/types.js
  525. var r = { kind: "null" };
  526. var e2 = { kind: "number" };
  527. var t5 = { kind: "string" };
  528. var i4 = { kind: "boolean" };
  529. var o = { kind: "color" };
  530. var f2 = { kind: "object" };
  531. var u = { kind: "value" };
  532. function a4(n2, r2) {
  533. return { kind: "array", itemType: n2, n: r2 };
  534. }
  535. var y = [r, e2, t5, i4, o, f2, a4(u)];
  536. function k(n2) {
  537. if ("array" === n2.kind) {
  538. const r2 = k(n2.itemType);
  539. return "number" == typeof n2.n ? `array<${r2}, ${n2.n}>` : "value" === n2.itemType.kind ? "array" : `array<${r2}>`;
  540. }
  541. return n2.kind;
  542. }
  543. function l4(y2) {
  544. if (null === y2)
  545. return r;
  546. if ("string" == typeof y2)
  547. return t5;
  548. if ("boolean" == typeof y2)
  549. return i4;
  550. if ("number" == typeof y2)
  551. return e2;
  552. if (y2 instanceof l)
  553. return o;
  554. if (Array.isArray(y2)) {
  555. let n2;
  556. for (const r2 of y2) {
  557. const e3 = l4(r2);
  558. if (n2) {
  559. if (n2 !== e3) {
  560. n2 = u;
  561. break;
  562. }
  563. } else
  564. n2 = e3;
  565. }
  566. return a4(n2 || u, y2.length);
  567. }
  568. return "object" == typeof y2 ? f2 : u;
  569. }
  570. function c3(n2, r2) {
  571. if ("array" === r2.kind)
  572. return "array" === n2.kind && (0 === n2.n && "value" === n2.itemType.kind || c3(n2.itemType, r2.itemType)) && ("number" != typeof r2.n || r2.n === n2.n);
  573. if ("value" === r2.kind) {
  574. for (const e3 of y)
  575. if (c3(n2, e3))
  576. return true;
  577. }
  578. return r2.kind === n2.kind;
  579. }
  580. function d(r2) {
  581. if (null === r2)
  582. return "";
  583. const e3 = typeof r2;
  584. return "string" === e3 ? r2 : "number" === e3 || "boolean" === e3 ? String(r2) : r2 instanceof l ? r2.toString() : JSON.stringify(r2);
  585. }
  586. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/expression/expression.js
  587. var _ = class {
  588. constructor(t7) {
  589. this._parent = t7, this._vars = {};
  590. }
  591. add(t7, e3) {
  592. this._vars[t7] = e3;
  593. }
  594. get(t7) {
  595. return this._vars[t7] ? this._vars[t7] : this._parent ? this._parent.get(t7) : null;
  596. }
  597. };
  598. var v2 = class {
  599. constructor() {
  600. this.type = u;
  601. }
  602. static parse(t7) {
  603. if (t7.length > 1)
  604. throw new Error('"id" does not expect arguments');
  605. return new v2();
  606. }
  607. evaluate(t7, e3) {
  608. return t7 == null ? void 0 : t7.id;
  609. }
  610. };
  611. var b2 = class {
  612. constructor() {
  613. this.type = t5;
  614. }
  615. static parse(t7) {
  616. if (t7.length > 1)
  617. throw new Error('"geometry-type" does not expect arguments');
  618. return new b2();
  619. }
  620. evaluate(t7, e3) {
  621. if (!t7)
  622. return null;
  623. switch (t7.type) {
  624. case s.Point:
  625. return "Point";
  626. case s.LineString:
  627. return "LineString";
  628. case s.Polygon:
  629. return "Polygon";
  630. default:
  631. return null;
  632. }
  633. }
  634. };
  635. var d2 = class {
  636. constructor() {
  637. this.type = f2;
  638. }
  639. static parse(t7) {
  640. if (t7.length > 1)
  641. throw new Error('"properties" does not expect arguments');
  642. return new d2();
  643. }
  644. evaluate(t7, e3) {
  645. return t7 == null ? void 0 : t7.values;
  646. }
  647. };
  648. var x = class {
  649. constructor() {
  650. this.type = e2;
  651. }
  652. static parse(t7) {
  653. if (t7.length > 1)
  654. throw new Error('"zoom" does not expect arguments');
  655. return new x();
  656. }
  657. evaluate(t7, e3) {
  658. return e3;
  659. }
  660. };
  661. var E = class {
  662. constructor(t7, e3, r2) {
  663. this._lhs = t7, this._rhs = e3, this._compare = r2, this.type = i4;
  664. }
  665. static parse(t7, e3, r2) {
  666. if (3 !== t7.length && 4 !== t7.length)
  667. throw new Error(`"${t7[0]}" expects 2 or 3 arguments`);
  668. if (4 === t7.length)
  669. throw new Error(`"${t7[0]}" collator not supported`);
  670. return new E(pt(t7[1], e3), pt(t7[2], e3), r2);
  671. }
  672. evaluate(t7, e3) {
  673. return this._compare(this._lhs.evaluate(t7, e3), this._rhs.evaluate(t7, e3));
  674. }
  675. };
  676. var $ = class extends E {
  677. static parse(t7, e3) {
  678. return E.parse(t7, e3, (t8, e4) => t8 === e4);
  679. }
  680. };
  681. var M = class extends E {
  682. static parse(t7, e3) {
  683. return E.parse(t7, e3, (t8, e4) => t8 !== e4);
  684. }
  685. };
  686. var k2 = class extends E {
  687. static parse(t7, e3) {
  688. return E.parse(t7, e3, (t8, e4) => t8 < e4);
  689. }
  690. };
  691. var A = class extends E {
  692. static parse(t7, e3) {
  693. return E.parse(t7, e3, (t8, e4) => t8 <= e4);
  694. }
  695. };
  696. var j = class extends E {
  697. static parse(t7, e3) {
  698. return E.parse(t7, e3, (t8, e4) => t8 > e4);
  699. }
  700. };
  701. var q = class extends E {
  702. static parse(t7, e3) {
  703. return E.parse(t7, e3, (t8, e4) => t8 >= e4);
  704. }
  705. };
  706. var N2 = class {
  707. constructor(t7) {
  708. this._arg = t7, this.type = i4;
  709. }
  710. static parse(t7, e3) {
  711. if (2 !== t7.length)
  712. throw new Error('"!" expects 1 argument');
  713. return new N2(pt(t7[1], e3));
  714. }
  715. evaluate(t7, e3) {
  716. return !this._arg.evaluate(t7, e3);
  717. }
  718. };
  719. var R2 = class {
  720. constructor(t7) {
  721. this._args = t7, this.type = i4;
  722. }
  723. static parse(t7, e3) {
  724. const r2 = [];
  725. for (let s2 = 1; s2 < t7.length; s2++)
  726. r2.push(pt(t7[s2], e3));
  727. return new R2(r2);
  728. }
  729. evaluate(t7, e3) {
  730. for (const r2 of this._args)
  731. if (!r2.evaluate(t7, e3))
  732. return false;
  733. return true;
  734. }
  735. };
  736. var C2 = class {
  737. constructor(t7) {
  738. this._args = t7, this.type = i4;
  739. }
  740. static parse(t7, e3) {
  741. const r2 = [];
  742. for (let s2 = 1; s2 < t7.length; s2++)
  743. r2.push(pt(t7[s2], e3));
  744. return new C2(r2);
  745. }
  746. evaluate(t7, e3) {
  747. for (const r2 of this._args)
  748. if (r2.evaluate(t7, e3))
  749. return true;
  750. return false;
  751. }
  752. };
  753. var z2 = class {
  754. constructor(t7) {
  755. this._args = t7, this.type = i4;
  756. }
  757. static parse(t7, e3) {
  758. const r2 = [];
  759. for (let s2 = 1; s2 < t7.length; s2++)
  760. r2.push(pt(t7[s2], e3));
  761. return new z2(r2);
  762. }
  763. evaluate(t7, e3) {
  764. for (const r2 of this._args)
  765. if (r2.evaluate(t7, e3))
  766. return false;
  767. return true;
  768. }
  769. };
  770. var I = class {
  771. constructor(t7, e3, r2) {
  772. this.type = t7, this._args = e3, this._fallback = r2;
  773. }
  774. static parse(t7, e3, r2) {
  775. if (t7.length < 4)
  776. throw new Error('"case" expects at least 3 arguments');
  777. if (t7.length % 2 == 1)
  778. throw new Error('"case" expects an odd number of arguments');
  779. let s2;
  780. const n2 = [];
  781. for (let o2 = 1; o2 < t7.length - 1; o2 += 2) {
  782. const a6 = pt(t7[o2], e3), i5 = pt(t7[o2 + 1], e3, r2);
  783. s2 || (s2 = i5.type), n2.push({ condition: a6, output: i5 });
  784. }
  785. const a5 = pt(t7[t7.length - 1], e3, r2);
  786. return s2 || (s2 = a5.type), new I(s2, n2, a5);
  787. }
  788. evaluate(t7, e3) {
  789. for (const r2 of this._args)
  790. if (r2.condition.evaluate(t7, e3))
  791. return r2.output.evaluate(t7, e3);
  792. return this._fallback.evaluate(t7, e3);
  793. }
  794. };
  795. var L = class {
  796. constructor(t7, e3) {
  797. this.type = t7, this._args = e3;
  798. }
  799. static parse(t7, e3) {
  800. if (t7.length < 2)
  801. throw new Error('"coalesce" expects at least 1 argument');
  802. let r2;
  803. const s2 = [];
  804. for (let n2 = 1; n2 < t7.length; n2++) {
  805. const a5 = pt(t7[n2], e3);
  806. r2 || (r2 = a5.type), s2.push(a5);
  807. }
  808. return new L(r2, s2);
  809. }
  810. evaluate(t7, e3) {
  811. for (const r2 of this._args) {
  812. const s2 = r2.evaluate(t7, e3);
  813. if (null !== s2)
  814. return s2;
  815. }
  816. return null;
  817. }
  818. };
  819. var U = class {
  820. constructor(t7, e3, r2, s2, n2) {
  821. this.type = t7, this._input = e3, this._labels = r2, this._outputs = s2, this._fallback = n2;
  822. }
  823. static parse(t7, e3) {
  824. if (t7.length < 3)
  825. throw new Error('"match" expects at least 3 arguments');
  826. if (t7.length % 2 == 0)
  827. throw new Error('"case" expects an even number of arguments');
  828. let r2;
  829. const s2 = pt(t7[1], e3), n2 = [], a5 = {};
  830. let o2;
  831. for (let i5 = 2; i5 < t7.length - 1; i5 += 2) {
  832. let s3 = t7[i5];
  833. Array.isArray(s3) || (s3 = [s3]);
  834. for (const t8 of s3) {
  835. const e4 = typeof t8;
  836. if ("string" !== e4 && "number" !== e4)
  837. throw new Error('"match" requires string or number literal as labels');
  838. if (o2) {
  839. if (e4 !== o2)
  840. throw new Error('"match" requires labels to have the same type');
  841. } else
  842. o2 = e4;
  843. a5[t8] = n2.length;
  844. }
  845. const l6 = pt(t7[i5 + 1], e3);
  846. r2 || (r2 = l6.type), n2.push(l6);
  847. }
  848. return new U(r2, s2, a5, n2, pt(t7[t7.length - 1], e3));
  849. }
  850. evaluate(t7, e3) {
  851. const r2 = this._input.evaluate(t7, e3);
  852. return (this._outputs[this._labels[r2]] || this._fallback).evaluate(t7, e3);
  853. }
  854. };
  855. var P = class {
  856. constructor(t7, e3, r2, s2, n2) {
  857. this._operator = t7, this.type = e3, this.interpolation = r2, this.input = s2, this._stops = n2;
  858. }
  859. static parse(t7, e3, r2) {
  860. const s2 = t7[0];
  861. if (t7.length < 5)
  862. throw new Error(`"${s2}" expects at least 4 arguments`);
  863. const n2 = t7[1];
  864. if (!Array.isArray(n2) || 0 === n2.length)
  865. throw new Error(`"${n2}" is not a valid interpolation`);
  866. switch (n2[0]) {
  867. case "linear":
  868. if (1 !== n2.length)
  869. throw new Error("Linear interpolation cannot have parameters");
  870. break;
  871. case "exponential":
  872. if (2 !== n2.length || "number" != typeof n2[1])
  873. throw new Error("Exponential interpolation requires one numeric argument");
  874. break;
  875. case "cubic-bezier":
  876. if (5 !== n2.length)
  877. throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");
  878. for (let t8 = 1; t8 < 5; t8++) {
  879. const e4 = n2[t8];
  880. if ("number" != typeof e4 || e4 < 0 || e4 > 1)
  881. throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");
  882. }
  883. break;
  884. default:
  885. throw new Error(`"${t7[0]}" unknown interpolation type "${n2[0]}"`);
  886. }
  887. if (t7.length % 2 != 1)
  888. throw new Error(`"${s2}" expects an even number of arguments`);
  889. const a5 = pt(t7[2], e3, e2);
  890. let o2;
  891. "interpolate-hcl" === s2 || "interpolate-lab" === s2 ? o2 = o : r2 && "value" !== r2.kind && (o2 = r2);
  892. const i5 = [];
  893. for (let l6 = 3; l6 < t7.length; l6 += 2) {
  894. const r3 = t7[l6];
  895. if ("number" != typeof r3)
  896. throw new Error(`"${s2}" requires stop inputs as literal numbers`);
  897. if (i5.length && i5[i5.length - 1][0] >= r3)
  898. throw new Error(`"${s2}" requires strictly ascending stop inputs`);
  899. const n3 = pt(t7[l6 + 1], e3, o2);
  900. o2 || (o2 = n3.type), i5.push([r3, n3]);
  901. }
  902. if (o2 && o2 !== o && o2 !== e2 && ("array" !== o2.kind || o2.itemType !== e2))
  903. throw new Error(`"${s2}" cannot interpolate type ${k(o2)}`);
  904. return new P(s2, o2, n2, a5, i5);
  905. }
  906. evaluate(n2, o2) {
  907. const i5 = this._stops;
  908. if (1 === i5.length)
  909. return i5[0][1].evaluate(n2, o2);
  910. const l6 = this.input.evaluate(n2, o2);
  911. if (l6 <= i5[0][0])
  912. return i5[0][1].evaluate(n2, o2);
  913. if (l6 >= i5[i5.length - 1][0])
  914. return i5[i5.length - 1][1].evaluate(n2, o2);
  915. let u2 = 0;
  916. for (; ++u2 < i5.length && !(l6 < i5[u2][0]); )
  917. ;
  918. const c5 = i5[u2 - 1][0], h2 = i5[u2][0], g = P.interpolationRatio(this.interpolation, l6, c5, h2), f4 = i5[u2 - 1][1].evaluate(n2, o2), w = i5[u2][1].evaluate(n2, o2);
  919. if ("interpolate" === this._operator) {
  920. if ("array" === this.type.kind && Array.isArray(f4) && Array.isArray(w))
  921. return f4.map((t7, e3) => b(t7, w[e3], g));
  922. if ("color" === this.type.kind && f4 instanceof l && w instanceof l) {
  923. const e3 = new l(f4), r2 = new l(w);
  924. return new l([b(e3.r, r2.r, g), b(e3.g, r2.g, g), b(e3.b, r2.b, g), b(e3.a, r2.a, g)]);
  925. }
  926. if ("number" === this.type.kind && "number" == typeof f4 && "number" == typeof w)
  927. return b(f4, w, g);
  928. throw new Error(`"${this._operator}" cannot interpolate type ${k(this.type)}`);
  929. }
  930. if ("interpolate-hcl" === this._operator) {
  931. const s2 = v(f4), n3 = v(w), o3 = n3.h - s2.h, i6 = p({ h: s2.h + g * (o3 > 180 || o3 < -180 ? o3 - 360 * Math.round(o3 / 360) : o3), c: b(s2.c, n3.c, g), l: b(s2.l, n3.l, g) });
  932. return new l({ a: b(f4.a, w.a, g), ...i6 });
  933. }
  934. if ("interpolate-lab" === this._operator) {
  935. const e3 = z(f4), n3 = z(w), o3 = p({ l: b(e3.l, n3.l, g), a: b(e3.a, n3.a, g), b: b(e3.b, n3.b, g) });
  936. return new l({ a: b(f4.a, w.a, g), ...o3 });
  937. }
  938. throw new Error(`Unexpected operator "${this._operator}"`);
  939. }
  940. interpolationUniformValue(t7, e3) {
  941. const r2 = this._stops;
  942. if (1 === r2.length)
  943. return 0;
  944. if (t7 >= r2[r2.length - 1][0])
  945. return 0;
  946. let s2 = 0;
  947. for (; ++s2 < r2.length && !(t7 < r2[s2][0]); )
  948. ;
  949. const n2 = r2[s2 - 1][0], a5 = r2[s2][0];
  950. return P.interpolationRatio(this.interpolation, e3, n2, a5);
  951. }
  952. getInterpolationRange(t7) {
  953. const e3 = this._stops;
  954. if (1 === e3.length) {
  955. const t8 = e3[0][0];
  956. return [t8, t8];
  957. }
  958. const r2 = e3[e3.length - 1][0];
  959. if (t7 >= r2)
  960. return [r2, r2];
  961. let s2 = 0;
  962. for (; ++s2 < e3.length && !(t7 < e3[s2][0]); )
  963. ;
  964. return [e3[s2 - 1][0], e3[s2][0]];
  965. }
  966. static interpolationRatio(t7, e3, r2, s2) {
  967. let a5 = 0;
  968. if ("linear" === t7[0])
  969. a5 = P._exponentialInterpolationRatio(e3, 1, r2, s2);
  970. else if ("exponential" === t7[0])
  971. a5 = P._exponentialInterpolationRatio(e3, t7[1], r2, s2);
  972. else if ("cubic-bezier" === t7[0]) {
  973. a5 = e(t7[1], t7[2], t7[3], t7[4])(P._exponentialInterpolationRatio(e3, 1, r2, s2), 1e-5);
  974. }
  975. return a5 < 0 ? a5 = 0 : a5 > 1 && (a5 = 1), a5;
  976. }
  977. static _exponentialInterpolationRatio(t7, e3, r2, s2) {
  978. const n2 = s2 - r2;
  979. if (0 === n2)
  980. return 0;
  981. const a5 = t7 - r2;
  982. return 1 === e3 ? a5 / n2 : (e3 ** a5 - 1) / (e3 ** n2 - 1);
  983. }
  984. };
  985. var S = class {
  986. constructor(t7, e3, r2) {
  987. this.type = t7, this._input = e3, this._stops = r2;
  988. }
  989. static parse(t7, e3) {
  990. if (t7.length < 5)
  991. throw new Error('"step" expects at least 4 arguments');
  992. if (t7.length % 2 != 1)
  993. throw new Error('"step" expects an even number of arguments');
  994. const r2 = pt(t7[1], e3, e2);
  995. let s2;
  996. const n2 = [];
  997. n2.push([-1 / 0, pt(t7[2], e3)]);
  998. for (let a5 = 3; a5 < t7.length; a5 += 2) {
  999. const r3 = t7[a5];
  1000. if ("number" != typeof r3)
  1001. throw new Error('"step" requires stop inputs as literal numbers');
  1002. if (n2.length && n2[n2.length - 1][0] >= r3)
  1003. throw new Error('"step" requires strictly ascending stop inputs');
  1004. const o2 = pt(t7[a5 + 1], e3);
  1005. s2 || (s2 = o2.type), n2.push([r3, o2]);
  1006. }
  1007. return new S(s2, r2, n2);
  1008. }
  1009. evaluate(t7, e3) {
  1010. const r2 = this._stops;
  1011. if (1 === r2.length)
  1012. return r2[0][1].evaluate(t7, e3);
  1013. const s2 = this._input.evaluate(t7, e3);
  1014. let n2 = 0;
  1015. for (; ++n2 < r2.length && !(s2 < r2[n2][0]); )
  1016. ;
  1017. return this._stops[n2 - 1][1].evaluate(t7, e3);
  1018. }
  1019. };
  1020. var B = class {
  1021. constructor(t7, e3) {
  1022. this.type = t7, this._output = e3;
  1023. }
  1024. static parse(t7, e3, r2) {
  1025. if (t7.length < 4)
  1026. throw new Error('"let" expects at least 3 arguments');
  1027. if (t7.length % 2 == 1)
  1028. throw new Error('"let" expects an odd number of arguments');
  1029. const s2 = new _(e3);
  1030. for (let a5 = 1; a5 < t7.length - 1; a5 += 2) {
  1031. const r3 = t7[a5];
  1032. if ("string" != typeof r3)
  1033. throw new Error(`"let" requires a string to define variable names - found ${r3}`);
  1034. s2.add(r3, pt(t7[a5 + 1], e3));
  1035. }
  1036. const n2 = pt(t7[t7.length - 1], s2, r2);
  1037. return new B(n2.type, n2);
  1038. }
  1039. evaluate(t7, e3) {
  1040. return this._output.evaluate(t7, e3);
  1041. }
  1042. };
  1043. var G = class {
  1044. constructor(t7, e3) {
  1045. this.type = t7, this.output = e3;
  1046. }
  1047. static parse(t7, e3, r2) {
  1048. if (2 !== t7.length || "string" != typeof t7[1])
  1049. throw new Error('"var" requires just one literal string argument');
  1050. const s2 = e3.get(t7[1]);
  1051. if (!s2)
  1052. throw new Error(`${t7[1]} must be defined before being used in a "var" expression`);
  1053. return new G(r2 || u, s2);
  1054. }
  1055. evaluate(t7, e3) {
  1056. return this.output.evaluate(t7, e3);
  1057. }
  1058. };
  1059. var O = class {
  1060. constructor(t7, e3, r2) {
  1061. this.type = t7, this._index = e3, this._array = r2;
  1062. }
  1063. static parse(t7, e3) {
  1064. if (3 !== t7.length)
  1065. throw new Error('"at" expects 2 arguments');
  1066. const r2 = pt(t7[1], e3, e2), s2 = pt(t7[2], e3);
  1067. return new O(s2.type.itemType, r2, s2);
  1068. }
  1069. evaluate(t7, e3) {
  1070. const r2 = this._index.evaluate(t7, e3), s2 = this._array.evaluate(t7, e3);
  1071. if (r2 < 0 || r2 >= s2.length)
  1072. throw new Error('"at" index out of bounds');
  1073. if (r2 !== Math.floor(r2))
  1074. throw new Error('"at" index must be an integer');
  1075. return s2[r2];
  1076. }
  1077. };
  1078. var T4 = class {
  1079. constructor(t7, e3) {
  1080. this._key = t7, this._obj = e3, this.type = u;
  1081. }
  1082. static parse(t7, e3) {
  1083. let r2, s2;
  1084. switch (t7.length) {
  1085. case 2:
  1086. return r2 = pt(t7[1], e3), new T4(r2);
  1087. case 3:
  1088. return r2 = pt(t7[1], e3), s2 = pt(t7[2], e3), new T4(r2, s2);
  1089. default:
  1090. throw new Error('"get" expects 1 or 2 arguments');
  1091. }
  1092. }
  1093. evaluate(t7, e3) {
  1094. const r2 = this._key.evaluate(t7, e3);
  1095. if (this._obj) {
  1096. return this._obj.evaluate(t7, e3)[r2];
  1097. }
  1098. return t7 == null ? void 0 : t7.values[r2];
  1099. }
  1100. };
  1101. var F = class {
  1102. constructor(t7, e3) {
  1103. this._key = t7, this._obj = e3, this.type = i4;
  1104. }
  1105. static parse(t7, e3) {
  1106. let r2, s2;
  1107. switch (t7.length) {
  1108. case 2:
  1109. return r2 = pt(t7[1], e3), new F(r2);
  1110. case 3:
  1111. return r2 = pt(t7[1], e3), s2 = pt(t7[2], e3), new F(r2, s2);
  1112. default:
  1113. throw new Error('"has" expects 1 or 2 arguments');
  1114. }
  1115. }
  1116. evaluate(t7, e3) {
  1117. const r2 = this._key.evaluate(t7, e3);
  1118. if (this._obj) {
  1119. return r2 in this._obj.evaluate(t7, e3);
  1120. }
  1121. return !!(t7 == null ? void 0 : t7.values[r2]);
  1122. }
  1123. };
  1124. var V = class {
  1125. constructor(t7, e3) {
  1126. this._key = t7, this._vals = e3, this.type = i4;
  1127. }
  1128. static parse(t7, e3) {
  1129. if (3 !== t7.length)
  1130. throw new Error('"in" expects 2 arguments');
  1131. return new V(pt(t7[1], e3), pt(t7[2], e3));
  1132. }
  1133. evaluate(t7, e3) {
  1134. const r2 = this._key.evaluate(t7, e3);
  1135. return this._vals.evaluate(t7, e3).includes(r2);
  1136. }
  1137. };
  1138. var D = class {
  1139. constructor(t7, e3, r2) {
  1140. this._item = t7, this._array = e3, this._from = r2, this.type = e2;
  1141. }
  1142. static parse(t7, e3) {
  1143. if (t7.length < 3 || t7.length > 4)
  1144. throw new Error('"index-of" expects 3 or 4 arguments');
  1145. const r2 = pt(t7[1], e3), s2 = pt(t7[2], e3);
  1146. if (4 === t7.length) {
  1147. const n2 = pt(t7[3], e3, e2);
  1148. return new D(r2, s2, n2);
  1149. }
  1150. return new D(r2, s2);
  1151. }
  1152. evaluate(t7, e3) {
  1153. const r2 = this._item.evaluate(t7, e3), s2 = this._array.evaluate(t7, e3);
  1154. if (this._from) {
  1155. const n2 = this._from.evaluate(t7, e3);
  1156. if (n2 !== Math.floor(n2))
  1157. throw new Error('"index-of" index must be an integer');
  1158. return s2.indexOf(r2, n2);
  1159. }
  1160. return s2.indexOf(r2);
  1161. }
  1162. };
  1163. var H = class {
  1164. constructor(t7) {
  1165. this._arg = t7, this.type = e2;
  1166. }
  1167. static parse(t7, e3) {
  1168. if (2 !== t7.length)
  1169. throw new Error('"length" expects 2 arguments');
  1170. const r2 = pt(t7[1], e3);
  1171. return new H(r2);
  1172. }
  1173. evaluate(t7, e3) {
  1174. const r2 = this._arg.evaluate(t7, e3);
  1175. if ("string" == typeof r2)
  1176. return r2.length;
  1177. if (Array.isArray(r2))
  1178. return r2.length;
  1179. throw new Error('"length" expects string or array');
  1180. }
  1181. };
  1182. var J = class {
  1183. constructor(t7, e3, r2, s2) {
  1184. this.type = t7, this._array = e3, this._from = r2, this._to = s2;
  1185. }
  1186. static parse(t7, e3) {
  1187. if (t7.length < 3 || t7.length > 4)
  1188. throw new Error('"slice" expects 2 or 3 arguments');
  1189. const r2 = pt(t7[1], e3), s2 = pt(t7[2], e3, e2);
  1190. if (s2.type !== e2)
  1191. throw new Error('"slice" index must return a number');
  1192. if (4 === t7.length) {
  1193. const n2 = pt(t7[3], e3, e2);
  1194. if (n2.type !== e2)
  1195. throw new Error('"slice" index must return a number');
  1196. return new J(r2.type, r2, s2, n2);
  1197. }
  1198. return new J(r2.type, r2, s2);
  1199. }
  1200. evaluate(t7, e3) {
  1201. const r2 = this._array.evaluate(t7, e3);
  1202. if (!Array.isArray(r2) && "string" != typeof r2)
  1203. throw new Error('"slice" input must be an array or a string');
  1204. const s2 = this._from.evaluate(t7, e3);
  1205. if (s2 < 0 || s2 >= r2.length)
  1206. throw new Error('"slice" index out of bounds');
  1207. if (s2 !== Math.floor(s2))
  1208. throw new Error('"slice" index must be an integer');
  1209. if (this._to) {
  1210. const n2 = this._to.evaluate(t7, e3);
  1211. if (n2 < 0 || n2 >= r2.length)
  1212. throw new Error('"slice" index out of bounds');
  1213. if (n2 !== Math.floor(n2))
  1214. throw new Error('"slice" index must be an integer');
  1215. return r2.slice(s2, n2);
  1216. }
  1217. return r2.slice(s2);
  1218. }
  1219. };
  1220. var K = class {
  1221. constructor() {
  1222. this.type = i4;
  1223. }
  1224. static parse(t7) {
  1225. if (1 !== t7.length)
  1226. throw new Error('"has-id" expects no arguments');
  1227. return new K();
  1228. }
  1229. evaluate(t7, e3) {
  1230. return t7 && void 0 !== t7.id;
  1231. }
  1232. };
  1233. var Q = class {
  1234. constructor(t7, e3) {
  1235. this._args = t7, this._calculate = e3, this.type = e2;
  1236. }
  1237. static parse(t7, e3, r2) {
  1238. const s2 = t7.slice(1).map((t8) => pt(t8, e3));
  1239. return new Q(s2, r2);
  1240. }
  1241. evaluate(t7, e3) {
  1242. let r2;
  1243. return this._args && (r2 = this._args.map((r3) => r3.evaluate(t7, e3))), this._calculate(r2);
  1244. }
  1245. };
  1246. var W = class extends Q {
  1247. static parse(t7, e3) {
  1248. switch (t7.length) {
  1249. case 2:
  1250. return Q.parse(t7, e3, (t8) => -t8[0]);
  1251. case 3:
  1252. return Q.parse(t7, e3, (t8) => t8[0] - t8[1]);
  1253. default:
  1254. throw new Error('"-" expects 1 or 2 arguments');
  1255. }
  1256. }
  1257. };
  1258. var X2 = class extends Q {
  1259. static parse(t7, e3) {
  1260. return Q.parse(t7, e3, (t8) => {
  1261. let e4 = 1;
  1262. for (const r2 of t8)
  1263. e4 *= r2;
  1264. return e4;
  1265. });
  1266. }
  1267. };
  1268. var Y = class extends Q {
  1269. static parse(t7, e3) {
  1270. if (3 === t7.length)
  1271. return Q.parse(t7, e3, (t8) => t8[0] / t8[1]);
  1272. throw new Error('"/" expects 2 arguments');
  1273. }
  1274. };
  1275. var Z = class extends Q {
  1276. static parse(t7, e3) {
  1277. if (3 === t7.length)
  1278. return Q.parse(t7, e3, (t8) => t8[0] % t8[1]);
  1279. throw new Error('"%" expects 2 arguments');
  1280. }
  1281. };
  1282. var tt = class extends Q {
  1283. static parse(t7, e3) {
  1284. if (3 === t7.length)
  1285. return Q.parse(t7, e3, (t8) => t8[0] ** t8[1]);
  1286. throw new Error('"^" expects 1 or 2 arguments');
  1287. }
  1288. };
  1289. var et = class extends Q {
  1290. static parse(t7, e3) {
  1291. return Q.parse(t7, e3, (t8) => {
  1292. let e4 = 0;
  1293. for (const r2 of t8)
  1294. e4 += r2;
  1295. return e4;
  1296. });
  1297. }
  1298. };
  1299. var rt = class {
  1300. constructor(t7, e3) {
  1301. this._args = t7, this._calculate = e3, this.type = e2;
  1302. }
  1303. static parse(t7, e3) {
  1304. const r2 = t7.slice(1).map((t8) => pt(t8, e3));
  1305. return new rt(r2, rt.ops[t7[0]]);
  1306. }
  1307. evaluate(t7, e3) {
  1308. let r2;
  1309. return this._args && (r2 = this._args.map((r3) => r3.evaluate(t7, e3))), this._calculate(r2);
  1310. }
  1311. };
  1312. rt.ops = { abs: (t7) => Math.abs(t7[0]), acos: (t7) => Math.acos(t7[0]), asin: (t7) => Math.asin(t7[0]), atan: (t7) => Math.atan(t7[0]), ceil: (t7) => Math.ceil(t7[0]), cos: (t7) => Math.cos(t7[0]), e: () => Math.E, floor: (t7) => Math.floor(t7[0]), ln: (t7) => Math.log(t7[0]), ln2: () => Math.LN2, log10: (t7) => Math.log(t7[0]) / Math.LN10, log2: (t7) => Math.log(t7[0]) / Math.LN2, max: (t7) => Math.max(...t7), min: (t7) => Math.min(...t7), pi: () => Math.PI, round: (t7) => Math.round(t7[0]), sin: (t7) => Math.sin(t7[0]), sqrt: (t7) => Math.sqrt(t7[0]), tan: (t7) => Math.tan(t7[0]) };
  1313. var st = class {
  1314. constructor(t7) {
  1315. this._args = t7, this.type = t5;
  1316. }
  1317. static parse(t7, e3) {
  1318. return new st(t7.slice(1).map((t8) => pt(t8, e3)));
  1319. }
  1320. evaluate(t7, e3) {
  1321. return this._args.map((r2) => r2.evaluate(t7, e3)).join("");
  1322. }
  1323. };
  1324. var nt = class {
  1325. constructor(t7, e3) {
  1326. this._arg = t7, this._calculate = e3, this.type = t5;
  1327. }
  1328. static parse(t7, e3) {
  1329. if (2 !== t7.length)
  1330. throw new Error(`${t7[0]} expects 1 argument`);
  1331. const r2 = pt(t7[1], e3);
  1332. return new nt(r2, nt.ops[t7[0]]);
  1333. }
  1334. evaluate(t7, e3) {
  1335. return this._calculate(this._arg.evaluate(t7, e3));
  1336. }
  1337. };
  1338. nt.ops = { downcase: (t7) => t7.toLowerCase(), upcase: (t7) => t7.toUpperCase() };
  1339. var at = class {
  1340. constructor(t7) {
  1341. this._args = t7, this.type = o;
  1342. }
  1343. static parse(t7, e3) {
  1344. if (4 !== t7.length)
  1345. throw new Error('"rgb" expects 3 arguments');
  1346. const r2 = t7.slice(1).map((t8) => pt(t8, e3));
  1347. return new at(r2);
  1348. }
  1349. evaluate(e3, r2) {
  1350. const s2 = this._validate(this._args[0].evaluate(e3, r2)), n2 = this._validate(this._args[1].evaluate(e3, r2)), a5 = this._validate(this._args[2].evaluate(e3, r2));
  1351. return new l({ r: s2, g: n2, b: a5 });
  1352. }
  1353. _validate(t7) {
  1354. if ("number" != typeof t7 || t7 < 0 || t7 > 255)
  1355. throw new Error(`${t7}: invalid color component`);
  1356. return Math.round(t7);
  1357. }
  1358. };
  1359. var ot = class {
  1360. constructor(t7) {
  1361. this._args = t7, this.type = o;
  1362. }
  1363. static parse(t7, e3) {
  1364. if (5 !== t7.length)
  1365. throw new Error('"rgba" expects 4 arguments');
  1366. const r2 = t7.slice(1).map((t8) => pt(t8, e3));
  1367. return new ot(r2);
  1368. }
  1369. evaluate(e3, r2) {
  1370. const s2 = this._validate(this._args[0].evaluate(e3, r2)), n2 = this._validate(this._args[1].evaluate(e3, r2)), a5 = this._validate(this._args[2].evaluate(e3, r2)), o2 = this._validateAlpha(this._args[3].evaluate(e3, r2));
  1371. return new l({ r: s2, g: n2, b: a5, a: o2 });
  1372. }
  1373. _validate(t7) {
  1374. if ("number" != typeof t7 || t7 < 0 || t7 > 255)
  1375. throw new Error(`${t7}: invalid color component`);
  1376. return Math.round(t7);
  1377. }
  1378. _validateAlpha(t7) {
  1379. if ("number" != typeof t7 || t7 < 0 || t7 > 1)
  1380. throw new Error(`${t7}: invalid alpha color component`);
  1381. return t7;
  1382. }
  1383. };
  1384. var it = class {
  1385. constructor(t7) {
  1386. this._color = t7, this.type = a4(e2, 4);
  1387. }
  1388. static parse(t7, e3) {
  1389. if (2 !== t7.length)
  1390. throw new Error('"to-rgba" expects 1 argument');
  1391. const r2 = pt(t7[1], e3);
  1392. return new it(r2);
  1393. }
  1394. evaluate(e3, r2) {
  1395. return new l(this._color.evaluate(e3, r2)).toRgba();
  1396. }
  1397. };
  1398. var lt = class {
  1399. constructor(t7, e3) {
  1400. this.type = t7, this._args = e3;
  1401. }
  1402. static parse(t7, e3) {
  1403. const r2 = t7[0];
  1404. if (t7.length < 2)
  1405. throw new Error(`${r2} expects at least one argument`);
  1406. let s2, n2 = 1;
  1407. if ("array" === r2) {
  1408. if (t7.length > 2) {
  1409. switch (t7[1]) {
  1410. case "string":
  1411. s2 = t5;
  1412. break;
  1413. case "number":
  1414. s2 = e2;
  1415. break;
  1416. case "boolean":
  1417. s2 = i4;
  1418. break;
  1419. default:
  1420. throw new Error('"array" type argument must be string, number or boolean');
  1421. }
  1422. n2++;
  1423. } else
  1424. s2 = u;
  1425. let e4;
  1426. if (t7.length > 3) {
  1427. if (e4 = t7[2], null !== e4 && ("number" != typeof e4 || e4 < 0 || e4 !== Math.floor(e4)))
  1428. throw new Error('"array" length argument must be a positive integer literal');
  1429. n2++;
  1430. }
  1431. s2 = a4(s2, e4);
  1432. } else
  1433. switch (r2) {
  1434. case "string":
  1435. s2 = t5;
  1436. break;
  1437. case "number":
  1438. s2 = e2;
  1439. break;
  1440. case "boolean":
  1441. s2 = i4;
  1442. break;
  1443. case "object":
  1444. s2 = f2;
  1445. }
  1446. const a5 = [];
  1447. for (; n2 < t7.length; n2++) {
  1448. const r3 = pt(t7[n2], e3);
  1449. a5.push(r3);
  1450. }
  1451. return new lt(s2, a5);
  1452. }
  1453. evaluate(t7, e3) {
  1454. let r2;
  1455. for (const s2 of this._args) {
  1456. const n2 = s2.evaluate(t7, e3);
  1457. if (r2 = l4(n2), c3(r2, this.type))
  1458. return n2;
  1459. }
  1460. throw new Error(`Expected ${k(this.type)} but got ${k(r2)}`);
  1461. }
  1462. };
  1463. var ut = class {
  1464. constructor(t7, e3) {
  1465. this.type = t7, this._args = e3;
  1466. }
  1467. static parse(t7, e3) {
  1468. const r2 = t7[0], s2 = ut.types[r2];
  1469. if (s2 === i4 || s2 === t5) {
  1470. if (2 !== t7.length)
  1471. throw new Error(`${r2} expects one argument`);
  1472. } else if (t7.length < 2)
  1473. throw new Error(`${r2} expects at least one argument`);
  1474. const n2 = [];
  1475. for (let a5 = 1; a5 < t7.length; a5++) {
  1476. const r3 = pt(t7[a5], e3);
  1477. n2.push(r3);
  1478. }
  1479. return new ut(s2, n2);
  1480. }
  1481. evaluate(e3, r2) {
  1482. if (this.type === i4)
  1483. return Boolean(this._args[0].evaluate(e3, r2));
  1484. if (this.type === t5)
  1485. return d(this._args[0].evaluate(e3, r2));
  1486. if (this.type === e2) {
  1487. for (const t7 of this._args) {
  1488. const s2 = Number(t7.evaluate(e3, r2));
  1489. if (!isNaN(s2))
  1490. return s2;
  1491. }
  1492. return null;
  1493. }
  1494. if (this.type === o) {
  1495. for (const s2 of this._args)
  1496. try {
  1497. const n2 = ut.toColor(s2.evaluate(e3, r2));
  1498. if (n2 instanceof l)
  1499. return n2;
  1500. } catch {
  1501. }
  1502. return null;
  1503. }
  1504. }
  1505. static toBoolean(t7) {
  1506. return Boolean(t7);
  1507. }
  1508. static toString(t7) {
  1509. return d(t7);
  1510. }
  1511. static toNumber(t7) {
  1512. const e3 = Number(t7);
  1513. if (isNaN(e3))
  1514. throw new Error(`"${t7}" is not a number`);
  1515. return e3;
  1516. }
  1517. static toColor(e3) {
  1518. if (e3 instanceof l)
  1519. return e3;
  1520. if ("string" == typeof e3) {
  1521. const r2 = l.fromString(e3);
  1522. if (r2)
  1523. return r2;
  1524. throw new Error(`"${e3}" is not a color`);
  1525. }
  1526. if (Array.isArray(e3))
  1527. return l.fromArray(e3);
  1528. throw new Error(`"${e3}" is not a color`);
  1529. }
  1530. };
  1531. ut.types = { "to-boolean": i4, "to-color": o, "to-number": e2, "to-string": t5 };
  1532. var ct = class {
  1533. constructor(t7) {
  1534. this._val = t7, this.type = l4(t7);
  1535. }
  1536. static parse(t7) {
  1537. if (2 !== t7.length)
  1538. throw new Error('"literal" expects 1 argument');
  1539. return new ct(t7[1]);
  1540. }
  1541. evaluate(t7, e3) {
  1542. return this._val;
  1543. }
  1544. };
  1545. var ht = class {
  1546. constructor(t7) {
  1547. this._arg = t7, this.type = t5;
  1548. }
  1549. static parse(t7, e3) {
  1550. if (2 !== t7.length)
  1551. throw new Error('"typeof" expects 1 argument');
  1552. return new ht(pt(t7[1], e3));
  1553. }
  1554. evaluate(t7, e3) {
  1555. return k(l4(this._arg.evaluate(t7, e3)));
  1556. }
  1557. };
  1558. function pt(t7, e3, r2) {
  1559. const s2 = typeof t7;
  1560. if ("string" === s2 || "boolean" === s2 || "number" === s2 || null === t7) {
  1561. if (r2)
  1562. switch (r2.kind) {
  1563. case "string":
  1564. "string" !== s2 && (t7 = ut.toString(t7));
  1565. break;
  1566. case "number":
  1567. "number" !== s2 && (t7 = ut.toNumber(t7));
  1568. break;
  1569. case "color":
  1570. t7 = ut.toColor(t7);
  1571. }
  1572. t7 = ["literal", t7];
  1573. }
  1574. if (!Array.isArray(t7) || 0 === t7.length)
  1575. throw new Error("Expression must be a non empty array");
  1576. const n2 = t7[0];
  1577. if ("string" != typeof n2)
  1578. throw new Error("First element of expression must be a string");
  1579. const a5 = gt[n2];
  1580. if (void 0 === a5)
  1581. throw new Error(`Invalid expression operator "${n2}"`);
  1582. if (!a5)
  1583. throw new Error(`Unimplemented expression operator "${n2}"`);
  1584. return a5.parse(t7, e3, r2);
  1585. }
  1586. var gt = { array: lt, boolean: lt, collator: null, format: null, image: null, literal: ct, number: lt, "number-format": null, object: lt, string: lt, "to-boolean": ut, "to-color": ut, "to-number": ut, "to-string": ut, typeof: ht, accumulated: null, "feature-state": null, "geometry-type": b2, id: v2, "line-progress": null, properties: d2, at: O, get: T4, has: F, in: V, "index-of": D, length: H, slice: J, "!": N2, "!=": M, "<": k2, "<=": A, "==": $, ">": j, ">=": q, all: R2, any: C2, case: I, coalesce: L, match: U, within: null, interpolate: P, "interpolate-hcl": P, "interpolate-lab": P, step: S, let: B, var: G, concat: st, downcase: nt, "is-supported-script": null, "resolved-locale": null, upcase: nt, rgb: at, rgba: ot, "to-rgba": it, "-": W, "*": X2, "/": Y, "%": Z, "^": tt, "+": et, abs: rt, acos: rt, asin: rt, atan: rt, ceil: rt, cos: rt, e: rt, floor: rt, ln: rt, ln2: rt, log10: rt, log2: rt, max: rt, min: rt, pi: rt, round: rt, sin: rt, sqrt: rt, tan: rt, zoom: x, "heatmap-density": null, "has-id": K, none: z2 };
  1587. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/Filter.js
  1588. var t6 = class {
  1589. constructor(e3) {
  1590. this._expression = e3;
  1591. }
  1592. filter(e3, r2) {
  1593. if (!this._expression)
  1594. return true;
  1595. try {
  1596. return this._expression.evaluate(e3, r2);
  1597. } catch (t7) {
  1598. return console.log(t7.message), true;
  1599. }
  1600. }
  1601. static createFilter(n2) {
  1602. if (!n2)
  1603. return null;
  1604. this.isLegacyFilter(n2) && (n2 = this.convertLegacyFilter(n2));
  1605. try {
  1606. const s2 = pt(n2, null, i4);
  1607. return new t6(s2);
  1608. } catch (s2) {
  1609. return console.log(s2.message), null;
  1610. }
  1611. }
  1612. static isLegacyFilter(e3) {
  1613. if (!Array.isArray(e3))
  1614. return true;
  1615. if (0 === e3.length)
  1616. return true;
  1617. switch (e3[0]) {
  1618. case "==":
  1619. case "!=":
  1620. case ">":
  1621. case "<":
  1622. case ">=":
  1623. case "<=":
  1624. return 3 === e3.length && "string" == typeof e3[1] && !Array.isArray(e3[2]);
  1625. case "in":
  1626. return e3.length >= 3 && "string" == typeof e3[1] && !Array.isArray(e3[2]);
  1627. case "!in":
  1628. case "none":
  1629. case "!has":
  1630. return true;
  1631. case "any":
  1632. case "all":
  1633. for (let r2 = 1; r2 < e3.length; r2++)
  1634. if (this.isLegacyFilter(e3[r2]))
  1635. return true;
  1636. return false;
  1637. case "has":
  1638. return 2 === e3.length && ("$id" === e3[1] || "$type" === e3[1]);
  1639. default:
  1640. return false;
  1641. }
  1642. }
  1643. static convertLegacyFilter(e3) {
  1644. if (!Array.isArray(e3) || 0 === e3.length)
  1645. return true;
  1646. const r2 = e3[0];
  1647. if (1 === e3.length)
  1648. return "any" !== r2;
  1649. switch (r2) {
  1650. case "==":
  1651. return t6.convertComparison("==", e3[1], e3[2]);
  1652. case "!=":
  1653. return t6.negate(t6.convertComparison("==", e3[1], e3[2]));
  1654. case ">":
  1655. case "<":
  1656. case ">=":
  1657. case "<=":
  1658. return t6.convertComparison(r2, e3[1], e3[2]);
  1659. case "in":
  1660. return t6.convertIn(e3[1], e3.slice(2));
  1661. case "!in":
  1662. return t6.negate(t6.convertIn(e3[1], e3.slice(2)));
  1663. case "any":
  1664. case "all":
  1665. case "none":
  1666. return t6.convertCombining(r2, e3.slice(1));
  1667. case "has":
  1668. return t6.convertHas(e3[1]);
  1669. case "!has":
  1670. return t6.negate(t6.convertHas(e3[1]));
  1671. default:
  1672. throw new Error("Unexpected legacy filter.");
  1673. }
  1674. }
  1675. static convertComparison(e3, r2, t7) {
  1676. switch (r2) {
  1677. case "$type":
  1678. return [e3, ["geometry-type"], t7];
  1679. case "$id":
  1680. return [e3, ["id"], t7];
  1681. default:
  1682. return [e3, ["get", r2], t7];
  1683. }
  1684. }
  1685. static convertIn(e3, r2) {
  1686. switch (e3) {
  1687. case "$type":
  1688. return ["in", ["geometry-type"], ["literal", r2]];
  1689. case "$id":
  1690. return ["in", ["id"], ["literal", r2]];
  1691. default:
  1692. return ["in", ["get", e3], ["literal", r2]];
  1693. }
  1694. }
  1695. static convertHas(e3) {
  1696. switch (e3) {
  1697. case "$type":
  1698. return true;
  1699. case "$id":
  1700. return ["has-id"];
  1701. default:
  1702. return ["has", e3];
  1703. }
  1704. }
  1705. static convertCombining(e3, r2) {
  1706. return [e3].concat(r2.map(this.convertLegacyFilter));
  1707. }
  1708. static negate(e3) {
  1709. return ["!", e3];
  1710. }
  1711. };
  1712. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleProperty.js
  1713. var h = class {
  1714. constructor(t7, e3) {
  1715. let n2;
  1716. switch (this.isDataDriven = false, this.interpolator = null, t7.type) {
  1717. case "number":
  1718. case "color":
  1719. n2 = true;
  1720. break;
  1721. case "array":
  1722. n2 = "number" === t7.value;
  1723. break;
  1724. default:
  1725. n2 = false;
  1726. }
  1727. if (null == e3 && (e3 = t7.default), Array.isArray(e3) && e3.length > 0 && gt[e3[0]]) {
  1728. const r2 = { number: e2, color: o, string: t5, boolean: i4, enum: t5 };
  1729. try {
  1730. const n3 = "array" === t7.type ? a4(r2[t7.value] || u, t7.length) : r2[t7.type], u2 = pt(e3, null, n3);
  1731. this.getValue = this._buildExpression(u2, t7), this.isDataDriven = true, u2 instanceof P && u2.input instanceof x && (this.interpolator = u2);
  1732. } catch (c5) {
  1733. console.log(c5.message), this.getValue = this._buildSimple(t7.default);
  1734. }
  1735. return;
  1736. }
  1737. n2 && "interval" === e3.type && (n2 = false);
  1738. const h2 = e3 && e3.stops && e3.stops.length > 0;
  1739. if (h2)
  1740. for (const r2 of e3.stops)
  1741. r2[1] = this._validate(r2[1], t7);
  1742. if (this.isDataDriven = !!e3 && !!e3.property, this.isDataDriven)
  1743. if (void 0 !== e3.default && (e3.default = this._validate(e3.default, t7)), h2)
  1744. switch (e3.type) {
  1745. case "identity":
  1746. this.getValue = this._buildIdentity(e3, t7);
  1747. break;
  1748. case "categorical":
  1749. this.getValue = this._buildCategorical(e3, t7);
  1750. break;
  1751. default:
  1752. this.getValue = n2 ? this._buildInterpolate(e3, t7) : this._buildInterval(e3, t7);
  1753. }
  1754. else
  1755. this.getValue = this._buildIdentity(e3, t7);
  1756. else
  1757. h2 ? this.getValue = n2 ? this._buildZoomInterpolate(e3) : this._buildZoomInterval(e3) : (e3 = this._validate(e3, t7), this.getValue = this._buildSimple(e3));
  1758. }
  1759. _validate(t7, e3) {
  1760. if ("number" === e3.type) {
  1761. if (t7 < e3.minimum)
  1762. return e3.minimum;
  1763. if (t7 > e3.maximum)
  1764. return e3.maximum;
  1765. } else
  1766. "color" === e3.type ? t7 = h._parseColor(t7) : "enum" === e3.type ? "string" == typeof t7 && (t7 = e3.values.indexOf(t7)) : "array" === e3.type && "enum" === e3.value ? t7 = t7.map((t8) => "string" == typeof t8 ? e3.values.indexOf(t8) : t8) : "string" === e3.type && (t7 = d(t7));
  1767. return t7;
  1768. }
  1769. _buildSimple(t7) {
  1770. return () => t7;
  1771. }
  1772. _buildExpression(t7, e3) {
  1773. return (r2, i5) => {
  1774. try {
  1775. const l6 = t7.evaluate(i5, r2);
  1776. return void 0 === l6 ? e3.default : this._validate(l6, e3);
  1777. } catch (l6) {
  1778. return console.log(l6.message), e3.default;
  1779. }
  1780. };
  1781. }
  1782. _buildIdentity(t7, e3) {
  1783. return (r2, i5) => {
  1784. let l6;
  1785. return i5 && (l6 = i5.values[t7.property]), void 0 !== l6 && (l6 = this._validate(l6, e3)), null != l6 ? l6 : void 0 !== t7.default ? t7.default : e3.default;
  1786. };
  1787. }
  1788. _buildCategorical(t7, e3) {
  1789. return (r2, i5) => {
  1790. let l6;
  1791. return i5 && (l6 = i5.values[t7.property]), l6 = this._categorical(l6, t7.stops), void 0 !== l6 ? l6 : void 0 !== t7.default ? t7.default : e3.default;
  1792. };
  1793. }
  1794. _buildInterval(t7, e3) {
  1795. return (r2, i5) => {
  1796. let l6;
  1797. return i5 && (l6 = i5.values[t7.property]), "number" == typeof l6 ? this._interval(l6, t7.stops) : void 0 !== t7.default ? t7.default : e3.default;
  1798. };
  1799. }
  1800. _buildInterpolate(t7, e3) {
  1801. return (r2, i5) => {
  1802. let l6;
  1803. return i5 && (l6 = i5.values[t7.property]), "number" == typeof l6 ? this._interpolate(l6, t7.stops, t7.base || 1) : void 0 !== t7.default ? t7.default : e3.default;
  1804. };
  1805. }
  1806. _buildZoomInterpolate(t7) {
  1807. return (e3) => this._interpolate(e3, t7.stops, t7.base || 1);
  1808. }
  1809. _buildZoomInterval(t7) {
  1810. return (e3) => this._interval(e3, t7.stops);
  1811. }
  1812. _categorical(t7, e3) {
  1813. const r2 = e3.length;
  1814. for (let i5 = 0; i5 < r2; i5++)
  1815. if (e3[i5][0] === t7)
  1816. return e3[i5][1];
  1817. }
  1818. _interval(t7, e3) {
  1819. const r2 = e3.length;
  1820. let i5 = 0;
  1821. for (let l6 = 0; l6 < r2 && e3[l6][0] <= t7; l6++)
  1822. i5 = l6;
  1823. return e3[i5][1];
  1824. }
  1825. _interpolate(t7, r2, i5) {
  1826. let l6, a5;
  1827. const s2 = r2.length;
  1828. for (let e3 = 0; e3 < s2; e3++) {
  1829. const i6 = r2[e3];
  1830. if (!(i6[0] <= t7)) {
  1831. a5 = i6;
  1832. break;
  1833. }
  1834. l6 = i6;
  1835. }
  1836. if (l6 && a5) {
  1837. const r3 = a5[0] - l6[0], s3 = t7 - l6[0], o2 = 1 === i5 ? s3 / r3 : (i5 ** s3 - 1) / (i5 ** r3 - 1);
  1838. if (Array.isArray(l6[1])) {
  1839. const t8 = l6[1], r4 = a5[1], i6 = [];
  1840. for (let l7 = 0; l7 < t8.length; l7++)
  1841. i6.push(b(t8[l7], r4[l7], o2));
  1842. return i6;
  1843. }
  1844. return b(l6[1], a5[1], o2);
  1845. }
  1846. return l6 ? l6[1] : a5 ? a5[1] : void 0;
  1847. }
  1848. static _isEmpty(t7) {
  1849. for (const e3 in t7)
  1850. if (t7.hasOwnProperty(e3))
  1851. return false;
  1852. return true;
  1853. }
  1854. static _parseColor(e3) {
  1855. return Array.isArray(e3) ? e3 : ("string" == typeof e3 && (e3 = new l(e3)), e3 instanceof l && !this._isEmpty(e3) ? l.toUnitRGBA(e3) : void 0);
  1856. }
  1857. };
  1858. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleLayer.js
  1859. var D2;
  1860. !function(t7) {
  1861. t7[t7.BUTT = 0] = "BUTT", t7[t7.ROUND = 1] = "ROUND", t7[t7.SQUARE = 2] = "SQUARE", t7[t7.UNKNOWN = 4] = "UNKNOWN";
  1862. }(D2 || (D2 = {}));
  1863. var P2 = class {
  1864. constructor(t7, i5, e3, a5) {
  1865. switch (this.type = t7, this.typeName = i5.type, this.id = i5.id, this.source = i5.source, this.sourceLayer = i5["source-layer"], this.minzoom = i5.minzoom, this.maxzoom = i5.maxzoom, this.filter = i5.filter, this.layout = i5.layout, this.paint = i5.paint, this.z = e3, this.uid = a5, t7) {
  1866. case a.BACKGROUND:
  1867. this._layoutDefinition = f.backgroundLayoutDefinition, this._paintDefinition = f.backgroundPaintDefinition;
  1868. break;
  1869. case a.FILL:
  1870. this._layoutDefinition = f.fillLayoutDefinition, this._paintDefinition = f.fillPaintDefinition;
  1871. break;
  1872. case a.LINE:
  1873. this._layoutDefinition = f.lineLayoutDefinition, this._paintDefinition = f.linePaintDefinition;
  1874. break;
  1875. case a.SYMBOL:
  1876. this._layoutDefinition = f.symbolLayoutDefinition, this._paintDefinition = f.symbolPaintDefinition;
  1877. break;
  1878. case a.CIRCLE:
  1879. this._layoutDefinition = f.circleLayoutDefinition, this._paintDefinition = f.circlePaintDefinition;
  1880. }
  1881. this._layoutProperties = this._parseLayout(this.layout), this._paintProperties = this._parsePaint(this.paint);
  1882. }
  1883. getFeatureFilter() {
  1884. return void 0 !== this._featureFilter ? this._featureFilter : this._featureFilter = t6.createFilter(this.filter);
  1885. }
  1886. getLayoutProperty(t7) {
  1887. return this._layoutProperties[t7];
  1888. }
  1889. getPaintProperty(t7) {
  1890. return this._paintProperties[t7];
  1891. }
  1892. getLayoutValue(t7, i5, e3) {
  1893. let a5;
  1894. const o2 = this._layoutProperties[t7];
  1895. return o2 && (a5 = o2.getValue(i5, e3)), void 0 === a5 && (a5 = this._layoutDefinition[t7].default), a5;
  1896. }
  1897. getPaintValue(t7, i5, e3) {
  1898. let a5;
  1899. const o2 = this._paintProperties[t7];
  1900. return o2 && (a5 = o2.getValue(i5, e3)), void 0 === a5 && (a5 = this._paintDefinition[t7].default), a5;
  1901. }
  1902. isPainterDataDriven() {
  1903. const t7 = this._paintProperties;
  1904. if (t7) {
  1905. for (const i5 in t7)
  1906. if (t7[i5].isDataDriven)
  1907. return true;
  1908. }
  1909. return false;
  1910. }
  1911. _parseLayout(t7) {
  1912. const i5 = {};
  1913. for (const e3 in t7) {
  1914. const a5 = this._layoutDefinition[e3];
  1915. a5 && (i5[e3] = new h(a5, t7[e3]));
  1916. }
  1917. return i5;
  1918. }
  1919. _parsePaint(t7) {
  1920. const i5 = {};
  1921. for (const e3 in t7) {
  1922. const a5 = this._paintDefinition[e3];
  1923. a5 && (i5[e3] = new h(a5, t7[e3]));
  1924. }
  1925. return i5;
  1926. }
  1927. computeAttributesKey(t7, i5, e3, a5) {
  1928. let o2 = 0, r2 = 0;
  1929. for (const s2 of i5) {
  1930. let t8 = 3;
  1931. if (!s2 || s2 !== a5) {
  1932. const i6 = e3[s2], { isLayout: a6, isOptional: o3 } = i6, r3 = a6 ? this.getLayoutProperty(s2) : this.getPaintProperty(s2);
  1933. t8 = (r3 == null ? void 0 : r3.interpolator) ? 2 : (r3 == null ? void 0 : r3.isDataDriven) ? 1 : o3 && !r3 ? 3 : 0;
  1934. }
  1935. r2 |= t8 << o2, o2 += 2;
  1936. }
  1937. return r2 << 3 | t7;
  1938. }
  1939. };
  1940. var c4 = class extends P2 {
  1941. constructor(e3, a5, o2, r2) {
  1942. super(e3, a5, o2, r2), this.backgroundMaterial = new T2(this.computeAttributesKey(T.BACKGROUND, T2.ATTRIBUTES, T2.ATTRIBUTES_INFO));
  1943. }
  1944. };
  1945. var f3 = class extends P2 {
  1946. constructor(i5, e3, r2, s2) {
  1947. super(i5, e3, r2, s2);
  1948. const n2 = this.getPaintProperty("fill-color"), h2 = this.getPaintProperty("fill-opacity"), l6 = this.getPaintProperty("fill-pattern");
  1949. this.hasDataDrivenColor = n2 == null ? void 0 : n2.isDataDriven, this.hasDataDrivenOpacity = h2 == null ? void 0 : h2.isDataDriven, this.hasDataDrivenFill = this.hasDataDrivenColor || this.hasDataDrivenOpacity || (l6 == null ? void 0 : l6.isDataDriven);
  1950. const p2 = this.getPaintProperty("fill-outline-color");
  1951. this.outlineUsesFillColor = !p2, this.hasDataDrivenOutlineColor = p2 == null ? void 0 : p2.isDataDriven, this.hasDataDrivenOutline = p2 ? p2.isDataDriven : !!n2 && n2.isDataDriven, this.hasDataDrivenOutline = (p2 ? this.hasDataDrivenOutlineColor : this.hasDataDrivenColor) || this.hasDataDrivenOpacity, this.fillMaterial = new l3(this.computeAttributesKey(T.FILL, l3.ATTRIBUTES, l3.ATTRIBUTES_INFO)), this.outlineMaterial = new T3(this.computeAttributesKey(T.OUTLINE, this.outlineUsesFillColor ? T3.ATTRIBUTES_FILL : T3.ATTRIBUTES_OUTLINE, this.outlineUsesFillColor ? T3.ATTRIBUTES_INFO_FILL : T3.ATTRIBUTES_INFO_OUTLINE), this.outlineUsesFillColor);
  1952. }
  1953. };
  1954. var _2 = class extends P2 {
  1955. constructor(i5, e3, a5, o2) {
  1956. var _a, _b, _c, _d, _e, _f, _g, _h, _i;
  1957. super(i5, e3, a5, o2);
  1958. const s2 = this.getPaintProperty("line-pattern");
  1959. if (this.lineMaterial = new i2(this.computeAttributesKey(T.LINE, i2.ATTRIBUTES, i2.ATTRIBUTES_INFO, s2 ? "line-dasharray" : "")), this.hasDataDrivenLine = ((_a = this.getPaintProperty("line-blur")) == null ? void 0 : _a.isDataDriven) || ((_b = this.getPaintProperty("line-color")) == null ? void 0 : _b.isDataDriven) || ((_c = this.getPaintProperty("line-gap-width")) == null ? void 0 : _c.isDataDriven) || ((_d = this.getPaintProperty("line-offset")) == null ? void 0 : _d.isDataDriven) || ((_e = this.getPaintProperty("line-opacity")) == null ? void 0 : _e.isDataDriven) || ((_f = this.getPaintProperty("line-pattern")) == null ? void 0 : _f.isDataDriven) || ((_g = this.getPaintProperty("line-dasharray")) == null ? void 0 : _g.isDataDriven) || ((_h = this.getLayoutProperty("line-cap")) == null ? void 0 : _h.isDataDriven) || ((_i = this.getPaintProperty("line-width")) == null ? void 0 : _i.isDataDriven), this.canUseThinTessellation = false, !this.hasDataDrivenLine) {
  1960. const t7 = this.getPaintProperty("line-width");
  1961. if (!t7 || "number" == typeof t7 && 0.5 * t7 < X) {
  1962. const t8 = this.getPaintProperty("line-offset");
  1963. (!t8 || "number" == typeof t8 && 0 === t8) && (this.canUseThinTessellation = true);
  1964. }
  1965. }
  1966. }
  1967. getDashKey(t7, i5) {
  1968. let e3;
  1969. switch (i5) {
  1970. case D2.BUTT:
  1971. e3 = "Butt";
  1972. break;
  1973. case D2.ROUND:
  1974. e3 = "Round";
  1975. break;
  1976. case D2.SQUARE:
  1977. e3 = "Square";
  1978. break;
  1979. default:
  1980. e3 = "Butt";
  1981. }
  1982. return `dasharray-[${t7.toString()}]-${e3}`;
  1983. }
  1984. };
  1985. var L2 = class extends P2 {
  1986. constructor(i5, e3, a5, o2) {
  1987. var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
  1988. super(i5, e3, a5, o2), this.iconMaterial = new i3(this.computeAttributesKey(T.ICON, i3.ATTRIBUTES, i3.ATTRIBUTES_INFO)), this.textMaterial = new c2(this.computeAttributesKey(T.TEXT, c2.ATTRIBUTES, c2.ATTRIBUTES_INFO)), this.hasDataDrivenIcon = ((_a = this.getPaintProperty("icon-color")) == null ? void 0 : _a.isDataDriven) || ((_b = this.getPaintProperty("icon-halo-blur")) == null ? void 0 : _b.isDataDriven) || ((_c = this.getPaintProperty("icon-halo-color")) == null ? void 0 : _c.isDataDriven) || ((_d = this.getPaintProperty("icon-halo-width")) == null ? void 0 : _d.isDataDriven) || ((_e = this.getPaintProperty("icon-opacity")) == null ? void 0 : _e.isDataDriven) || ((_f = this.getLayoutProperty("icon-size")) == null ? void 0 : _f.isDataDriven), this.hasDataDrivenText = ((_g = this.getPaintProperty("text-color")) == null ? void 0 : _g.isDataDriven) || ((_h = this.getPaintProperty("text-halo-blur")) == null ? void 0 : _h.isDataDriven) || ((_i = this.getPaintProperty("text-halo-color")) == null ? void 0 : _i.isDataDriven) || ((_j = this.getPaintProperty("text-halo-width")) == null ? void 0 : _j.isDataDriven) || ((_k = this.getPaintProperty("text-opacity")) == null ? void 0 : _k.isDataDriven) || ((_l = this.getLayoutProperty("text-size")) == null ? void 0 : _l.isDataDriven);
  1989. }
  1990. };
  1991. var d3 = class extends P2 {
  1992. constructor(i5, a5, o2, r2) {
  1993. super(i5, a5, o2, r2), this.circleMaterial = new t4(this.computeAttributesKey(T.CIRCLE, t4.ATTRIBUTES, t4.ATTRIBUTES_INFO));
  1994. }
  1995. };
  1996. var T5 = class {
  1997. constructor(t7, i5, e3) {
  1998. let a5;
  1999. this.allowOverlap = t7.getLayoutValue("icon-allow-overlap", i5), this.ignorePlacement = t7.getLayoutValue("icon-ignore-placement", i5), this.keepUpright = t7.getLayoutValue("icon-keep-upright", i5), this.optional = t7.getLayoutValue("icon-optional", i5), this.rotationAlignment = t7.getLayoutValue("icon-rotation-alignment", i5), this.rotationAlignment === l2.AUTO && (this.rotationAlignment = e3 ? l2.MAP : l2.VIEWPORT), a5 = t7.getLayoutProperty("icon-anchor"), (a5 == null ? void 0 : a5.isDataDriven) ? this._anchorProp = a5 : this.anchor = t7.getLayoutValue("icon-anchor", i5), a5 = t7.getLayoutProperty("icon-offset"), (a5 == null ? void 0 : a5.isDataDriven) ? this._offsetProp = a5 : this.offset = t7.getLayoutValue("icon-offset", i5), a5 = t7.getLayoutProperty("icon-padding"), (a5 == null ? void 0 : a5.isDataDriven) ? this._paddingProp = a5 : this.padding = t7.getLayoutValue("icon-padding", i5), a5 = t7.getLayoutProperty("icon-rotate"), (a5 == null ? void 0 : a5.isDataDriven) ? this._rotateProp = a5 : this.rotate = t7.getLayoutValue("icon-rotate", i5), a5 = t7.getLayoutProperty("icon-size"), (a5 == null ? void 0 : a5.isDataDriven) ? this._sizeProp = a5 : this.size = t7.getLayoutValue("icon-size", i5);
  2000. }
  2001. update(t7, i5) {
  2002. this._anchorProp && (this.anchor = this._anchorProp.getValue(t7, i5)), this._offsetProp && (this.offset = this._offsetProp.getValue(t7, i5)), this._paddingProp && (this.padding = this._paddingProp.getValue(t7, i5)), this._rotateProp && (this.rotate = this._rotateProp.getValue(t7, i5)), this._sizeProp && (this.size = this._sizeProp.getValue(t7, i5));
  2003. }
  2004. };
  2005. var m = class {
  2006. constructor(t7, i5, e3) {
  2007. let a5;
  2008. this.allowOverlap = t7.getLayoutValue("text-allow-overlap", i5), this.ignorePlacement = t7.getLayoutValue("text-ignore-placement", i5), this.keepUpright = t7.getLayoutValue("text-keep-upright", i5), this.optional = t7.getLayoutValue("text-optional", i5), this.rotationAlignment = t7.getLayoutValue("text-rotation-alignment", i5), this.rotationAlignment === l2.AUTO && (this.rotationAlignment = e3 ? l2.MAP : l2.VIEWPORT), a5 = t7.getLayoutProperty("text-anchor"), (a5 == null ? void 0 : a5.isDataDriven) ? this._anchorProp = a5 : this.anchor = t7.getLayoutValue("text-anchor", i5), a5 = t7.getLayoutProperty("text-justify"), (a5 == null ? void 0 : a5.isDataDriven) ? this._justifyProp = a5 : this.justify = t7.getLayoutValue("text-justify", i5), a5 = t7.getLayoutProperty("text-letter-spacing"), (a5 == null ? void 0 : a5.isDataDriven) ? this._letterSpacingProp = a5 : this.letterSpacing = t7.getLayoutValue("text-letter-spacing", i5), a5 = t7.getLayoutProperty("text-line-height"), (a5 == null ? void 0 : a5.isDataDriven) ? this._lineHeightProp = a5 : this.lineHeight = t7.getLayoutValue("text-line-height", i5), a5 = t7.getLayoutProperty("text-max-angle"), (a5 == null ? void 0 : a5.isDataDriven) ? this._maxAngleProp = a5 : this.maxAngle = t7.getLayoutValue("text-max-angle", i5), a5 = t7.getLayoutProperty("text-max-width"), (a5 == null ? void 0 : a5.isDataDriven) ? this._maxWidthProp = a5 : this.maxWidth = t7.getLayoutValue("text-max-width", i5), a5 = t7.getLayoutProperty("text-offset"), (a5 == null ? void 0 : a5.isDataDriven) ? this._offsetProp = a5 : this.offset = t7.getLayoutValue("text-offset", i5), a5 = t7.getLayoutProperty("text-padding"), (a5 == null ? void 0 : a5.isDataDriven) ? this._paddingProp = a5 : this.padding = t7.getLayoutValue("text-padding", i5), a5 = t7.getLayoutProperty("text-rotate"), (a5 == null ? void 0 : a5.isDataDriven) ? this._rotateProp = a5 : this.rotate = t7.getLayoutValue("text-rotate", i5), a5 = t7.getLayoutProperty("text-size"), (a5 == null ? void 0 : a5.isDataDriven) ? this._sizeProp = a5 : this.size = t7.getLayoutValue("text-size", i5), a5 = t7.getLayoutProperty("text-writing-mode"), (a5 == null ? void 0 : a5.isDataDriven) ? this._writingModeProp = a5 : this.writingMode = t7.getLayoutValue("text-writing-mode", i5);
  2009. }
  2010. update(t7, i5) {
  2011. this._anchorProp && (this.anchor = this._anchorProp.getValue(t7, i5)), this._justifyProp && (this.justify = this._justifyProp.getValue(t7, i5)), this._letterSpacingProp && (this.letterSpacing = this._letterSpacingProp.getValue(t7, i5)), this._lineHeightProp && (this.lineHeight = this._lineHeightProp.getValue(t7, i5)), this._maxAngleProp && (this.maxAngle = this._maxAngleProp.getValue(t7, i5)), this._maxWidthProp && (this.maxWidth = this._maxWidthProp.getValue(t7, i5)), this._offsetProp && (this.offset = this._offsetProp.getValue(t7, i5)), this._paddingProp && (this.padding = this._paddingProp.getValue(t7, i5)), this._rotateProp && (this.rotate = this._rotateProp.getValue(t7, i5)), this._sizeProp && (this.size = this._sizeProp.getValue(t7, i5)), this._writingModeProp && (this.writingMode = this._writingModeProp.getValue(t7, i5));
  2012. }
  2013. };
  2014. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleRepository.js
  2015. var l5 = class {
  2016. constructor(t7) {
  2017. if (this._style = t7, this.backgroundBucketIds = [], this._uidToLayer = /* @__PURE__ */ new Map(), this._layerByName = {}, this._runningId = 0, t7.layers || (t7.layers = []), this.version = parseFloat(t7.version), this.layers = t7.layers.map((e3, t8, r2) => this._create(e3, t8, r2)).filter((e3) => !!e3), this.layers) {
  2018. let t8;
  2019. for (let r2 = 0; r2 < this.layers.length; r2++)
  2020. t8 = this.layers[r2], this._layerByName[t8.id] = t8, this._uidToLayer.set(t8.uid, t8), t8.type === a.BACKGROUND && this.backgroundBucketIds.push(t8.id);
  2021. }
  2022. this._identifyRefLayers();
  2023. }
  2024. isPainterDataDriven(e3) {
  2025. const t7 = this._layerByName[e3];
  2026. return !!t7 && t7.isPainterDataDriven();
  2027. }
  2028. getStyleLayerId(e3) {
  2029. return e3 >= this.layers.length ? null : this.layers[e3].id;
  2030. }
  2031. getStyleLayerByUID(e3) {
  2032. var _a;
  2033. return (_a = this._uidToLayer.get(e3)) != null ? _a : null;
  2034. }
  2035. getStyleLayerIndex(e3) {
  2036. const t7 = this._layerByName[e3];
  2037. return t7 ? this.layers.indexOf(t7) : -1;
  2038. }
  2039. setStyleLayer(e3, t7) {
  2040. if (!e3 || !e3.id)
  2041. return;
  2042. const r2 = this._style;
  2043. null != t7 && t7 >= this.layers.length && (t7 = this.layers.length - 1);
  2044. let i5, s2 = true;
  2045. const a5 = this._layerByName[e3.id];
  2046. if (a5) {
  2047. const y2 = this.layers.indexOf(a5);
  2048. t7 || (t7 = y2), t7 === y2 ? (s2 = false, i5 = l5._recreateLayer(e3, a5), this.layers[t7] = i5, r2.layers[t7] = e3) : (this.layers.splice(y2, 1), r2.layers.splice(y2, 1), i5 = this._create(e3, t7, this.layers), this.layers.splice(t7, 0, i5), r2.layers.splice(t7, 0, e3));
  2049. } else
  2050. i5 = this._create(e3, t7, this.layers), !t7 || t7 >= this.layers.length ? (this.layers.push(i5), r2.layers.push(e3)) : (this.layers.splice(t7, 0, i5), r2.layers.splice(t7, 0, e3));
  2051. this._layerByName[e3.id] = i5, this._uidToLayer.set(i5.uid, i5), s2 && this._recomputeZValues(), this._identifyRefLayers();
  2052. }
  2053. getStyleLayer(e3) {
  2054. const t7 = this._layerByName[e3];
  2055. return t7 ? { type: t7.typeName, id: t7.id, source: t7.source, "source-layer": t7.sourceLayer, minzoom: t7.minzoom, maxzoom: t7.maxzoom, filter: t7.filter, layout: t7.layout, paint: t7.paint } : null;
  2056. }
  2057. deleteStyleLayer(e3) {
  2058. const t7 = this._layerByName[e3];
  2059. if (t7) {
  2060. delete this._layerByName[e3], this._uidToLayer.delete(t7.uid);
  2061. const r2 = this.layers.indexOf(t7);
  2062. this.layers.splice(r2, 1), this._style.layers.splice(r2, 1), this._recomputeZValues(), this._identifyRefLayers();
  2063. }
  2064. }
  2065. getLayerById(e3) {
  2066. return this._layerByName[e3];
  2067. }
  2068. getLayoutProperties(e3) {
  2069. const t7 = this._layerByName[e3];
  2070. return t7 ? t7.layout : null;
  2071. }
  2072. getPaintProperties(e3) {
  2073. const t7 = this._layerByName[e3];
  2074. return t7 ? t7.paint : null;
  2075. }
  2076. setPaintProperties(e3, t7) {
  2077. const r2 = this._layerByName[e3];
  2078. if (!r2)
  2079. return;
  2080. const i5 = { type: r2.typeName, id: r2.id, source: r2.source, "source-layer": r2.sourceLayer, minzoom: r2.minzoom, maxzoom: r2.maxzoom, filter: r2.filter, layout: r2.layout, paint: t7 }, s2 = l5._recreateLayer(i5, r2), a5 = this.layers.indexOf(r2);
  2081. this.layers[a5] = s2, this._style.layers[a5].paint = t7, this._layerByName[r2.id] = s2, this._uidToLayer.set(r2.uid, s2);
  2082. }
  2083. setLayoutProperties(e3, t7) {
  2084. const r2 = this._layerByName[e3];
  2085. if (!r2)
  2086. return;
  2087. const i5 = { type: r2.typeName, id: r2.id, source: r2.source, "source-layer": r2.sourceLayer, minzoom: r2.minzoom, maxzoom: r2.maxzoom, filter: r2.filter, layout: t7, paint: r2.paint }, s2 = l5._recreateLayer(i5, r2), a5 = this.layers.indexOf(r2);
  2088. this.layers[a5] = s2, this._style.layers[a5].layout = t7, this._layerByName[r2.id] = s2, this._uidToLayer.set(r2.uid, s2);
  2089. }
  2090. setStyleLayerVisibility(e3, t7) {
  2091. const r2 = this._layerByName[e3];
  2092. if (!r2)
  2093. return;
  2094. const i5 = r2.layout || {};
  2095. i5.visibility = t7;
  2096. const s2 = { type: r2.typeName, id: r2.id, source: r2.source, "source-layer": r2.sourceLayer, minzoom: r2.minzoom, maxzoom: r2.maxzoom, filter: r2.filter, layout: i5, paint: r2.paint }, a5 = l5._recreateLayer(s2, r2), y2 = this.layers.indexOf(r2);
  2097. this.layers[y2] = a5, this._style.layers[y2].layout = i5, this._layerByName[r2.id] = a5, this._uidToLayer.set(r2.uid, a5);
  2098. }
  2099. getStyleLayerVisibility(e3) {
  2100. var _a, _b;
  2101. const t7 = this._layerByName[e3];
  2102. if (!t7)
  2103. return "none";
  2104. return (_b = (_a = t7.layout) == null ? void 0 : _a.visibility) != null ? _b : "visible";
  2105. }
  2106. _recomputeZValues() {
  2107. const e3 = this.layers, t7 = 1 / (e3.length + 1);
  2108. for (let r2 = 0; r2 < e3.length; r2++)
  2109. e3[r2].z = 1 - (1 + r2) * t7;
  2110. }
  2111. _identifyRefLayers() {
  2112. var _a, _b;
  2113. const t7 = [], r2 = [];
  2114. let i5 = 0;
  2115. for (const s2 of this.layers) {
  2116. const a5 = s2.layout;
  2117. if (s2.type === a.FILL) {
  2118. const e3 = s2;
  2119. let r3 = s2.source + "|" + s2.sourceLayer;
  2120. r3 += "|" + ((_a = a5 == null ? void 0 : a5.visibility) != null ? _a : ""), r3 += "|" + s2.minzoom, r3 += "|" + s2.maxzoom, r3 += "|" + JSON.stringify(s2.filter), (e3.hasDataDrivenFill || e3.hasDataDrivenOutline) && (r3 += "|" + i5), t7.push({ key: r3, layer: s2 });
  2121. } else if (s2.type === a.LINE) {
  2122. const e3 = s2, t8 = s2.paint, l6 = null != t8 && (null != t8["line-pattern"] || null != t8["line-dasharray"]);
  2123. let y2 = s2.source + "|" + s2.sourceLayer;
  2124. y2 += "|" + ((_b = a5 == null ? void 0 : a5.visibility) != null ? _b : ""), y2 += "|" + s2.minzoom, y2 += "|" + s2.maxzoom, y2 += "|" + JSON.stringify(s2.filter), y2 += "|" + (void 0 !== a5 ? a5["line-cap"] : ""), y2 += "|" + (void 0 !== a5 ? a5["line-join"] : ""), (e3.hasDataDrivenLine || l6) && (y2 += "|" + i5), r2.push({ key: y2, layer: s2 });
  2125. }
  2126. ++i5;
  2127. }
  2128. this._assignRefLayers(t7), this._assignRefLayers(r2);
  2129. }
  2130. _assignRefLayers(t7) {
  2131. let r2, i5;
  2132. t7.sort((e3, t8) => e3.key < t8.key ? -1 : e3.key > t8.key ? 1 : 0);
  2133. const s2 = t7.length;
  2134. for (let a5 = 0; a5 < s2; a5++) {
  2135. const l6 = t7[a5];
  2136. if (l6.key === r2)
  2137. l6.layer.refLayerId = i5;
  2138. else if (r2 = l6.key, i5 = l6.layer.id, l6.layer.type === a.FILL) {
  2139. if (!l6.layer.getPaintProperty("fill-outline-color"))
  2140. for (let e3 = a5 + 1; e3 < s2; e3++) {
  2141. const s3 = t7[e3];
  2142. if (s3.key !== r2)
  2143. break;
  2144. if (s3.layer.getPaintProperty("fill-outline-color")) {
  2145. t7[a5] = s3, t7[e3] = l6, i5 = s3.layer.id;
  2146. break;
  2147. }
  2148. }
  2149. } else if (l6.layer.type === a.LINE) {
  2150. let e3 = l6.layer;
  2151. for (let y2 = a5 + 1; y2 < s2; y2++) {
  2152. const s3 = t7[y2];
  2153. if (s3.key !== r2)
  2154. break;
  2155. const n2 = s3.layer;
  2156. (e3.canUseThinTessellation && !n2.canUseThinTessellation || !e3.canUseThinTessellation && (n2.getPaintProperty("line-pattern") || n2.getPaintProperty("line-dasharray"))) && (e3 = n2, t7[a5] = s3, t7[y2] = l6, i5 = s3.layer.id);
  2157. }
  2158. }
  2159. }
  2160. }
  2161. _create(l6, y2, n2) {
  2162. const o2 = 1 - (1 + y2) * (1 / (n2.length + 1)), u2 = this._runningId++;
  2163. switch (l6.type) {
  2164. case "background":
  2165. return new c4(a.BACKGROUND, l6, o2, u2);
  2166. case "fill":
  2167. return new f3(a.FILL, l6, o2, u2);
  2168. case "line":
  2169. return new _2(a.LINE, l6, o2, u2);
  2170. case "symbol":
  2171. return new L2(a.SYMBOL, l6, o2, u2);
  2172. case "raster":
  2173. console.warn(`Unsupported vector tile raster layer ${l6.id}`);
  2174. case "circle":
  2175. return new d3(a.CIRCLE, l6, o2, u2);
  2176. }
  2177. }
  2178. static _recreateLayer(l6, y2) {
  2179. switch (l6.type) {
  2180. case "background":
  2181. return new c4(a.BACKGROUND, l6, y2.z, y2.uid);
  2182. case "fill":
  2183. return new f3(a.FILL, l6, y2.z, y2.uid);
  2184. case "line":
  2185. return new _2(a.LINE, l6, y2.z, y2.uid);
  2186. case "symbol":
  2187. return new L2(a.SYMBOL, l6, y2.z, y2.uid);
  2188. case "raster":
  2189. console.warn(`Unsupported vector tile raster layer ${l6.id}`);
  2190. case "circle":
  2191. return new d3(a.CIRCLE, l6, y2.z, y2.uid);
  2192. }
  2193. }
  2194. };
  2195. export {
  2196. t3 as t,
  2197. T5 as T,
  2198. m,
  2199. l5 as l
  2200. };
  2201. //# sourceMappingURL=chunk-LC47RING.js.map