123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702 |
- import {
- e as e2
- } from "./chunk-PJ7ZQ4VD.js";
- import {
- o as o2,
- s as s2
- } from "./chunk-TERAW6FT.js";
- import {
- e
- } from "./chunk-WEMIK25H.js";
- import {
- a,
- i,
- l,
- o,
- r
- } from "./chunk-JXW4QTJA.js";
- import {
- s3 as s
- } from "./chunk-EMJ4ZSM2.js";
- // node_modules/@arcgis/core/layers/effects/colorMatrixFunctions.js
- var r2 = (r3, s4) => {
- const o4 = s2(r3, s4, 0, 0, 0, 0, s4, 0, 0, 0, 0, s4, 0, 0, 0, 0, 1);
- return o2(o4, o4);
- };
- var s3 = (r3, s4) => {
- 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);
- return o2(o4, o4);
- };
- var o3 = (r3, s4) => {
- 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);
- return o2(c2, c2);
- };
- var c = (r3, s4) => {
- 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);
- return o2(e6, e6);
- };
- var e3 = (r3, s4) => {
- const o4 = 1 - 2 * s4, c2 = s2(r3, o4, 0, 0, s4, 0, o4, 0, s4, 0, 0, o4, s4, 0, 0, 0, 1);
- return o2(c2, c2);
- };
- var u = (r3, s4) => {
- 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);
- return o2(o4, o4);
- };
- var a2 = (r3, s4) => {
- 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);
- return o2(c2, c2);
- };
- // node_modules/@arcgis/core/layers/effects/effects.js
- var l2 = class {
- constructor(t, s4, r3) {
- this.strength = t, this.radius = s4, this.threshold = r3, this.type = "bloom";
- }
- interpolate(t, s4, r3) {
- this.strength = y(t.strength, s4.strength, r3), this.radius = y(t.radius, s4.radius, r3), this.threshold = y(t.threshold, s4.threshold, r3);
- }
- clone() {
- return new l2(this.strength, this.radius, this.threshold);
- }
- toJSON() {
- return { type: "bloom", radius: x(this.radius), strength: this.strength, threshold: this.threshold };
- }
- };
- var p = class {
- constructor(t) {
- this.radius = t, this.type = "blur";
- }
- interpolate(t, s4, r3) {
- this.radius = Math.round(y(t.radius, s4.radius, r3));
- }
- clone() {
- return new p(this.radius);
- }
- toJSON() {
- return { type: "blur", radius: x(this.radius) };
- }
- };
- var d = class {
- constructor(t, s4) {
- this.type = t, this.amount = s4, this.type !== "invert" && this.type !== "grayscale" && this.type !== "sepia" || (this.amount = Math.min(this.amount, 1));
- }
- get colorMatrix() {
- return this._colorMatrix || this._updateMatrix(), this._colorMatrix;
- }
- interpolate(t, s4, r3) {
- this.amount = y(t.amount, s4.amount, r3), this._updateMatrix();
- }
- clone() {
- return new d(this.type, this.amount);
- }
- toJSON() {
- return { type: this.type, amount: this.amount };
- }
- _updateMatrix() {
- const t = this._colorMatrix || e2();
- switch (this.type) {
- case "brightness":
- this._colorMatrix = r2(t, this.amount);
- break;
- case "contrast":
- this._colorMatrix = s3(t, this.amount);
- break;
- case "grayscale":
- this._colorMatrix = o3(t, this.amount);
- break;
- case "invert":
- this._colorMatrix = e3(t, this.amount);
- break;
- case "saturate":
- this._colorMatrix = u(t, this.amount);
- break;
- case "sepia":
- this._colorMatrix = a2(t, this.amount);
- }
- }
- };
- var m = class {
- constructor(t, s4, r3, o4) {
- this.offsetX = t, this.offsetY = s4, this.blurRadius = r3, this.color = o4, this.type = "drop-shadow";
- }
- interpolate(t, s4, r3) {
- 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);
- }
- clone() {
- return new m(this.offsetX, this.offsetY, this.blurRadius, [...this.color]);
- }
- toJSON() {
- const t = [...this.color];
- return t[3] *= 255, { type: "drop-shadow", xoffset: x(this.offsetX), yoffset: x(this.offsetY), blurRadius: x(this.blurRadius), color: t };
- }
- };
- var f = class {
- constructor(t) {
- this.angle = t, this.type = "hue-rotate";
- }
- get colorMatrix() {
- return this._colorMatrix || this._updateMatrix(), this._colorMatrix;
- }
- interpolate(t, s4, r3) {
- this.angle = y(t.angle, s4.angle, r3), this._updateMatrix();
- }
- clone() {
- return new f(this.angle);
- }
- toJSON() {
- return { type: "hue-rotate", angle: this.angle };
- }
- _updateMatrix() {
- const t = this._colorMatrix || e2();
- this._colorMatrix = c(t, this.angle);
- }
- };
- var M = class {
- constructor(t) {
- this.amount = t, this.type = "opacity", this.amount = Math.min(this.amount, 1);
- }
- interpolate(t, s4, r3) {
- this.amount = y(t.amount, s4.amount, r3);
- }
- clone() {
- return new M(this.amount);
- }
- toJSON() {
- return { type: "opacity", amount: this.amount };
- }
- };
- function y(t, s4, r3) {
- return t + (s4 - t) * r3;
- }
- function x(t) {
- return Math.round(1e3 * e(t)) / 1e3;
- }
- function g(s4) {
- switch (s4.type) {
- case "grayscale":
- case "sepia":
- case "invert":
- return new d(s4.type, 0);
- case "saturate":
- case "brightness":
- case "contrast":
- return new d(s4.type, 1);
- case "opacity":
- return new M(1);
- case "hue-rotate":
- return new f(0);
- case "blur":
- return new p(0);
- case "drop-shadow":
- return new m(0, 0, 0, [...l("transparent")]);
- case "bloom":
- return new l2(0, 0, 1);
- }
- }
- // node_modules/@arcgis/core/layers/effects/utils.js
- function n(t, n2) {
- const e6 = t.length > n2.length ? t : n2;
- return (t.length > n2.length ? n2 : t).every((t2, n3) => t2.type === e6[n3].type);
- }
- function e4(n2, e6) {
- const h2 = n2.length > e6.length ? n2 : e6, l3 = n2.length > e6.length ? e6 : n2;
- for (let g3 = l3.length; g3 < h2.length; g3++)
- l3.push(g(h2[g3]));
- }
- function h(t) {
- const n2 = t[0];
- return !!n2 && "type" in n2;
- }
- // node_modules/@arcgis/core/layers/effects/parser.js
- var m2;
- var g2;
- var v = { exports: {} };
- function d2(t) {
- if (!t || t.length === 0)
- return null;
- if (typeof t == "string") {
- const e7 = y2(t);
- return e7 && e7.length !== 0 ? e7 : null;
- }
- const e6 = t.map((t2) => {
- if (!Number.isFinite(t2.scale) || t2.scale <= 0)
- throw new s("effect:invalid-scale", "scale must be finite and greater than 0", { stop: t2 });
- return { scale: t2.scale, effects: y2(t2.value) };
- });
- e6.sort((t2, e7) => e7.effects.length - t2.effects.length);
- for (let r3 = 0; r3 < e6.length - 1; r3++) {
- if (!n(e6[r3].effects, e6[r3 + 1].effects))
- 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 });
- e4(e6[r3].effects, e6[r3 + 1].effects);
- }
- return e6.sort((t2, e7) => e7.scale - t2.scale), e6;
- }
- function y2(t) {
- let e6;
- if (!t)
- return [];
- try {
- e6 = v.exports.parse(t);
- } catch (r3) {
- throw new s("effect:invalid-syntax", "Invalid effect syntax", { value: t, error: r3 });
- }
- return e6.map((t2) => A(t2));
- }
- function A(t) {
- try {
- switch (t.name) {
- case "grayscale":
- case "sepia":
- case "saturate":
- case "invert":
- case "brightness":
- case "contrast":
- return w(t);
- case "opacity":
- return x2(t);
- case "hue-rotate":
- return b(t);
- case "blur":
- return C(t);
- case "drop-shadow":
- return F(t);
- case "bloom":
- return E(t);
- }
- } catch (e6) {
- throw e6.details.filter = t, e6;
- }
- throw new s("effect:unknown-effect", `Effect '${t.name}' is not supported`, { effect: t });
- }
- function w(t) {
- let e6 = 1;
- return j(t.parameters, 1), t.parameters.length === 1 && (e6 = M2(t.parameters[0])), new d(t.name, e6);
- }
- function x2(t) {
- let e6 = 1;
- return j(t.parameters, 1), t.parameters.length === 1 && (e6 = M2(t.parameters[0])), new M(e6);
- }
- function b(t) {
- let e6 = 0;
- return j(t.parameters, 1), t.parameters.length === 1 && (e6 = N(t.parameters[0])), new f(e6);
- }
- function C(t) {
- let e6 = 0;
- return j(t.parameters, 1), t.parameters.length === 1 && (e6 = T(t.parameters[0]), O(e6, t.parameters[0])), new p(e6);
- }
- function F(t) {
- const e6 = [];
- let r3 = null;
- for (const n2 of t.parameters)
- if (n2.type === "color") {
- if (e6.length && Object.freeze(e6), r3)
- throw new s("effect:type-error", "Accepts only one color", {});
- r3 = U(n2);
- } else {
- const t2 = T(n2);
- if (Object.isFrozen(e6))
- throw new s("effect:type-error", "<length> parameters not consecutive", { lengths: e6 });
- e6.push(t2), e6.length === 3 && O(t2, n2);
- }
- if (e6.length < 2 || e6.length > 3)
- throw new s("effect:type-error", `Expected <length>{2,3}, Actual: <length>{${e6.length}}`, { lengths: e6 });
- return new m(e6[0], e6[1], e6[2] || 0, r3 || H("black"));
- }
- function E(t) {
- let e6 = 1, r3 = 0, n2 = 0;
- 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);
- }
- function j(t, e6) {
- if (t.length > e6)
- throw new s("effect:type-error", `Function supports up to ${e6} parameters, Actual: ${t.length}`, { parameters: t });
- }
- function $(t) {
- if (t.type === "color")
- return "<color>";
- if (t.unit) {
- if (R[t.unit])
- return "<length>";
- if (S[t.unit])
- return "<angle>";
- if (t.unit === "%")
- return "<percentage>";
- }
- return "<double>";
- }
- function O(t, e6) {
- if (t < 0)
- throw new s("effect:type-error", `Negative values are not allowed, Actual: ${t}`, { term: e6 });
- }
- function k(t) {
- if (t.type !== "quantity" || t.unit !== null)
- throw new s("effect:type-error", `Expected <double>, Actual: ${$(t)}`, { term: t });
- }
- function q(t) {
- if (t.type !== "quantity" || t.unit !== null && t.unit !== "%")
- throw new s("effect:type-error", `Expected <double> or <percentage>, Actual: ${$(t)}`, { term: t });
- }
- g2 = function() {
- function t(t2, e7) {
- function r4() {
- this.constructor = t2;
- }
- r4.prototype = e7.prototype, t2.prototype = new r4();
- }
- function e6(t2, r4, n3, u2) {
- var a3 = Error.call(this, t2);
- return Object.setPrototypeOf && Object.setPrototypeOf(a3, e6.prototype), a3.expected = r4, a3.found = n3, a3.location = u2, a3.name = "SyntaxError", a3;
- }
- function r3(t2, e7, r4) {
- return r4 = r4 || " ", t2.length > e7 ? t2 : (e7 -= t2.length, t2 + (r4 += r4.repeat(e7)).slice(0, e7));
- }
- function n2(t2, r4) {
- 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() {
- return [];
- }, st = function(t3, e7) {
- return { type: "function", name: t3, parameters: e7 || [] };
- }, ft = function(t3, e7) {
- return e7.length > 0 ? le(t3, e7, 3) : [t3];
- }, pt = function(t3) {
- return { type: "quantity", value: t3.value, unit: t3.unit };
- }, ht = function(t3) {
- return { type: "color", colorType: t3.type, value: t3.value };
- }, mt = function(t3) {
- return t3;
- }, gt = function() {
- return Tt();
- }, vt = function(t3) {
- return { value: t3, unit: "%" };
- }, dt = function(t3) {
- return { value: t3, unit: "px" };
- }, yt = function(t3) {
- return { value: t3, unit: "cm" };
- }, At = function(t3) {
- return { value: t3, unit: "mm" };
- }, wt = function(t3) {
- return { value: t3, unit: "in" };
- }, xt = function(t3) {
- return { value: t3, unit: "pt" };
- }, bt = function(t3) {
- return { value: t3, unit: "pc" };
- }, Ct = function(t3) {
- return { value: t3, unit: "deg" };
- }, Ft = function(t3) {
- return { value: t3, unit: "rad" };
- }, Et = function(t3) {
- return { value: t3, unit: "grad" };
- }, jt = function(t3) {
- return { value: t3, unit: "turn" };
- }, $t = function(t3) {
- return { value: t3, unit: null };
- }, Ot = function() {
- return { type: "hex", value: Tt() };
- }, kt = function(t3) {
- return { type: "function", value: t3 };
- }, qt = function() {
- return { type: "named", value: Tt() };
- }, St = function() {
- return parseFloat(Tt());
- }, zt = 0, Rt = 0, It = [{ line: 1, column: 1 }], Mt = 0, Pt = [], Nt = 0;
- if ("startRule" in r4) {
- if (!(r4.startRule in c2))
- throw new Error(`Can't start parsing from rule "` + r4.startRule + '".');
- o4 = c2[r4.startRule];
- }
- function Tt() {
- return t2.substring(Rt, zt);
- }
- function Ut(t3, e7) {
- return { type: "literal", text: t3, ignoreCase: e7 };
- }
- function Ht(t3, e7, r5) {
- return { type: "class", parts: t3, inverted: e7, ignoreCase: r5 };
- }
- function _t() {
- return { type: "end" };
- }
- function Bt(t3) {
- return { type: "other", description: t3 };
- }
- function Dt(e7) {
- var r5, n4 = It[e7];
- if (n4)
- return n4;
- for (r5 = e7 - 1; !It[r5]; )
- r5--;
- for (n4 = { line: (n4 = It[r5]).line, column: n4.column }; r5 < e7; )
- t2.charCodeAt(r5) === 10 ? (n4.line++, n4.column = 1) : n4.column++, r5++;
- return It[e7] = n4, n4;
- }
- function Gt(t3, e7) {
- var r5 = Dt(t3), n4 = Dt(e7);
- return { source: a3, start: { offset: t3, line: r5.line, column: r5.column }, end: { offset: e7, line: n4.line, column: n4.column } };
- }
- function Jt(t3) {
- zt < Mt || (zt > Mt && (Mt = zt, Pt = []), Pt.push(t3));
- }
- function Kt(t3, r5, n4) {
- return new e6(e6.buildMessage(t3, r5), t3, r5, n4);
- }
- function Lt() {
- var t3;
- return (t3 = Qt()) === u2 && (t3 = Vt()), t3;
- }
- function Qt() {
- var e7, r5;
- 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;
- }
- function Vt() {
- var t3, e7;
- if (t3 = [], (e7 = Wt()) !== u2)
- for (; e7 !== u2; )
- t3.push(e7), e7 = Wt();
- else
- t3 = u2;
- return t3;
- }
- function Wt() {
- var e7, r5, n4, a4;
- 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;
- }
- function Xt() {
- var e7, r5, n4, a4, c3, o5, i3, l4;
- if (e7 = zt, (r5 = Yt()) !== u2) {
- 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; )
- 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);
- Rt = e7, e7 = ft(r5, n4);
- } else
- zt = e7, e7 = u2;
- return e7;
- }
- function Yt() {
- var t3, e7;
- 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;
- }
- function Zt() {
- var e7, r5;
- for (Nt++, e7 = [], j2.test(t2.charAt(zt)) ? (r5 = t2.charAt(zt), zt++) : (r5 = u2, Nt === 0 && Jt(P2)); r5 !== u2; )
- e7.push(r5), j2.test(t2.charAt(zt)) ? (r5 = t2.charAt(zt), zt++) : (r5 = u2, Nt === 0 && Jt(P2));
- return Nt--, r5 = u2, Nt === 0 && Jt(M3), e7;
- }
- function te() {
- var e7, r5, n4;
- 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;
- }
- function ee() {
- var e7, r5, n4;
- if (Nt++, e7 = zt, r5 = [], $2.test(t2.charAt(zt)) ? (n4 = t2.charAt(zt), zt++) : (n4 = u2, Nt === 0 && Jt(H2)), n4 !== u2)
- for (; n4 !== u2; )
- r5.push(n4), $2.test(t2.charAt(zt)) ? (n4 = t2.charAt(zt), zt++) : (n4 = u2, Nt === 0 && Jt(H2));
- else
- r5 = u2;
- return r5 !== u2 && (Rt = e7, r5 = gt()), Nt--, (e7 = r5) === u2 && (r5 = u2, Nt === 0 && Jt(U2)), e7;
- }
- function re() {
- var e7, r5, n4;
- 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;
- }
- function ne() {
- var e7, r5, n4;
- 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;
- }
- function ue() {
- var e7, r5, n4;
- 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;
- }
- function ae() {
- var t3, e7;
- 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;
- }
- function ce() {
- var e7, r5, n4, a4;
- if (Nt++, e7 = zt, t2.charCodeAt(zt) === 35 ? (r5 = C2, zt++) : (r5 = u2, Nt === 0 && Jt(nt)), r5 !== u2) {
- if (n4 = [], O2.test(t2.charAt(zt)) ? (a4 = t2.charAt(zt), zt++) : (a4 = u2, Nt === 0 && Jt(ut)), a4 !== u2)
- for (; a4 !== u2; )
- n4.push(a4), O2.test(t2.charAt(zt)) ? (a4 = t2.charAt(zt), zt++) : (a4 = u2, Nt === 0 && Jt(ut));
- else
- n4 = u2;
- n4 !== u2 ? (Rt = e7, e7 = Ot()) : (zt = e7, e7 = u2);
- } else
- zt = e7, e7 = u2;
- 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;
- }
- function oe() {
- var e7, r5, n4, a4, c3, o5, i3;
- 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; )
- n4.push(a4), q2.test(t2.charAt(zt)) ? (a4 = t2.charAt(zt), zt++) : (a4 = u2, Nt === 0 && Jt(ct));
- if (t2.charCodeAt(zt) === 46 ? (a4 = F2, zt++) : (a4 = u2, Nt === 0 && Jt(ot)), a4 !== u2) {
- if (c3 = [], q2.test(t2.charAt(zt)) ? (o5 = t2.charAt(zt), zt++) : (o5 = u2, Nt === 0 && Jt(ct)), o5 !== u2)
- for (; o5 !== u2; )
- c3.push(o5), q2.test(t2.charAt(zt)) ? (o5 = t2.charAt(zt), zt++) : (o5 = u2, Nt === 0 && Jt(ct));
- else
- c3 = u2;
- c3 !== u2 ? r5 = n4 = [n4, a4, c3] : (zt = r5, r5 = u2);
- } else
- zt = r5, r5 = u2;
- if (r5 === u2)
- if (r5 = [], q2.test(t2.charAt(zt)) ? (n4 = t2.charAt(zt), zt++) : (n4 = u2, Nt === 0 && Jt(ct)), n4 !== u2)
- for (; n4 !== u2; )
- r5.push(n4), q2.test(t2.charAt(zt)) ? (n4 = t2.charAt(zt), zt++) : (n4 = u2, Nt === 0 && Jt(ct));
- else
- r5 = u2;
- if (r5 !== u2) {
- if (n4 = zt, t2.charCodeAt(zt) === 101 ? (a4 = E2, zt++) : (a4 = u2, Nt === 0 && Jt(it)), a4 !== u2) {
- 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)
- for (; i3 !== u2; )
- o5.push(i3), q2.test(t2.charAt(zt)) ? (i3 = t2.charAt(zt), zt++) : (i3 = u2, Nt === 0 && Jt(ct));
- else
- o5 = u2;
- o5 !== u2 ? n4 = a4 = [a4, c3, o5] : (zt = n4, n4 = u2);
- } else
- zt = n4, n4 = u2;
- n4 === u2 && (n4 = null), Rt = e7, e7 = St();
- } else
- zt = e7, e7 = u2;
- return e7;
- }
- function ie(t3, e7) {
- return t3.map(function(t4) {
- return t4[e7];
- });
- }
- function le(t3, e7, r5) {
- return [t3].concat(ie(e7, r5));
- }
- if ((n3 = o4()) !== u2 && zt === t2.length)
- return n3;
- 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));
- }
- return t(e6, Error), e6.prototype.format = function(t2) {
- var e7 = "Error: " + this.message;
- if (this.location) {
- var n3, u2 = null;
- for (n3 = 0; n3 < t2.length; n3++)
- if (t2[n3].source === this.location.source) {
- u2 = t2[n3].text.split(/\r\n|\n|\r/g);
- break;
- }
- var a3 = this.location.start, c2 = this.location.source + ":" + a3.line + ":" + a3.column;
- if (u2) {
- 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;
- e7 += "\n --> " + c2 + "\n" + i2 + " |\n" + a3.line + " | " + l3 + "\n" + i2 + " | " + r3("", a3.column - 1) + r3("", s4 - a3.column, "^");
- } else
- e7 += "\n at " + c2;
- }
- return e7;
- }, e6.buildMessage = function(t2, e7) {
- var r4 = { literal: function(t3) {
- return '"' + u2(t3.text) + '"';
- }, class: function(t3) {
- var e8 = t3.parts.map(function(t4) {
- return Array.isArray(t4) ? a3(t4[0]) + "-" + a3(t4[1]) : a3(t4);
- });
- return "[" + (t3.inverted ? "^" : "") + e8 + "]";
- }, any: function() {
- return "any character";
- }, end: function() {
- return "end of input";
- }, other: function(t3) {
- return t3.description;
- } };
- function n3(t3) {
- return t3.charCodeAt(0).toString(16).toUpperCase();
- }
- function u2(t3) {
- 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) {
- return "\\x0" + n3(t4);
- }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(t4) {
- return "\\x" + n3(t4);
- });
- }
- function a3(t3) {
- 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) {
- return "\\x0" + n3(t4);
- }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(t4) {
- return "\\x" + n3(t4);
- });
- }
- function c2(t3) {
- return r4[t3.type](t3);
- }
- function o4(t3) {
- var e8, r5, n4 = t3.map(c2);
- if (n4.sort(), n4.length > 0) {
- for (e8 = 1, r5 = 1; e8 < n4.length; e8++)
- n4[e8 - 1] !== n4[e8] && (n4[r5] = n4[e8], r5++);
- n4.length = r5;
- }
- switch (n4.length) {
- case 1:
- return n4[0];
- case 2:
- return n4[0] + " or " + n4[1];
- default:
- return n4.slice(0, -1).join(", ") + ", or " + n4[n4.length - 1];
- }
- }
- function i2(t3) {
- return t3 ? '"' + u2(t3) + '"' : "end of input";
- }
- return "Expected " + o4(t2) + " but " + i2(e7) + " found.";
- }, { SyntaxError: e6, parse: n2 };
- }, (m2 = v).exports && (m2.exports = g2());
- var S = { deg: 1, grad: 0.9, rad: 180 / Math.PI, turn: 360 };
- function z(t) {
- if (t.type !== "quantity" || !(t.value === 0 && t.unit === null || t.unit && S[t.unit] != null))
- throw new s("effect:type-error", `Expected <angle>, Actual: ${$(t)}`, { term: t });
- }
- var R = { px: 1, cm: 96 / 2.54, mm: 96 / 2.54 / 10, in: 96, pc: 16, pt: 96 / 72 };
- function I(t) {
- if (t.type !== "quantity" || !(t.value === 0 && t.unit === null || t.unit && R[t.unit] != null))
- throw new s("effect:type-error", `Expected <length>, Actual: ${$(t)}`, { term: t });
- }
- function M2(t) {
- q(t);
- const e6 = t.value;
- return O(e6, t), t.unit === "%" ? 0.01 * e6 : e6;
- }
- function P(t) {
- return k(t), O(t.value, t), t.value;
- }
- function N(t) {
- return z(t), t.value * S[t.unit] || 0;
- }
- function T(t) {
- return I(t), t.value * R[t.unit] || 0;
- }
- function U(t) {
- switch (t.colorType) {
- case "hex":
- return i(t.value);
- case "named":
- return H(t.value);
- case "function":
- return D(t.value);
- }
- }
- function H(e6) {
- if (!r(e6))
- throw new s("effect:unknown-color", `color '${e6}' isn't valid`, { namedColor: e6 });
- return a(e6);
- }
- var _ = /^rgba?/i;
- var B = /^hsla?/i;
- function D(t) {
- if (j(t.parameters, 4), _.test(t.name))
- return [M2(t.parameters[0]), M2(t.parameters[1]), M2(t.parameters[2]), t.parameters[3] ? M2(t.parameters[3]) : 1];
- if (B.test(t.name))
- return o(P(t.parameters[0]), M2(t.parameters[1]), M2(t.parameters[2]), t.parameters[3] ? M2(t.parameters[3]) : 1);
- throw new s("effect:syntax-error", `Invalid color function '${t.name}'`, { colorFunction: t });
- }
- export {
- n,
- e4 as e,
- h,
- d2 as d
- };
- //# sourceMappingURL=chunk-WJW5DUN6.js.map
|