chunk-WJW5DUN6.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  1. import {
  2. e as e2
  3. } from "./chunk-PJ7ZQ4VD.js";
  4. import {
  5. o as o2,
  6. s as s2
  7. } from "./chunk-TERAW6FT.js";
  8. import {
  9. e
  10. } from "./chunk-WEMIK25H.js";
  11. import {
  12. a,
  13. i,
  14. l,
  15. o,
  16. r
  17. } from "./chunk-JXW4QTJA.js";
  18. import {
  19. s3 as s
  20. } from "./chunk-EMJ4ZSM2.js";
  21. // node_modules/@arcgis/core/layers/effects/colorMatrixFunctions.js
  22. var r2 = (r3, s4) => {
  23. const o4 = s2(r3, s4, 0, 0, 0, 0, s4, 0, 0, 0, 0, s4, 0, 0, 0, 0, 1);
  24. return o2(o4, o4);
  25. };
  26. var s3 = (r3, s4) => {
  27. const o4 = s2(r3, s4, 0, 0, 0.5 - 0.5 * s4, 0, s4, 0, 0.5 - 0.5 * s4, 0, 0, s4, 0.5 - 0.5 * s4, 0, 0, 0, 1);
  28. return o2(o4, o4);
  29. };
  30. var o3 = (r3, s4) => {
  31. const o4 = 1 - s4, c2 = s2(r3, 0.2126 + 0.7874 * o4, 0.7152 - 0.7152 * o4, 0.0722 - 0.0722 * o4, 0, 0.2126 - 0.2126 * o4, 0.7152 + 0.2848 * o4, 0.0722 - 0.0722 * o4, 0, 0.2126 - 0.2126 * o4, 0.7152 - 0.7152 * o4, 0.0722 + 0.9278 * o4, 0, 0, 0, 0, 1);
  32. return o2(c2, c2);
  33. };
  34. var c = (r3, s4) => {
  35. const o4 = Math.sin(s4 * Math.PI / 180), c2 = Math.cos(s4 * Math.PI / 180), e6 = s2(r3, 0.213 + 0.787 * c2 - 0.213 * o4, 0.715 - 0.715 * c2 - 0.715 * o4, 0.072 - 0.072 * c2 + 0.928 * o4, 0, 0.213 - 0.213 * c2 + 0.143 * o4, 0.715 + 0.285 * c2 + 0.14 * o4, 0.072 - 0.072 * c2 - 0.283 * o4, 0, 0.213 - 0.213 * c2 - 0.787 * o4, 0.715 - 0.715 * c2 + 0.715 * o4, 0.072 + 0.928 * c2 + 0.072 * o4, 0, 0, 0, 0, 1);
  36. return o2(e6, e6);
  37. };
  38. var e3 = (r3, s4) => {
  39. const o4 = 1 - 2 * s4, c2 = s2(r3, o4, 0, 0, s4, 0, o4, 0, s4, 0, 0, o4, s4, 0, 0, 0, 1);
  40. return o2(c2, c2);
  41. };
  42. var u = (r3, s4) => {
  43. const o4 = s2(r3, 0.213 + 0.787 * s4, 0.715 - 0.715 * s4, 0.072 - 0.072 * s4, 0, 0.213 - 0.213 * s4, 0.715 + 0.285 * s4, 0.072 - 0.072 * s4, 0, 0.213 - 0.213 * s4, 0.715 - 0.715 * s4, 0.072 + 0.928 * s4, 0, 0, 0, 0, 1);
  44. return o2(o4, o4);
  45. };
  46. var a2 = (r3, s4) => {
  47. const o4 = 1 - s4, c2 = s2(r3, 0.393 + 0.607 * o4, 0.769 - 0.769 * o4, 0.189 - 0.189 * o4, 0, 0.349 - 0.349 * o4, 0.686 + 0.314 * o4, 0.168 - 0.168 * o4, 0, 0.272 - 0.272 * o4, 0.534 - 0.534 * o4, 0.131 + 0.869 * o4, 0, 0, 0, 0, 1);
  48. return o2(c2, c2);
  49. };
  50. // node_modules/@arcgis/core/layers/effects/effects.js
  51. var l2 = class {
  52. constructor(t, s4, r3) {
  53. this.strength = t, this.radius = s4, this.threshold = r3, this.type = "bloom";
  54. }
  55. interpolate(t, s4, r3) {
  56. this.strength = y(t.strength, s4.strength, r3), this.radius = y(t.radius, s4.radius, r3), this.threshold = y(t.threshold, s4.threshold, r3);
  57. }
  58. clone() {
  59. return new l2(this.strength, this.radius, this.threshold);
  60. }
  61. toJSON() {
  62. return { type: "bloom", radius: x(this.radius), strength: this.strength, threshold: this.threshold };
  63. }
  64. };
  65. var p = class {
  66. constructor(t) {
  67. this.radius = t, this.type = "blur";
  68. }
  69. interpolate(t, s4, r3) {
  70. this.radius = Math.round(y(t.radius, s4.radius, r3));
  71. }
  72. clone() {
  73. return new p(this.radius);
  74. }
  75. toJSON() {
  76. return { type: "blur", radius: x(this.radius) };
  77. }
  78. };
  79. var d = class {
  80. constructor(t, s4) {
  81. this.type = t, this.amount = s4, this.type !== "invert" && this.type !== "grayscale" && this.type !== "sepia" || (this.amount = Math.min(this.amount, 1));
  82. }
  83. get colorMatrix() {
  84. return this._colorMatrix || this._updateMatrix(), this._colorMatrix;
  85. }
  86. interpolate(t, s4, r3) {
  87. this.amount = y(t.amount, s4.amount, r3), this._updateMatrix();
  88. }
  89. clone() {
  90. return new d(this.type, this.amount);
  91. }
  92. toJSON() {
  93. return { type: this.type, amount: this.amount };
  94. }
  95. _updateMatrix() {
  96. const t = this._colorMatrix || e2();
  97. switch (this.type) {
  98. case "brightness":
  99. this._colorMatrix = r2(t, this.amount);
  100. break;
  101. case "contrast":
  102. this._colorMatrix = s3(t, this.amount);
  103. break;
  104. case "grayscale":
  105. this._colorMatrix = o3(t, this.amount);
  106. break;
  107. case "invert":
  108. this._colorMatrix = e3(t, this.amount);
  109. break;
  110. case "saturate":
  111. this._colorMatrix = u(t, this.amount);
  112. break;
  113. case "sepia":
  114. this._colorMatrix = a2(t, this.amount);
  115. }
  116. }
  117. };
  118. var m = class {
  119. constructor(t, s4, r3, o4) {
  120. this.offsetX = t, this.offsetY = s4, this.blurRadius = r3, this.color = o4, this.type = "drop-shadow";
  121. }
  122. interpolate(t, s4, r3) {
  123. this.offsetX = y(t.offsetX, s4.offsetX, r3), this.offsetY = y(t.offsetY, s4.offsetY, r3), this.blurRadius = y(t.blurRadius, s4.blurRadius, r3), this.color[0] = Math.round(y(t.color[0], s4.color[0], r3)), this.color[1] = Math.round(y(t.color[1], s4.color[1], r3)), this.color[2] = Math.round(y(t.color[2], s4.color[2], r3)), this.color[3] = y(t.color[3], s4.color[3], r3);
  124. }
  125. clone() {
  126. return new m(this.offsetX, this.offsetY, this.blurRadius, [...this.color]);
  127. }
  128. toJSON() {
  129. const t = [...this.color];
  130. return t[3] *= 255, { type: "drop-shadow", xoffset: x(this.offsetX), yoffset: x(this.offsetY), blurRadius: x(this.blurRadius), color: t };
  131. }
  132. };
  133. var f = class {
  134. constructor(t) {
  135. this.angle = t, this.type = "hue-rotate";
  136. }
  137. get colorMatrix() {
  138. return this._colorMatrix || this._updateMatrix(), this._colorMatrix;
  139. }
  140. interpolate(t, s4, r3) {
  141. this.angle = y(t.angle, s4.angle, r3), this._updateMatrix();
  142. }
  143. clone() {
  144. return new f(this.angle);
  145. }
  146. toJSON() {
  147. return { type: "hue-rotate", angle: this.angle };
  148. }
  149. _updateMatrix() {
  150. const t = this._colorMatrix || e2();
  151. this._colorMatrix = c(t, this.angle);
  152. }
  153. };
  154. var M = class {
  155. constructor(t) {
  156. this.amount = t, this.type = "opacity", this.amount = Math.min(this.amount, 1);
  157. }
  158. interpolate(t, s4, r3) {
  159. this.amount = y(t.amount, s4.amount, r3);
  160. }
  161. clone() {
  162. return new M(this.amount);
  163. }
  164. toJSON() {
  165. return { type: "opacity", amount: this.amount };
  166. }
  167. };
  168. function y(t, s4, r3) {
  169. return t + (s4 - t) * r3;
  170. }
  171. function x(t) {
  172. return Math.round(1e3 * e(t)) / 1e3;
  173. }
  174. function g(s4) {
  175. switch (s4.type) {
  176. case "grayscale":
  177. case "sepia":
  178. case "invert":
  179. return new d(s4.type, 0);
  180. case "saturate":
  181. case "brightness":
  182. case "contrast":
  183. return new d(s4.type, 1);
  184. case "opacity":
  185. return new M(1);
  186. case "hue-rotate":
  187. return new f(0);
  188. case "blur":
  189. return new p(0);
  190. case "drop-shadow":
  191. return new m(0, 0, 0, [...l("transparent")]);
  192. case "bloom":
  193. return new l2(0, 0, 1);
  194. }
  195. }
  196. // node_modules/@arcgis/core/layers/effects/utils.js
  197. function n(t, n2) {
  198. const e6 = t.length > n2.length ? t : n2;
  199. return (t.length > n2.length ? n2 : t).every((t2, n3) => t2.type === e6[n3].type);
  200. }
  201. function e4(n2, e6) {
  202. const h2 = n2.length > e6.length ? n2 : e6, l3 = n2.length > e6.length ? e6 : n2;
  203. for (let g3 = l3.length; g3 < h2.length; g3++)
  204. l3.push(g(h2[g3]));
  205. }
  206. function h(t) {
  207. const n2 = t[0];
  208. return !!n2 && "type" in n2;
  209. }
  210. // node_modules/@arcgis/core/layers/effects/parser.js
  211. var m2;
  212. var g2;
  213. var v = { exports: {} };
  214. function d2(t) {
  215. if (!t || t.length === 0)
  216. return null;
  217. if (typeof t == "string") {
  218. const e7 = y2(t);
  219. return e7 && e7.length !== 0 ? e7 : null;
  220. }
  221. const e6 = t.map((t2) => {
  222. if (!Number.isFinite(t2.scale) || t2.scale <= 0)
  223. throw new s("effect:invalid-scale", "scale must be finite and greater than 0", { stop: t2 });
  224. return { scale: t2.scale, effects: y2(t2.value) };
  225. });
  226. e6.sort((t2, e7) => e7.effects.length - t2.effects.length);
  227. for (let r3 = 0; r3 < e6.length - 1; r3++) {
  228. if (!n(e6[r3].effects, e6[r3 + 1].effects))
  229. throw new s("effect:interpolation-impossible", "Cannot interpolate by scale between 2 lists of mixed effects", { a: e6[r3].effects, b: e6[r3 + 1].effects });
  230. e4(e6[r3].effects, e6[r3 + 1].effects);
  231. }
  232. return e6.sort((t2, e7) => e7.scale - t2.scale), e6;
  233. }
  234. function y2(t) {
  235. let e6;
  236. if (!t)
  237. return [];
  238. try {
  239. e6 = v.exports.parse(t);
  240. } catch (r3) {
  241. throw new s("effect:invalid-syntax", "Invalid effect syntax", { value: t, error: r3 });
  242. }
  243. return e6.map((t2) => A(t2));
  244. }
  245. function A(t) {
  246. try {
  247. switch (t.name) {
  248. case "grayscale":
  249. case "sepia":
  250. case "saturate":
  251. case "invert":
  252. case "brightness":
  253. case "contrast":
  254. return w(t);
  255. case "opacity":
  256. return x2(t);
  257. case "hue-rotate":
  258. return b(t);
  259. case "blur":
  260. return C(t);
  261. case "drop-shadow":
  262. return F(t);
  263. case "bloom":
  264. return E(t);
  265. }
  266. } catch (e6) {
  267. throw e6.details.filter = t, e6;
  268. }
  269. throw new s("effect:unknown-effect", `Effect '${t.name}' is not supported`, { effect: t });
  270. }
  271. function w(t) {
  272. let e6 = 1;
  273. return j(t.parameters, 1), t.parameters.length === 1 && (e6 = M2(t.parameters[0])), new d(t.name, e6);
  274. }
  275. function x2(t) {
  276. let e6 = 1;
  277. return j(t.parameters, 1), t.parameters.length === 1 && (e6 = M2(t.parameters[0])), new M(e6);
  278. }
  279. function b(t) {
  280. let e6 = 0;
  281. return j(t.parameters, 1), t.parameters.length === 1 && (e6 = N(t.parameters[0])), new f(e6);
  282. }
  283. function C(t) {
  284. let e6 = 0;
  285. return j(t.parameters, 1), t.parameters.length === 1 && (e6 = T(t.parameters[0]), O(e6, t.parameters[0])), new p(e6);
  286. }
  287. function F(t) {
  288. const e6 = [];
  289. let r3 = null;
  290. for (const n2 of t.parameters)
  291. if (n2.type === "color") {
  292. if (e6.length && Object.freeze(e6), r3)
  293. throw new s("effect:type-error", "Accepts only one color", {});
  294. r3 = U(n2);
  295. } else {
  296. const t2 = T(n2);
  297. if (Object.isFrozen(e6))
  298. throw new s("effect:type-error", "<length> parameters not consecutive", { lengths: e6 });
  299. e6.push(t2), e6.length === 3 && O(t2, n2);
  300. }
  301. if (e6.length < 2 || e6.length > 3)
  302. throw new s("effect:type-error", `Expected <length>{2,3}, Actual: <length>{${e6.length}}`, { lengths: e6 });
  303. return new m(e6[0], e6[1], e6[2] || 0, r3 || H("black"));
  304. }
  305. function E(t) {
  306. let e6 = 1, r3 = 0, n2 = 0;
  307. return j(t.parameters, 3), t.parameters[0] && (e6 = M2(t.parameters[0])), t.parameters[1] && (r3 = T(t.parameters[1]), O(r3, t.parameters[1])), t.parameters[2] && (n2 = M2(t.parameters[2])), new l2(e6, r3, n2);
  308. }
  309. function j(t, e6) {
  310. if (t.length > e6)
  311. throw new s("effect:type-error", `Function supports up to ${e6} parameters, Actual: ${t.length}`, { parameters: t });
  312. }
  313. function $(t) {
  314. if (t.type === "color")
  315. return "<color>";
  316. if (t.unit) {
  317. if (R[t.unit])
  318. return "<length>";
  319. if (S[t.unit])
  320. return "<angle>";
  321. if (t.unit === "%")
  322. return "<percentage>";
  323. }
  324. return "<double>";
  325. }
  326. function O(t, e6) {
  327. if (t < 0)
  328. throw new s("effect:type-error", `Negative values are not allowed, Actual: ${t}`, { term: e6 });
  329. }
  330. function k(t) {
  331. if (t.type !== "quantity" || t.unit !== null)
  332. throw new s("effect:type-error", `Expected <double>, Actual: ${$(t)}`, { term: t });
  333. }
  334. function q(t) {
  335. if (t.type !== "quantity" || t.unit !== null && t.unit !== "%")
  336. throw new s("effect:type-error", `Expected <double> or <percentage>, Actual: ${$(t)}`, { term: t });
  337. }
  338. g2 = function() {
  339. function t(t2, e7) {
  340. function r4() {
  341. this.constructor = t2;
  342. }
  343. r4.prototype = e7.prototype, t2.prototype = new r4();
  344. }
  345. function e6(t2, r4, n3, u2) {
  346. var a3 = Error.call(this, t2);
  347. return Object.setPrototypeOf && Object.setPrototypeOf(a3, e6.prototype), a3.expected = r4, a3.found = n3, a3.location = u2, a3.name = "SyntaxError", a3;
  348. }
  349. function r3(t2, e7, r4) {
  350. return r4 = r4 || " ", t2.length > e7 ? t2 : (e7 -= t2.length, t2 + (r4 += r4.repeat(e7)).slice(0, e7));
  351. }
  352. function n2(t2, r4) {
  353. var n3, u2 = {}, a3 = (r4 = r4 !== void 0 ? r4 : {}).grammarSource, c2 = { start: Lt }, o4 = Lt, i2 = "none", l3 = ")", s4 = ",", f2 = "(", p2 = "%", h2 = "px", m3 = "cm", g3 = "mm", v2 = "in", d3 = "pt", y3 = "pc", A2 = "deg", w2 = "rad", x3 = "grad", b2 = "turn", C2 = "#", F2 = ".", E2 = "e", j2 = /^[ \t\n\r]/, $2 = /^[a-z\-]/, O2 = /^[0-9a-fA-F]/, k2 = /^[+\-]/, q2 = /^[0-9]/, S2 = Bt("none"), z2 = Ut("none", false), R2 = Ut(")", false), I2 = Ut(",", false), M3 = Bt("whitespace"), P2 = Ht([" ", " ", "\n", "\r"], false, false), N2 = Bt("function"), T2 = Ut("(", false), U2 = Bt("identifier"), H2 = Ht([["a", "z"], "-"], false, false), _2 = Bt("percentage"), B2 = Ut("%", false), D2 = Bt("length"), G = Ut("px", false), J = Ut("cm", false), K = Ut("mm", false), L = Ut("in", false), Q = Ut("pt", false), V = Ut("pc", false), W = Bt("angle"), X = Ut("deg", false), Y = Ut("rad", false), Z = Ut("grad", false), tt = Ut("turn", false), et = Bt("number"), rt = Bt("color"), nt = Ut("#", false), ut = Ht([["0", "9"], ["a", "f"], ["A", "F"]], false, false), at = Ht(["+", "-"], false, false), ct = Ht([["0", "9"]], false, false), ot = Ut(".", false), it = Ut("e", false), lt = function() {
  354. return [];
  355. }, st = function(t3, e7) {
  356. return { type: "function", name: t3, parameters: e7 || [] };
  357. }, ft = function(t3, e7) {
  358. return e7.length > 0 ? le(t3, e7, 3) : [t3];
  359. }, pt = function(t3) {
  360. return { type: "quantity", value: t3.value, unit: t3.unit };
  361. }, ht = function(t3) {
  362. return { type: "color", colorType: t3.type, value: t3.value };
  363. }, mt = function(t3) {
  364. return t3;
  365. }, gt = function() {
  366. return Tt();
  367. }, vt = function(t3) {
  368. return { value: t3, unit: "%" };
  369. }, dt = function(t3) {
  370. return { value: t3, unit: "px" };
  371. }, yt = function(t3) {
  372. return { value: t3, unit: "cm" };
  373. }, At = function(t3) {
  374. return { value: t3, unit: "mm" };
  375. }, wt = function(t3) {
  376. return { value: t3, unit: "in" };
  377. }, xt = function(t3) {
  378. return { value: t3, unit: "pt" };
  379. }, bt = function(t3) {
  380. return { value: t3, unit: "pc" };
  381. }, Ct = function(t3) {
  382. return { value: t3, unit: "deg" };
  383. }, Ft = function(t3) {
  384. return { value: t3, unit: "rad" };
  385. }, Et = function(t3) {
  386. return { value: t3, unit: "grad" };
  387. }, jt = function(t3) {
  388. return { value: t3, unit: "turn" };
  389. }, $t = function(t3) {
  390. return { value: t3, unit: null };
  391. }, Ot = function() {
  392. return { type: "hex", value: Tt() };
  393. }, kt = function(t3) {
  394. return { type: "function", value: t3 };
  395. }, qt = function() {
  396. return { type: "named", value: Tt() };
  397. }, St = function() {
  398. return parseFloat(Tt());
  399. }, zt = 0, Rt = 0, It = [{ line: 1, column: 1 }], Mt = 0, Pt = [], Nt = 0;
  400. if ("startRule" in r4) {
  401. if (!(r4.startRule in c2))
  402. throw new Error(`Can't start parsing from rule "` + r4.startRule + '".');
  403. o4 = c2[r4.startRule];
  404. }
  405. function Tt() {
  406. return t2.substring(Rt, zt);
  407. }
  408. function Ut(t3, e7) {
  409. return { type: "literal", text: t3, ignoreCase: e7 };
  410. }
  411. function Ht(t3, e7, r5) {
  412. return { type: "class", parts: t3, inverted: e7, ignoreCase: r5 };
  413. }
  414. function _t() {
  415. return { type: "end" };
  416. }
  417. function Bt(t3) {
  418. return { type: "other", description: t3 };
  419. }
  420. function Dt(e7) {
  421. var r5, n4 = It[e7];
  422. if (n4)
  423. return n4;
  424. for (r5 = e7 - 1; !It[r5]; )
  425. r5--;
  426. for (n4 = { line: (n4 = It[r5]).line, column: n4.column }; r5 < e7; )
  427. t2.charCodeAt(r5) === 10 ? (n4.line++, n4.column = 1) : n4.column++, r5++;
  428. return It[e7] = n4, n4;
  429. }
  430. function Gt(t3, e7) {
  431. var r5 = Dt(t3), n4 = Dt(e7);
  432. return { source: a3, start: { offset: t3, line: r5.line, column: r5.column }, end: { offset: e7, line: n4.line, column: n4.column } };
  433. }
  434. function Jt(t3) {
  435. zt < Mt || (zt > Mt && (Mt = zt, Pt = []), Pt.push(t3));
  436. }
  437. function Kt(t3, r5, n4) {
  438. return new e6(e6.buildMessage(t3, r5), t3, r5, n4);
  439. }
  440. function Lt() {
  441. var t3;
  442. return (t3 = Qt()) === u2 && (t3 = Vt()), t3;
  443. }
  444. function Qt() {
  445. var e7, r5;
  446. return Nt++, e7 = zt, Zt(), t2.substr(zt, 4) === i2 ? (r5 = i2, zt += 4) : (r5 = u2, Nt === 0 && Jt(z2)), r5 !== u2 ? (Zt(), Rt = e7, e7 = lt()) : (zt = e7, e7 = u2), Nt--, e7 === u2 && Nt === 0 && Jt(S2), e7;
  447. }
  448. function Vt() {
  449. var t3, e7;
  450. if (t3 = [], (e7 = Wt()) !== u2)
  451. for (; e7 !== u2; )
  452. t3.push(e7), e7 = Wt();
  453. else
  454. t3 = u2;
  455. return t3;
  456. }
  457. function Wt() {
  458. var e7, r5, n4, a4;
  459. return e7 = zt, Zt(), (r5 = te()) !== u2 ? (Zt(), (n4 = Xt()) === u2 && (n4 = null), Zt(), t2.charCodeAt(zt) === 41 ? (a4 = l3, zt++) : (a4 = u2, Nt === 0 && Jt(R2)), a4 !== u2 ? (Zt(), Rt = e7, e7 = st(r5, n4)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2), e7;
  460. }
  461. function Xt() {
  462. var e7, r5, n4, a4, c3, o5, i3, l4;
  463. if (e7 = zt, (r5 = Yt()) !== u2) {
  464. for (n4 = [], a4 = zt, c3 = Zt(), t2.charCodeAt(zt) === 44 ? (o5 = s4, zt++) : (o5 = u2, Nt === 0 && Jt(I2)), o5 === u2 && (o5 = null), i3 = Zt(), (l4 = Yt()) !== u2 ? a4 = c3 = [c3, o5, i3, l4] : (zt = a4, a4 = u2); a4 !== u2; )
  465. n4.push(a4), a4 = zt, c3 = Zt(), t2.charCodeAt(zt) === 44 ? (o5 = s4, zt++) : (o5 = u2, Nt === 0 && Jt(I2)), o5 === u2 && (o5 = null), i3 = Zt(), (l4 = Yt()) !== u2 ? a4 = c3 = [c3, o5, i3, l4] : (zt = a4, a4 = u2);
  466. Rt = e7, e7 = ft(r5, n4);
  467. } else
  468. zt = e7, e7 = u2;
  469. return e7;
  470. }
  471. function Yt() {
  472. var t3, e7;
  473. return t3 = zt, (e7 = re()) === u2 && (e7 = ne()) === u2 && (e7 = ue()) === u2 && (e7 = ae()), e7 !== u2 && (Rt = t3, e7 = pt(e7)), (t3 = e7) === u2 && (t3 = zt, (e7 = ce()) !== u2 && (Rt = t3, e7 = ht(e7)), t3 = e7), t3;
  474. }
  475. function Zt() {
  476. var e7, r5;
  477. for (Nt++, e7 = [], j2.test(t2.charAt(zt)) ? (r5 = t2.charAt(zt), zt++) : (r5 = u2, Nt === 0 && Jt(P2)); r5 !== u2; )
  478. e7.push(r5), j2.test(t2.charAt(zt)) ? (r5 = t2.charAt(zt), zt++) : (r5 = u2, Nt === 0 && Jt(P2));
  479. return Nt--, r5 = u2, Nt === 0 && Jt(M3), e7;
  480. }
  481. function te() {
  482. var e7, r5, n4;
  483. return Nt++, e7 = zt, (r5 = ee()) !== u2 ? (t2.charCodeAt(zt) === 40 ? (n4 = f2, zt++) : (n4 = u2, Nt === 0 && Jt(T2)), n4 !== u2 ? (Rt = e7, e7 = mt(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2), Nt--, e7 === u2 && (r5 = u2, Nt === 0 && Jt(N2)), e7;
  484. }
  485. function ee() {
  486. var e7, r5, n4;
  487. if (Nt++, e7 = zt, r5 = [], $2.test(t2.charAt(zt)) ? (n4 = t2.charAt(zt), zt++) : (n4 = u2, Nt === 0 && Jt(H2)), n4 !== u2)
  488. for (; n4 !== u2; )
  489. r5.push(n4), $2.test(t2.charAt(zt)) ? (n4 = t2.charAt(zt), zt++) : (n4 = u2, Nt === 0 && Jt(H2));
  490. else
  491. r5 = u2;
  492. return r5 !== u2 && (Rt = e7, r5 = gt()), Nt--, (e7 = r5) === u2 && (r5 = u2, Nt === 0 && Jt(U2)), e7;
  493. }
  494. function re() {
  495. var e7, r5, n4;
  496. return Nt++, e7 = zt, Zt(), (r5 = oe()) !== u2 ? (t2.charCodeAt(zt) === 37 ? (n4 = p2, zt++) : (n4 = u2, Nt === 0 && Jt(B2)), n4 !== u2 ? (Rt = e7, e7 = vt(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2), Nt--, e7 === u2 && Nt === 0 && Jt(_2), e7;
  497. }
  498. function ne() {
  499. var e7, r5, n4;
  500. return Nt++, e7 = zt, Zt(), (r5 = oe()) !== u2 ? (t2.substr(zt, 2) === h2 ? (n4 = h2, zt += 2) : (n4 = u2, Nt === 0 && Jt(G)), n4 !== u2 ? (Rt = e7, e7 = dt(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2), e7 === u2 && (e7 = zt, Zt(), (r5 = oe()) !== u2 ? (t2.substr(zt, 2) === m3 ? (n4 = m3, zt += 2) : (n4 = u2, Nt === 0 && Jt(J)), n4 !== u2 ? (Rt = e7, e7 = yt(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2), e7 === u2 && (e7 = zt, Zt(), (r5 = oe()) !== u2 ? (t2.substr(zt, 2) === g3 ? (n4 = g3, zt += 2) : (n4 = u2, Nt === 0 && Jt(K)), n4 !== u2 ? (Rt = e7, e7 = At(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2), e7 === u2 && (e7 = zt, Zt(), (r5 = oe()) !== u2 ? (t2.substr(zt, 2) === v2 ? (n4 = v2, zt += 2) : (n4 = u2, Nt === 0 && Jt(L)), n4 !== u2 ? (Rt = e7, e7 = wt(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2), e7 === u2 && (e7 = zt, Zt(), (r5 = oe()) !== u2 ? (t2.substr(zt, 2) === d3 ? (n4 = d3, zt += 2) : (n4 = u2, Nt === 0 && Jt(Q)), n4 !== u2 ? (Rt = e7, e7 = xt(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2), e7 === u2 && (e7 = zt, Zt(), (r5 = oe()) !== u2 ? (t2.substr(zt, 2) === y3 ? (n4 = y3, zt += 2) : (n4 = u2, Nt === 0 && Jt(V)), n4 !== u2 ? (Rt = e7, e7 = bt(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2)))))), Nt--, e7 === u2 && Nt === 0 && Jt(D2), e7;
  501. }
  502. function ue() {
  503. var e7, r5, n4;
  504. return Nt++, e7 = zt, (r5 = oe()) !== u2 ? (t2.substr(zt, 3) === A2 ? (n4 = A2, zt += 3) : (n4 = u2, Nt === 0 && Jt(X)), n4 !== u2 ? (Rt = e7, e7 = Ct(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2), e7 === u2 && (e7 = zt, (r5 = oe()) !== u2 ? (t2.substr(zt, 3) === w2 ? (n4 = w2, zt += 3) : (n4 = u2, Nt === 0 && Jt(Y)), n4 !== u2 ? (Rt = e7, e7 = Ft(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2), e7 === u2 && (e7 = zt, (r5 = oe()) !== u2 ? (t2.substr(zt, 4) === x3 ? (n4 = x3, zt += 4) : (n4 = u2, Nt === 0 && Jt(Z)), n4 !== u2 ? (Rt = e7, e7 = Et(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2), e7 === u2 && (e7 = zt, (r5 = oe()) !== u2 ? (t2.substr(zt, 4) === b2 ? (n4 = b2, zt += 4) : (n4 = u2, Nt === 0 && Jt(tt)), n4 !== u2 ? (Rt = e7, e7 = jt(r5)) : (zt = e7, e7 = u2)) : (zt = e7, e7 = u2)))), Nt--, e7 === u2 && (r5 = u2, Nt === 0 && Jt(W)), e7;
  505. }
  506. function ae() {
  507. var t3, e7;
  508. return Nt++, t3 = zt, Zt(), (e7 = oe()) !== u2 ? (Rt = t3, t3 = $t(e7)) : (zt = t3, t3 = u2), Nt--, t3 === u2 && Nt === 0 && Jt(et), t3;
  509. }
  510. function ce() {
  511. var e7, r5, n4, a4;
  512. if (Nt++, e7 = zt, t2.charCodeAt(zt) === 35 ? (r5 = C2, zt++) : (r5 = u2, Nt === 0 && Jt(nt)), r5 !== u2) {
  513. if (n4 = [], O2.test(t2.charAt(zt)) ? (a4 = t2.charAt(zt), zt++) : (a4 = u2, Nt === 0 && Jt(ut)), a4 !== u2)
  514. for (; a4 !== u2; )
  515. n4.push(a4), O2.test(t2.charAt(zt)) ? (a4 = t2.charAt(zt), zt++) : (a4 = u2, Nt === 0 && Jt(ut));
  516. else
  517. n4 = u2;
  518. n4 !== u2 ? (Rt = e7, e7 = Ot()) : (zt = e7, e7 = u2);
  519. } else
  520. zt = e7, e7 = u2;
  521. return e7 === u2 && (e7 = zt, (r5 = Wt()) !== u2 && (Rt = e7, r5 = kt(r5)), (e7 = r5) === u2 && (e7 = zt, (r5 = ee()) !== u2 && (Rt = e7, r5 = qt()), e7 = r5)), Nt--, e7 === u2 && (r5 = u2, Nt === 0 && Jt(rt)), e7;
  522. }
  523. function oe() {
  524. var e7, r5, n4, a4, c3, o5, i3;
  525. for (e7 = zt, k2.test(t2.charAt(zt)) ? (t2.charAt(zt), zt++) : Nt === 0 && Jt(at), r5 = zt, n4 = [], q2.test(t2.charAt(zt)) ? (a4 = t2.charAt(zt), zt++) : (a4 = u2, Nt === 0 && Jt(ct)); a4 !== u2; )
  526. n4.push(a4), q2.test(t2.charAt(zt)) ? (a4 = t2.charAt(zt), zt++) : (a4 = u2, Nt === 0 && Jt(ct));
  527. if (t2.charCodeAt(zt) === 46 ? (a4 = F2, zt++) : (a4 = u2, Nt === 0 && Jt(ot)), a4 !== u2) {
  528. if (c3 = [], q2.test(t2.charAt(zt)) ? (o5 = t2.charAt(zt), zt++) : (o5 = u2, Nt === 0 && Jt(ct)), o5 !== u2)
  529. for (; o5 !== u2; )
  530. c3.push(o5), q2.test(t2.charAt(zt)) ? (o5 = t2.charAt(zt), zt++) : (o5 = u2, Nt === 0 && Jt(ct));
  531. else
  532. c3 = u2;
  533. c3 !== u2 ? r5 = n4 = [n4, a4, c3] : (zt = r5, r5 = u2);
  534. } else
  535. zt = r5, r5 = u2;
  536. if (r5 === u2)
  537. if (r5 = [], q2.test(t2.charAt(zt)) ? (n4 = t2.charAt(zt), zt++) : (n4 = u2, Nt === 0 && Jt(ct)), n4 !== u2)
  538. for (; n4 !== u2; )
  539. r5.push(n4), q2.test(t2.charAt(zt)) ? (n4 = t2.charAt(zt), zt++) : (n4 = u2, Nt === 0 && Jt(ct));
  540. else
  541. r5 = u2;
  542. if (r5 !== u2) {
  543. if (n4 = zt, t2.charCodeAt(zt) === 101 ? (a4 = E2, zt++) : (a4 = u2, Nt === 0 && Jt(it)), a4 !== u2) {
  544. if (k2.test(t2.charAt(zt)) ? (c3 = t2.charAt(zt), zt++) : (c3 = u2, Nt === 0 && Jt(at)), c3 === u2 && (c3 = null), o5 = [], q2.test(t2.charAt(zt)) ? (i3 = t2.charAt(zt), zt++) : (i3 = u2, Nt === 0 && Jt(ct)), i3 !== u2)
  545. for (; i3 !== u2; )
  546. o5.push(i3), q2.test(t2.charAt(zt)) ? (i3 = t2.charAt(zt), zt++) : (i3 = u2, Nt === 0 && Jt(ct));
  547. else
  548. o5 = u2;
  549. o5 !== u2 ? n4 = a4 = [a4, c3, o5] : (zt = n4, n4 = u2);
  550. } else
  551. zt = n4, n4 = u2;
  552. n4 === u2 && (n4 = null), Rt = e7, e7 = St();
  553. } else
  554. zt = e7, e7 = u2;
  555. return e7;
  556. }
  557. function ie(t3, e7) {
  558. return t3.map(function(t4) {
  559. return t4[e7];
  560. });
  561. }
  562. function le(t3, e7, r5) {
  563. return [t3].concat(ie(e7, r5));
  564. }
  565. if ((n3 = o4()) !== u2 && zt === t2.length)
  566. return n3;
  567. throw n3 !== u2 && zt < t2.length && Jt(_t()), Kt(Pt, Mt < t2.length ? t2.charAt(Mt) : null, Mt < t2.length ? Gt(Mt, Mt + 1) : Gt(Mt, Mt));
  568. }
  569. return t(e6, Error), e6.prototype.format = function(t2) {
  570. var e7 = "Error: " + this.message;
  571. if (this.location) {
  572. var n3, u2 = null;
  573. for (n3 = 0; n3 < t2.length; n3++)
  574. if (t2[n3].source === this.location.source) {
  575. u2 = t2[n3].text.split(/\r\n|\n|\r/g);
  576. break;
  577. }
  578. var a3 = this.location.start, c2 = this.location.source + ":" + a3.line + ":" + a3.column;
  579. if (u2) {
  580. var o4 = this.location.end, i2 = r3("", a3.line.toString().length), l3 = u2[a3.line - 1], s4 = a3.line === o4.line ? o4.column : l3.length + 1;
  581. e7 += "\n --> " + c2 + "\n" + i2 + " |\n" + a3.line + " | " + l3 + "\n" + i2 + " | " + r3("", a3.column - 1) + r3("", s4 - a3.column, "^");
  582. } else
  583. e7 += "\n at " + c2;
  584. }
  585. return e7;
  586. }, e6.buildMessage = function(t2, e7) {
  587. var r4 = { literal: function(t3) {
  588. return '"' + u2(t3.text) + '"';
  589. }, class: function(t3) {
  590. var e8 = t3.parts.map(function(t4) {
  591. return Array.isArray(t4) ? a3(t4[0]) + "-" + a3(t4[1]) : a3(t4);
  592. });
  593. return "[" + (t3.inverted ? "^" : "") + e8 + "]";
  594. }, any: function() {
  595. return "any character";
  596. }, end: function() {
  597. return "end of input";
  598. }, other: function(t3) {
  599. return t3.description;
  600. } };
  601. function n3(t3) {
  602. return t3.charCodeAt(0).toString(16).toUpperCase();
  603. }
  604. function u2(t3) {
  605. return t3.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(t4) {
  606. return "\\x0" + n3(t4);
  607. }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(t4) {
  608. return "\\x" + n3(t4);
  609. });
  610. }
  611. function a3(t3) {
  612. return t3.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(t4) {
  613. return "\\x0" + n3(t4);
  614. }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(t4) {
  615. return "\\x" + n3(t4);
  616. });
  617. }
  618. function c2(t3) {
  619. return r4[t3.type](t3);
  620. }
  621. function o4(t3) {
  622. var e8, r5, n4 = t3.map(c2);
  623. if (n4.sort(), n4.length > 0) {
  624. for (e8 = 1, r5 = 1; e8 < n4.length; e8++)
  625. n4[e8 - 1] !== n4[e8] && (n4[r5] = n4[e8], r5++);
  626. n4.length = r5;
  627. }
  628. switch (n4.length) {
  629. case 1:
  630. return n4[0];
  631. case 2:
  632. return n4[0] + " or " + n4[1];
  633. default:
  634. return n4.slice(0, -1).join(", ") + ", or " + n4[n4.length - 1];
  635. }
  636. }
  637. function i2(t3) {
  638. return t3 ? '"' + u2(t3) + '"' : "end of input";
  639. }
  640. return "Expected " + o4(t2) + " but " + i2(e7) + " found.";
  641. }, { SyntaxError: e6, parse: n2 };
  642. }, (m2 = v).exports && (m2.exports = g2());
  643. var S = { deg: 1, grad: 0.9, rad: 180 / Math.PI, turn: 360 };
  644. function z(t) {
  645. if (t.type !== "quantity" || !(t.value === 0 && t.unit === null || t.unit && S[t.unit] != null))
  646. throw new s("effect:type-error", `Expected <angle>, Actual: ${$(t)}`, { term: t });
  647. }
  648. var R = { px: 1, cm: 96 / 2.54, mm: 96 / 2.54 / 10, in: 96, pc: 16, pt: 96 / 72 };
  649. function I(t) {
  650. if (t.type !== "quantity" || !(t.value === 0 && t.unit === null || t.unit && R[t.unit] != null))
  651. throw new s("effect:type-error", `Expected <length>, Actual: ${$(t)}`, { term: t });
  652. }
  653. function M2(t) {
  654. q(t);
  655. const e6 = t.value;
  656. return O(e6, t), t.unit === "%" ? 0.01 * e6 : e6;
  657. }
  658. function P(t) {
  659. return k(t), O(t.value, t), t.value;
  660. }
  661. function N(t) {
  662. return z(t), t.value * S[t.unit] || 0;
  663. }
  664. function T(t) {
  665. return I(t), t.value * R[t.unit] || 0;
  666. }
  667. function U(t) {
  668. switch (t.colorType) {
  669. case "hex":
  670. return i(t.value);
  671. case "named":
  672. return H(t.value);
  673. case "function":
  674. return D(t.value);
  675. }
  676. }
  677. function H(e6) {
  678. if (!r(e6))
  679. throw new s("effect:unknown-color", `color '${e6}' isn't valid`, { namedColor: e6 });
  680. return a(e6);
  681. }
  682. var _ = /^rgba?/i;
  683. var B = /^hsla?/i;
  684. function D(t) {
  685. if (j(t.parameters, 4), _.test(t.name))
  686. return [M2(t.parameters[0]), M2(t.parameters[1]), M2(t.parameters[2]), t.parameters[3] ? M2(t.parameters[3]) : 1];
  687. if (B.test(t.name))
  688. return o(P(t.parameters[0]), M2(t.parameters[1]), M2(t.parameters[2]), t.parameters[3] ? M2(t.parameters[3]) : 1);
  689. throw new s("effect:syntax-error", `Invalid color function '${t.name}'`, { colorFunction: t });
  690. }
  691. export {
  692. n,
  693. e4 as e,
  694. h,
  695. d2 as d
  696. };
  697. //# sourceMappingURL=chunk-WJW5DUN6.js.map