prettier-plugin-embed 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.bak +211 -0
  2. package/README.md +61 -36
  3. package/dist/embedded/css/embedded-language.d.ts +6 -0
  4. package/dist/embedded/css/embedder.d.ts +9 -0
  5. package/dist/embedded/css/index.d.ts +3 -0
  6. package/dist/embedded/css/options.d.ts +37 -0
  7. package/dist/embedded/es/options.d.ts +12 -8
  8. package/dist/embedded/glsl/embedded-language.d.ts +6 -0
  9. package/dist/embedded/glsl/embedder.d.ts +9 -0
  10. package/dist/embedded/glsl/index.d.ts +3 -0
  11. package/dist/embedded/glsl/options.d.ts +37 -0
  12. package/dist/embedded/html/options.d.ts +10 -6
  13. package/dist/embedded/index.d.ts +1 -0
  14. package/dist/embedded/markdown/embedded-language.d.ts +6 -0
  15. package/dist/embedded/markdown/embedder.d.ts +9 -0
  16. package/dist/embedded/markdown/index.d.ts +3 -0
  17. package/dist/embedded/markdown/options.d.ts +38 -0
  18. package/dist/embedded/noop/options.d.ts +6 -3
  19. package/dist/embedded/php/options.d.ts +15 -11
  20. package/dist/embedded/register.d.ts +11 -7
  21. package/dist/embedded/ruby/embedded-language.d.ts +6 -0
  22. package/dist/embedded/ruby/embedder.d.ts +9 -0
  23. package/dist/embedded/ruby/index.d.ts +3 -0
  24. package/dist/embedded/ruby/options.d.ts +60 -0
  25. package/dist/embedded/sql/options.d.ts +9 -6
  26. package/dist/embedded/ts/options.d.ts +12 -8
  27. package/dist/embedded/utils.d.ts +4 -2
  28. package/dist/embedded/xml/options.d.ts +12 -8
  29. package/dist/index.js +814 -524
  30. package/dist/options.d.ts +53 -10
  31. package/package.json +17 -10
  32. package/dist/prettier-plugin-embed-wide-dark.svg +0 -309
  33. package/dist/prettier-plugin-embed-wide-light.svg +0 -309
package/dist/index.js CHANGED
@@ -1,70 +1,70 @@
1
- import Me from "prettier/parser-babel";
2
- import je from "prettier/parser-espree";
3
- import Be from "prettier/parser-flow";
4
- import Fe from "prettier/parser-typescript";
5
- import Ne from "prettier/parser-meriyah";
6
- import { utils as Y, builders as M } from "prettier/doc";
7
- import { parse as ke } from "@xml-tools/parser";
8
- import { printers as Re } from "prettier/plugins/estree.mjs";
9
- const Ie = "embeddedEs";
10
- function Ce(e) {
1
+ import rt from "prettier/parser-babel";
2
+ import it from "prettier/parser-espree";
3
+ import ot from "prettier/parser-flow";
4
+ import at from "prettier/parser-typescript";
5
+ import dt from "prettier/parser-meriyah";
6
+ import { utils as re, builders as k } from "prettier/doc";
7
+ import { parse as lt } from "@xml-tools/parser";
8
+ import { printers as ct } from "prettier/plugins/estree.mjs";
9
+ const We = "embeddedCss";
10
+ function ut(e) {
11
11
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
12
12
  }
13
- var ve = { exports: {} };
13
+ var Ge = { exports: {} };
14
14
  (function(e) {
15
15
  var n = (() => {
16
- var s = Object.defineProperty, t = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.getOwnPropertySymbols, h = Object.prototype.hasOwnProperty, p = Object.prototype.propertyIsEnumerable, c = (u, l, d) => l in u ? s(u, l, { enumerable: !0, configurable: !0, writable: !0, value: d }) : u[l] = d, x = (u, l) => {
17
- for (var d in l || (l = {}))
18
- h.call(l, d) && c(u, d, l[d]);
19
- if (a)
20
- for (var d of a(l))
21
- p.call(l, d) && c(u, d, l[d]);
22
- return u;
23
- }, g = (u, l) => {
24
- for (var d in l)
25
- s(u, d, { get: l[d], enumerable: !0 });
26
- }, D = (u, l, d, y) => {
27
- if (l && typeof l == "object" || typeof l == "function")
28
- for (let m of i(l))
29
- !h.call(u, m) && m !== d && s(u, m, { get: () => l[m], enumerable: !(y = t(l, m)) || y.enumerable });
30
- return u;
31
- }, L = (u) => D(s({}, "__esModule", { value: !0 }), u), r = (u, l, d) => (c(u, typeof l != "symbol" ? l + "" : l, d), d), E = {};
32
- g(E, {
33
- DEFAULT_OPTIONS: () => T,
34
- DEFAULT_UUID_LENGTH: () => w,
35
- default: () => v
16
+ var r = Object.defineProperty, t = Object.getOwnPropertyDescriptor, s = Object.getOwnPropertyNames, o = Object.getOwnPropertySymbols, h = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable, d = (p, a, c) => a in p ? r(p, a, { enumerable: !0, configurable: !0, writable: !0, value: c }) : p[a] = c, f = (p, a) => {
17
+ for (var c in a || (a = {}))
18
+ h.call(a, c) && d(p, c, a[c]);
19
+ if (o)
20
+ for (var c of o(a))
21
+ g.call(a, c) && d(p, c, a[c]);
22
+ return p;
23
+ }, u = (p, a) => {
24
+ for (var c in a)
25
+ r(p, c, { get: a[c], enumerable: !0 });
26
+ }, $ = (p, a, c, I) => {
27
+ if (a && typeof a == "object" || typeof a == "function")
28
+ for (let E of s(a))
29
+ !h.call(p, E) && E !== c && r(p, E, { get: () => a[E], enumerable: !(I = t(a, E)) || I.enumerable });
30
+ return p;
31
+ }, S = (p) => $(r({}, "__esModule", { value: !0 }), p), i = (p, a, c) => (d(p, typeof a != "symbol" ? a + "" : a, c), c), _ = {};
32
+ u(_, {
33
+ DEFAULT_OPTIONS: () => L,
34
+ DEFAULT_UUID_LENGTH: () => v,
35
+ default: () => y
36
36
  });
37
- var I = "5.0.3", w = 6, T = {
37
+ var b = "5.0.3", v = 6, L = {
38
38
  dictionary: "alphanum",
39
39
  shuffle: !0,
40
40
  debug: !1,
41
- length: w,
41
+ length: v,
42
42
  counter: 0
43
- }, b = class {
44
- constructor(l = {}) {
45
- r(this, "counter"), r(this, "debug"), r(this, "dict"), r(this, "version"), r(this, "dictIndex", 0), r(this, "dictRange", []), r(this, "lowerBound", 0), r(this, "upperBound", 0), r(this, "dictLength", 0), r(this, "uuidLength"), r(this, "_digit_first_ascii", 48), r(this, "_digit_last_ascii", 58), r(this, "_alpha_lower_first_ascii", 97), r(this, "_alpha_lower_last_ascii", 123), r(this, "_hex_last_ascii", 103), r(this, "_alpha_upper_first_ascii", 65), r(this, "_alpha_upper_last_ascii", 91), r(this, "_number_dict_ranges", {
43
+ }, m = class {
44
+ constructor(a = {}) {
45
+ i(this, "counter"), i(this, "debug"), i(this, "dict"), i(this, "version"), i(this, "dictIndex", 0), i(this, "dictRange", []), i(this, "lowerBound", 0), i(this, "upperBound", 0), i(this, "dictLength", 0), i(this, "uuidLength"), i(this, "_digit_first_ascii", 48), i(this, "_digit_last_ascii", 58), i(this, "_alpha_lower_first_ascii", 97), i(this, "_alpha_lower_last_ascii", 123), i(this, "_hex_last_ascii", 103), i(this, "_alpha_upper_first_ascii", 65), i(this, "_alpha_upper_last_ascii", 91), i(this, "_number_dict_ranges", {
46
46
  digits: [this._digit_first_ascii, this._digit_last_ascii]
47
- }), r(this, "_alpha_dict_ranges", {
47
+ }), i(this, "_alpha_dict_ranges", {
48
48
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
49
49
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
50
- }), r(this, "_alpha_lower_dict_ranges", {
50
+ }), i(this, "_alpha_lower_dict_ranges", {
51
51
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
52
- }), r(this, "_alpha_upper_dict_ranges", {
52
+ }), i(this, "_alpha_upper_dict_ranges", {
53
53
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
54
- }), r(this, "_alphanum_dict_ranges", {
54
+ }), i(this, "_alphanum_dict_ranges", {
55
55
  digits: [this._digit_first_ascii, this._digit_last_ascii],
56
56
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
57
57
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
58
- }), r(this, "_alphanum_lower_dict_ranges", {
58
+ }), i(this, "_alphanum_lower_dict_ranges", {
59
59
  digits: [this._digit_first_ascii, this._digit_last_ascii],
60
60
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
61
- }), r(this, "_alphanum_upper_dict_ranges", {
61
+ }), i(this, "_alphanum_upper_dict_ranges", {
62
62
  digits: [this._digit_first_ascii, this._digit_last_ascii],
63
63
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
64
- }), r(this, "_hex_dict_ranges", {
64
+ }), i(this, "_hex_dict_ranges", {
65
65
  decDigits: [this._digit_first_ascii, this._digit_last_ascii],
66
66
  alphaDigits: [this._alpha_lower_first_ascii, this._hex_last_ascii]
67
- }), r(this, "_dict_ranges", {
67
+ }), i(this, "_dict_ranges", {
68
68
  _number_dict_ranges: this._number_dict_ranges,
69
69
  _alpha_dict_ranges: this._alpha_dict_ranges,
70
70
  _alpha_lower_dict_ranges: this._alpha_lower_dict_ranges,
@@ -73,72 +73,72 @@ var ve = { exports: {} };
73
73
  _alphanum_lower_dict_ranges: this._alphanum_lower_dict_ranges,
74
74
  _alphanum_upper_dict_ranges: this._alphanum_upper_dict_ranges,
75
75
  _hex_dict_ranges: this._hex_dict_ranges
76
- }), r(this, "log", (...o) => {
77
- const _ = [...o];
78
- if (_[0] = `[short-unique-id] ${o[0]}`, this.debug === !0 && typeof console < "u" && console !== null)
79
- return console.log(..._);
80
- }), r(this, "setDictionary", (o, _) => {
81
- let f;
82
- if (o && Array.isArray(o) && o.length > 1)
83
- f = o;
76
+ }), i(this, "log", (...l) => {
77
+ const x = [...l];
78
+ if (x[0] = `[short-unique-id] ${l[0]}`, this.debug === !0 && typeof console < "u" && console !== null)
79
+ return console.log(...x);
80
+ }), i(this, "setDictionary", (l, x) => {
81
+ let w;
82
+ if (l && Array.isArray(l) && l.length > 1)
83
+ w = l;
84
84
  else {
85
- f = [];
86
- let S;
87
- this.dictIndex = S = 0;
88
- const q = `_${o}_dict_ranges`, O = this._dict_ranges[q];
89
- Object.keys(O).forEach((P) => {
90
- const z = P;
91
- for (this.dictRange = O[z], this.lowerBound = this.dictRange[0], this.upperBound = this.dictRange[1], this.dictIndex = S = this.lowerBound; this.lowerBound <= this.upperBound ? S < this.upperBound : S > this.upperBound; this.dictIndex = this.lowerBound <= this.upperBound ? S += 1 : S -= 1)
92
- f.push(String.fromCharCode(this.dictIndex));
85
+ w = [];
86
+ let T;
87
+ this.dictIndex = T = 0;
88
+ const P = `_${l}_dict_ranges`, U = this._dict_ranges[P];
89
+ Object.keys(U).forEach((N) => {
90
+ const te = N;
91
+ for (this.dictRange = U[te], this.lowerBound = this.dictRange[0], this.upperBound = this.dictRange[1], this.dictIndex = T = this.lowerBound; this.lowerBound <= this.upperBound ? T < this.upperBound : T > this.upperBound; this.dictIndex = this.lowerBound <= this.upperBound ? T += 1 : T -= 1)
92
+ w.push(String.fromCharCode(this.dictIndex));
93
93
  });
94
94
  }
95
- _ && (f = f.sort(() => Math.random() - 0.5)), this.dict = f, this.dictLength = this.dict.length, this.setCounter(0);
96
- }), r(this, "seq", () => this.sequentialUUID()), r(this, "sequentialUUID", () => {
97
- let o, _, f = "";
98
- o = this.counter;
95
+ x && (w = w.sort(() => Math.random() - 0.5)), this.dict = w, this.dictLength = this.dict.length, this.setCounter(0);
96
+ }), i(this, "seq", () => this.sequentialUUID()), i(this, "sequentialUUID", () => {
97
+ let l, x, w = "";
98
+ l = this.counter;
99
99
  do
100
- _ = o % this.dictLength, o = Math.trunc(o / this.dictLength), f += this.dict[_];
101
- while (o !== 0);
102
- return this.counter += 1, f;
103
- }), r(this, "rnd", (o = this.uuidLength || w) => this.randomUUID(o)), r(this, "randomUUID", (o = this.uuidLength || w) => {
104
- let _, f, S;
105
- if (o === null || typeof o > "u" || o < 1)
100
+ x = l % this.dictLength, l = Math.trunc(l / this.dictLength), w += this.dict[x];
101
+ while (l !== 0);
102
+ return this.counter += 1, w;
103
+ }), i(this, "rnd", (l = this.uuidLength || v) => this.randomUUID(l)), i(this, "randomUUID", (l = this.uuidLength || v) => {
104
+ let x, w, T;
105
+ if (l === null || typeof l > "u" || l < 1)
106
106
  throw new Error("Invalid UUID Length Provided");
107
- for (_ = "", S = 0; S < o; S += 1)
108
- f = parseInt(
107
+ for (x = "", T = 0; T < l; T += 1)
108
+ w = parseInt(
109
109
  (Math.random() * this.dictLength).toFixed(0),
110
110
  10
111
- ) % this.dictLength, _ += this.dict[f];
112
- return _;
113
- }), r(this, "fmt", (o, _) => this.formattedUUID(o, _)), r(this, "formattedUUID", (o, _) => {
114
- const f = {
111
+ ) % this.dictLength, x += this.dict[w];
112
+ return x;
113
+ }), i(this, "fmt", (l, x) => this.formattedUUID(l, x)), i(this, "formattedUUID", (l, x) => {
114
+ const w = {
115
115
  $r: this.randomUUID,
116
116
  $s: this.sequentialUUID,
117
117
  $t: this.stamp
118
118
  };
119
- return o.replace(
119
+ return l.replace(
120
120
  /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
121
- (q) => {
122
- const O = q.slice(0, 2), P = parseInt(q.slice(2), 10);
123
- return O === "$s" ? f[O]().padStart(P, "0") : O === "$t" && _ ? f[O](P, _) : f[O](P);
121
+ (P) => {
122
+ const U = P.slice(0, 2), N = parseInt(P.slice(2), 10);
123
+ return U === "$s" ? w[U]().padStart(N, "0") : U === "$t" && x ? w[U](N, x) : w[U](N);
124
124
  }
125
125
  );
126
- }), r(this, "availableUUIDs", (o = this.uuidLength) => parseFloat(
127
- Math.pow([...new Set(this.dict)].length, o).toFixed(0)
128
- )), r(this, "approxMaxBeforeCollision", (o = this.availableUUIDs(this.uuidLength)) => parseFloat(
129
- Math.sqrt(Math.PI / 2 * o).toFixed(20)
130
- )), r(this, "collisionProbability", (o = this.availableUUIDs(this.uuidLength), _ = this.uuidLength) => parseFloat(
131
- (this.approxMaxBeforeCollision(o) / this.availableUUIDs(_)).toFixed(20)
132
- )), r(this, "uniqueness", (o = this.availableUUIDs(this.uuidLength)) => {
133
- const _ = parseFloat(
134
- (1 - this.approxMaxBeforeCollision(o) / o).toFixed(20)
126
+ }), i(this, "availableUUIDs", (l = this.uuidLength) => parseFloat(
127
+ Math.pow([...new Set(this.dict)].length, l).toFixed(0)
128
+ )), i(this, "approxMaxBeforeCollision", (l = this.availableUUIDs(this.uuidLength)) => parseFloat(
129
+ Math.sqrt(Math.PI / 2 * l).toFixed(20)
130
+ )), i(this, "collisionProbability", (l = this.availableUUIDs(this.uuidLength), x = this.uuidLength) => parseFloat(
131
+ (this.approxMaxBeforeCollision(l) / this.availableUUIDs(x)).toFixed(20)
132
+ )), i(this, "uniqueness", (l = this.availableUUIDs(this.uuidLength)) => {
133
+ const x = parseFloat(
134
+ (1 - this.approxMaxBeforeCollision(l) / l).toFixed(20)
135
135
  );
136
- return _ > 1 ? 1 : _ < 0 ? 0 : _;
137
- }), r(this, "getVersion", () => this.version), r(this, "stamp", (o, _) => {
138
- const f = Math.floor(+(_ || /* @__PURE__ */ new Date()) / 1e3).toString(16);
139
- if (typeof o == "number" && o === 0)
140
- return f;
141
- if (typeof o != "number" || o < 10)
136
+ return x > 1 ? 1 : x < 0 ? 0 : x;
137
+ }), i(this, "getVersion", () => this.version), i(this, "stamp", (l, x) => {
138
+ const w = Math.floor(+(x || /* @__PURE__ */ new Date()) / 1e3).toString(16);
139
+ if (typeof l == "number" && l === 0)
140
+ return w;
141
+ if (typeof l != "number" || l < 10)
142
142
  throw new Error(
143
143
  [
144
144
  "Param finalLength must be a number greater than or equal to 10,",
@@ -146,162 +146,211 @@ var ve = { exports: {} };
146
146
  ].join(`
147
147
  `)
148
148
  );
149
- const S = o - 9, q = Math.round(Math.random() * (S > 15 ? 15 : S)), O = this.randomUUID(S);
150
- return `${O.substring(0, q)}${f}${O.substring(q)}${q.toString(16)}`;
151
- }), r(this, "parseStamp", (o, _) => {
152
- if (_ && !/t0|t[1-9]\d{1,}/.test(_))
149
+ const T = l - 9, P = Math.round(Math.random() * (T > 15 ? 15 : T)), U = this.randomUUID(T);
150
+ return `${U.substring(0, P)}${w}${U.substring(P)}${P.toString(16)}`;
151
+ }), i(this, "parseStamp", (l, x) => {
152
+ if (x && !/t0|t[1-9]\d{1,}/.test(x))
153
153
  throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");
154
- const f = _ ? _.replace(
154
+ const w = x ? x.replace(
155
155
  /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
156
- (q) => {
157
- const O = {
158
- $r: (W) => [...Array(W)].map(() => "r").join(""),
159
- $s: (W) => [...Array(W)].map(() => "s").join(""),
160
- $t: (W) => [...Array(W)].map(() => "t").join("")
161
- }, P = q.slice(0, 2), z = parseInt(q.slice(2), 10);
162
- return O[P](z);
156
+ (P) => {
157
+ const U = {
158
+ $r: (Y) => [...Array(Y)].map(() => "r").join(""),
159
+ $s: (Y) => [...Array(Y)].map(() => "s").join(""),
160
+ $t: (Y) => [...Array(Y)].map(() => "t").join("")
161
+ }, N = P.slice(0, 2), te = parseInt(P.slice(2), 10);
162
+ return U[N](te);
163
163
  }
164
164
  ).replace(
165
165
  /^(.*?)(t{8,})(.*)$/g,
166
- (q, O, P) => o.substring(O.length, O.length + P.length)
167
- ) : o;
168
- if (f.length === 8)
169
- return new Date(parseInt(f, 16) * 1e3);
170
- if (f.length < 10)
166
+ (P, U, N) => l.substring(U.length, U.length + N.length)
167
+ ) : l;
168
+ if (w.length === 8)
169
+ return new Date(parseInt(w, 16) * 1e3);
170
+ if (w.length < 10)
171
171
  throw new Error("Stamp length invalid");
172
- const S = parseInt(f.substring(f.length - 1), 16);
173
- return new Date(parseInt(f.substring(S, S + 8), 16) * 1e3);
174
- }), r(this, "setCounter", (o) => {
175
- this.counter = o;
172
+ const T = parseInt(w.substring(w.length - 1), 16);
173
+ return new Date(parseInt(w.substring(T, T + 8), 16) * 1e3);
174
+ }), i(this, "setCounter", (l) => {
175
+ this.counter = l;
176
176
  });
177
- const d = x(x({}, T), l);
178
- this.counter = 0, this.debug = !1, this.dict = [], this.version = I;
177
+ const c = f(f({}, L), a);
178
+ this.counter = 0, this.debug = !1, this.dict = [], this.version = b;
179
179
  const {
180
- dictionary: y,
181
- shuffle: m,
182
- length: $,
183
- counter: U
184
- } = d;
185
- return this.uuidLength = $, this.setDictionary(y, m), this.setCounter(U), this.debug = d.debug, this.log(this.dict), this.log(
180
+ dictionary: I,
181
+ shuffle: E,
182
+ length: D,
183
+ counter: O
184
+ } = c;
185
+ return this.uuidLength = D, this.setDictionary(I, E), this.setCounter(O), this.debug = c.debug, this.log(this.dict), this.log(
186
186
  `Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`
187
187
  ), this.log = this.log.bind(this), this.setDictionary = this.setDictionary.bind(this), this.setCounter = this.setCounter.bind(this), this.seq = this.seq.bind(this), this.sequentialUUID = this.sequentialUUID.bind(this), this.rnd = this.rnd.bind(this), this.randomUUID = this.randomUUID.bind(this), this.fmt = this.fmt.bind(this), this.formattedUUID = this.formattedUUID.bind(this), this.availableUUIDs = this.availableUUIDs.bind(this), this.approxMaxBeforeCollision = this.approxMaxBeforeCollision.bind(this), this.collisionProbability = this.collisionProbability.bind(this), this.uniqueness = this.uniqueness.bind(this), this.getVersion = this.getVersion.bind(this), this.stamp = this.stamp.bind(this), this.parseStamp = this.parseStamp.bind(this), this;
188
188
  }
189
189
  };
190
- r(b, "default", b);
191
- var v = b;
192
- return L(E);
190
+ i(m, "default", m);
191
+ var y = m;
192
+ return S(_);
193
193
  })();
194
194
  e.exports = n.default, typeof window < "u" && (n = n.default);
195
- })(ve);
196
- var Ae = ve.exports;
197
- const We = /* @__PURE__ */ Ce(Ae), { group: Ge, indent: Xe, softline: ee, lineSuffixBoundary: ze } = M, { mapDoc: He } = Y;
198
- function Ve(e, n) {
199
- var i;
200
- const { node: s } = e;
195
+ })(Ge);
196
+ var pt = Ge.exports;
197
+ const ht = /* @__PURE__ */ ut(pt), { group: gt, indent: mt, softline: le, lineSuffixBoundary: _t } = k, { mapDoc: ft } = re;
198
+ function bt(e, n) {
199
+ var s;
200
+ const { node: r } = e;
201
201
  let t = n();
202
- return (i = s == null ? void 0 : s.comments) != null && i.length && (t = Ge([Xe([ee, t]), ee])), ["${", t, ze, "}"];
202
+ return (s = r == null ? void 0 : r.comments) != null && s.length && (t = gt([mt([le, t]), le])), ["${", t, _t, "}"];
203
203
  }
204
- function C(e, n) {
204
+ function M(e, n) {
205
205
  return e.map(
206
- (s) => Ve(s, n),
206
+ (r) => bt(r, n),
207
207
  "expressions"
208
208
  );
209
209
  }
210
- function X(e, n, s) {
211
- return He(e, (i) => {
212
- if (typeof i != "string")
213
- return i;
214
- const a = [], h = i.split(n);
215
- for (let p = 0; p < h.length; p++) {
216
- let c = h[p];
217
- if (p % 2 == 0) {
218
- if (!c)
210
+ function q(e, n, r) {
211
+ return ft(e, (s) => {
212
+ if (typeof s != "string")
213
+ return s;
214
+ const o = [], h = s.split(n);
215
+ for (let g = 0; g < h.length; g++) {
216
+ let d = h[g];
217
+ if (g % 2 == 0) {
218
+ if (!d)
219
219
  continue;
220
- c = c.replaceAll(/([\\`]|\${)/g, "\\$1"), a.push(c);
220
+ d = d.replaceAll(/([\\`]|\${)/g, "\\$1"), o.push(d);
221
221
  } else {
222
- const x = Number(c);
223
- a.push(s[x]);
222
+ const f = Number(d);
223
+ o.push(r[f]);
224
224
  }
225
225
  }
226
- return a;
226
+ return o;
227
227
  });
228
228
  }
229
- function Q(e, n, s) {
229
+ function Q(e, n, r) {
230
230
  var t;
231
231
  if (!(((t = n.plugins) == null ? void 0 : t.some(
232
- (i) => {
233
- var a;
234
- return ((a = i.name) == null ? void 0 : a.includes(e)) ?? !1;
232
+ (s) => {
233
+ var o;
234
+ return ((o = s.name) == null ? void 0 : o.includes(e)) ?? !1;
235
235
  }
236
236
  )) ?? !1))
237
237
  throw new Error(
238
- `Cannot format embedded language identified by "${s}", because plugin "${e}" is not loaded.`
238
+ `Cannot format embedded language identified by "${r}", because plugin "${e}" is not loaded.`
239
239
  );
240
240
  }
241
- function Ye(e, n, s) {
242
- if (n === s) {
241
+ function yt(e, n, r) {
242
+ if (n === r) {
243
243
  e.unshift(n);
244
244
  return;
245
245
  }
246
- let t = 0, i = e.length;
247
- for (; t < i; ) {
248
- const a = t + i >>> 1;
249
- if (e[a] === s) {
246
+ let t = 0, s = e.length;
247
+ for (; t < s; ) {
248
+ const o = t + s >>> 1;
249
+ if (e[o] === r) {
250
250
  e.push(n);
251
251
  return;
252
252
  }
253
- e[a] < n ? t = a + 1 : i = a;
253
+ e[o] < n ? t = o + 1 : s = o;
254
254
  }
255
255
  e.splice(t, 0, n);
256
256
  }
257
- const { randomUUID: te } = new We({
257
+ const { randomUUID: ce } = new ht({
258
258
  length: 16,
259
259
  dictionary: "alphanum_lower"
260
260
  });
261
- function A(e = "p", n = "") {
262
- const s = te(), t = te(), i = ne(e), a = ne(n), h = (c) => `${e}${s}${c}${t}${n}`, p = new RegExp(
263
- `${i}${s}(\\d+)${t}${a}`,
261
+ function j(e = "p", n = "") {
262
+ const r = ce(), t = ce(), s = ue(e), o = ue(n), h = (d) => `${e}${r}${d}${t}${n}`, g = new RegExp(
263
+ `${s}${r}(\\d+)${t}${o}`,
264
264
  "g"
265
265
  );
266
266
  return {
267
267
  createPlaceholder: h,
268
- placeholderRegex: p
268
+ placeholderRegex: g
269
269
  };
270
270
  }
271
- function ne(e) {
271
+ function ue(e) {
272
272
  return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
273
273
  }
274
- const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s, t, i) => {
275
- var a, h, p, c, x;
274
+ function R(e) {
275
+ return `${e}Identifiers`;
276
+ }
277
+ function It(e) {
278
+ return `${e}Parser`;
279
+ }
280
+ const { line: pe, group: B, indent: he, softline: ge } = k, Et = async (e, n, r, t, s) => {
281
+ var o, h, g, d, f;
282
+ try {
283
+ const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j("@p"), i = u.quasis.map(
284
+ (a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
285
+ ).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = M(r, n), L = await e(i, {
286
+ parser: "scss"
287
+ }), m = q(
288
+ L,
289
+ S,
290
+ v
291
+ );
292
+ if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
293
+ return B([
294
+ "`",
295
+ _,
296
+ (d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [B(m)] : he([B(m)]),
297
+ b,
298
+ "`"
299
+ ]);
300
+ const y = _.length ? pe : ge, p = b.length ? pe : ge;
301
+ return B([
302
+ "`",
303
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, B(m)] : he([y, B(m)]),
304
+ p,
305
+ "`"
306
+ ]);
307
+ } catch (u) {
308
+ throw console.error(u), u;
309
+ }
310
+ }, xt = ["css"], $t = R(We), vt = {
311
+ [$t]: {
312
+ category: "Global",
313
+ type: "string",
314
+ array: !0,
315
+ default: [{ value: [...xt] }],
316
+ description: "Specify embedded CSS language identifiers."
317
+ }
318
+ }, wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
319
+ __proto__: null,
320
+ embeddedLanguage: We,
321
+ embedder: Et,
322
+ options: vt
323
+ }, Symbol.toStringTag, { value: "Module" })), ie = "embeddedEs", { line: me, group: F, indent: _e, softline: fe } = k, Dt = async (e, n, r, t, s) => {
324
+ var o, h, g, d, f;
276
325
  try {
277
- const { node: g } = s, { createPlaceholder: D, placeholderRegex: L } = A(), r = g.quasis.map(
278
- (l, d, { length: y }) => d === y - 1 ? l.value.cooked : l.value.cooked + D(d)
279
- ).join(""), E = ((a = r.match(/^\s+/)) == null ? void 0 : a[0]) ?? "", I = ((h = r.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", w = C(s, n), T = await e(r, {
326
+ const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
327
+ (a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
328
+ ).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = M(r, n), L = await e(i, {
280
329
  parser: t.embeddedEsParser ?? "babel"
281
- }), b = X(
282
- T,
330
+ }), m = q(
283
331
  L,
284
- w
332
+ S,
333
+ v
285
334
  );
286
- if ((p = t.preserveEmbeddedExteriorWhitespaces) != null && p.includes(i))
287
- return j([
335
+ if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
336
+ return F([
288
337
  "`",
289
- E,
290
- (c = t.noEmbeddedMultiLineIndentation) != null && c.includes(i) ? [j(b)] : ie([j(b)]),
291
- I,
338
+ _,
339
+ (d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [F(m)] : _e([F(m)]),
340
+ b,
292
341
  "`"
293
342
  ]);
294
- const v = E.length ? se : re, u = I.length ? se : re;
295
- return j([
343
+ const y = _.length ? me : fe, p = b.length ? me : fe;
344
+ return F([
296
345
  "`",
297
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [v, j(b)] : ie([v, j(b)]),
298
- u,
346
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, F(m)] : _e([y, F(m)]),
347
+ p,
299
348
  "`"
300
349
  ]);
301
- } catch (g) {
302
- throw console.error(g), g;
350
+ } catch (u) {
351
+ throw console.error(u), u;
303
352
  }
304
- }, Je = [
353
+ }, Lt = [
305
354
  "js",
306
355
  "es",
307
356
  "es6",
@@ -309,70 +358,140 @@ const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s,
309
358
  "cjs",
310
359
  "pac",
311
360
  "javascript"
312
- ], Ke = "embeddedEsParser", Ze = {
313
- [Ie]: {
361
+ ], St = R(ie), Tt = It(ie), Ot = {
362
+ [St]: {
314
363
  category: "Global",
315
364
  type: "string",
316
365
  array: !0,
317
- default: [{ value: [...Je] }],
318
- description: "Specify embedded ES languages."
366
+ default: [{ value: [...Lt] }],
367
+ description: "Specify embedded ES language identifiers."
319
368
  },
320
- [Ke]: {
369
+ [Tt]: {
321
370
  category: "Global",
322
371
  type: "string",
323
372
  array: !1,
324
373
  default: "babel",
325
- description: "Specify the parser for the embedded ES languages."
374
+ description: "Specify the embedded ES language parser."
326
375
  }
327
- }, et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
376
+ }, Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
328
377
  __proto__: null,
329
- embeddedLanguage: Ie,
330
- embedder: Qe,
331
- options: Ze
332
- }, Symbol.toStringTag, { value: "Module" })), $e = "embeddedHtml", { line: oe, group: B, indent: ae, softline: le } = M, { mapDoc: tt } = Y, nt = async (e, n, s, t, i) => {
333
- var a, h, p, c, x;
378
+ embeddedLanguage: ie,
379
+ embedder: Dt,
380
+ options: Ot
381
+ }, Symbol.toStringTag, { value: "Module" })), ze = "embeddedGlsl", { line: be, group: A, indent: ye, softline: Ie } = k, Pt = async (e, n, r, t, s) => {
382
+ var o, h, g, d, f;
334
383
  try {
335
- const { node: g } = s, { createPlaceholder: D, placeholderRegex: L } = A(), r = g.quasis.map(
336
- (l, d, { length: y }) => d === y - 1 ? l.value.cooked : l.value.cooked + D(d)
337
- ).join(""), E = ((a = r.match(/^\s+/)) == null ? void 0 : a[0]) ?? "", I = ((h = r.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", w = C(s, n), T = await e(r, {
384
+ Q("prettier-plugin-glsl", t, s);
385
+ const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
386
+ (c, I, { length: E }) => I === E - 1 ? c.value.cooked : c.value.cooked + $(I)
387
+ ).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = i.slice(
388
+ _.length,
389
+ -b.length || void 0
390
+ ), L = M(r, n), m = await e(v, {
391
+ parser: "glsl-parser"
392
+ }), y = q(
393
+ m,
394
+ S,
395
+ L
396
+ );
397
+ if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
398
+ return A([
399
+ "`",
400
+ _,
401
+ (d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [A(y)] : ye([A(y)]),
402
+ b,
403
+ "`"
404
+ ]);
405
+ const p = _.length ? be : Ie, a = b.length ? be : Ie;
406
+ return A([
407
+ "`",
408
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [p, A(y)] : ye([p, A(y)]),
409
+ a,
410
+ "`"
411
+ ]);
412
+ } catch (u) {
413
+ throw console.error(u), u;
414
+ }
415
+ }, kt = [
416
+ "glsl",
417
+ "fp",
418
+ "frag",
419
+ "frg",
420
+ "fs",
421
+ "fsh",
422
+ "fshader",
423
+ "geo",
424
+ "geom",
425
+ "glslf",
426
+ "glslv",
427
+ "gs",
428
+ "gshader",
429
+ "rchit",
430
+ "rmiss",
431
+ "shader",
432
+ "tesc",
433
+ "tese",
434
+ "vert",
435
+ "vrx",
436
+ "vsh",
437
+ "vshader"
438
+ ], Rt = R(ze), Mt = {
439
+ [Rt]: {
440
+ category: "Global",
441
+ type: "string",
442
+ array: !0,
443
+ default: [{ value: [...kt] }],
444
+ description: 'Specify embedded GLSL language identifiers. This requires "prettier-plugin-glsl".'
445
+ }
446
+ }, jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
447
+ __proto__: null,
448
+ embeddedLanguage: ze,
449
+ embedder: Pt,
450
+ options: Mt
451
+ }, Symbol.toStringTag, { value: "Module" })), Xe = "embeddedHtml", { line: Ee, group: C, indent: xe, softline: $e } = k, { mapDoc: Nt } = re, qt = async (e, n, r, t, s) => {
452
+ var o, h, g, d, f;
453
+ try {
454
+ const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
455
+ (a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
456
+ ).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = M(r, n), L = await e(i, {
338
457
  parser: "html"
339
- }), b = tt(T, (l) => {
340
- if (typeof l != "string")
341
- return l;
342
- const d = [], y = l.split(L);
343
- for (let m = 0; m < y.length; m++) {
344
- let $ = y[m];
345
- if (m % 2 == 0) {
346
- if (!$)
458
+ }), m = Nt(L, (a) => {
459
+ if (typeof a != "string")
460
+ return a;
461
+ const c = [], I = a.split(S);
462
+ for (let E = 0; E < I.length; E++) {
463
+ let D = I[E];
464
+ if (E % 2 == 0) {
465
+ if (!D)
347
466
  continue;
348
- $ = $.replaceAll(/([\\`]|\${)/g, "\\$1"), t.__embeddedInHtml && ($ = $.replaceAll(/<\/(?=script\b)/gi, "<\\/")), d.push($);
467
+ D = D.replaceAll(/([\\`]|\${)/g, "\\$1"), t.__embeddedInHtml && (D = D.replaceAll(/<\/(?=script\b)/gi, "<\\/")), c.push(D);
349
468
  } else {
350
- const U = Number($);
351
- d.push(w[U]);
469
+ const O = Number(D);
470
+ c.push(v[O]);
352
471
  }
353
472
  }
354
- return d;
473
+ return c;
355
474
  });
356
475
  if (t.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
357
- t.htmlWhitespaceSensitivity === "css" || (p = t.preserveEmbeddedExteriorWhitespaces) != null && p.includes(i))
358
- return B([
476
+ t.htmlWhitespaceSensitivity === "css" || (g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
477
+ return C([
359
478
  "`",
360
- E,
361
- (c = t.noEmbeddedMultiLineIndentation) != null && c.includes(i) ? [B(b)] : ae([B(b)]),
362
- I,
479
+ _,
480
+ (d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [C(m)] : xe([C(m)]),
481
+ b,
363
482
  "`"
364
483
  ]);
365
- const v = E.length ? oe : le, u = I.length ? oe : le;
366
- return B([
484
+ const y = _.length ? Ee : $e, p = b.length ? Ee : $e;
485
+ return C([
367
486
  "`",
368
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [v, B(b)] : ae([v, B(b)]),
369
- u,
487
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, C(m)] : xe([y, C(m)]),
488
+ p,
370
489
  "`"
371
490
  ]);
372
- } catch (g) {
373
- throw console.error(g), g;
491
+ } catch (u) {
492
+ throw console.error(u), u;
374
493
  }
375
- }, st = [
494
+ }, Bt = [
376
495
  "html",
377
496
  "htm",
378
497
  "shtml",
@@ -385,79 +504,246 @@ const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s,
385
504
  "jshtm",
386
505
  "volt",
387
506
  "rhtml"
388
- ], it = {
389
- [$e]: {
507
+ ], Ft = R(Xe), At = {
508
+ [Ft]: {
509
+ category: "Global",
510
+ type: "string",
511
+ array: !0,
512
+ default: [{ value: [...Bt] }],
513
+ description: "Specify embedded HTML language identifiers."
514
+ }
515
+ }, Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
516
+ __proto__: null,
517
+ embeddedLanguage: Xe,
518
+ embedder: qt,
519
+ options: At
520
+ }, Symbol.toStringTag, { value: "Module" })), He = "embeddedMarkdown", { line: ve, group: W, indent: we, softline: De } = k, Wt = async (e, n, r, t, s) => {
521
+ var o, h, g, d, f;
522
+ try {
523
+ const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
524
+ (a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
525
+ ).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = M(r, n), L = await e(i, {
526
+ parser: "markdown",
527
+ __inJsTemplate: !0
528
+ }), m = q(
529
+ L,
530
+ S,
531
+ v
532
+ );
533
+ if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
534
+ return W([
535
+ "`",
536
+ _,
537
+ (d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [W(m)] : we([W(m)]),
538
+ b,
539
+ "`"
540
+ ]);
541
+ const y = _.length ? ve : De, p = b.length ? ve : De;
542
+ return W([
543
+ "`",
544
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, W(m)] : we([y, W(m)]),
545
+ p,
546
+ "`"
547
+ ]);
548
+ } catch (u) {
549
+ throw console.error(u), u;
550
+ }
551
+ }, Gt = [
552
+ "md",
553
+ "livemd",
554
+ "markdown",
555
+ "mdown",
556
+ "mdwn",
557
+ "mkd",
558
+ "mkdn",
559
+ "mkdown",
560
+ "ronn",
561
+ "scd",
562
+ "workbook"
563
+ ], zt = R(He), Xt = {
564
+ [zt]: {
390
565
  category: "Global",
391
566
  type: "string",
392
567
  array: !0,
393
- default: [{ value: [...st] }],
394
- description: "Specify embedded HTML languages."
568
+ default: [{ value: [...Gt] }],
569
+ description: "Specify embedded Markdown language identifiers."
395
570
  }
396
- }, rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
571
+ }, Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
397
572
  __proto__: null,
398
- embeddedLanguage: $e,
399
- embedder: nt,
400
- options: it
401
- }, Symbol.toStringTag, { value: "Module" })), J = "embeddedNoop", ot = {
402
- [J]: {
573
+ embeddedLanguage: He,
574
+ embedder: Wt,
575
+ options: Xt
576
+ }, Symbol.toStringTag, { value: "Module" })), oe = "embeddedNoop", Vt = R(oe), Yt = {
577
+ [Vt]: {
403
578
  category: "Global",
404
579
  type: "string",
405
580
  array: !0,
406
581
  default: [{ value: [] }],
407
- description: "Specify embedded languages that will not be formatted."
582
+ description: "Specify embedded language identifiers that will not be formatted."
408
583
  }
409
- }, at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
584
+ }, Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
410
585
  __proto__: null,
411
- embeddedLanguage: J,
412
- options: ot
413
- }, Symbol.toStringTag, { value: "Module" })), De = "embeddedPhp", { line: ce, group: F, indent: de, softline: ue } = M, lt = async (e, n, s, t, i) => {
414
- var a, h, p, c, x;
586
+ embeddedLanguage: oe,
587
+ options: Yt
588
+ }, Symbol.toStringTag, { value: "Module" })), Ve = "embeddedPhp", { line: Le, group: G, indent: Se, softline: Te } = k, Jt = async (e, n, r, t, s) => {
589
+ var o, h, g, d, f;
415
590
  try {
416
- Q("@prettier/plugin-php", t, i);
417
- const { node: g } = s, { createPlaceholder: D, placeholderRegex: L } = A("$p"), r = g.quasis.map(
418
- (d, y, { length: m }) => y === m - 1 ? d.value.cooked : d.value.cooked + D(y)
419
- ).join(""), E = ((a = r.match(/^\s+/)) == null ? void 0 : a[0]) ?? "", I = ((h = r.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", w = r.slice(
420
- E.length,
421
- -I.length || void 0
422
- ), T = C(s, n), b = await e(w, {
591
+ Q("@prettier/plugin-php", t, s);
592
+ const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j("$p"), i = u.quasis.map(
593
+ (c, I, { length: E }) => I === E - 1 ? c.value.cooked : c.value.cooked + $(I)
594
+ ).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = i.slice(
595
+ _.length,
596
+ -b.length || void 0
597
+ ), L = M(r, n), m = await e(v, {
423
598
  parser: "php"
424
- }), v = X(
425
- b,
426
- L,
427
- T
599
+ }), y = q(
600
+ m,
601
+ S,
602
+ L
428
603
  );
429
- if ((p = t.preserveEmbeddedExteriorWhitespaces) != null && p.includes(i))
430
- return F([
604
+ if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
605
+ return G([
431
606
  "`",
432
- E,
433
- (c = t.noEmbeddedMultiLineIndentation) != null && c.includes(i) ? [F(v)] : de([F(v)]),
434
- I,
607
+ _,
608
+ (d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [G(y)] : Se([G(y)]),
609
+ b,
435
610
  "`"
436
611
  ]);
437
- const u = E.length ? ce : ue, l = I.length ? ce : ue;
438
- return F([
612
+ const p = _.length ? Le : Te, a = b.length ? Le : Te;
613
+ return G([
439
614
  "`",
440
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [u, F(v)] : de([u, F(v)]),
441
- l,
615
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [p, G(y)] : Se([p, G(y)]),
616
+ a,
442
617
  "`"
443
618
  ]);
444
- } catch (g) {
445
- throw console.error(g), g;
619
+ } catch (u) {
620
+ throw console.error(u), u;
446
621
  }
447
- }, ct = ["php", "php5", "phtml", "ctp"], dt = {
448
- [De]: {
622
+ }, Kt = ["php", "php5", "phtml", "ctp"], Zt = R(Ve), en = {
623
+ [Zt]: {
449
624
  category: "Global",
450
625
  type: "string",
451
626
  array: !0,
452
- default: [{ value: [...ct] }],
453
- description: "Specify embedded PHP languages. This requires @prettier/plugin-php"
627
+ default: [{ value: [...Kt] }],
628
+ description: 'Specify embedded PHP language identifiers. This requires "@prettier/plugin-php".'
454
629
  }
455
- }, ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
630
+ }, tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
456
631
  __proto__: null,
457
- embeddedLanguage: De,
458
- embedder: lt,
459
- options: dt
460
- }, Symbol.toStringTag, { value: "Module" })), we = "embeddedSql", K = [
632
+ embeddedLanguage: Ve,
633
+ embedder: Jt,
634
+ options: en
635
+ }, Symbol.toStringTag, { value: "Module" })), Ye = "embeddedRuby", K = [
636
+ "ruby",
637
+ "arb",
638
+ "axlsx",
639
+ "builder",
640
+ "eye",
641
+ "fcgi",
642
+ "gemfile",
643
+ "gemspec",
644
+ "god",
645
+ "jb",
646
+ "jbuilder",
647
+ "mspec",
648
+ "opal",
649
+ "pluginspec",
650
+ "podspec",
651
+ "rabl",
652
+ "rake",
653
+ "rb",
654
+ "rbi",
655
+ "rbuild",
656
+ "rbw",
657
+ "rbx",
658
+ "ru",
659
+ "thor",
660
+ "watchr"
661
+ ], Z = ["rbs"], ee = ["haml"], nn = [
662
+ ...K,
663
+ ...Z,
664
+ ...ee
665
+ ], sn = "embeddedRubyParser", rn = R(Ye), on = {
666
+ [rn]: {
667
+ category: "Global",
668
+ type: "string",
669
+ array: !0,
670
+ default: [{ value: [...nn] }],
671
+ description: 'Specify embedded Ruby language identifiers. This requires "@prettier/plugin-ruby".'
672
+ },
673
+ [sn]: {
674
+ category: "Global",
675
+ type: "string",
676
+ array: !1,
677
+ default: void 0,
678
+ description: "Specify the embedded Ruby language parser."
679
+ }
680
+ }, { line: Oe, group: z, indent: Ue, softline: Pe } = k, an = async (e, n, r, t, s, o) => {
681
+ var h, g, d, f, u;
682
+ try {
683
+ Q("@prettier/plugin-ruby", t, s);
684
+ const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), _ = $.quasis.map(
685
+ (E, D, { length: O }) => D === O - 1 ? E.value.cooked : E.value.cooked + S(D)
686
+ ).join(""), b = ((h = _.match(/^\s+/)) == null ? void 0 : h[0]) ?? "", v = ((g = _.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", L = _.slice(
687
+ b.length,
688
+ -v.length || void 0
689
+ ), m = M(r, n), y = dn(t, s, o), p = await e(L, {
690
+ parser: y
691
+ }), a = q(
692
+ p,
693
+ i,
694
+ m
695
+ );
696
+ if ((d = t.preserveEmbeddedExteriorWhitespaces) != null && d.includes(s))
697
+ return z([
698
+ "`",
699
+ b,
700
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [z(a)] : Ue([z(a)]),
701
+ v,
702
+ "`"
703
+ ]);
704
+ const c = b.length ? Oe : Pe, I = v.length ? Oe : Pe;
705
+ return z([
706
+ "`",
707
+ (u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [c, z(a)] : Ue([c, z(a)]),
708
+ I,
709
+ "`"
710
+ ]);
711
+ } catch ($) {
712
+ throw console.error($), $;
713
+ }
714
+ };
715
+ function dn(e, n, r) {
716
+ if (typeof e.embeddedRubyParser == "string")
717
+ return e.embeddedRubyParser;
718
+ const t = r.indexOf(n);
719
+ for (let s = t; s >= 0; --s) {
720
+ if (ln(n))
721
+ return K[0];
722
+ if (cn(n))
723
+ return Z[0];
724
+ if (un(n))
725
+ return ee[0];
726
+ }
727
+ throw new SyntaxError(`Unrecognized ruby identifier: ${n}`);
728
+ }
729
+ function ln(e) {
730
+ return K.includes(e);
731
+ }
732
+ function cn(e) {
733
+ return Z.includes(e);
734
+ }
735
+ function un(e) {
736
+ return ee.includes(e);
737
+ }
738
+ const pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
739
+ __proto__: null,
740
+ HAML_PARSER_IDENTIFIERS: ee,
741
+ RBS_PARSER_IDENTIFIERS: Z,
742
+ RUBY_PARSER_IDENTIFIERS: K,
743
+ embeddedLanguage: Ye,
744
+ embedder: an,
745
+ options: on
746
+ }, Symbol.toStringTag, { value: "Module" })), Qe = "embeddedSql", ae = [
461
747
  "sql",
462
748
  "bigquery",
463
749
  "hive",
@@ -474,7 +760,7 @@ const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s,
474
760
  "transactsql",
475
761
  "tsql",
476
762
  "trino"
477
- ], Se = [
763
+ ], Je = [
478
764
  "bigquery",
479
765
  "db2",
480
766
  "hive",
@@ -483,181 +769,181 @@ const { line: se, group: j, indent: ie, softline: re } = M, Qe = async (e, n, s,
483
769
  "postgresql",
484
770
  "transactsql",
485
771
  "flinksql"
486
- ], ht = {
487
- [we]: {
772
+ ], hn = R(Qe), gn = {
773
+ [hn]: {
488
774
  category: "Global",
489
775
  type: "string",
490
776
  array: !0,
491
- default: [{ value: [...K] }],
492
- description: "Specify embedded SQL languages. This requires prettier-plugin-sql"
777
+ default: [{ value: [...ae] }],
778
+ description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql".'
493
779
  }
494
- }, { hardline: pt, group: N, line: he, softline: pe, indent: _e } = M, { mapDoc: _t } = Y, gt = async (e, n, s, t, i, a) => {
495
- var h, p, c, x, g;
780
+ }, { hardline: mn, group: X, line: ke, softline: Re, indent: Me } = k, { mapDoc: _n } = re, fn = async (e, n, r, t, s, o) => {
781
+ var h, g, d, f, u;
496
782
  try {
497
- Q("prettier-plugin-sql", t, i);
498
- const { node: D } = s, { createPlaceholder: L, placeholderRegex: r } = A(), E = D.quasis.map(
499
- (y, m, { length: $ }) => m === $ - 1 ? y.value.cooked : y.value.cooked + L(m)
500
- ).join(""), I = ((h = E.match(/^\s+/)) == null ? void 0 : h[0]) ?? "", w = ((p = E.match(/\s+$/)) == null ? void 0 : p[0]) ?? "", T = C(s, n), b = ft(
783
+ Q("prettier-plugin-sql", t, s);
784
+ const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), _ = $.quasis.map(
785
+ (I, E, { length: D }) => E === D - 1 ? I.value.cooked : I.value.cooked + S(E)
786
+ ).join(""), b = ((h = _.match(/^\s+/)) == null ? void 0 : h[0]) ?? "", v = ((g = _.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", L = M(r, n), m = yn(
501
787
  t,
502
- i,
503
- a
788
+ s,
789
+ o
504
790
  );
505
- if (typeof b > "u")
506
- throw new SyntaxError(`Unrecognized language: ${i}`);
507
- const v = await e(E, {
791
+ if (typeof m > "u")
792
+ throw new SyntaxError(`Unrecognized identifier: ${s}`);
793
+ const y = await e(_, {
508
794
  parser: "sql",
509
- ...b
510
- }), u = _t(v, (y) => {
511
- if (typeof y != "string")
512
- return y;
513
- const m = [], $ = y.split(r);
514
- for (let U = 0; U < $.length; U++) {
515
- let o = $[U];
516
- if (U % 2 == 0) {
517
- if (!o)
795
+ ...m
796
+ }), p = _n(y, (I) => {
797
+ if (typeof I != "string")
798
+ return I;
799
+ const E = [], D = I.split(i);
800
+ for (let O = 0; O < D.length; O++) {
801
+ let l = D[O];
802
+ if (O % 2 == 0) {
803
+ if (!l)
518
804
  continue;
519
- o = o.replaceAll(/([\\`]|\${)/g, "\\$1"), o.split(/(\n)/).forEach(
520
- (_) => _ === `
521
- ` ? m.push(pt) : m.push(_)
805
+ l = l.replaceAll(/([\\`]|\${)/g, "\\$1"), l.split(/(\n)/).forEach(
806
+ (x) => x === `
807
+ ` ? E.push(mn) : E.push(x)
522
808
  );
523
809
  } else {
524
- const _ = Number(o);
525
- m.push(T[_]);
810
+ const x = Number(l);
811
+ E.push(L[x]);
526
812
  }
527
813
  }
528
- return m;
814
+ return E;
529
815
  });
530
- if ((c = t.preserveEmbeddedExteriorWhitespaces) != null && c.includes(i))
531
- return N([
816
+ if ((d = t.preserveEmbeddedExteriorWhitespaces) != null && d.includes(s))
817
+ return X([
532
818
  "`",
533
- I,
534
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [N(u)] : _e([N(u)]),
535
- w,
819
+ b,
820
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [X(p)] : Me([X(p)]),
821
+ v,
536
822
  "`"
537
823
  ]);
538
- const l = I.length ? he : pe, d = w.length ? he : pe;
539
- return N([
824
+ const a = b.length ? ke : Re, c = v.length ? ke : Re;
825
+ return X([
540
826
  "`",
541
- (g = t.noEmbeddedMultiLineIndentation) != null && g.includes(i) ? [l, N(u)] : _e([l, N(u)]),
542
- d,
827
+ (u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [a, X(p)] : Me([a, X(p)]),
828
+ c,
543
829
  "`"
544
830
  ]);
545
- } catch (D) {
546
- throw console.error(D), D;
831
+ } catch ($) {
832
+ throw console.error($), $;
547
833
  }
548
- }, mt = {
549
- "sql-formatter": (e) => K.includes(e),
550
- "node-sql-parser": (e) => Se.includes(e)
834
+ }, bn = {
835
+ "sql-formatter": (e) => ae.includes(e),
836
+ "node-sql-parser": (e) => Je.includes(e)
551
837
  };
552
- function ge(e, n) {
553
- for (const s of n)
554
- if (mt[s](e))
555
- switch (s) {
838
+ function je(e, n) {
839
+ for (const r of n)
840
+ if (bn[r](e))
841
+ switch (r) {
556
842
  case "sql-formatter":
557
843
  return {
558
- formatter: s,
844
+ formatter: r,
559
845
  language: e
560
846
  };
561
847
  case "node-sql-parser":
562
848
  return {
563
- formatter: s,
849
+ formatter: r,
564
850
  database: e
565
851
  };
566
852
  }
567
853
  }
568
- function H(e, n, s) {
569
- let t = ge(e, s);
854
+ function ne(e, n, r) {
855
+ let t = je(e, r);
570
856
  if (t)
571
857
  return t;
572
- const i = n.indexOf(e);
573
- for (let a = i - 1; a >= 0; --a)
574
- if (t = ge(
575
- n[a],
576
- s
858
+ const s = n.indexOf(e);
859
+ for (let o = s - 1; o >= 0; --o)
860
+ if (t = je(
861
+ n[o],
862
+ r
577
863
  ), t)
578
864
  return t;
579
865
  }
580
- function ft(e, n, s) {
866
+ function yn(e, n, r) {
581
867
  switch (e.formatter ?? "sql-formatter") {
582
868
  case "sql-formatter":
583
- return H(
869
+ return ne(
584
870
  n,
585
- s,
871
+ r,
586
872
  ["sql-formatter", "node-sql-parser"]
587
873
  );
588
874
  case "node-sql-parser":
589
- return H(
875
+ return ne(
590
876
  n,
591
- s,
877
+ r,
592
878
  ["node-sql-parser", "sql-formatter"]
593
879
  );
594
880
  default:
595
- return H(
881
+ return ne(
596
882
  n,
597
- s,
883
+ r,
598
884
  ["sql-formatter", "node-sql-parser"]
599
885
  );
600
886
  }
601
887
  }
602
- const bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
888
+ const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
603
889
  __proto__: null,
604
- NODE_SQL_PARSER_DATABASES: Se,
605
- SQL_FORMATTER_LANGUAGES: K,
606
- embeddedLanguage: we,
607
- embedder: gt,
608
- options: ht
609
- }, Symbol.toStringTag, { value: "Module" })), Oe = "embeddedTs", { line: me, group: k, indent: fe, softline: be } = M, yt = async (e, n, s, t, i) => {
610
- var a, h, p, c, x;
890
+ NODE_SQL_PARSER_DATABASES: Je,
891
+ SQL_FORMATTER_LANGUAGES: ae,
892
+ embeddedLanguage: Qe,
893
+ embedder: fn,
894
+ options: gn
895
+ }, Symbol.toStringTag, { value: "Module" })), Ke = "embeddedTs", { line: Ne, group: H, indent: qe, softline: Be } = k, En = async (e, n, r, t, s) => {
896
+ var o, h, g, d, f;
611
897
  try {
612
- const { node: g } = s, { createPlaceholder: D, placeholderRegex: L } = A(), r = g.quasis.map(
613
- (l, d, { length: y }) => d === y - 1 ? l.value.cooked : l.value.cooked + D(d)
614
- ).join(""), E = ((a = r.match(/^\s+/)) == null ? void 0 : a[0]) ?? "", I = ((h = r.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", w = C(s, n), T = await e(r, {
898
+ const { node: u } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = u.quasis.map(
899
+ (a, c, { length: I }) => c === I - 1 ? a.value.cooked : a.value.cooked + $(c)
900
+ ).join(""), _ = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((h = i.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", v = M(r, n), L = await e(i, {
615
901
  parser: t.embeddedTsParser ?? "typescript"
616
- }), b = X(
617
- T,
902
+ }), m = q(
618
903
  L,
619
- w
904
+ S,
905
+ v
620
906
  );
621
- if ((p = t.preserveEmbeddedExteriorWhitespaces) != null && p.includes(i))
622
- return k([
907
+ if ((g = t.preserveEmbeddedExteriorWhitespaces) != null && g.includes(s))
908
+ return H([
623
909
  "`",
624
- E,
625
- (c = t.noEmbeddedMultiLineIndentation) != null && c.includes(i) ? [k(b)] : fe([k(b)]),
626
- I,
910
+ _,
911
+ (d = t.noEmbeddedMultiLineIndentation) != null && d.includes(s) ? [H(m)] : qe([H(m)]),
912
+ b,
627
913
  "`"
628
914
  ]);
629
- const v = E.length ? me : be, u = I.length ? me : be;
630
- return k([
915
+ const y = _.length ? Ne : Be, p = b.length ? Ne : Be;
916
+ return H([
631
917
  "`",
632
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [v, k(b)] : fe([v, k(b)]),
633
- u,
918
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [y, H(m)] : qe([y, H(m)]),
919
+ p,
634
920
  "`"
635
921
  ]);
636
- } catch (g) {
637
- throw console.error(g), g;
922
+ } catch (u) {
923
+ throw console.error(u), u;
638
924
  }
639
- }, xt = ["ts", "cts", "mts", "typescript"], Et = "embeddedTsParser", It = {
640
- [Oe]: {
925
+ }, xn = ["ts", "cts", "mts", "typescript"], $n = "embeddedTsParser", vn = R(Ke), wn = {
926
+ [vn]: {
641
927
  category: "Global",
642
928
  type: "string",
643
929
  array: !0,
644
- default: [{ value: [...xt] }],
645
- description: "Specify embedded TS languages."
930
+ default: [{ value: [...xn] }],
931
+ description: "Specify embedded TS language parsers."
646
932
  },
647
- [Et]: {
933
+ [$n]: {
648
934
  category: "Global",
649
935
  type: "string",
650
936
  array: !1,
651
937
  default: "typescript",
652
- description: "Specify the parser for the embedded TS languages."
938
+ description: "Specify the embedded TS language parser."
653
939
  }
654
- }, vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
940
+ }, Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
655
941
  __proto__: null,
656
- embeddedLanguage: Oe,
657
- embedder: yt,
658
- options: It
659
- }, Symbol.toStringTag, { value: "Module" })), Z = "embeddedXml";
660
- function $t(e) {
942
+ embeddedLanguage: Ke,
943
+ embedder: En,
944
+ options: wn
945
+ }, Symbol.toStringTag, { value: "Module" })), de = "embeddedXml";
946
+ function Ln(e) {
661
947
  const n = {
662
948
  loc: {
663
949
  start: {
@@ -669,15 +955,15 @@ function $t(e) {
669
955
  column: e.column + e.length
670
956
  }
671
957
  }
672
- }, s = new SyntaxError(
958
+ }, r = new SyntaxError(
673
959
  `${e.message} (${n.loc.start.line}:${n.loc.start.column})`,
674
960
  {
675
961
  cause: e
676
962
  }
677
963
  );
678
- return Object.assign(s, n), s;
964
+ return Object.assign(r, n), r;
679
965
  }
680
- function ye(e) {
966
+ function Fe(e) {
681
967
  const n = {
682
968
  loc: {
683
969
  start: {
@@ -689,61 +975,61 @@ function ye(e) {
689
975
  column: e.token.endColumn ?? NaN
690
976
  }
691
977
  }
692
- }, s = new SyntaxError(
978
+ }, r = new SyntaxError(
693
979
  `${e.message} (${n.loc.start.line}:${n.loc.start.column})`,
694
980
  {
695
981
  cause: e
696
982
  }
697
983
  );
698
- return Object.assign(s, n), s;
984
+ return Object.assign(r, n), r;
699
985
  }
700
- const Dt = {
986
+ const Sn = {
701
987
  parse(e, n) {
702
- var a, h;
703
- const { lexErrors: s, parseErrors: t, cst: i } = ke(e);
704
- if (s.length > 0) {
705
- const p = s[0];
706
- throw $t(p);
988
+ var o, h;
989
+ const { lexErrors: r, parseErrors: t, cst: s } = lt(e);
990
+ if (r.length > 0) {
991
+ const g = r[0];
992
+ throw Ln(g);
707
993
  }
708
994
  if (t.length > 0) {
709
- let p = !1;
710
- for (const c of t) {
995
+ let g = !1;
996
+ for (const d of t) {
711
997
  if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
712
- c.name
998
+ d.name
713
999
  ))
714
- throw ye(c);
715
- if (c.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
716
- p = !0;
1000
+ throw Fe(d);
1001
+ if (d.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
1002
+ g = !0;
717
1003
  continue;
718
1004
  }
719
1005
  if (/Expecting token of type --> EOF <-- but found --> '.+' <--/.test(
720
- c.message
721
- ) || /Redundant input, expecting EOF but found: /.test(c.message)) {
722
- (a = n.__embeddedXmlFragmentRecoverIndex) == null || a.splice(
1006
+ d.message
1007
+ ) || /Redundant input, expecting EOF but found: /.test(d.message)) {
1008
+ (o = n.__embeddedXmlFragmentRecoverIndex) == null || o.splice(
723
1009
  0,
724
1010
  n.__embeddedXmlFragmentRecoverIndex.length,
725
- c.token.startOffset
1011
+ d.token.startOffset
726
1012
  );
727
1013
  break;
728
1014
  }
729
1015
  if (/Expecting token of type --> OPEN <-- but found --> '.+' <--/.test(
730
- c.message
1016
+ d.message
731
1017
  )) {
732
- if (c.token.endOffset === void 0 || Number.isNaN(c.token.endOffset))
1018
+ if (d.token.endOffset === void 0 || Number.isNaN(d.token.endOffset))
733
1019
  break;
734
1020
  (h = n.__embeddedXmlFragmentRecoverIndex) == null || h.splice(
735
1021
  0,
736
1022
  n.__embeddedXmlFragmentRecoverIndex.length,
737
- c.token.startOffset,
738
- c.token.endOffset
739
- ), p = !0;
1023
+ d.token.startOffset,
1024
+ d.token.endOffset
1025
+ ), g = !0;
740
1026
  break;
741
1027
  }
742
- throw ye(c);
1028
+ throw Fe(d);
743
1029
  }
744
- p && Te(i);
1030
+ g && Ze(s);
745
1031
  }
746
- return i;
1032
+ return s;
747
1033
  },
748
1034
  astFormat: "xml",
749
1035
  locStart(e) {
@@ -753,74 +1039,74 @@ const Dt = {
753
1039
  return e.location.endOffset ?? NaN;
754
1040
  }
755
1041
  };
756
- function Te(e) {
1042
+ function Ze(e) {
757
1043
  const n = e.children;
758
- for (const s in n) {
759
- const t = n[s] ?? [];
760
- for (let i = t.length - 1; i >= 0; --i) {
761
- const a = t[i];
762
- if (wt(a)) {
763
- if (Object.keys(a.children).length === 0) {
764
- t.splice(i, 1), t.length === 0 && delete n[s];
1044
+ for (const r in n) {
1045
+ const t = n[r] ?? [];
1046
+ for (let s = t.length - 1; s >= 0; --s) {
1047
+ const o = t[s];
1048
+ if (Tn(o)) {
1049
+ if (Object.keys(o.children).length === 0) {
1050
+ t.splice(s, 1), t.length === 0 && delete n[r];
765
1051
  continue;
766
1052
  }
767
- Te(a);
1053
+ Ze(o);
768
1054
  }
769
1055
  }
770
1056
  }
771
1057
  }
772
- function wt(e) {
1058
+ function Tn(e) {
773
1059
  return "name" in e && "children" in e && "location" in e;
774
1060
  }
775
- const { line: xe, group: R, indent: Ee, softline: V } = M, St = async (e, n, s, t, i) => {
776
- var a, h, p, c, x, g;
1061
+ const { line: Ae, group: V, indent: Ce, softline: se } = k, On = async (e, n, r, t, s) => {
1062
+ var o, h, g, d, f, u;
777
1063
  try {
778
- Q("@prettier/plugin-xml", t, i);
779
- const { node: D } = s, { createPlaceholder: L, placeholderRegex: r } = A(), E = D.quasis.map(
780
- (m, $, { length: U }) => $ === U - 1 ? m.value.cooked : m.value.cooked + L($)
781
- ).join(""), I = ((a = E.match(/^\s+/)) == null ? void 0 : a[0]) ?? "", w = ((h = E.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", T = E.slice(
782
- I.length,
783
- -w.length || void 0
784
- ), b = C(s, n), v = [];
785
- let u = 0;
786
- for (; u !== void 0; ) {
787
- const m = T.slice(u);
788
- if (m.length === 0)
1064
+ Q("@prettier/plugin-xml", t, s);
1065
+ const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), _ = $.quasis.map(
1066
+ (E, D, { length: O }) => D === O - 1 ? E.value.cooked : E.value.cooked + S(D)
1067
+ ).join(""), b = ((o = _.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", v = ((h = _.match(/\s+$/)) == null ? void 0 : h[0]) ?? "", L = _.slice(
1068
+ b.length,
1069
+ -v.length || void 0
1070
+ ), m = M(r, n), y = [];
1071
+ let p = 0;
1072
+ for (; p !== void 0; ) {
1073
+ const E = L.slice(p);
1074
+ if (E.length === 0)
789
1075
  break;
790
- u > 0 && t.xmlWhitespaceSensitivity !== "strict" && v.push(V), (p = t.__embeddedXmlFragmentRecoverIndex) == null || p.splice(
1076
+ p > 0 && t.xmlWhitespaceSensitivity !== "strict" && y.push(se), (g = t.__embeddedXmlFragmentRecoverIndex) == null || g.splice(
791
1077
  0,
792
1078
  t.__embeddedXmlFragmentRecoverIndex.length
793
1079
  );
794
- let $ = await e(m, {
795
- parser: Z
1080
+ let D = await e(E, {
1081
+ parser: de
796
1082
  });
797
- const [U, o] = t.__embeddedXmlFragmentRecoverIndex ?? [];
798
- U === void 0 ? u = void 0 : o === void 0 ? u += U : ($ = m.slice(U, o + 1), u += o + 1), v.push($);
1083
+ const [O, l] = t.__embeddedXmlFragmentRecoverIndex ?? [];
1084
+ O === void 0 ? p = void 0 : l === void 0 ? p += O : (D = E.slice(O, l + 1), p += l + 1), y.push(D);
799
1085
  }
800
- const l = X(
801
- v,
802
- r,
803
- b
1086
+ const a = q(
1087
+ y,
1088
+ i,
1089
+ m
804
1090
  );
805
- if (t.xmlWhitespaceSensitivity === "strict" || (c = t.preserveEmbeddedExteriorWhitespaces) != null && c.includes(i))
806
- return R([
1091
+ if (t.xmlWhitespaceSensitivity === "strict" || (d = t.preserveEmbeddedExteriorWhitespaces) != null && d.includes(s))
1092
+ return V([
807
1093
  "`",
808
- I,
809
- (x = t.noEmbeddedMultiLineIndentation) != null && x.includes(i) ? [R(l)] : Ee([R(l)]),
810
- w,
1094
+ b,
1095
+ (f = t.noEmbeddedMultiLineIndentation) != null && f.includes(s) ? [V(a)] : Ce([V(a)]),
1096
+ v,
811
1097
  "`"
812
1098
  ]);
813
- const d = I.length ? xe : V, y = w.length ? xe : V;
814
- return R([
1099
+ const c = b.length ? Ae : se, I = v.length ? Ae : se;
1100
+ return V([
815
1101
  "`",
816
- (g = t.noEmbeddedMultiLineIndentation) != null && g.includes(i) ? [d, R(l)] : Ee([d, R(l)]),
817
- y,
1102
+ (u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [c, V(a)] : Ce([c, V(a)]),
1103
+ I,
818
1104
  "`"
819
1105
  ]);
820
- } catch (D) {
821
- throw console.error(D), D;
1106
+ } catch ($) {
1107
+ throw console.error($), $;
822
1108
  }
823
- }, Ot = [
1109
+ }, Un = [
824
1110
  "xml",
825
1111
  "xsd",
826
1112
  "ascx",
@@ -844,7 +1130,6 @@ const { line: xe, group: R, indent: Ee, softline: V } = M, St = async (e, n, s,
844
1130
  "jmx",
845
1131
  "launch",
846
1132
  "menu",
847
- "mxml",
848
1133
  "nuspec",
849
1134
  "opml",
850
1135
  "owl",
@@ -878,13 +1163,13 @@ const { line: xe, group: R, indent: Ee, softline: V } = M, St = async (e, n, s,
878
1163
  "xpdl",
879
1164
  "xul",
880
1165
  "xoml"
881
- ], Tt = {
882
- [Z]: {
1166
+ ], Pn = R(de), kn = {
1167
+ [Pn]: {
883
1168
  category: "Global",
884
1169
  type: "string",
885
1170
  array: !0,
886
- default: [{ value: [...Ot] }],
887
- description: "Specify embedded XML languages. This requires @prettier/plugin-xml"
1171
+ default: [{ value: [...Un] }],
1172
+ description: 'Specify embedded XML language identifiers. This requires "@prettier/plugin-xml".'
888
1173
  },
889
1174
  /** @internal */
890
1175
  __embeddedXmlFragmentRecoverIndex: {
@@ -894,76 +1179,80 @@ const { line: xe, group: R, indent: Ee, softline: V } = M, St = async (e, n, s,
894
1179
  default: [{ value: [] }],
895
1180
  description: "This option is read only and used as a workaround to support xml fragments"
896
1181
  }
897
- }, Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1182
+ }, Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
898
1183
  __proto__: null,
899
- embeddedLanguage: Z,
900
- embedder: St,
901
- options: Tt,
902
- parser: Dt
903
- }, Symbol.toStringTag, { value: "Module" })), Ue = [], Le = {}, qe = {}, Pe = {}, Lt = /* @__PURE__ */ Object.assign({
904
- "./es/index.ts": et,
905
- "./html/index.ts": rt,
906
- "./noop/index.ts": at,
907
- "./php/index.ts": ut,
908
- "./sql/index.ts": bt,
909
- "./ts/index.ts": vt,
910
- "./xml/index.ts": Ut
1184
+ embeddedLanguage: de,
1185
+ embedder: On,
1186
+ options: kn,
1187
+ parser: Sn
1188
+ }, Symbol.toStringTag, { value: "Module" })), et = [], tt = {}, nt = {}, st = {}, Mn = /* @__PURE__ */ Object.assign({
1189
+ "./css/index.ts": wt,
1190
+ "./es/index.ts": Ut,
1191
+ "./glsl/index.ts": jt,
1192
+ "./html/index.ts": Ct,
1193
+ "./markdown/index.ts": Ht,
1194
+ "./noop/index.ts": Qt,
1195
+ "./php/index.ts": tn,
1196
+ "./ruby/index.ts": pn,
1197
+ "./sql/index.ts": In,
1198
+ "./ts/index.ts": Dn,
1199
+ "./xml/index.ts": Rn
911
1200
  });
912
- Object.values(Lt).forEach(
913
- ({ embeddedLanguage: e, parser: n, embedder: s, options: t }) => {
914
- Ye(Ue, e, J), n && (Le[e] = n), s && (qe[e] = s), Object.assign(Pe, t);
1201
+ Object.values(Mn).forEach(
1202
+ ({ embeddedLanguage: e, parser: n, embedder: r, options: t }) => {
1203
+ yt(et, e, oe), n && (tt[e] = n), r && (nt[e] = r), Object.assign(st, t);
915
1204
  }
916
1205
  );
917
- const Vt = {
1206
+ const Kn = {
918
1207
  // parsers from internal
919
- ...Me.parsers,
920
- ...je.parsers,
921
- ...Be.parsers,
922
- ...Fe.parsers,
923
- ...Ne.parsers,
1208
+ ...rt.parsers,
1209
+ ...it.parsers,
1210
+ ...ot.parsers,
1211
+ ...at.parsers,
1212
+ ...dt.parsers,
924
1213
  // parsers from this plugin
925
- ...Le
926
- }, { estree: G } = Re, qt = function(e, n) {
1214
+ ...tt
1215
+ }, { estree: J } = ct, jn = function(e, n) {
927
1216
  var t;
928
- const { node: s } = e;
929
- if (s.type !== "TemplateLiteral" || s.quasis.some(({ value: { cooked: i } }) => i === null))
1217
+ const { node: r } = e;
1218
+ if (r.type !== "TemplateLiteral" || r.quasis.some(({ value: { cooked: s } }) => s === null))
930
1219
  return null;
931
- for (const i of Ue) {
932
- const a = n[i];
933
- if (!a)
1220
+ for (const s of et) {
1221
+ const o = n[R(s)];
1222
+ if (!o)
934
1223
  continue;
935
- const h = Pt(
1224
+ const h = Nn(
936
1225
  e,
937
- a,
1226
+ o,
938
1227
  n.noEmbeddedIdentificationByComment ?? []
939
- ) ?? Mt(
1228
+ ) ?? qn(
940
1229
  e,
941
- a,
1230
+ o,
942
1231
  n.noEmbeddedIdentificationByTag ?? []
943
1232
  );
944
1233
  if (h === void 0)
945
1234
  continue;
946
- const p = qe[i];
947
- if (!p)
1235
+ const g = nt[s];
1236
+ if (!g)
948
1237
  return null;
949
- const c = e.node;
950
- return c.quasis.length === 1 && c.quasis[0].value.raw.trim() === "" ? "``" : async (...x) => {
951
- const g = await p(...x, h, a);
952
- return M.label(
953
- { embed: !0, ...g.label },
954
- g
1238
+ const d = e.node;
1239
+ return d.quasis.length === 1 && d.quasis[0].value.raw.trim() === "" ? "``" : async (...f) => {
1240
+ const u = await g(...f, h, o);
1241
+ return k.label(
1242
+ { embed: !0, ...u.label },
1243
+ u
955
1244
  );
956
1245
  };
957
1246
  }
958
- return ((t = G.embed) == null ? void 0 : t.call(G, e, n)) ?? null;
1247
+ return ((t = J.embed) == null ? void 0 : t.call(J, e, n)) ?? null;
959
1248
  };
960
- function Pt({ node: e, parent: n }, s, t) {
961
- if (s.length === 0 || e.type !== "TemplateLiteral")
1249
+ function Nn({ node: e, parent: n }, r, t) {
1250
+ if (r.length === 0 || e.type !== "TemplateLiteral")
962
1251
  return;
963
- const i = e.comments ?? (n == null ? void 0 : n.comments);
964
- if (!i)
1252
+ const s = e.comments ?? (n == null ? void 0 : n.comments);
1253
+ if (!s)
965
1254
  return;
966
- const a = i[i.length - 1];
1255
+ const o = s[s.length - 1];
967
1256
  if (!(![
968
1257
  "MultiLine",
969
1258
  // meriyah
@@ -971,48 +1260,48 @@ function Pt({ node: e, parent: n }, s, t) {
971
1260
  // typescript, acorn, espree, flow
972
1261
  "CommentBlock"
973
1262
  // babel, babel-flow, babel-ts
974
- ].includes(a.type) || !a.leading)) {
975
- for (const h of s)
976
- if (` ${h} ` === a.value && !t.includes(h))
1263
+ ].includes(o.type) || !o.leading)) {
1264
+ for (const h of r)
1265
+ if (` ${h} ` === o.value && !t.includes(h))
977
1266
  return h;
978
1267
  }
979
1268
  }
980
- function Mt({ node: e, parent: n }, s, t) {
981
- if (s.length !== 0 && !(e.type !== "TemplateLiteral" || (n == null ? void 0 : n.type) !== "TaggedTemplateExpression" || n.tag.type !== "Identifier")) {
982
- for (const i of s)
983
- if (n.tag.name === i && !t.includes(i))
984
- return i;
1269
+ function qn({ node: e, parent: n }, r, t) {
1270
+ if (r.length !== 0 && !(e.type !== "TemplateLiteral" || (n == null ? void 0 : n.type) !== "TaggedTemplateExpression" || n.tag.type !== "Identifier")) {
1271
+ for (const s of r)
1272
+ if (n.tag.name === s && !t.includes(s))
1273
+ return s;
985
1274
  }
986
1275
  }
987
- const Yt = {
1276
+ const Zn = {
988
1277
  estree: {
989
- ...G,
990
- embed: qt
1278
+ ...J,
1279
+ embed: jn
991
1280
  }
992
- }, jt = "noEmbeddedIdentificationByComment", Bt = "noEmbeddedIdentificationByTag", Ft = "preserveEmbeddedExteriorWhitespaces", Nt = "noEmbeddedMultiLineIndentation", Qt = {
993
- ...Pe,
994
- [jt]: {
1281
+ }, Bn = "noEmbeddedIdentificationByComment", Fn = "noEmbeddedIdentificationByTag", An = "preserveEmbeddedExteriorWhitespaces", Cn = "noEmbeddedMultiLineIndentation", es = {
1282
+ ...st,
1283
+ [Bn]: {
995
1284
  category: "Global",
996
1285
  type: "string",
997
1286
  array: !0,
998
1287
  default: [{ value: [] }],
999
1288
  description: 'This option turns off "/* identifier */ `...`" comment-based language identification for the specified identifiers.'
1000
1289
  },
1001
- [Bt]: {
1290
+ [Fn]: {
1002
1291
  category: "Global",
1003
1292
  type: "string",
1004
1293
  array: !0,
1005
1294
  default: [{ value: [] }],
1006
1295
  description: 'This option turns off "identifier`...`" tag-based language identification for the specified identifiers.'
1007
1296
  },
1008
- [Ft]: {
1297
+ [An]: {
1009
1298
  category: "Config",
1010
1299
  type: "string",
1011
1300
  array: !0,
1012
1301
  default: [{ value: [] }],
1013
1302
  description: "This option preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
1014
1303
  },
1015
- [Nt]: {
1304
+ [Cn]: {
1016
1305
  category: "Global",
1017
1306
  type: "string",
1018
1307
  array: !0,
@@ -1021,11 +1310,12 @@ const Yt = {
1021
1310
  }
1022
1311
  };
1023
1312
  export {
1024
- qe as embeddedEmbedders,
1025
- Ue as embeddedLanguages,
1026
- Pe as embeddedOptions,
1027
- Le as embeddedParsers,
1028
- Qt as options,
1029
- Vt as parsers,
1030
- Yt as printers
1313
+ nt as embeddedEmbedders,
1314
+ et as embeddedLanguages,
1315
+ st as embeddedOptions,
1316
+ tt as embeddedParsers,
1317
+ R as makeIdentifiersName,
1318
+ es as options,
1319
+ Kn as parsers,
1320
+ Zn as printers
1031
1321
  };