react-monaco-json-merge 1.1.17 → 1.2.1
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.
- package/dist/components/editor.d.ts.map +1 -1
- package/dist/index.cjs +35 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1448 -1310
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/jsonPatchDiff.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as _e, useRef as
|
|
3
|
-
function
|
|
1
|
+
import { jsx as gt, Fragment as Pn } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _e, useRef as se, useCallback as Ne, useEffect as Se } from "react";
|
|
3
|
+
function tn(e, t) {
|
|
4
4
|
(t == null || t > e.length) && (t = e.length);
|
|
5
5
|
for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
|
|
6
6
|
return n;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function _n(e) {
|
|
9
9
|
if (Array.isArray(e)) return e;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return (t =
|
|
11
|
+
function Rn(e, t, r) {
|
|
12
|
+
return (t = Fn(t)) in e ? Object.defineProperty(e, t, {
|
|
13
13
|
value: r,
|
|
14
14
|
enumerable: !0,
|
|
15
15
|
configurable: !0,
|
|
16
16
|
writable: !0
|
|
17
17
|
}) : e[t] = r, e;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function jn(e, t) {
|
|
20
20
|
var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
21
21
|
if (r != null) {
|
|
22
|
-
var n, o, i, s, c = [], a = !0,
|
|
22
|
+
var n, o, i, s, c = [], a = !0, f = !1;
|
|
23
23
|
try {
|
|
24
24
|
if (i = (r = r.call(e)).next, t !== 0) for (; !(a = (n = i.call(r)).done) && (c.push(n.value), c.length !== t); a = !0) ;
|
|
25
25
|
} catch (l) {
|
|
26
|
-
|
|
26
|
+
f = !0, o = l;
|
|
27
27
|
} finally {
|
|
28
28
|
try {
|
|
29
29
|
if (!a && r.return != null && (s = r.return(), Object(s) !== s)) return;
|
|
30
30
|
} finally {
|
|
31
|
-
if (
|
|
31
|
+
if (f) throw o;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
return c;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Dn() {
|
|
38
38
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
39
39
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function nn(e, t) {
|
|
42
42
|
var r = Object.keys(e);
|
|
43
43
|
if (Object.getOwnPropertySymbols) {
|
|
44
44
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -48,27 +48,27 @@ function qt(e, t) {
|
|
|
48
48
|
}
|
|
49
49
|
return r;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function rn(e) {
|
|
52
52
|
for (var t = 1; t < arguments.length; t++) {
|
|
53
53
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
54
|
-
t % 2 ?
|
|
55
|
-
|
|
56
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
54
|
+
t % 2 ? nn(Object(r), !0).forEach(function(n) {
|
|
55
|
+
Rn(e, n, r[n]);
|
|
56
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : nn(Object(r)).forEach(function(n) {
|
|
57
57
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function xn(e, t) {
|
|
63
63
|
if (e == null) return {};
|
|
64
|
-
var r, n, o =
|
|
64
|
+
var r, n, o = Mn(e, t);
|
|
65
65
|
if (Object.getOwnPropertySymbols) {
|
|
66
66
|
var i = Object.getOwnPropertySymbols(e);
|
|
67
67
|
for (n = 0; n < i.length; n++) r = i[n], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
68
68
|
}
|
|
69
69
|
return o;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function Mn(e, t) {
|
|
72
72
|
if (e == null) return {};
|
|
73
73
|
var r = {};
|
|
74
74
|
for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
|
|
@@ -77,10 +77,10 @@ function In(e, t) {
|
|
|
77
77
|
}
|
|
78
78
|
return r;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
return
|
|
80
|
+
function $n(e, t) {
|
|
81
|
+
return _n(e) || jn(e, t) || Un(e, t) || Dn();
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Bn(e, t) {
|
|
84
84
|
if (typeof e != "object" || !e) return e;
|
|
85
85
|
var r = e[Symbol.toPrimitive];
|
|
86
86
|
if (r !== void 0) {
|
|
@@ -90,18 +90,18 @@ function Sn(e, t) {
|
|
|
90
90
|
}
|
|
91
91
|
return (t === "string" ? String : Number)(e);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
var t =
|
|
93
|
+
function Fn(e) {
|
|
94
|
+
var t = Bn(e, "string");
|
|
95
95
|
return typeof t == "symbol" ? t : t + "";
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Un(e, t) {
|
|
98
98
|
if (e) {
|
|
99
|
-
if (typeof e == "string") return
|
|
99
|
+
if (typeof e == "string") return tn(e, t);
|
|
100
100
|
var r = {}.toString.call(e).slice(8, -1);
|
|
101
|
-
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
101
|
+
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? tn(e, t) : void 0;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Vn(e, t, r) {
|
|
105
105
|
return t in e ? Object.defineProperty(e, t, {
|
|
106
106
|
value: r,
|
|
107
107
|
enumerable: !0,
|
|
@@ -109,7 +109,7 @@ function Pn(e, t, r) {
|
|
|
109
109
|
writable: !0
|
|
110
110
|
}) : e[t] = r, e;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function on(e, t) {
|
|
113
113
|
var r = Object.keys(e);
|
|
114
114
|
if (Object.getOwnPropertySymbols) {
|
|
115
115
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -119,18 +119,18 @@ function zt(e, t) {
|
|
|
119
119
|
}
|
|
120
120
|
return r;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function sn(e) {
|
|
123
123
|
for (var t = 1; t < arguments.length; t++) {
|
|
124
124
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
125
|
-
t % 2 ?
|
|
126
|
-
|
|
127
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
125
|
+
t % 2 ? on(Object(r), !0).forEach(function(n) {
|
|
126
|
+
Vn(e, n, r[n]);
|
|
127
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : on(Object(r)).forEach(function(n) {
|
|
128
128
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
return e;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Jn() {
|
|
134
134
|
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
135
135
|
t[r] = arguments[r];
|
|
136
136
|
return function(n) {
|
|
@@ -139,7 +139,7 @@ function Rn() {
|
|
|
139
139
|
}, n);
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function ct(e) {
|
|
143
143
|
return function t() {
|
|
144
144
|
for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
|
145
145
|
o[i] = arguments[i];
|
|
@@ -150,38 +150,38 @@ function Ce(e) {
|
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function vt(e) {
|
|
154
154
|
return {}.toString.call(e).includes("Object");
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Hn(e) {
|
|
157
157
|
return !Object.keys(e).length;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function at(e) {
|
|
160
160
|
return typeof e == "function";
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Gn(e, t) {
|
|
163
163
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
return
|
|
167
|
-
return !
|
|
168
|
-
}) &&
|
|
165
|
+
function Wn(e, t) {
|
|
166
|
+
return vt(t) || Me("changeType"), Object.keys(t).some(function(r) {
|
|
167
|
+
return !Gn(e, r);
|
|
168
|
+
}) && Me("changeField"), t;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
|
|
170
|
+
function qn(e) {
|
|
171
|
+
at(e) || Me("selectorType");
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
175
|
-
return !
|
|
176
|
-
}) &&
|
|
173
|
+
function Yn(e) {
|
|
174
|
+
at(e) || vt(e) || Me("handlerType"), vt(e) && Object.values(e).some(function(t) {
|
|
175
|
+
return !at(t);
|
|
176
|
+
}) && Me("handlersType");
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
e ||
|
|
178
|
+
function zn(e) {
|
|
179
|
+
e || Me("initialIsRequired"), vt(e) || Me("initialType"), Hn(e) && Me("initialContent");
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function Cn(e, t) {
|
|
182
182
|
throw new Error(e[t] || e.default);
|
|
183
183
|
}
|
|
184
|
-
var
|
|
184
|
+
var Xn = {
|
|
185
185
|
initialIsRequired: "initial state is required",
|
|
186
186
|
initialType: "initial state should be an object",
|
|
187
187
|
initialContent: "initial state shouldn't be an empty object",
|
|
@@ -191,49 +191,49 @@ var Un = {
|
|
|
191
191
|
changeType: "provided value of changes should be an object",
|
|
192
192
|
changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
|
|
193
193
|
default: "an unknown error accured in `state-local` package"
|
|
194
|
-
},
|
|
195
|
-
changes:
|
|
196
|
-
selector:
|
|
197
|
-
handler:
|
|
198
|
-
initial:
|
|
194
|
+
}, Me = ct(Cn)(Xn), ht = {
|
|
195
|
+
changes: Wn,
|
|
196
|
+
selector: qn,
|
|
197
|
+
handler: Yn,
|
|
198
|
+
initial: zn
|
|
199
199
|
};
|
|
200
|
-
function
|
|
200
|
+
function Kn(e) {
|
|
201
201
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
202
|
-
|
|
202
|
+
ht.initial(e), ht.handler(t);
|
|
203
203
|
var r = {
|
|
204
204
|
current: e
|
|
205
|
-
}, n =
|
|
205
|
+
}, n = ct(er)(r, t), o = ct(Zn)(r), i = ct(ht.changes)(e), s = ct(Qn)(r);
|
|
206
206
|
function c() {
|
|
207
|
-
var
|
|
207
|
+
var f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(l) {
|
|
208
208
|
return l;
|
|
209
209
|
};
|
|
210
|
-
return
|
|
210
|
+
return ht.selector(f), f(r.current);
|
|
211
211
|
}
|
|
212
|
-
function a(
|
|
213
|
-
|
|
212
|
+
function a(f) {
|
|
213
|
+
Jn(n, o, i, s)(f);
|
|
214
214
|
}
|
|
215
215
|
return [c, a];
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
return
|
|
217
|
+
function Qn(e, t) {
|
|
218
|
+
return at(t) ? t(e.current) : t;
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
return e.current =
|
|
220
|
+
function Zn(e, t) {
|
|
221
|
+
return e.current = sn(sn({}, e.current), t), t;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
return
|
|
223
|
+
function er(e, t, r) {
|
|
224
|
+
return at(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
|
|
225
225
|
var o;
|
|
226
226
|
return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
|
|
227
227
|
}), r;
|
|
228
228
|
}
|
|
229
|
-
var
|
|
230
|
-
create:
|
|
231
|
-
},
|
|
229
|
+
var tr = {
|
|
230
|
+
create: Kn
|
|
231
|
+
}, nr = {
|
|
232
232
|
paths: {
|
|
233
233
|
vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
|
-
function
|
|
236
|
+
function rr(e) {
|
|
237
237
|
return function t() {
|
|
238
238
|
for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
|
239
239
|
o[i] = arguments[i];
|
|
@@ -244,23 +244,23 @@ function Yn(e) {
|
|
|
244
244
|
};
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function or(e) {
|
|
248
248
|
return {}.toString.call(e).includes("Object");
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
return e ||
|
|
250
|
+
function ir(e) {
|
|
251
|
+
return e || cn("configIsRequired"), or(e) || cn("configType"), e.urls ? (sr(), {
|
|
252
252
|
paths: {
|
|
253
253
|
vs: e.urls.monacoBase
|
|
254
254
|
}
|
|
255
255
|
}) : e;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
console.warn(
|
|
257
|
+
function sr() {
|
|
258
|
+
console.warn(gn.deprecation);
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function cr(e, t) {
|
|
261
261
|
throw new Error(e[t] || e.default);
|
|
262
262
|
}
|
|
263
|
-
var
|
|
263
|
+
var gn = {
|
|
264
264
|
configIsRequired: "the configuration object is required",
|
|
265
265
|
configType: "the configuration object should be an object",
|
|
266
266
|
default: "an unknown error accured in `@monaco-editor/loader` package",
|
|
@@ -274,9 +274,9 @@ var on = {
|
|
|
274
274
|
|
|
275
275
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
276
276
|
`
|
|
277
|
-
},
|
|
278
|
-
config:
|
|
279
|
-
},
|
|
277
|
+
}, cn = rr(cr)(gn), ar = {
|
|
278
|
+
config: ir
|
|
279
|
+
}, lr = function() {
|
|
280
280
|
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
|
281
281
|
r[n] = arguments[n];
|
|
282
282
|
return function(o) {
|
|
@@ -285,43 +285,43 @@ var on = {
|
|
|
285
285
|
}, o);
|
|
286
286
|
};
|
|
287
287
|
};
|
|
288
|
-
function
|
|
288
|
+
function mn(e, t) {
|
|
289
289
|
return Object.keys(t).forEach(function(r) {
|
|
290
|
-
t[r] instanceof Object && e[r] && Object.assign(t[r],
|
|
291
|
-
}),
|
|
290
|
+
t[r] instanceof Object && e[r] && Object.assign(t[r], mn(e[r], t[r]));
|
|
291
|
+
}), rn(rn({}, e), t);
|
|
292
292
|
}
|
|
293
|
-
var
|
|
293
|
+
var ur = {
|
|
294
294
|
type: "cancelation",
|
|
295
295
|
msg: "operation is manually canceled"
|
|
296
296
|
};
|
|
297
|
-
function
|
|
297
|
+
function Lt(e) {
|
|
298
298
|
var t = !1, r = new Promise(function(n, o) {
|
|
299
299
|
e.then(function(i) {
|
|
300
|
-
return t ? o(
|
|
300
|
+
return t ? o(ur) : n(i);
|
|
301
301
|
}), e.catch(o);
|
|
302
302
|
});
|
|
303
303
|
return r.cancel = function() {
|
|
304
304
|
return t = !0;
|
|
305
305
|
}, r;
|
|
306
306
|
}
|
|
307
|
-
var
|
|
308
|
-
config:
|
|
307
|
+
var fr = ["monaco"], pr = tr.create({
|
|
308
|
+
config: nr,
|
|
309
309
|
isInitialized: !1,
|
|
310
310
|
resolve: null,
|
|
311
311
|
reject: null,
|
|
312
312
|
monaco: null
|
|
313
|
-
}),
|
|
314
|
-
function
|
|
315
|
-
var t =
|
|
316
|
-
|
|
313
|
+
}), yn = $n(pr, 2), ut = yn[0], At = yn[1];
|
|
314
|
+
function dr(e) {
|
|
315
|
+
var t = ar.config(e), r = t.monaco, n = xn(t, fr);
|
|
316
|
+
At(function(o) {
|
|
317
317
|
return {
|
|
318
|
-
config:
|
|
318
|
+
config: mn(o.config, n),
|
|
319
319
|
monaco: r
|
|
320
320
|
};
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
var e =
|
|
323
|
+
function hr() {
|
|
324
|
+
var e = ut(function(t) {
|
|
325
325
|
var r = t.monaco, n = t.isInitialized, o = t.resolve;
|
|
326
326
|
return {
|
|
327
327
|
monaco: r,
|
|
@@ -330,37 +330,37 @@ function or() {
|
|
|
330
330
|
};
|
|
331
331
|
});
|
|
332
332
|
if (!e.isInitialized) {
|
|
333
|
-
if (
|
|
333
|
+
if (At({
|
|
334
334
|
isInitialized: !0
|
|
335
335
|
}), e.monaco)
|
|
336
|
-
return e.resolve(e.monaco),
|
|
336
|
+
return e.resolve(e.monaco), Lt(kt);
|
|
337
337
|
if (window.monaco && window.monaco.editor)
|
|
338
|
-
return
|
|
339
|
-
|
|
338
|
+
return vn(window.monaco), e.resolve(window.monaco), Lt(kt);
|
|
339
|
+
lr(gr, yr)(vr);
|
|
340
340
|
}
|
|
341
|
-
return
|
|
341
|
+
return Lt(kt);
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function gr(e) {
|
|
344
344
|
return document.body.appendChild(e);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function mr(e) {
|
|
347
347
|
var t = document.createElement("script");
|
|
348
348
|
return e && (t.src = e), t;
|
|
349
349
|
}
|
|
350
|
-
function
|
|
351
|
-
var t =
|
|
350
|
+
function yr(e) {
|
|
351
|
+
var t = ut(function(n) {
|
|
352
352
|
var o = n.config, i = n.reject;
|
|
353
353
|
return {
|
|
354
354
|
config: o,
|
|
355
355
|
reject: i
|
|
356
356
|
};
|
|
357
|
-
}), r =
|
|
357
|
+
}), r = mr("".concat(t.config.paths.vs, "/loader.js"));
|
|
358
358
|
return r.onload = function() {
|
|
359
359
|
return e();
|
|
360
360
|
}, r.onerror = t.reject, r;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
363
|
-
var e =
|
|
362
|
+
function vr() {
|
|
363
|
+
var e = ut(function(r) {
|
|
364
364
|
var n = r.config, o = r.resolve, i = r.reject;
|
|
365
365
|
return {
|
|
366
366
|
config: n,
|
|
@@ -370,154 +370,154 @@ function ar() {
|
|
|
370
370
|
}), t = window.require;
|
|
371
371
|
t.config(e.config), t(["vs/editor/editor.main"], function(r) {
|
|
372
372
|
var n = r.m;
|
|
373
|
-
|
|
373
|
+
vn(n), e.resolve(n);
|
|
374
374
|
}, function(r) {
|
|
375
375
|
e.reject(r);
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
|
-
function
|
|
379
|
-
|
|
378
|
+
function vn(e) {
|
|
379
|
+
ut().monaco || At({
|
|
380
380
|
monaco: e
|
|
381
381
|
});
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
return
|
|
383
|
+
function br() {
|
|
384
|
+
return ut(function(e) {
|
|
385
385
|
var t = e.monaco;
|
|
386
386
|
return t;
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
|
-
var
|
|
390
|
-
return
|
|
389
|
+
var kt = new Promise(function(e, t) {
|
|
390
|
+
return At({
|
|
391
391
|
resolve: e,
|
|
392
392
|
reject: t
|
|
393
393
|
});
|
|
394
|
-
}),
|
|
395
|
-
config:
|
|
396
|
-
init:
|
|
397
|
-
__getMonacoInstance:
|
|
398
|
-
},
|
|
399
|
-
function
|
|
394
|
+
}), wr = {
|
|
395
|
+
config: dr,
|
|
396
|
+
init: hr,
|
|
397
|
+
__getMonacoInstance: br
|
|
398
|
+
}, oe = /* @__PURE__ */ ((e) => (e[e.excluded = 0] = "excluded", e[e.first = 1] = "first", e[e.second = 2] = "second", e))(oe || {}), $ = /* @__PURE__ */ ((e) => (e.SAME_CHANGE = "same_change", e.INPUT1_ONLY = "input1_only", e.INPUT2_ONLY = "input2_only", e.TRUE_CONFLICT = "true_conflict", e))($ || {});
|
|
399
|
+
function Or(e, t = !1) {
|
|
400
400
|
const r = e.length;
|
|
401
|
-
let n = 0, o = "", i = 0, s = 16, c = 0, a = 0,
|
|
402
|
-
function
|
|
403
|
-
let S = 0,
|
|
404
|
-
for (; S <
|
|
405
|
-
let
|
|
406
|
-
if (
|
|
407
|
-
|
|
408
|
-
else if (
|
|
409
|
-
|
|
410
|
-
else if (
|
|
411
|
-
|
|
401
|
+
let n = 0, o = "", i = 0, s = 16, c = 0, a = 0, f = 0, l = 0, y = 0;
|
|
402
|
+
function d(u, A) {
|
|
403
|
+
let S = 0, p = 0;
|
|
404
|
+
for (; S < u; ) {
|
|
405
|
+
let v = e.charCodeAt(n);
|
|
406
|
+
if (v >= 48 && v <= 57)
|
|
407
|
+
p = p * 16 + v - 48;
|
|
408
|
+
else if (v >= 65 && v <= 70)
|
|
409
|
+
p = p * 16 + v - 65 + 10;
|
|
410
|
+
else if (v >= 97 && v <= 102)
|
|
411
|
+
p = p * 16 + v - 97 + 10;
|
|
412
412
|
else
|
|
413
413
|
break;
|
|
414
414
|
n++, S++;
|
|
415
415
|
}
|
|
416
|
-
return S <
|
|
416
|
+
return S < u && (p = -1), p;
|
|
417
417
|
}
|
|
418
|
-
function
|
|
419
|
-
n =
|
|
418
|
+
function h(u) {
|
|
419
|
+
n = u, o = "", i = 0, s = 16, y = 0;
|
|
420
420
|
}
|
|
421
|
-
function
|
|
422
|
-
let
|
|
421
|
+
function T() {
|
|
422
|
+
let u = n;
|
|
423
423
|
if (e.charCodeAt(n) === 48)
|
|
424
424
|
n++;
|
|
425
425
|
else
|
|
426
|
-
for (n++; n < e.length &&
|
|
426
|
+
for (n++; n < e.length && Ce(e.charCodeAt(n)); )
|
|
427
427
|
n++;
|
|
428
428
|
if (n < e.length && e.charCodeAt(n) === 46)
|
|
429
|
-
if (n++, n < e.length &&
|
|
430
|
-
for (n++; n < e.length &&
|
|
429
|
+
if (n++, n < e.length && Ce(e.charCodeAt(n)))
|
|
430
|
+
for (n++; n < e.length && Ce(e.charCodeAt(n)); )
|
|
431
431
|
n++;
|
|
432
432
|
else
|
|
433
|
-
return y = 3, e.substring(
|
|
434
|
-
let
|
|
433
|
+
return y = 3, e.substring(u, n);
|
|
434
|
+
let A = n;
|
|
435
435
|
if (n < e.length && (e.charCodeAt(n) === 69 || e.charCodeAt(n) === 101))
|
|
436
|
-
if (n++, (n < e.length && e.charCodeAt(n) === 43 || e.charCodeAt(n) === 45) && n++, n < e.length &&
|
|
437
|
-
for (n++; n < e.length &&
|
|
436
|
+
if (n++, (n < e.length && e.charCodeAt(n) === 43 || e.charCodeAt(n) === 45) && n++, n < e.length && Ce(e.charCodeAt(n))) {
|
|
437
|
+
for (n++; n < e.length && Ce(e.charCodeAt(n)); )
|
|
438
438
|
n++;
|
|
439
|
-
|
|
439
|
+
A = n;
|
|
440
440
|
} else
|
|
441
441
|
y = 3;
|
|
442
|
-
return e.substring(
|
|
442
|
+
return e.substring(u, A);
|
|
443
443
|
}
|
|
444
444
|
function N() {
|
|
445
|
-
let
|
|
445
|
+
let u = "", A = n;
|
|
446
446
|
for (; ; ) {
|
|
447
447
|
if (n >= r) {
|
|
448
|
-
|
|
448
|
+
u += e.substring(A, n), y = 2;
|
|
449
449
|
break;
|
|
450
450
|
}
|
|
451
451
|
const S = e.charCodeAt(n);
|
|
452
452
|
if (S === 34) {
|
|
453
|
-
|
|
453
|
+
u += e.substring(A, n), n++;
|
|
454
454
|
break;
|
|
455
455
|
}
|
|
456
456
|
if (S === 92) {
|
|
457
|
-
if (
|
|
457
|
+
if (u += e.substring(A, n), n++, n >= r) {
|
|
458
458
|
y = 2;
|
|
459
459
|
break;
|
|
460
460
|
}
|
|
461
461
|
switch (e.charCodeAt(n++)) {
|
|
462
462
|
case 34:
|
|
463
|
-
|
|
463
|
+
u += '"';
|
|
464
464
|
break;
|
|
465
465
|
case 92:
|
|
466
|
-
|
|
466
|
+
u += "\\";
|
|
467
467
|
break;
|
|
468
468
|
case 47:
|
|
469
|
-
|
|
469
|
+
u += "/";
|
|
470
470
|
break;
|
|
471
471
|
case 98:
|
|
472
|
-
|
|
472
|
+
u += "\b";
|
|
473
473
|
break;
|
|
474
474
|
case 102:
|
|
475
|
-
|
|
475
|
+
u += "\f";
|
|
476
476
|
break;
|
|
477
477
|
case 110:
|
|
478
|
-
|
|
478
|
+
u += `
|
|
479
479
|
`;
|
|
480
480
|
break;
|
|
481
481
|
case 114:
|
|
482
|
-
|
|
482
|
+
u += "\r";
|
|
483
483
|
break;
|
|
484
484
|
case 116:
|
|
485
|
-
|
|
485
|
+
u += " ";
|
|
486
486
|
break;
|
|
487
487
|
case 117:
|
|
488
|
-
const
|
|
489
|
-
|
|
488
|
+
const v = d(4);
|
|
489
|
+
v >= 0 ? u += String.fromCharCode(v) : y = 4;
|
|
490
490
|
break;
|
|
491
491
|
default:
|
|
492
492
|
y = 5;
|
|
493
493
|
}
|
|
494
|
-
|
|
494
|
+
A = n;
|
|
495
495
|
continue;
|
|
496
496
|
}
|
|
497
497
|
if (S >= 0 && S <= 31)
|
|
498
|
-
if (
|
|
499
|
-
|
|
498
|
+
if (it(S)) {
|
|
499
|
+
u += e.substring(A, n), y = 2;
|
|
500
500
|
break;
|
|
501
501
|
} else
|
|
502
502
|
y = 6;
|
|
503
503
|
n++;
|
|
504
504
|
}
|
|
505
|
-
return
|
|
505
|
+
return u;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
if (o = "", y = 0, i = n, a = c, l =
|
|
507
|
+
function m() {
|
|
508
|
+
if (o = "", y = 0, i = n, a = c, l = f, n >= r)
|
|
509
509
|
return i = r, s = 17;
|
|
510
|
-
let
|
|
511
|
-
if (
|
|
510
|
+
let u = e.charCodeAt(n);
|
|
511
|
+
if (St(u)) {
|
|
512
512
|
do
|
|
513
|
-
n++, o += String.fromCharCode(
|
|
514
|
-
while (
|
|
513
|
+
n++, o += String.fromCharCode(u), u = e.charCodeAt(n);
|
|
514
|
+
while (St(u));
|
|
515
515
|
return s = 15;
|
|
516
516
|
}
|
|
517
|
-
if (
|
|
518
|
-
return n++, o += String.fromCharCode(
|
|
519
|
-
`), c++,
|
|
520
|
-
switch (
|
|
517
|
+
if (it(u))
|
|
518
|
+
return n++, o += String.fromCharCode(u), u === 13 && e.charCodeAt(n) === 10 && (n++, o += `
|
|
519
|
+
`), c++, f = n, s = 14;
|
|
520
|
+
switch (u) {
|
|
521
521
|
// tokens: []{}:,
|
|
522
522
|
case 123:
|
|
523
523
|
return n++, s = 1;
|
|
@@ -536,30 +536,30 @@ function fr(e, t = !1) {
|
|
|
536
536
|
return n++, o = N(), s = 10;
|
|
537
537
|
// comments
|
|
538
538
|
case 47:
|
|
539
|
-
const
|
|
539
|
+
const A = n - 1;
|
|
540
540
|
if (e.charCodeAt(n + 1) === 47) {
|
|
541
|
-
for (n += 2; n < r && !
|
|
541
|
+
for (n += 2; n < r && !it(e.charCodeAt(n)); )
|
|
542
542
|
n++;
|
|
543
|
-
return o = e.substring(
|
|
543
|
+
return o = e.substring(A, n), s = 12;
|
|
544
544
|
}
|
|
545
545
|
if (e.charCodeAt(n + 1) === 42) {
|
|
546
546
|
n += 2;
|
|
547
547
|
const S = r - 1;
|
|
548
|
-
let
|
|
548
|
+
let p = !1;
|
|
549
549
|
for (; n < S; ) {
|
|
550
|
-
const
|
|
551
|
-
if (
|
|
552
|
-
n += 2,
|
|
550
|
+
const v = e.charCodeAt(n);
|
|
551
|
+
if (v === 42 && e.charCodeAt(n + 1) === 47) {
|
|
552
|
+
n += 2, p = !0;
|
|
553
553
|
break;
|
|
554
554
|
}
|
|
555
|
-
n++,
|
|
555
|
+
n++, it(v) && (v === 13 && e.charCodeAt(n) === 10 && n++, c++, f = n);
|
|
556
556
|
}
|
|
557
|
-
return
|
|
557
|
+
return p || (n++, y = 1), o = e.substring(A, n), s = 13;
|
|
558
558
|
}
|
|
559
|
-
return o += String.fromCharCode(
|
|
559
|
+
return o += String.fromCharCode(u), n++, s = 16;
|
|
560
560
|
// numbers
|
|
561
561
|
case 45:
|
|
562
|
-
if (o += String.fromCharCode(
|
|
562
|
+
if (o += String.fromCharCode(u), n++, n === r || !Ce(e.charCodeAt(n)))
|
|
563
563
|
return s = 16;
|
|
564
564
|
// found a minus, followed by a number so
|
|
565
565
|
// we fall through to proceed with scanning
|
|
@@ -574,11 +574,11 @@ function fr(e, t = !1) {
|
|
|
574
574
|
case 55:
|
|
575
575
|
case 56:
|
|
576
576
|
case 57:
|
|
577
|
-
return o +=
|
|
577
|
+
return o += T(), s = 11;
|
|
578
578
|
// literals and unknown symbols
|
|
579
579
|
default:
|
|
580
|
-
for (; n < r &&
|
|
581
|
-
n++,
|
|
580
|
+
for (; n < r && g(u); )
|
|
581
|
+
n++, u = e.charCodeAt(n);
|
|
582
582
|
if (i !== n) {
|
|
583
583
|
switch (o = e.substring(i, n), o) {
|
|
584
584
|
case "true":
|
|
@@ -590,13 +590,13 @@ function fr(e, t = !1) {
|
|
|
590
590
|
}
|
|
591
591
|
return s = 16;
|
|
592
592
|
}
|
|
593
|
-
return o += String.fromCharCode(
|
|
593
|
+
return o += String.fromCharCode(u), n++, s = 16;
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
|
-
function
|
|
597
|
-
if (
|
|
596
|
+
function g(u) {
|
|
597
|
+
if (St(u) || it(u))
|
|
598
598
|
return !1;
|
|
599
|
-
switch (
|
|
599
|
+
switch (u) {
|
|
600
600
|
case 125:
|
|
601
601
|
case 93:
|
|
602
602
|
case 123:
|
|
@@ -609,17 +609,17 @@ function fr(e, t = !1) {
|
|
|
609
609
|
}
|
|
610
610
|
return !0;
|
|
611
611
|
}
|
|
612
|
-
function
|
|
613
|
-
let
|
|
612
|
+
function O() {
|
|
613
|
+
let u;
|
|
614
614
|
do
|
|
615
|
-
|
|
616
|
-
while (
|
|
617
|
-
return
|
|
615
|
+
u = m();
|
|
616
|
+
while (u >= 12 && u <= 15);
|
|
617
|
+
return u;
|
|
618
618
|
}
|
|
619
619
|
return {
|
|
620
|
-
setPosition:
|
|
620
|
+
setPosition: h,
|
|
621
621
|
getPosition: () => n,
|
|
622
|
-
scan: t ?
|
|
622
|
+
scan: t ? O : m,
|
|
623
623
|
getToken: () => s,
|
|
624
624
|
getTokenValue: () => o,
|
|
625
625
|
getTokenOffset: () => i,
|
|
@@ -629,33 +629,33 @@ function fr(e, t = !1) {
|
|
|
629
629
|
getTokenError: () => y
|
|
630
630
|
};
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function St(e) {
|
|
633
633
|
return e === 32 || e === 9;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function it(e) {
|
|
636
636
|
return e === 10 || e === 13;
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function Ce(e) {
|
|
639
639
|
return e >= 48 && e <= 57;
|
|
640
640
|
}
|
|
641
|
-
var
|
|
641
|
+
var an;
|
|
642
642
|
(function(e) {
|
|
643
643
|
e[e.lineFeed = 10] = "lineFeed", e[e.carriageReturn = 13] = "carriageReturn", e[e.space = 32] = "space", e[e._0 = 48] = "_0", e[e._1 = 49] = "_1", e[e._2 = 50] = "_2", e[e._3 = 51] = "_3", e[e._4 = 52] = "_4", e[e._5 = 53] = "_5", e[e._6 = 54] = "_6", e[e._7 = 55] = "_7", e[e._8 = 56] = "_8", e[e._9 = 57] = "_9", e[e.a = 97] = "a", e[e.b = 98] = "b", e[e.c = 99] = "c", e[e.d = 100] = "d", e[e.e = 101] = "e", e[e.f = 102] = "f", e[e.g = 103] = "g", e[e.h = 104] = "h", e[e.i = 105] = "i", e[e.j = 106] = "j", e[e.k = 107] = "k", e[e.l = 108] = "l", e[e.m = 109] = "m", e[e.n = 110] = "n", e[e.o = 111] = "o", e[e.p = 112] = "p", e[e.q = 113] = "q", e[e.r = 114] = "r", e[e.s = 115] = "s", e[e.t = 116] = "t", e[e.u = 117] = "u", e[e.v = 118] = "v", e[e.w = 119] = "w", e[e.x = 120] = "x", e[e.y = 121] = "y", e[e.z = 122] = "z", e[e.A = 65] = "A", e[e.B = 66] = "B", e[e.C = 67] = "C", e[e.D = 68] = "D", e[e.E = 69] = "E", e[e.F = 70] = "F", e[e.G = 71] = "G", e[e.H = 72] = "H", e[e.I = 73] = "I", e[e.J = 74] = "J", e[e.K = 75] = "K", e[e.L = 76] = "L", e[e.M = 77] = "M", e[e.N = 78] = "N", e[e.O = 79] = "O", e[e.P = 80] = "P", e[e.Q = 81] = "Q", e[e.R = 82] = "R", e[e.S = 83] = "S", e[e.T = 84] = "T", e[e.U = 85] = "U", e[e.V = 86] = "V", e[e.W = 87] = "W", e[e.X = 88] = "X", e[e.Y = 89] = "Y", e[e.Z = 90] = "Z", e[e.asterisk = 42] = "asterisk", e[e.backslash = 92] = "backslash", e[e.closeBrace = 125] = "closeBrace", e[e.closeBracket = 93] = "closeBracket", e[e.colon = 58] = "colon", e[e.comma = 44] = "comma", e[e.dot = 46] = "dot", e[e.doubleQuote = 34] = "doubleQuote", e[e.minus = 45] = "minus", e[e.openBrace = 123] = "openBrace", e[e.openBracket = 91] = "openBracket", e[e.plus = 43] = "plus", e[e.slash = 47] = "slash", e[e.formFeed = 12] = "formFeed", e[e.tab = 9] = "tab";
|
|
644
|
-
})(
|
|
644
|
+
})(an || (an = {}));
|
|
645
645
|
new Array(20).fill(0).map((e, t) => " ".repeat(t));
|
|
646
|
-
const
|
|
647
|
-
new Array(
|
|
648
|
-
` + " ".repeat(t)), new Array(
|
|
649
|
-
` + " ".repeat(t)), new Array(
|
|
650
|
-
` + " ".repeat(t)), new Array(
|
|
646
|
+
const Xe = 200;
|
|
647
|
+
new Array(Xe).fill(0).map((e, t) => `
|
|
648
|
+
` + " ".repeat(t)), new Array(Xe).fill(0).map((e, t) => "\r" + " ".repeat(t)), new Array(Xe).fill(0).map((e, t) => `\r
|
|
649
|
+
` + " ".repeat(t)), new Array(Xe).fill(0).map((e, t) => `
|
|
650
|
+
` + " ".repeat(t)), new Array(Xe).fill(0).map((e, t) => "\r" + " ".repeat(t)), new Array(Xe).fill(0).map((e, t) => `\r
|
|
651
651
|
` + " ".repeat(t));
|
|
652
|
-
var
|
|
652
|
+
var bt;
|
|
653
653
|
(function(e) {
|
|
654
654
|
e.DEFAULT = {
|
|
655
655
|
allowTrailingComma: !1
|
|
656
656
|
};
|
|
657
|
-
})(
|
|
658
|
-
function
|
|
657
|
+
})(bt || (bt = {}));
|
|
658
|
+
function Ar(e, t = [], r = bt.DEFAULT) {
|
|
659
659
|
let n = { type: "array", offset: -1, length: -1, children: [], parent: void 0 };
|
|
660
660
|
function o(a) {
|
|
661
661
|
n.type === "property" && (n.length = a - n.offset, n = n.parent);
|
|
@@ -663,36 +663,36 @@ function pr(e, t = [], r = ut.DEFAULT) {
|
|
|
663
663
|
function i(a) {
|
|
664
664
|
return n.children.push(a), a;
|
|
665
665
|
}
|
|
666
|
-
|
|
666
|
+
Er(e, {
|
|
667
667
|
onObjectBegin: (a) => {
|
|
668
668
|
n = i({ type: "object", offset: a, length: -1, parent: n, children: [] });
|
|
669
669
|
},
|
|
670
|
-
onObjectProperty: (a,
|
|
671
|
-
n = i({ type: "property", offset:
|
|
670
|
+
onObjectProperty: (a, f, l) => {
|
|
671
|
+
n = i({ type: "property", offset: f, length: -1, parent: n, children: [] }), n.children.push({ type: "string", value: a, offset: f, length: l, parent: n });
|
|
672
672
|
},
|
|
673
|
-
onObjectEnd: (a,
|
|
674
|
-
o(a +
|
|
673
|
+
onObjectEnd: (a, f) => {
|
|
674
|
+
o(a + f), n.length = a + f - n.offset, n = n.parent, o(a + f);
|
|
675
675
|
},
|
|
676
|
-
onArrayBegin: (a,
|
|
676
|
+
onArrayBegin: (a, f) => {
|
|
677
677
|
n = i({ type: "array", offset: a, length: -1, parent: n, children: [] });
|
|
678
678
|
},
|
|
679
|
-
onArrayEnd: (a,
|
|
680
|
-
n.length = a +
|
|
679
|
+
onArrayEnd: (a, f) => {
|
|
680
|
+
n.length = a + f - n.offset, n = n.parent, o(a + f);
|
|
681
681
|
},
|
|
682
|
-
onLiteralValue: (a,
|
|
683
|
-
i({ type:
|
|
682
|
+
onLiteralValue: (a, f, l) => {
|
|
683
|
+
i({ type: Tr(a), offset: f, length: l, parent: n, value: a }), o(f + l);
|
|
684
684
|
},
|
|
685
|
-
onSeparator: (a,
|
|
686
|
-
n.type === "property" && (a === ":" ? n.colonOffset =
|
|
685
|
+
onSeparator: (a, f, l) => {
|
|
686
|
+
n.type === "property" && (a === ":" ? n.colonOffset = f : a === "," && o(f));
|
|
687
687
|
},
|
|
688
|
-
onError: (a,
|
|
689
|
-
t.push({ error: a, offset:
|
|
688
|
+
onError: (a, f, l) => {
|
|
689
|
+
t.push({ error: a, offset: f, length: l });
|
|
690
690
|
}
|
|
691
691
|
}, r);
|
|
692
692
|
const c = n.children[0];
|
|
693
693
|
return c && delete c.parent, c;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function Nr(e, t) {
|
|
696
696
|
if (!e)
|
|
697
697
|
return;
|
|
698
698
|
let r = e;
|
|
@@ -716,80 +716,80 @@ function dr(e, t) {
|
|
|
716
716
|
}
|
|
717
717
|
return r;
|
|
718
718
|
}
|
|
719
|
-
function
|
|
720
|
-
const n =
|
|
719
|
+
function Er(e, t, r = bt.DEFAULT) {
|
|
720
|
+
const n = Or(e, !1), o = [];
|
|
721
721
|
let i = 0;
|
|
722
|
-
function s(
|
|
723
|
-
return
|
|
722
|
+
function s(L) {
|
|
723
|
+
return L ? () => i === 0 && L(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
|
|
724
724
|
}
|
|
725
|
-
function c(
|
|
726
|
-
return
|
|
725
|
+
function c(L) {
|
|
726
|
+
return L ? (I) => i === 0 && L(I, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
|
|
727
727
|
}
|
|
728
|
-
function a(
|
|
729
|
-
return
|
|
728
|
+
function a(L) {
|
|
729
|
+
return L ? (I) => i === 0 && L(I, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => o.slice()) : () => !0;
|
|
730
730
|
}
|
|
731
|
-
function
|
|
732
|
-
return
|
|
733
|
-
i > 0 ? i++ :
|
|
731
|
+
function f(L) {
|
|
732
|
+
return L ? () => {
|
|
733
|
+
i > 0 ? i++ : L(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => o.slice()) === !1 && (i = 1);
|
|
734
734
|
} : () => !0;
|
|
735
735
|
}
|
|
736
|
-
function l(
|
|
737
|
-
return
|
|
738
|
-
i > 0 && i--, i === 0 &&
|
|
736
|
+
function l(L) {
|
|
737
|
+
return L ? () => {
|
|
738
|
+
i > 0 && i--, i === 0 && L(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter());
|
|
739
739
|
} : () => !0;
|
|
740
740
|
}
|
|
741
|
-
const y =
|
|
742
|
-
function
|
|
741
|
+
const y = f(t.onObjectBegin), d = a(t.onObjectProperty), h = l(t.onObjectEnd), T = f(t.onArrayBegin), N = l(t.onArrayEnd), m = a(t.onLiteralValue), g = c(t.onSeparator), O = s(t.onComment), u = c(t.onError), A = r && r.disallowComments, S = r && r.allowTrailingComma;
|
|
742
|
+
function p() {
|
|
743
743
|
for (; ; ) {
|
|
744
|
-
const
|
|
744
|
+
const L = n.scan();
|
|
745
745
|
switch (n.getTokenError()) {
|
|
746
746
|
case 4:
|
|
747
|
-
|
|
747
|
+
v(
|
|
748
748
|
14
|
|
749
749
|
/* ParseErrorCode.InvalidUnicode */
|
|
750
750
|
);
|
|
751
751
|
break;
|
|
752
752
|
case 5:
|
|
753
|
-
|
|
753
|
+
v(
|
|
754
754
|
15
|
|
755
755
|
/* ParseErrorCode.InvalidEscapeCharacter */
|
|
756
756
|
);
|
|
757
757
|
break;
|
|
758
758
|
case 3:
|
|
759
|
-
|
|
759
|
+
v(
|
|
760
760
|
13
|
|
761
761
|
/* ParseErrorCode.UnexpectedEndOfNumber */
|
|
762
762
|
);
|
|
763
763
|
break;
|
|
764
764
|
case 1:
|
|
765
|
-
|
|
765
|
+
A || v(
|
|
766
766
|
11
|
|
767
767
|
/* ParseErrorCode.UnexpectedEndOfComment */
|
|
768
768
|
);
|
|
769
769
|
break;
|
|
770
770
|
case 2:
|
|
771
|
-
|
|
771
|
+
v(
|
|
772
772
|
12
|
|
773
773
|
/* ParseErrorCode.UnexpectedEndOfString */
|
|
774
774
|
);
|
|
775
775
|
break;
|
|
776
776
|
case 6:
|
|
777
|
-
|
|
777
|
+
v(
|
|
778
778
|
16
|
|
779
779
|
/* ParseErrorCode.InvalidCharacter */
|
|
780
780
|
);
|
|
781
781
|
break;
|
|
782
782
|
}
|
|
783
|
-
switch (
|
|
783
|
+
switch (L) {
|
|
784
784
|
case 12:
|
|
785
785
|
case 13:
|
|
786
|
-
|
|
786
|
+
A ? v(
|
|
787
787
|
10
|
|
788
788
|
/* ParseErrorCode.InvalidCommentToken */
|
|
789
|
-
) :
|
|
789
|
+
) : O();
|
|
790
790
|
break;
|
|
791
791
|
case 16:
|
|
792
|
-
|
|
792
|
+
v(
|
|
793
793
|
1
|
|
794
794
|
/* ParseErrorCode.InvalidSymbol */
|
|
795
795
|
);
|
|
@@ -798,119 +798,119 @@ function hr(e, t, r = ut.DEFAULT) {
|
|
|
798
798
|
case 14:
|
|
799
799
|
break;
|
|
800
800
|
default:
|
|
801
|
-
return
|
|
801
|
+
return L;
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
-
function
|
|
806
|
-
if (
|
|
807
|
-
let
|
|
808
|
-
for (;
|
|
809
|
-
if (
|
|
810
|
-
|
|
805
|
+
function v(L, I = [], D = []) {
|
|
806
|
+
if (u(L), I.length + D.length > 0) {
|
|
807
|
+
let K = n.getToken();
|
|
808
|
+
for (; K !== 17; ) {
|
|
809
|
+
if (I.indexOf(K) !== -1) {
|
|
810
|
+
p();
|
|
811
811
|
break;
|
|
812
|
-
} else if (
|
|
812
|
+
} else if (D.indexOf(K) !== -1)
|
|
813
813
|
break;
|
|
814
|
-
|
|
814
|
+
K = p();
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
const
|
|
820
|
-
return
|
|
818
|
+
function R(L) {
|
|
819
|
+
const I = n.getTokenValue();
|
|
820
|
+
return L ? m(I) : (d(I), o.push(I)), p(), !0;
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function P() {
|
|
823
823
|
switch (n.getToken()) {
|
|
824
824
|
case 11:
|
|
825
|
-
const
|
|
826
|
-
let
|
|
827
|
-
isNaN(
|
|
825
|
+
const L = n.getTokenValue();
|
|
826
|
+
let I = Number(L);
|
|
827
|
+
isNaN(I) && (v(
|
|
828
828
|
2
|
|
829
829
|
/* ParseErrorCode.InvalidNumberFormat */
|
|
830
|
-
),
|
|
830
|
+
), I = 0), m(I);
|
|
831
831
|
break;
|
|
832
832
|
case 7:
|
|
833
|
-
|
|
833
|
+
m(null);
|
|
834
834
|
break;
|
|
835
835
|
case 8:
|
|
836
|
-
|
|
836
|
+
m(!0);
|
|
837
837
|
break;
|
|
838
838
|
case 9:
|
|
839
|
-
|
|
839
|
+
m(!1);
|
|
840
840
|
break;
|
|
841
841
|
default:
|
|
842
842
|
return !1;
|
|
843
843
|
}
|
|
844
|
-
return
|
|
844
|
+
return p(), !0;
|
|
845
845
|
}
|
|
846
|
-
function
|
|
847
|
-
return n.getToken() !== 10 ? (
|
|
846
|
+
function x() {
|
|
847
|
+
return n.getToken() !== 10 ? (v(3, [], [
|
|
848
848
|
2,
|
|
849
849
|
5
|
|
850
850
|
/* SyntaxKind.CommaToken */
|
|
851
|
-
]), !1) : (
|
|
851
|
+
]), !1) : (R(!1), n.getToken() === 6 ? (g(":"), p(), F() || v(4, [], [
|
|
852
852
|
2,
|
|
853
853
|
5
|
|
854
854
|
/* SyntaxKind.CommaToken */
|
|
855
|
-
])) :
|
|
855
|
+
])) : v(5, [], [
|
|
856
856
|
2,
|
|
857
857
|
5
|
|
858
858
|
/* SyntaxKind.CommaToken */
|
|
859
859
|
]), o.pop(), !0);
|
|
860
860
|
}
|
|
861
861
|
function M() {
|
|
862
|
-
y(),
|
|
863
|
-
let
|
|
862
|
+
y(), p();
|
|
863
|
+
let L = !1;
|
|
864
864
|
for (; n.getToken() !== 2 && n.getToken() !== 17; ) {
|
|
865
865
|
if (n.getToken() === 5) {
|
|
866
|
-
if (
|
|
866
|
+
if (L || v(4, [], []), g(","), p(), n.getToken() === 2 && S)
|
|
867
867
|
break;
|
|
868
|
-
} else
|
|
869
|
-
|
|
868
|
+
} else L && v(6, [], []);
|
|
869
|
+
x() || v(4, [], [
|
|
870
870
|
2,
|
|
871
871
|
5
|
|
872
872
|
/* SyntaxKind.CommaToken */
|
|
873
|
-
]),
|
|
873
|
+
]), L = !0;
|
|
874
874
|
}
|
|
875
|
-
return
|
|
875
|
+
return h(), n.getToken() !== 2 ? v(7, [
|
|
876
876
|
2
|
|
877
877
|
/* SyntaxKind.CloseBraceToken */
|
|
878
|
-
], []) :
|
|
878
|
+
], []) : p(), !0;
|
|
879
879
|
}
|
|
880
|
-
function
|
|
881
|
-
|
|
882
|
-
let
|
|
880
|
+
function B() {
|
|
881
|
+
T(), p();
|
|
882
|
+
let L = !0, I = !1;
|
|
883
883
|
for (; n.getToken() !== 4 && n.getToken() !== 17; ) {
|
|
884
884
|
if (n.getToken() === 5) {
|
|
885
|
-
if (
|
|
885
|
+
if (I || v(4, [], []), g(","), p(), n.getToken() === 4 && S)
|
|
886
886
|
break;
|
|
887
|
-
} else
|
|
888
|
-
|
|
887
|
+
} else I && v(6, [], []);
|
|
888
|
+
L ? (o.push(0), L = !1) : o[o.length - 1]++, F() || v(4, [], [
|
|
889
889
|
4,
|
|
890
890
|
5
|
|
891
891
|
/* SyntaxKind.CommaToken */
|
|
892
|
-
]),
|
|
892
|
+
]), I = !0;
|
|
893
893
|
}
|
|
894
|
-
return N(),
|
|
894
|
+
return N(), L || o.pop(), n.getToken() !== 4 ? v(8, [
|
|
895
895
|
4
|
|
896
896
|
/* SyntaxKind.CloseBracketToken */
|
|
897
|
-
], []) :
|
|
897
|
+
], []) : p(), !0;
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function F() {
|
|
900
900
|
switch (n.getToken()) {
|
|
901
901
|
case 3:
|
|
902
|
-
return
|
|
902
|
+
return B();
|
|
903
903
|
case 1:
|
|
904
904
|
return M();
|
|
905
905
|
case 10:
|
|
906
|
-
return
|
|
906
|
+
return R(!0);
|
|
907
907
|
default:
|
|
908
|
-
return
|
|
908
|
+
return P();
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
|
-
return
|
|
911
|
+
return p(), n.getToken() === 17 ? r.allowEmptyContent ? !0 : (v(4, [], []), !1) : F() ? (n.getToken() !== 17 && v(9, [], []), !0) : (v(4, [], []), !1);
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function Tr(e) {
|
|
914
914
|
switch (typeof e) {
|
|
915
915
|
case "boolean":
|
|
916
916
|
return "boolean";
|
|
@@ -929,25 +929,25 @@ function gr(e) {
|
|
|
929
929
|
return "null";
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
|
-
var
|
|
932
|
+
var ln;
|
|
933
933
|
(function(e) {
|
|
934
934
|
e[e.None = 0] = "None", e[e.UnexpectedEndOfComment = 1] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 2] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 3] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 4] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 5] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 6] = "InvalidCharacter";
|
|
935
|
-
})(
|
|
936
|
-
var
|
|
935
|
+
})(ln || (ln = {}));
|
|
936
|
+
var un;
|
|
937
937
|
(function(e) {
|
|
938
938
|
e[e.OpenBraceToken = 1] = "OpenBraceToken", e[e.CloseBraceToken = 2] = "CloseBraceToken", e[e.OpenBracketToken = 3] = "OpenBracketToken", e[e.CloseBracketToken = 4] = "CloseBracketToken", e[e.CommaToken = 5] = "CommaToken", e[e.ColonToken = 6] = "ColonToken", e[e.NullKeyword = 7] = "NullKeyword", e[e.TrueKeyword = 8] = "TrueKeyword", e[e.FalseKeyword = 9] = "FalseKeyword", e[e.StringLiteral = 10] = "StringLiteral", e[e.NumericLiteral = 11] = "NumericLiteral", e[e.LineCommentTrivia = 12] = "LineCommentTrivia", e[e.BlockCommentTrivia = 13] = "BlockCommentTrivia", e[e.LineBreakTrivia = 14] = "LineBreakTrivia", e[e.Trivia = 15] = "Trivia", e[e.Unknown = 16] = "Unknown", e[e.EOF = 17] = "EOF";
|
|
939
|
-
})(
|
|
940
|
-
const
|
|
941
|
-
var
|
|
939
|
+
})(un || (un = {}));
|
|
940
|
+
const bn = Ar, wn = Nr;
|
|
941
|
+
var fn;
|
|
942
942
|
(function(e) {
|
|
943
943
|
e[e.InvalidSymbol = 1] = "InvalidSymbol", e[e.InvalidNumberFormat = 2] = "InvalidNumberFormat", e[e.PropertyNameExpected = 3] = "PropertyNameExpected", e[e.ValueExpected = 4] = "ValueExpected", e[e.ColonExpected = 5] = "ColonExpected", e[e.CommaExpected = 6] = "CommaExpected", e[e.CloseBraceExpected = 7] = "CloseBraceExpected", e[e.CloseBracketExpected = 8] = "CloseBracketExpected", e[e.EndOfFileExpected = 9] = "EndOfFileExpected", e[e.InvalidCommentToken = 10] = "InvalidCommentToken", e[e.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 14] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 16] = "InvalidCharacter";
|
|
944
|
-
})(
|
|
945
|
-
function
|
|
944
|
+
})(fn || (fn = {}));
|
|
945
|
+
function Ir(e) {
|
|
946
946
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
947
947
|
}
|
|
948
|
-
var
|
|
949
|
-
function
|
|
950
|
-
return
|
|
948
|
+
var Pt, pn;
|
|
949
|
+
function Lr() {
|
|
950
|
+
return pn || (pn = 1, Pt = function e(t, r) {
|
|
951
951
|
if (t === r) return !0;
|
|
952
952
|
if (t && r && typeof t == "object" && typeof r == "object") {
|
|
953
953
|
if (t.constructor !== r.constructor) return !1;
|
|
@@ -971,10 +971,84 @@ function yr() {
|
|
|
971
971
|
return !0;
|
|
972
972
|
}
|
|
973
973
|
return t !== t && r !== r;
|
|
974
|
-
}),
|
|
974
|
+
}), Pt;
|
|
975
|
+
}
|
|
976
|
+
var kr = Lr();
|
|
977
|
+
const he = /* @__PURE__ */ Ir(kr);
|
|
978
|
+
function _t(e) {
|
|
979
|
+
if (typeof e != "object" || e === null)
|
|
980
|
+
return !1;
|
|
981
|
+
const t = Object.getPrototypeOf(e);
|
|
982
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
983
|
+
}
|
|
984
|
+
function Rt(e, t) {
|
|
985
|
+
return Array.isArray(e) && e.length > 0 ? [...e, t] : [t];
|
|
986
|
+
}
|
|
987
|
+
function Sr(e, t = {}) {
|
|
988
|
+
if (!_t(e) && !Array.isArray(e))
|
|
989
|
+
throw new TypeError("Expected a plain object or array");
|
|
990
|
+
const { deep: r = !1, compare: n, ignoreKeys: o } = t, i = /* @__PURE__ */ new WeakMap(), s = (l) => Array.isArray(o) ? o.includes(l.key) : typeof o == "function" ? o(l) : !1, c = (l) => typeof r == "boolean" ? r : typeof r == "function" ? r(l) : !1, a = (l, y, d) => {
|
|
991
|
+
const h = i.get(l);
|
|
992
|
+
if (h !== void 0)
|
|
993
|
+
return h;
|
|
994
|
+
const T = [];
|
|
995
|
+
T.length = l.length, i.set(l, T);
|
|
996
|
+
for (const N of l.keys()) {
|
|
997
|
+
if (!(N in l))
|
|
998
|
+
continue;
|
|
999
|
+
const m = l[N], g = String(N), O = Rt(y, g), u = {
|
|
1000
|
+
key: g,
|
|
1001
|
+
value: m,
|
|
1002
|
+
path: O,
|
|
1003
|
+
depth: d + 1
|
|
1004
|
+
};
|
|
1005
|
+
if (Array.isArray(m)) {
|
|
1006
|
+
T[N] = c(u) ? a(m, O, d + 1) : m;
|
|
1007
|
+
continue;
|
|
1008
|
+
}
|
|
1009
|
+
if (_t(m)) {
|
|
1010
|
+
T[N] = c(u) ? f(m, O, d + 1) : m;
|
|
1011
|
+
continue;
|
|
1012
|
+
}
|
|
1013
|
+
T[N] = m;
|
|
1014
|
+
}
|
|
1015
|
+
return T;
|
|
1016
|
+
}, f = (l, y = [], d = 0) => {
|
|
1017
|
+
const h = i.get(l);
|
|
1018
|
+
if (h !== void 0)
|
|
1019
|
+
return h;
|
|
1020
|
+
const T = {}, N = Object.keys(l), m = [], g = [];
|
|
1021
|
+
for (const A of N) {
|
|
1022
|
+
const S = l[A], p = Rt(y, A);
|
|
1023
|
+
s({
|
|
1024
|
+
key: A,
|
|
1025
|
+
value: S,
|
|
1026
|
+
path: p,
|
|
1027
|
+
depth: d
|
|
1028
|
+
}) ? m.push(A) : g.push(A);
|
|
1029
|
+
}
|
|
1030
|
+
const O = g.sort(n), u = [...m, ...O];
|
|
1031
|
+
i.set(l, T);
|
|
1032
|
+
for (const A of u) {
|
|
1033
|
+
const S = l[A], p = Rt(y, A), v = {
|
|
1034
|
+
key: A,
|
|
1035
|
+
value: S,
|
|
1036
|
+
path: p,
|
|
1037
|
+
depth: d
|
|
1038
|
+
};
|
|
1039
|
+
let R = S;
|
|
1040
|
+
c(v) && (Array.isArray(S) ? R = a(S, p, d) : _t(S) && (R = f(S, p, d + 1)));
|
|
1041
|
+
const P = Object.getOwnPropertyDescriptor(l, A);
|
|
1042
|
+
P.get || P.set ? Object.defineProperty(T, A, P) : Object.defineProperty(T, A, {
|
|
1043
|
+
...P,
|
|
1044
|
+
value: R
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1047
|
+
return T;
|
|
1048
|
+
};
|
|
1049
|
+
return Array.isArray(e) ? a(e, [], -1) : f(e, [], 0);
|
|
975
1050
|
}
|
|
976
|
-
|
|
977
|
-
const de = /* @__PURE__ */ mr(vr), W = (e, t) => {
|
|
1051
|
+
const J = (e, t) => {
|
|
978
1052
|
if (!e) return;
|
|
979
1053
|
const r = t.replace(/^\//, "").replace(/\[/g, ".").replace(/\]/g, "").split(/[./#]/).filter(Boolean);
|
|
980
1054
|
let n = e;
|
|
@@ -998,7 +1072,7 @@ const de = /* @__PURE__ */ mr(vr), W = (e, t) => {
|
|
|
998
1072
|
* (c) 2017-2022 Joachim Wester
|
|
999
1073
|
* MIT licensed
|
|
1000
1074
|
*/
|
|
1001
|
-
var
|
|
1075
|
+
var Pr = /* @__PURE__ */ (function() {
|
|
1002
1076
|
var e = function(t, r) {
|
|
1003
1077
|
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, o) {
|
|
1004
1078
|
n.__proto__ = o;
|
|
@@ -1013,11 +1087,11 @@ var br = /* @__PURE__ */ (function() {
|
|
|
1013
1087
|
}
|
|
1014
1088
|
t.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
|
|
1015
1089
|
};
|
|
1016
|
-
})(),
|
|
1017
|
-
function
|
|
1018
|
-
return
|
|
1090
|
+
})(), _r = Object.prototype.hasOwnProperty;
|
|
1091
|
+
function xt(e, t) {
|
|
1092
|
+
return _r.call(e, t);
|
|
1019
1093
|
}
|
|
1020
|
-
function
|
|
1094
|
+
function Mt(e) {
|
|
1021
1095
|
if (Array.isArray(e)) {
|
|
1022
1096
|
for (var t = new Array(e.length), r = 0; r < t.length; r++)
|
|
1023
1097
|
t[r] = "" + r;
|
|
@@ -1027,10 +1101,10 @@ function Tt(e) {
|
|
|
1027
1101
|
return Object.keys(e);
|
|
1028
1102
|
var n = [];
|
|
1029
1103
|
for (var o in e)
|
|
1030
|
-
|
|
1104
|
+
xt(e, o) && n.push(o);
|
|
1031
1105
|
return n;
|
|
1032
1106
|
}
|
|
1033
|
-
function
|
|
1107
|
+
function Oe(e) {
|
|
1034
1108
|
switch (typeof e) {
|
|
1035
1109
|
case "object":
|
|
1036
1110
|
return JSON.parse(JSON.stringify(e));
|
|
@@ -1042,7 +1116,7 @@ function we(e) {
|
|
|
1042
1116
|
return e;
|
|
1043
1117
|
}
|
|
1044
1118
|
}
|
|
1045
|
-
function
|
|
1119
|
+
function $t(e) {
|
|
1046
1120
|
for (var t = 0, r = e.length, n; t < r; ) {
|
|
1047
1121
|
if (n = e.charCodeAt(t), n >= 48 && n <= 57) {
|
|
1048
1122
|
t++;
|
|
@@ -1052,29 +1126,29 @@ function It(e) {
|
|
|
1052
1126
|
}
|
|
1053
1127
|
return !0;
|
|
1054
1128
|
}
|
|
1055
|
-
function
|
|
1129
|
+
function Je(e) {
|
|
1056
1130
|
return e.indexOf("/") === -1 && e.indexOf("~") === -1 ? e : e.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
1057
1131
|
}
|
|
1058
|
-
function
|
|
1132
|
+
function On(e) {
|
|
1059
1133
|
return e.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
1060
1134
|
}
|
|
1061
|
-
function
|
|
1135
|
+
function Bt(e) {
|
|
1062
1136
|
if (e === void 0)
|
|
1063
1137
|
return !0;
|
|
1064
1138
|
if (e) {
|
|
1065
1139
|
if (Array.isArray(e)) {
|
|
1066
1140
|
for (var t = 0, r = e.length; t < r; t++)
|
|
1067
|
-
if (
|
|
1141
|
+
if (Bt(e[t]))
|
|
1068
1142
|
return !0;
|
|
1069
1143
|
} else if (typeof e == "object") {
|
|
1070
|
-
for (var n =
|
|
1071
|
-
if (
|
|
1144
|
+
for (var n = Mt(e), o = n.length, i = 0; i < o; i++)
|
|
1145
|
+
if (Bt(e[n[i]]))
|
|
1072
1146
|
return !0;
|
|
1073
1147
|
}
|
|
1074
1148
|
}
|
|
1075
1149
|
return !1;
|
|
1076
1150
|
}
|
|
1077
|
-
function
|
|
1151
|
+
function dn(e, t) {
|
|
1078
1152
|
var r = [e];
|
|
1079
1153
|
for (var n in t) {
|
|
1080
1154
|
var o = typeof t[n] == "object" ? JSON.stringify(t[n], null, 2) : t[n];
|
|
@@ -1083,17 +1157,17 @@ function nn(e, t) {
|
|
|
1083
1157
|
return r.join(`
|
|
1084
1158
|
`);
|
|
1085
1159
|
}
|
|
1086
|
-
var
|
|
1160
|
+
var An = (
|
|
1087
1161
|
/** @class */
|
|
1088
1162
|
(function(e) {
|
|
1089
|
-
|
|
1163
|
+
Pr(t, e);
|
|
1090
1164
|
function t(r, n, o, i, s) {
|
|
1091
|
-
var c = this.constructor, a = e.call(this,
|
|
1092
|
-
return a.name = n, a.index = o, a.operation = i, a.tree = s, Object.setPrototypeOf(a, c.prototype), a.message =
|
|
1165
|
+
var c = this.constructor, a = e.call(this, dn(r, { name: n, index: o, operation: i, tree: s })) || this;
|
|
1166
|
+
return a.name = n, a.index = o, a.operation = i, a.tree = s, Object.setPrototypeOf(a, c.prototype), a.message = dn(r, { name: n, index: o, operation: i, tree: s }), a;
|
|
1093
1167
|
}
|
|
1094
1168
|
return t;
|
|
1095
1169
|
})(Error)
|
|
1096
|
-
), ce =
|
|
1170
|
+
), ce = An, Rr = Oe, Ke = {
|
|
1097
1171
|
add: function(e, t, r) {
|
|
1098
1172
|
return e[t] = this.value, { newDocument: r };
|
|
1099
1173
|
},
|
|
@@ -1106,24 +1180,24 @@ var pn = (
|
|
|
1106
1180
|
return e[t] = this.value, { newDocument: r, removed: n };
|
|
1107
1181
|
},
|
|
1108
1182
|
move: function(e, t, r) {
|
|
1109
|
-
var n =
|
|
1110
|
-
n && (n =
|
|
1111
|
-
var o =
|
|
1112
|
-
return
|
|
1183
|
+
var n = wt(r, this.path);
|
|
1184
|
+
n && (n = Oe(n));
|
|
1185
|
+
var o = He(r, { op: "remove", path: this.from }).removed;
|
|
1186
|
+
return He(r, { op: "add", path: this.path, value: o }), { newDocument: r, removed: n };
|
|
1113
1187
|
},
|
|
1114
1188
|
copy: function(e, t, r) {
|
|
1115
|
-
var n =
|
|
1116
|
-
return
|
|
1189
|
+
var n = wt(r, this.from);
|
|
1190
|
+
return He(r, { op: "add", path: this.path, value: Oe(n) }), { newDocument: r };
|
|
1117
1191
|
},
|
|
1118
1192
|
test: function(e, t, r) {
|
|
1119
|
-
return { newDocument: r, test:
|
|
1193
|
+
return { newDocument: r, test: lt(e[t], this.value) };
|
|
1120
1194
|
},
|
|
1121
1195
|
_get: function(e, t, r) {
|
|
1122
1196
|
return this.value = e[t], { newDocument: r };
|
|
1123
1197
|
}
|
|
1124
|
-
},
|
|
1198
|
+
}, jr = {
|
|
1125
1199
|
add: function(e, t, r) {
|
|
1126
|
-
return
|
|
1200
|
+
return $t(t) ? e.splice(t, 0, this.value) : e[t] = this.value, { newDocument: r, index: t };
|
|
1127
1201
|
},
|
|
1128
1202
|
remove: function(e, t, r) {
|
|
1129
1203
|
var n = e.splice(t, 1);
|
|
@@ -1133,28 +1207,28 @@ var pn = (
|
|
|
1133
1207
|
var n = e[t];
|
|
1134
1208
|
return e[t] = this.value, { newDocument: r, removed: n };
|
|
1135
1209
|
},
|
|
1136
|
-
move:
|
|
1137
|
-
copy:
|
|
1138
|
-
test:
|
|
1139
|
-
_get:
|
|
1210
|
+
move: Ke.move,
|
|
1211
|
+
copy: Ke.copy,
|
|
1212
|
+
test: Ke.test,
|
|
1213
|
+
_get: Ke._get
|
|
1140
1214
|
};
|
|
1141
|
-
function
|
|
1215
|
+
function wt(e, t) {
|
|
1142
1216
|
if (t == "")
|
|
1143
1217
|
return e;
|
|
1144
1218
|
var r = { op: "_get", path: t };
|
|
1145
|
-
return
|
|
1219
|
+
return He(e, r), r.value;
|
|
1146
1220
|
}
|
|
1147
|
-
function
|
|
1148
|
-
if (r === void 0 && (r = !1), n === void 0 && (n = !0), o === void 0 && (o = !0), i === void 0 && (i = 0), r && (typeof r == "function" ? r(t, 0, e, t.path) :
|
|
1221
|
+
function He(e, t, r, n, o, i) {
|
|
1222
|
+
if (r === void 0 && (r = !1), n === void 0 && (n = !0), o === void 0 && (o = !0), i === void 0 && (i = 0), r && (typeof r == "function" ? r(t, 0, e, t.path) : Ot(t, 0)), t.path === "") {
|
|
1149
1223
|
var s = { newDocument: e };
|
|
1150
1224
|
if (t.op === "add")
|
|
1151
1225
|
return s.newDocument = t.value, s;
|
|
1152
1226
|
if (t.op === "replace")
|
|
1153
1227
|
return s.newDocument = t.value, s.removed = e, s;
|
|
1154
1228
|
if (t.op === "move" || t.op === "copy")
|
|
1155
|
-
return s.newDocument =
|
|
1229
|
+
return s.newDocument = wt(e, t.from), t.op === "move" && (s.removed = e), s;
|
|
1156
1230
|
if (t.op === "test") {
|
|
1157
|
-
if (s.test =
|
|
1231
|
+
if (s.test = lt(e, t.value), s.test === !1)
|
|
1158
1232
|
throw new ce("Test operation failed", "TEST_OPERATION_FAILED", i, t, e);
|
|
1159
1233
|
return s.newDocument = e, s;
|
|
1160
1234
|
} else {
|
|
@@ -1167,56 +1241,56 @@ function xe(e, t, r, n, o, i) {
|
|
|
1167
1241
|
return s;
|
|
1168
1242
|
}
|
|
1169
1243
|
} else {
|
|
1170
|
-
n || (e =
|
|
1171
|
-
var c = t.path || "", a = c.split("/"),
|
|
1172
|
-
for (typeof r == "function" ?
|
|
1173
|
-
if (
|
|
1244
|
+
n || (e = Oe(e));
|
|
1245
|
+
var c = t.path || "", a = c.split("/"), f = e, l = 1, y = a.length, d = void 0, h = void 0, T = void 0;
|
|
1246
|
+
for (typeof r == "function" ? T = r : T = Ot; ; ) {
|
|
1247
|
+
if (h = a[l], h && h.indexOf("~") != -1 && (h = On(h)), o && (h == "__proto__" || h == "prototype" && l > 0 && a[l - 1] == "constructor"))
|
|
1174
1248
|
throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");
|
|
1175
|
-
if (r &&
|
|
1176
|
-
if (
|
|
1177
|
-
|
|
1249
|
+
if (r && d === void 0 && (f[h] === void 0 ? d = a.slice(0, l).join("/") : l == y - 1 && (d = t.path), d !== void 0 && T(t, 0, e, d)), l++, Array.isArray(f)) {
|
|
1250
|
+
if (h === "-")
|
|
1251
|
+
h = f.length;
|
|
1178
1252
|
else {
|
|
1179
|
-
if (r &&
|
|
1253
|
+
if (r && !$t(h))
|
|
1180
1254
|
throw new ce("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index", "OPERATION_PATH_ILLEGAL_ARRAY_INDEX", i, t, e);
|
|
1181
|
-
|
|
1255
|
+
$t(h) && (h = ~~h);
|
|
1182
1256
|
}
|
|
1183
1257
|
if (l >= y) {
|
|
1184
|
-
if (r && t.op === "add" &&
|
|
1258
|
+
if (r && t.op === "add" && h > f.length)
|
|
1185
1259
|
throw new ce("The specified index MUST NOT be greater than the number of elements in the array", "OPERATION_VALUE_OUT_OF_BOUNDS", i, t, e);
|
|
1186
|
-
var s =
|
|
1260
|
+
var s = jr[t.op].call(t, f, h, e);
|
|
1187
1261
|
if (s.test === !1)
|
|
1188
1262
|
throw new ce("Test operation failed", "TEST_OPERATION_FAILED", i, t, e);
|
|
1189
1263
|
return s;
|
|
1190
1264
|
}
|
|
1191
1265
|
} else if (l >= y) {
|
|
1192
|
-
var s =
|
|
1266
|
+
var s = Ke[t.op].call(t, f, h, e);
|
|
1193
1267
|
if (s.test === !1)
|
|
1194
1268
|
throw new ce("Test operation failed", "TEST_OPERATION_FAILED", i, t, e);
|
|
1195
1269
|
return s;
|
|
1196
1270
|
}
|
|
1197
|
-
if (
|
|
1271
|
+
if (f = f[h], r && l < y && (!f || typeof f != "object"))
|
|
1198
1272
|
throw new ce("Cannot perform operation at the desired path", "OPERATION_PATH_UNRESOLVABLE", i, t, e);
|
|
1199
1273
|
}
|
|
1200
1274
|
}
|
|
1201
1275
|
}
|
|
1202
|
-
function
|
|
1276
|
+
function Vt(e, t, r, n, o) {
|
|
1203
1277
|
if (n === void 0 && (n = !0), o === void 0 && (o = !0), r && !Array.isArray(t))
|
|
1204
1278
|
throw new ce("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
|
|
1205
|
-
n || (e =
|
|
1279
|
+
n || (e = Oe(e));
|
|
1206
1280
|
for (var i = new Array(t.length), s = 0, c = t.length; s < c; s++)
|
|
1207
|
-
i[s] =
|
|
1281
|
+
i[s] = He(e, t[s], r, !0, o, s), e = i[s].newDocument;
|
|
1208
1282
|
return i.newDocument = e, i;
|
|
1209
1283
|
}
|
|
1210
|
-
function
|
|
1211
|
-
var n =
|
|
1284
|
+
function Dr(e, t, r) {
|
|
1285
|
+
var n = He(e, t);
|
|
1212
1286
|
if (n.test === !1)
|
|
1213
1287
|
throw new ce("Test operation failed", "TEST_OPERATION_FAILED", r, t, e);
|
|
1214
1288
|
return n.newDocument;
|
|
1215
1289
|
}
|
|
1216
|
-
function
|
|
1290
|
+
function Ot(e, t, r, n) {
|
|
1217
1291
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
1218
1292
|
throw new ce("Operation is not an object", "OPERATION_NOT_AN_OBJECT", t, e, r);
|
|
1219
|
-
if (
|
|
1293
|
+
if (Ke[e.op]) {
|
|
1220
1294
|
if (typeof e.path != "string")
|
|
1221
1295
|
throw new ce("Operation `path` property is not a string", "OPERATION_PATH_INVALID", t, e, r);
|
|
1222
1296
|
if (e.path.indexOf("/") !== 0 && e.path.length > 0)
|
|
@@ -1225,7 +1299,7 @@ function pt(e, t, r, n) {
|
|
|
1225
1299
|
throw new ce("Operation `from` property is not present (applicable in `move` and `copy` operations)", "OPERATION_FROM_REQUIRED", t, e, r);
|
|
1226
1300
|
if ((e.op === "add" || e.op === "replace" || e.op === "test") && e.value === void 0)
|
|
1227
1301
|
throw new ce("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)", "OPERATION_VALUE_REQUIRED", t, e, r);
|
|
1228
|
-
if ((e.op === "add" || e.op === "replace" || e.op === "test") &&
|
|
1302
|
+
if ((e.op === "add" || e.op === "replace" || e.op === "test") && Bt(e.value))
|
|
1229
1303
|
throw new ce("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)", "OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED", t, e, r);
|
|
1230
1304
|
if (r) {
|
|
1231
1305
|
if (e.op == "add") {
|
|
@@ -1236,21 +1310,21 @@ function pt(e, t, r, n) {
|
|
|
1236
1310
|
if (e.path !== n)
|
|
1237
1311
|
throw new ce("Cannot perform the operation at a path that does not exist", "OPERATION_PATH_UNRESOLVABLE", t, e, r);
|
|
1238
1312
|
} else if (e.op === "move" || e.op === "copy") {
|
|
1239
|
-
var s = { op: "_get", path: e.from, value: void 0 }, c =
|
|
1313
|
+
var s = { op: "_get", path: e.from, value: void 0 }, c = Nn([s], r);
|
|
1240
1314
|
if (c && c.name === "OPERATION_PATH_UNRESOLVABLE")
|
|
1241
1315
|
throw new ce("Cannot perform the operation from a path that does not exist", "OPERATION_FROM_UNRESOLVABLE", t, e, r);
|
|
1242
1316
|
}
|
|
1243
1317
|
}
|
|
1244
1318
|
} else throw new ce("Operation `op` property is not one of operations defined in RFC-6902", "OPERATION_OP_INVALID", t, e, r);
|
|
1245
1319
|
}
|
|
1246
|
-
function
|
|
1320
|
+
function Nn(e, t, r) {
|
|
1247
1321
|
try {
|
|
1248
1322
|
if (!Array.isArray(e))
|
|
1249
1323
|
throw new ce("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
|
|
1250
1324
|
if (t)
|
|
1251
|
-
|
|
1325
|
+
Vt(Oe(t), Oe(e), r || !0);
|
|
1252
1326
|
else {
|
|
1253
|
-
r = r ||
|
|
1327
|
+
r = r || Ot;
|
|
1254
1328
|
for (var n = 0; n < e.length; n++)
|
|
1255
1329
|
r(e[n], n, t, void 0);
|
|
1256
1330
|
}
|
|
@@ -1260,7 +1334,7 @@ function dn(e, t, r) {
|
|
|
1260
1334
|
throw o;
|
|
1261
1335
|
}
|
|
1262
1336
|
}
|
|
1263
|
-
function
|
|
1337
|
+
function lt(e, t) {
|
|
1264
1338
|
if (e === t)
|
|
1265
1339
|
return !0;
|
|
1266
1340
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
@@ -1269,7 +1343,7 @@ function et(e, t) {
|
|
|
1269
1343
|
if (i = e.length, i != t.length)
|
|
1270
1344
|
return !1;
|
|
1271
1345
|
for (o = i; o-- !== 0; )
|
|
1272
|
-
if (!
|
|
1346
|
+
if (!lt(e[o], t[o]))
|
|
1273
1347
|
return !1;
|
|
1274
1348
|
return !0;
|
|
1275
1349
|
}
|
|
@@ -1282,30 +1356,30 @@ function et(e, t) {
|
|
|
1282
1356
|
if (!t.hasOwnProperty(c[o]))
|
|
1283
1357
|
return !1;
|
|
1284
1358
|
for (o = i; o-- !== 0; )
|
|
1285
|
-
if (s = c[o], !
|
|
1359
|
+
if (s = c[o], !lt(e[s], t[s]))
|
|
1286
1360
|
return !1;
|
|
1287
1361
|
return !0;
|
|
1288
1362
|
}
|
|
1289
1363
|
return e !== e && t !== t;
|
|
1290
1364
|
}
|
|
1291
|
-
const
|
|
1365
|
+
const xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1292
1366
|
__proto__: null,
|
|
1293
1367
|
JsonPatchError: ce,
|
|
1294
|
-
_areEquals:
|
|
1295
|
-
applyOperation:
|
|
1296
|
-
applyPatch:
|
|
1297
|
-
applyReducer:
|
|
1298
|
-
deepClone:
|
|
1299
|
-
getValueByPointer:
|
|
1300
|
-
validate:
|
|
1301
|
-
validator:
|
|
1368
|
+
_areEquals: lt,
|
|
1369
|
+
applyOperation: He,
|
|
1370
|
+
applyPatch: Vt,
|
|
1371
|
+
applyReducer: Dr,
|
|
1372
|
+
deepClone: Rr,
|
|
1373
|
+
getValueByPointer: wt,
|
|
1374
|
+
validate: Nn,
|
|
1375
|
+
validator: Ot
|
|
1302
1376
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1303
1377
|
/*!
|
|
1304
1378
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
1305
1379
|
* (c) 2017-2021 Joachim Wester
|
|
1306
1380
|
* MIT license
|
|
1307
1381
|
*/
|
|
1308
|
-
var
|
|
1382
|
+
var Jt = /* @__PURE__ */ new WeakMap(), Mr = (
|
|
1309
1383
|
/** @class */
|
|
1310
1384
|
/* @__PURE__ */ (function() {
|
|
1311
1385
|
function e(t) {
|
|
@@ -1313,7 +1387,7 @@ var Pt = /* @__PURE__ */ new WeakMap(), Tr = (
|
|
|
1313
1387
|
}
|
|
1314
1388
|
return e;
|
|
1315
1389
|
})()
|
|
1316
|
-
),
|
|
1390
|
+
), $r = (
|
|
1317
1391
|
/** @class */
|
|
1318
1392
|
/* @__PURE__ */ (function() {
|
|
1319
1393
|
function e(t, r) {
|
|
@@ -1322,95 +1396,95 @@ var Pt = /* @__PURE__ */ new WeakMap(), Tr = (
|
|
|
1322
1396
|
return e;
|
|
1323
1397
|
})()
|
|
1324
1398
|
);
|
|
1325
|
-
function
|
|
1326
|
-
return
|
|
1399
|
+
function Br(e) {
|
|
1400
|
+
return Jt.get(e);
|
|
1327
1401
|
}
|
|
1328
|
-
function
|
|
1402
|
+
function Fr(e, t) {
|
|
1329
1403
|
return e.observers.get(t);
|
|
1330
1404
|
}
|
|
1331
|
-
function
|
|
1405
|
+
function Ur(e, t) {
|
|
1332
1406
|
e.observers.delete(t.callback);
|
|
1333
1407
|
}
|
|
1334
|
-
function
|
|
1408
|
+
function Vr(e, t) {
|
|
1335
1409
|
t.unobserve();
|
|
1336
1410
|
}
|
|
1337
|
-
function
|
|
1338
|
-
var r = [], n, o =
|
|
1411
|
+
function Jr(e, t) {
|
|
1412
|
+
var r = [], n, o = Br(e);
|
|
1339
1413
|
if (!o)
|
|
1340
|
-
o = new
|
|
1414
|
+
o = new Mr(e), Jt.set(e, o);
|
|
1341
1415
|
else {
|
|
1342
|
-
var i =
|
|
1416
|
+
var i = Fr(o, t);
|
|
1343
1417
|
n = i && i.observer;
|
|
1344
1418
|
}
|
|
1345
1419
|
if (n)
|
|
1346
1420
|
return n;
|
|
1347
|
-
if (n = {}, o.value =
|
|
1421
|
+
if (n = {}, o.value = Oe(e), t) {
|
|
1348
1422
|
n.callback = t, n.next = null;
|
|
1349
1423
|
var s = function() {
|
|
1350
|
-
|
|
1424
|
+
Ft(n);
|
|
1351
1425
|
}, c = function() {
|
|
1352
1426
|
clearTimeout(n.next), n.next = setTimeout(s);
|
|
1353
1427
|
};
|
|
1354
1428
|
typeof window < "u" && (window.addEventListener("mouseup", c), window.addEventListener("keyup", c), window.addEventListener("mousedown", c), window.addEventListener("keydown", c), window.addEventListener("change", c));
|
|
1355
1429
|
}
|
|
1356
1430
|
return n.patches = r, n.object = e, n.unobserve = function() {
|
|
1357
|
-
|
|
1358
|
-
}, o.observers.set(t, new
|
|
1431
|
+
Ft(n), clearTimeout(n.next), Ur(o, n), typeof window < "u" && (window.removeEventListener("mouseup", c), window.removeEventListener("keyup", c), window.removeEventListener("mousedown", c), window.removeEventListener("keydown", c), window.removeEventListener("change", c));
|
|
1432
|
+
}, o.observers.set(t, new $r(t, n)), n;
|
|
1359
1433
|
}
|
|
1360
|
-
function
|
|
1434
|
+
function Ft(e, t) {
|
|
1361
1435
|
t === void 0 && (t = !1);
|
|
1362
|
-
var r =
|
|
1363
|
-
|
|
1436
|
+
var r = Jt.get(e.object);
|
|
1437
|
+
Ht(r.value, e.object, e.patches, "", t), e.patches.length && Vt(r.value, e.patches);
|
|
1364
1438
|
var n = e.patches;
|
|
1365
1439
|
return n.length > 0 && (e.patches = [], e.callback && e.callback(n)), n;
|
|
1366
1440
|
}
|
|
1367
|
-
function
|
|
1441
|
+
function Ht(e, t, r, n, o) {
|
|
1368
1442
|
if (t !== e) {
|
|
1369
1443
|
typeof t.toJSON == "function" && (t = t.toJSON());
|
|
1370
|
-
for (var i =
|
|
1371
|
-
var
|
|
1372
|
-
if (
|
|
1373
|
-
var y = t[
|
|
1374
|
-
typeof l == "object" && l != null && typeof y == "object" && y != null && Array.isArray(l) === Array.isArray(y) ?
|
|
1375
|
-
} else Array.isArray(e) === Array.isArray(t) ? (o && r.push({ op: "test", path: n + "/" +
|
|
1444
|
+
for (var i = Mt(t), s = Mt(e), c = !1, a = s.length - 1; a >= 0; a--) {
|
|
1445
|
+
var f = s[a], l = e[f];
|
|
1446
|
+
if (xt(t, f) && !(t[f] === void 0 && l !== void 0 && Array.isArray(t) === !1)) {
|
|
1447
|
+
var y = t[f];
|
|
1448
|
+
typeof l == "object" && l != null && typeof y == "object" && y != null && Array.isArray(l) === Array.isArray(y) ? Ht(l, y, r, n + "/" + Je(f), o) : l !== y && (o && r.push({ op: "test", path: n + "/" + Je(f), value: Oe(l) }), r.push({ op: "replace", path: n + "/" + Je(f), value: Oe(y) }));
|
|
1449
|
+
} else Array.isArray(e) === Array.isArray(t) ? (o && r.push({ op: "test", path: n + "/" + Je(f), value: Oe(l) }), r.push({ op: "remove", path: n + "/" + Je(f) }), c = !0) : (o && r.push({ op: "test", path: n, value: e }), r.push({ op: "replace", path: n, value: t }));
|
|
1376
1450
|
}
|
|
1377
1451
|
if (!(!c && i.length == s.length))
|
|
1378
1452
|
for (var a = 0; a < i.length; a++) {
|
|
1379
|
-
var
|
|
1380
|
-
!
|
|
1453
|
+
var f = i[a];
|
|
1454
|
+
!xt(e, f) && t[f] !== void 0 && r.push({ op: "add", path: n + "/" + Je(f), value: Oe(t[f]) });
|
|
1381
1455
|
}
|
|
1382
1456
|
}
|
|
1383
1457
|
}
|
|
1384
|
-
function
|
|
1458
|
+
function Qe(e, t, r) {
|
|
1385
1459
|
r === void 0 && (r = !1);
|
|
1386
1460
|
var n = [];
|
|
1387
|
-
return
|
|
1461
|
+
return Ht(e, t, n, "", r), n;
|
|
1388
1462
|
}
|
|
1389
|
-
const
|
|
1463
|
+
const Hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1390
1464
|
__proto__: null,
|
|
1391
|
-
compare:
|
|
1392
|
-
generate:
|
|
1393
|
-
observe:
|
|
1394
|
-
unobserve:
|
|
1465
|
+
compare: Qe,
|
|
1466
|
+
generate: Ft,
|
|
1467
|
+
observe: Jr,
|
|
1468
|
+
unobserve: Vr
|
|
1395
1469
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1396
|
-
Object.assign({},
|
|
1397
|
-
JsonPatchError:
|
|
1398
|
-
deepClone:
|
|
1399
|
-
escapePathComponent:
|
|
1400
|
-
unescapePathComponent:
|
|
1470
|
+
Object.assign({}, xr, Hr, {
|
|
1471
|
+
JsonPatchError: An,
|
|
1472
|
+
deepClone: Oe,
|
|
1473
|
+
escapePathComponent: Je,
|
|
1474
|
+
unescapePathComponent: On
|
|
1401
1475
|
});
|
|
1402
|
-
const
|
|
1403
|
-
function
|
|
1404
|
-
return !!(e[
|
|
1476
|
+
const Nt = "oneOf", Gt = "anyOf", Wt = "allOf";
|
|
1477
|
+
function qt(e) {
|
|
1478
|
+
return !!(e[Nt] || e[Gt] || e[Wt]);
|
|
1405
1479
|
}
|
|
1406
|
-
function
|
|
1407
|
-
const t = e[
|
|
1480
|
+
function En(e) {
|
|
1481
|
+
const t = e[Nt] || e[Gt] || e[Wt];
|
|
1408
1482
|
return Array.isArray(t) ? t : void 0;
|
|
1409
1483
|
}
|
|
1410
|
-
function
|
|
1411
|
-
return e.oneOf ?
|
|
1484
|
+
function mt(e) {
|
|
1485
|
+
return e.oneOf ? Nt : e.anyOf ? Gt : e.allOf ? Wt : "";
|
|
1412
1486
|
}
|
|
1413
|
-
function
|
|
1487
|
+
function Gr(e, t) {
|
|
1414
1488
|
if (typeof t != "object" || t === null || Array.isArray(t))
|
|
1415
1489
|
return null;
|
|
1416
1490
|
const r = t, n = /* @__PURE__ */ new Set();
|
|
@@ -1425,7 +1499,7 @@ function jr(e, t) {
|
|
|
1425
1499
|
return { field: o, value: r[o] };
|
|
1426
1500
|
return null;
|
|
1427
1501
|
}
|
|
1428
|
-
function
|
|
1502
|
+
function yt(e, t, r = Nt) {
|
|
1429
1503
|
var n;
|
|
1430
1504
|
if (t.length === 0)
|
|
1431
1505
|
throw new Error("No variants provided to chooseSubschemaSync");
|
|
@@ -1436,7 +1510,7 @@ function at(e, t, r = ht) {
|
|
|
1436
1510
|
return { selectedIndex: o, schema: i };
|
|
1437
1511
|
}
|
|
1438
1512
|
if (typeof e == "object" && e !== null && !Array.isArray(e)) {
|
|
1439
|
-
const o = e, i =
|
|
1513
|
+
const o = e, i = Gr(t, e);
|
|
1440
1514
|
if (i)
|
|
1441
1515
|
for (let s = 0; s < t.length; s++) {
|
|
1442
1516
|
const c = t[s], a = (n = c.properties) == null ? void 0 : n[i.field];
|
|
@@ -1449,10 +1523,10 @@ function at(e, t, r = ht) {
|
|
|
1449
1523
|
const a = c.required || [];
|
|
1450
1524
|
if (a.every((l) => l in o) && a.length > 0) {
|
|
1451
1525
|
let l = !0;
|
|
1452
|
-
for (const [y,
|
|
1453
|
-
if (
|
|
1454
|
-
const
|
|
1455
|
-
if (o[y] !==
|
|
1526
|
+
for (const [y, d] of Object.entries(c.properties))
|
|
1527
|
+
if (d && typeof d == "object" && "const" in d) {
|
|
1528
|
+
const h = d.const;
|
|
1529
|
+
if (o[y] !== h) {
|
|
1456
1530
|
l = !1;
|
|
1457
1531
|
break;
|
|
1458
1532
|
}
|
|
@@ -1478,32 +1552,39 @@ function at(e, t, r = ht) {
|
|
|
1478
1552
|
}
|
|
1479
1553
|
return { selectedIndex: 0, schema: t[0] };
|
|
1480
1554
|
}
|
|
1481
|
-
function
|
|
1482
|
-
|
|
1483
|
-
|
|
1555
|
+
function Wr(e) {
|
|
1556
|
+
if (typeof e == "object" && e !== null) {
|
|
1557
|
+
const t = Sr(e, { deep: !0 });
|
|
1558
|
+
return JSON.stringify(t, null, 2);
|
|
1559
|
+
}
|
|
1560
|
+
return JSON.stringify(e, null, 2);
|
|
1561
|
+
}
|
|
1562
|
+
function Ut(e, t, r) {
|
|
1563
|
+
const n = !he(e, t), o = !he(e, r);
|
|
1564
|
+
return n && o ? he(t, r) ? $.SAME_CHANGE : $.TRUE_CONFLICT : n ? $.INPUT1_ONLY : o ? $.INPUT2_ONLY : $.SAME_CHANGE;
|
|
1484
1565
|
}
|
|
1485
|
-
function
|
|
1566
|
+
function xe(e, t) {
|
|
1486
1567
|
try {
|
|
1487
|
-
const r =
|
|
1568
|
+
const r = bn(e);
|
|
1488
1569
|
if (!r)
|
|
1489
1570
|
return { start: 1, end: 1 };
|
|
1490
1571
|
const n = t.split("/").filter(Boolean).map((s) => {
|
|
1491
1572
|
const c = Number.parseInt(s, 10);
|
|
1492
1573
|
return !Number.isNaN(c) && String(c) === s ? c : s;
|
|
1493
|
-
}), o = n.length === 0 ? r :
|
|
1574
|
+
}), o = n.length === 0 ? r : wn(r, n);
|
|
1494
1575
|
return o ? {
|
|
1495
|
-
start:
|
|
1496
|
-
end:
|
|
1576
|
+
start: hn(e, o.offset),
|
|
1577
|
+
end: hn(e, o.offset + o.length)
|
|
1497
1578
|
} : { start: 1, end: 1 };
|
|
1498
1579
|
} catch {
|
|
1499
1580
|
return { start: 1, end: 1 };
|
|
1500
1581
|
}
|
|
1501
1582
|
}
|
|
1502
|
-
function
|
|
1583
|
+
function hn(e, t) {
|
|
1503
1584
|
return e.substring(0, t).split(`
|
|
1504
1585
|
`).length;
|
|
1505
1586
|
}
|
|
1506
|
-
function
|
|
1587
|
+
function qr(e, t) {
|
|
1507
1588
|
const r = /* @__PURE__ */ new Map(), n = (o) => {
|
|
1508
1589
|
const i = o.split("/").filter(Boolean);
|
|
1509
1590
|
return i.length > 0 ? `/${i[0]}` : "/";
|
|
@@ -1522,150 +1603,150 @@ function Dr(e, t) {
|
|
|
1522
1603
|
}
|
|
1523
1604
|
return r;
|
|
1524
1605
|
}
|
|
1525
|
-
function
|
|
1526
|
-
const s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(),
|
|
1527
|
-
for (const
|
|
1528
|
-
const
|
|
1529
|
-
if (
|
|
1530
|
-
const
|
|
1531
|
-
c.has(
|
|
1532
|
-
const
|
|
1533
|
-
|
|
1606
|
+
function Yr(e, t, r, n, o, i) {
|
|
1607
|
+
const s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), f = [], l = [];
|
|
1608
|
+
for (const m of e) {
|
|
1609
|
+
const g = m.path.match(/^(\/[^/]+(?:\/[^/]+)*)\/(\d+)(?:\/|$)/);
|
|
1610
|
+
if (g) {
|
|
1611
|
+
const O = g[1];
|
|
1612
|
+
c.has(O) || c.set(O, []);
|
|
1613
|
+
const u = c.get(O);
|
|
1614
|
+
u && u.push(m);
|
|
1534
1615
|
} else
|
|
1535
|
-
|
|
1536
|
-
}
|
|
1537
|
-
for (const
|
|
1538
|
-
const
|
|
1539
|
-
if (
|
|
1540
|
-
const
|
|
1541
|
-
a.has(
|
|
1542
|
-
const
|
|
1543
|
-
|
|
1616
|
+
f.push(m);
|
|
1617
|
+
}
|
|
1618
|
+
for (const m of t) {
|
|
1619
|
+
const g = m.path.match(/^(\/[^/]+(?:\/[^/]+)*)\/(\d+)(?:\/|$)/);
|
|
1620
|
+
if (g) {
|
|
1621
|
+
const O = g[1];
|
|
1622
|
+
a.has(O) || a.set(O, []);
|
|
1623
|
+
const u = a.get(O);
|
|
1624
|
+
u && u.push(m);
|
|
1544
1625
|
} else
|
|
1545
|
-
l.push(
|
|
1626
|
+
l.push(m);
|
|
1546
1627
|
}
|
|
1547
1628
|
const y = /* @__PURE__ */ new Set([...c.keys(), ...a.keys()]);
|
|
1548
|
-
for (const
|
|
1549
|
-
const
|
|
1550
|
-
if (!Array.isArray(
|
|
1551
|
-
const
|
|
1552
|
-
for (const M of
|
|
1553
|
-
const
|
|
1554
|
-
if (
|
|
1555
|
-
const
|
|
1556
|
-
s.has(
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1629
|
+
for (const m of y) {
|
|
1630
|
+
const g = J(r, m), O = J(n, m), u = J(o, m);
|
|
1631
|
+
if (!Array.isArray(g) || !Array.isArray(O) || !Array.isArray(u)) {
|
|
1632
|
+
const P = c.get(m) || [], x = a.get(m) || [];
|
|
1633
|
+
for (const M of P) {
|
|
1634
|
+
const B = M.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1635
|
+
if (B) {
|
|
1636
|
+
const F = B[1];
|
|
1637
|
+
s.has(F) || s.set(F, { patches1: [], patches2: [] });
|
|
1638
|
+
const L = s.get(F);
|
|
1639
|
+
L && L.patches1.push(M);
|
|
1559
1640
|
}
|
|
1560
1641
|
}
|
|
1561
|
-
for (const M of
|
|
1562
|
-
const
|
|
1563
|
-
if (
|
|
1564
|
-
const
|
|
1565
|
-
s.has(
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1642
|
+
for (const M of x) {
|
|
1643
|
+
const B = M.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1644
|
+
if (B) {
|
|
1645
|
+
const F = B[1];
|
|
1646
|
+
s.has(F) || s.set(F, { patches1: [], patches2: [] });
|
|
1647
|
+
const L = s.get(F);
|
|
1648
|
+
L && L.patches2.push(M);
|
|
1568
1649
|
}
|
|
1569
1650
|
}
|
|
1570
1651
|
continue;
|
|
1571
1652
|
}
|
|
1572
|
-
const
|
|
1573
|
-
if (
|
|
1574
|
-
const
|
|
1575
|
-
if (
|
|
1576
|
-
const
|
|
1577
|
-
for (const [
|
|
1578
|
-
|
|
1579
|
-
const
|
|
1580
|
-
for (const
|
|
1581
|
-
const
|
|
1582
|
-
if (
|
|
1583
|
-
const
|
|
1584
|
-
if (
|
|
1585
|
-
const ae = `${
|
|
1653
|
+
const A = Ze(i, m, r), S = A != null && A.items ? Array.isArray(A.items) && A.items[0] ? A.items[0] : Array.isArray(A.items) ? null : A.items : null, p = S && typeof S == "object" ? S : null;
|
|
1654
|
+
if (p) {
|
|
1655
|
+
const P = Xr(g, O, u, p);
|
|
1656
|
+
if (P.size > 0) {
|
|
1657
|
+
const x = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
|
|
1658
|
+
for (const [I, D] of P.entries())
|
|
1659
|
+
D.base !== void 0 && x.set(D.base, I), D.input1 !== void 0 && M.set(D.input1, I), D.input2 !== void 0 && B.set(D.input2, I);
|
|
1660
|
+
const F = c.get(m) || [], L = a.get(m) || [];
|
|
1661
|
+
for (const I of F) {
|
|
1662
|
+
const D = I.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
|
|
1663
|
+
if (D) {
|
|
1664
|
+
const K = Number.parseInt(D[1], 10), ie = M.get(K);
|
|
1665
|
+
if (ie !== void 0) {
|
|
1666
|
+
const ae = `${m}#${ie}`;
|
|
1586
1667
|
s.has(ae) || s.set(ae, { patches1: [], patches2: [] });
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1668
|
+
const ge = s.get(ae);
|
|
1669
|
+
ge && ge.patches1.push(I);
|
|
1589
1670
|
}
|
|
1590
1671
|
}
|
|
1591
1672
|
}
|
|
1592
|
-
for (const
|
|
1593
|
-
const
|
|
1594
|
-
if (
|
|
1595
|
-
const
|
|
1596
|
-
if (
|
|
1597
|
-
const ae = `${
|
|
1673
|
+
for (const I of L) {
|
|
1674
|
+
const D = I.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
|
|
1675
|
+
if (D) {
|
|
1676
|
+
const K = Number.parseInt(D[1], 10), ie = B.get(K);
|
|
1677
|
+
if (ie !== void 0) {
|
|
1678
|
+
const ae = `${m}#${ie}`;
|
|
1598
1679
|
s.has(ae) || s.set(ae, { patches1: [], patches2: [] });
|
|
1599
|
-
const
|
|
1600
|
-
|
|
1680
|
+
const ge = s.get(ae);
|
|
1681
|
+
ge && ge.patches2.push(I);
|
|
1601
1682
|
}
|
|
1602
1683
|
}
|
|
1603
1684
|
}
|
|
1604
1685
|
continue;
|
|
1605
1686
|
}
|
|
1606
1687
|
}
|
|
1607
|
-
const
|
|
1608
|
-
for (const
|
|
1609
|
-
const
|
|
1610
|
-
if (
|
|
1611
|
-
const M =
|
|
1688
|
+
const v = c.get(m) || [], R = a.get(m) || [];
|
|
1689
|
+
for (const P of v) {
|
|
1690
|
+
const x = P.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1691
|
+
if (x) {
|
|
1692
|
+
const M = x[1];
|
|
1612
1693
|
s.has(M) || s.set(M, { patches1: [], patches2: [] });
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1694
|
+
const B = s.get(M);
|
|
1695
|
+
B && B.patches1.push(P);
|
|
1615
1696
|
}
|
|
1616
1697
|
}
|
|
1617
|
-
for (const
|
|
1618
|
-
const
|
|
1619
|
-
if (
|
|
1620
|
-
const M =
|
|
1698
|
+
for (const P of R) {
|
|
1699
|
+
const x = P.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1700
|
+
if (x) {
|
|
1701
|
+
const M = x[1];
|
|
1621
1702
|
s.has(M) || s.set(M, { patches1: [], patches2: [] });
|
|
1622
|
-
const
|
|
1623
|
-
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
const
|
|
1628
|
-
if (!
|
|
1629
|
-
const
|
|
1630
|
-
if (
|
|
1631
|
-
const
|
|
1632
|
-
return
|
|
1633
|
-
},
|
|
1634
|
-
for (const
|
|
1635
|
-
const
|
|
1636
|
-
|
|
1637
|
-
}
|
|
1638
|
-
for (const
|
|
1639
|
-
const
|
|
1640
|
-
|
|
1641
|
-
}
|
|
1642
|
-
for (const
|
|
1643
|
-
s.has(
|
|
1644
|
-
for (const
|
|
1645
|
-
const
|
|
1646
|
-
if (
|
|
1647
|
-
const
|
|
1648
|
-
|
|
1703
|
+
const B = s.get(M);
|
|
1704
|
+
B && B.patches2.push(P);
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
const d = (m, g) => {
|
|
1709
|
+
if (!g) return null;
|
|
1710
|
+
const O = m.split("/").filter(Boolean);
|
|
1711
|
+
if (O.length < 2) return null;
|
|
1712
|
+
const u = `/${O[0]}`, A = Ze(g, u);
|
|
1713
|
+
return A && qt(A) ? u : null;
|
|
1714
|
+
}, h = [...f], T = [...l], N = /* @__PURE__ */ new Set();
|
|
1715
|
+
for (const m of h) {
|
|
1716
|
+
const g = d(m.path, i);
|
|
1717
|
+
g && N.add(g);
|
|
1718
|
+
}
|
|
1719
|
+
for (const m of T) {
|
|
1720
|
+
const g = d(m.path, i);
|
|
1721
|
+
g && N.add(g);
|
|
1722
|
+
}
|
|
1723
|
+
for (const m of N)
|
|
1724
|
+
s.has(m) || s.set(m, { patches1: [], patches2: [] });
|
|
1725
|
+
for (const m of h) {
|
|
1726
|
+
const g = m.path, O = d(g, i);
|
|
1727
|
+
if (O) {
|
|
1728
|
+
const u = s.get(O);
|
|
1729
|
+
u && u.patches1.push(m);
|
|
1649
1730
|
} else {
|
|
1650
|
-
s.has(
|
|
1651
|
-
const
|
|
1652
|
-
|
|
1731
|
+
s.has(g) || s.set(g, { patches1: [], patches2: [] });
|
|
1732
|
+
const u = s.get(g);
|
|
1733
|
+
u && u.patches1.push(m);
|
|
1653
1734
|
}
|
|
1654
1735
|
}
|
|
1655
|
-
for (const
|
|
1656
|
-
const
|
|
1657
|
-
if (
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1736
|
+
for (const m of T) {
|
|
1737
|
+
const g = m.path, O = d(g, i);
|
|
1738
|
+
if (O) {
|
|
1739
|
+
const u = s.get(O);
|
|
1740
|
+
u && u.patches2.push(m);
|
|
1660
1741
|
} else {
|
|
1661
|
-
s.has(
|
|
1662
|
-
const
|
|
1663
|
-
|
|
1742
|
+
s.has(g) || s.set(g, { patches1: [], patches2: [] });
|
|
1743
|
+
const u = s.get(g);
|
|
1744
|
+
u && u.patches2.push(m);
|
|
1664
1745
|
}
|
|
1665
1746
|
}
|
|
1666
1747
|
return s;
|
|
1667
1748
|
}
|
|
1668
|
-
function
|
|
1749
|
+
function Ze(e, t, r) {
|
|
1669
1750
|
if (!e)
|
|
1670
1751
|
return null;
|
|
1671
1752
|
const n = t.split("/").filter(Boolean);
|
|
@@ -1673,14 +1754,14 @@ function qe(e, t, r) {
|
|
|
1673
1754
|
return e;
|
|
1674
1755
|
let o = e, i = "";
|
|
1675
1756
|
for (let s = 0; s < n.length; s++) {
|
|
1676
|
-
const c = n[s], a = Number.parseInt(c, 10),
|
|
1677
|
-
if (o &&
|
|
1678
|
-
const l =
|
|
1757
|
+
const c = n[s], a = Number.parseInt(c, 10), f = !Number.isNaN(a) && String(a) === c;
|
|
1758
|
+
if (o && qt(o)) {
|
|
1759
|
+
const l = En(o), y = mt(o), d = r ? J(r, i || "/") : void 0;
|
|
1679
1760
|
if (l && l.length > 0)
|
|
1680
|
-
if (
|
|
1761
|
+
if (d !== void 0)
|
|
1681
1762
|
try {
|
|
1682
|
-
const { schema:
|
|
1683
|
-
o =
|
|
1763
|
+
const { schema: h } = yt(d, l, y);
|
|
1764
|
+
o = h;
|
|
1684
1765
|
} catch {
|
|
1685
1766
|
l.length > 0 && l[0] && (o = l[0]);
|
|
1686
1767
|
}
|
|
@@ -1689,7 +1770,7 @@ function qe(e, t, r) {
|
|
|
1689
1770
|
}
|
|
1690
1771
|
if (!o)
|
|
1691
1772
|
return null;
|
|
1692
|
-
if (
|
|
1773
|
+
if (f)
|
|
1693
1774
|
if (o.items)
|
|
1694
1775
|
if (Array.isArray(o.items)) {
|
|
1695
1776
|
const l = a < o.items.length ? o.items[a] : null;
|
|
@@ -1707,7 +1788,7 @@ function qe(e, t, r) {
|
|
|
1707
1788
|
}
|
|
1708
1789
|
return o;
|
|
1709
1790
|
}
|
|
1710
|
-
function
|
|
1791
|
+
function Tn(e) {
|
|
1711
1792
|
if (!e || typeof e != "object")
|
|
1712
1793
|
return [];
|
|
1713
1794
|
const t = [];
|
|
@@ -1727,115 +1808,115 @@ function gn(e) {
|
|
|
1727
1808
|
}
|
|
1728
1809
|
return t;
|
|
1729
1810
|
}
|
|
1730
|
-
function
|
|
1731
|
-
const t =
|
|
1811
|
+
function zr(e) {
|
|
1812
|
+
const t = Tn(e);
|
|
1732
1813
|
return t.length > 0 ? t[0] : null;
|
|
1733
1814
|
}
|
|
1734
|
-
function
|
|
1735
|
-
const n = /* @__PURE__ */ new Map(), o =
|
|
1815
|
+
function Cr(e, t, r) {
|
|
1816
|
+
const n = /* @__PURE__ */ new Map(), o = Tn(r);
|
|
1736
1817
|
if (o.length === 0)
|
|
1737
1818
|
return n;
|
|
1738
1819
|
const i = (c) => {
|
|
1739
1820
|
if (typeof c != "object" || c === null)
|
|
1740
1821
|
return null;
|
|
1741
|
-
const a = c,
|
|
1822
|
+
const a = c, f = [];
|
|
1742
1823
|
for (const l of o) {
|
|
1743
1824
|
const y = a[l];
|
|
1744
|
-
y != null &&
|
|
1825
|
+
y != null && f.push(`${l}:${JSON.stringify(y)}`);
|
|
1745
1826
|
}
|
|
1746
|
-
return
|
|
1827
|
+
return f.length > 0 ? f.join("|") : null;
|
|
1747
1828
|
}, s = (c, a) => {
|
|
1748
|
-
c.forEach((
|
|
1749
|
-
const y = i(
|
|
1829
|
+
c.forEach((f, l) => {
|
|
1830
|
+
const y = i(f);
|
|
1750
1831
|
if (y) {
|
|
1751
1832
|
n.has(y) || n.set(y, {});
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1833
|
+
const d = n.get(y);
|
|
1834
|
+
d && (d[a] = l);
|
|
1754
1835
|
}
|
|
1755
1836
|
});
|
|
1756
1837
|
};
|
|
1757
1838
|
return s(e, "input1"), s(t, "input2"), n;
|
|
1758
1839
|
}
|
|
1759
|
-
function
|
|
1760
|
-
const o = /* @__PURE__ */ new Map(), i =
|
|
1840
|
+
function Xr(e, t, r, n) {
|
|
1841
|
+
const o = /* @__PURE__ */ new Map(), i = zr(n);
|
|
1761
1842
|
if (!i)
|
|
1762
1843
|
return o;
|
|
1763
1844
|
const s = (c, a) => {
|
|
1764
|
-
c.forEach((
|
|
1765
|
-
if (typeof
|
|
1766
|
-
const y =
|
|
1845
|
+
c.forEach((f, l) => {
|
|
1846
|
+
if (typeof f == "object" && f !== null) {
|
|
1847
|
+
const y = f[i];
|
|
1767
1848
|
if (y != null) {
|
|
1768
|
-
const
|
|
1769
|
-
o.has(
|
|
1770
|
-
const
|
|
1771
|
-
|
|
1849
|
+
const d = String(y);
|
|
1850
|
+
o.has(d) || o.set(d, {});
|
|
1851
|
+
const h = o.get(d);
|
|
1852
|
+
h && (h[a] = l);
|
|
1772
1853
|
}
|
|
1773
1854
|
}
|
|
1774
1855
|
});
|
|
1775
1856
|
};
|
|
1776
1857
|
return s(e, "base"), s(t, "input1"), s(r, "input2"), o;
|
|
1777
1858
|
}
|
|
1778
|
-
function
|
|
1779
|
-
const o = typeof e == "object" && e !== null || Array.isArray(e) ? e : {}, i = typeof t == "object" && t !== null || Array.isArray(t) ? t : {}, s = typeof r == "object" && r !== null || Array.isArray(r) ? r : {}, c =
|
|
1780
|
-
let
|
|
1781
|
-
n && (
|
|
1782
|
-
const l = [], y = /* @__PURE__ */ new Set(),
|
|
1783
|
-
if (!n || typeof
|
|
1784
|
-
const
|
|
1785
|
-
if (!
|
|
1786
|
-
const
|
|
1787
|
-
if (!
|
|
1788
|
-
const
|
|
1789
|
-
return
|
|
1859
|
+
function Kr(e, t, r, n) {
|
|
1860
|
+
const o = typeof e == "object" && e !== null || Array.isArray(e) ? e : {}, i = typeof t == "object" && t !== null || Array.isArray(t) ? t : {}, s = typeof r == "object" && r !== null || Array.isArray(r) ? r : {}, c = Qe(o, i), a = Qe(o, s);
|
|
1861
|
+
let f = qr(c, a);
|
|
1862
|
+
n && (f = Yr(c, a, e, t, r, n));
|
|
1863
|
+
const l = [], y = /* @__PURE__ */ new Set(), d = (h, T, N, m) => {
|
|
1864
|
+
if (!n || typeof T != "object" || T === null || Array.isArray(T) || typeof N != "object" || N === null || Array.isArray(N) || typeof m != "object" || m === null || Array.isArray(m)) return !1;
|
|
1865
|
+
const g = Ze(n, h, T);
|
|
1866
|
+
if (!g || !qt(g)) return !1;
|
|
1867
|
+
const O = En(g);
|
|
1868
|
+
if (!O || O.length < 2) return !1;
|
|
1869
|
+
const u = yt(T, O, mt(g)), A = yt(N, O, mt(g)), S = yt(m, O, mt(g));
|
|
1870
|
+
return A.selectedIndex !== S.selectedIndex && (u.selectedIndex !== A.selectedIndex || u.selectedIndex !== S.selectedIndex);
|
|
1790
1871
|
};
|
|
1791
|
-
for (const [
|
|
1792
|
-
y.add(
|
|
1793
|
-
let
|
|
1794
|
-
|
|
1795
|
-
let
|
|
1796
|
-
if (
|
|
1797
|
-
|
|
1872
|
+
for (const [h, { patches1: T, patches2: N }] of f) {
|
|
1873
|
+
y.add(h);
|
|
1874
|
+
let m = h;
|
|
1875
|
+
T.length > 0 ? m = T[0].path : N.length > 0 ? m = N[0].path : h.includes("#") && (m = h.split("#")[0]);
|
|
1876
|
+
let g = h;
|
|
1877
|
+
if (h.includes("#"))
|
|
1878
|
+
g = h.split("#")[0];
|
|
1798
1879
|
else {
|
|
1799
|
-
const M =
|
|
1800
|
-
M.length > 1 && (
|
|
1801
|
-
}
|
|
1802
|
-
if ([...
|
|
1803
|
-
const M =
|
|
1804
|
-
if (
|
|
1805
|
-
const
|
|
1806
|
-
let
|
|
1807
|
-
!
|
|
1808
|
-
const ae = [...
|
|
1809
|
-
(
|
|
1810
|
-
),
|
|
1811
|
-
for (const
|
|
1812
|
-
const
|
|
1813
|
-
let
|
|
1814
|
-
|
|
1880
|
+
const M = h.split("/").filter(Boolean);
|
|
1881
|
+
M.length > 1 && (g = `/${M[0]}`);
|
|
1882
|
+
}
|
|
1883
|
+
if ([...T, ...N].every((M) => (M.path.split("/").slice(0, 2).join("/") || `/${M.path.split("/")[1]}`) === g) && g !== m) {
|
|
1884
|
+
const M = J(e, g), B = J(t, g), F = J(r, g);
|
|
1885
|
+
if (d(g, M, B, F)) {
|
|
1886
|
+
const I = M, D = B, K = F;
|
|
1887
|
+
let ie = Ut(I, D, K);
|
|
1888
|
+
!he(I, D) && !he(I, K) && !he(D, K) && (ie = $.TRUE_CONFLICT);
|
|
1889
|
+
const ae = [...T, ...N].filter(
|
|
1890
|
+
(Ae) => Ae.path.startsWith(`${g}/`) || Ae.path === g
|
|
1891
|
+
), ge = [], Pe = [];
|
|
1892
|
+
for (const Ae of ae) {
|
|
1893
|
+
const $e = Ae.path, Ee = e !== void 0 ? J(e, $e) : void 0, Be = J(t, $e), Z = J(r, $e);
|
|
1894
|
+
let pe = !1, ee = !1;
|
|
1895
|
+
Ae.op === "replace" ? Ee !== void 0 && (pe = !he(Ee, Be), ee = !he(Ee, Z)) : Ae.op === "add" ? (pe = Ee === void 0 && Be !== void 0, ee = Ee === void 0 && Z !== void 0) : Ae.op === "remove" && (pe = Ee !== void 0 && Be === void 0, ee = Ee !== void 0 && Z === void 0), Ee !== void 0 && (Be !== void 0 && he(Ee, Be) && (pe = !1), Z !== void 0 && he(Ee, Z) && (ee = !1)), pe && ge.push(Ae), ee && Pe.push(Ae);
|
|
1815
1896
|
}
|
|
1816
1897
|
l.push({
|
|
1817
|
-
path:
|
|
1818
|
-
baseValue:
|
|
1819
|
-
input1Value:
|
|
1820
|
-
input2Value:
|
|
1821
|
-
conflictType:
|
|
1822
|
-
patches1:
|
|
1823
|
-
patches2:
|
|
1898
|
+
path: g,
|
|
1899
|
+
baseValue: I,
|
|
1900
|
+
input1Value: D,
|
|
1901
|
+
input2Value: K,
|
|
1902
|
+
conflictType: ie,
|
|
1903
|
+
patches1: ge,
|
|
1904
|
+
patches2: Pe
|
|
1824
1905
|
});
|
|
1825
1906
|
continue;
|
|
1826
1907
|
}
|
|
1827
1908
|
}
|
|
1828
|
-
const
|
|
1829
|
-
let
|
|
1830
|
-
const
|
|
1831
|
-
!
|
|
1832
|
-
path:
|
|
1909
|
+
const u = J(e, m), A = J(t, m), S = J(r, m);
|
|
1910
|
+
let p = Ut(u, A, S);
|
|
1911
|
+
const v = u != null, R = A != null, P = S != null;
|
|
1912
|
+
!v && R && P && p !== $.SAME_CHANGE && (p = $.TRUE_CONFLICT), v && he(u, A) && he(u, S) || l.push({
|
|
1913
|
+
path: m,
|
|
1833
1914
|
// Use representative path for conflict (actual patch paths are in patches1/patches2)
|
|
1834
|
-
baseValue:
|
|
1835
|
-
input1Value:
|
|
1915
|
+
baseValue: u,
|
|
1916
|
+
input1Value: A,
|
|
1836
1917
|
input2Value: S,
|
|
1837
|
-
conflictType:
|
|
1838
|
-
patches1:
|
|
1918
|
+
conflictType: p,
|
|
1919
|
+
patches1: T,
|
|
1839
1920
|
// JSON Patch operations for base?input1 (contain actual paths with indices)
|
|
1840
1921
|
patches2: N
|
|
1841
1922
|
// JSON Patch operations for base?input2 (contain actual paths with indices)
|
|
@@ -1843,105 +1924,105 @@ function Fr(e, t, r, n) {
|
|
|
1843
1924
|
}
|
|
1844
1925
|
return l;
|
|
1845
1926
|
}
|
|
1846
|
-
function
|
|
1847
|
-
var y,
|
|
1848
|
-
const n = typeof e == "object" && e !== null || Array.isArray(e) ? e : {}, o = typeof t == "object" && t !== null || Array.isArray(t) ? t : {}, i =
|
|
1927
|
+
function Qr(e, t, r) {
|
|
1928
|
+
var y, d, h, T;
|
|
1929
|
+
const n = typeof e == "object" && e !== null || Array.isArray(e) ? e : {}, o = typeof t == "object" && t !== null || Array.isArray(t) ? t : {}, i = Qe(n, o);
|
|
1849
1930
|
if (i.length === 0)
|
|
1850
1931
|
return [];
|
|
1851
|
-
const s = [], c = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(),
|
|
1932
|
+
const s = [], c = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), f = [];
|
|
1852
1933
|
for (const N of i) {
|
|
1853
|
-
const
|
|
1854
|
-
if (
|
|
1855
|
-
const
|
|
1856
|
-
a.has(
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1934
|
+
const m = N.path.match(/^(\/[^/]+(?:\/[^/]+)*)\/(\d+)(?:\/|$)/);
|
|
1935
|
+
if (m) {
|
|
1936
|
+
const g = m[1];
|
|
1937
|
+
a.has(g) || a.set(g, []);
|
|
1938
|
+
const O = a.get(g);
|
|
1939
|
+
O && O.push(N);
|
|
1859
1940
|
} else
|
|
1860
|
-
|
|
1861
|
-
}
|
|
1862
|
-
for (const [N,
|
|
1863
|
-
const
|
|
1864
|
-
if (!Array.isArray(
|
|
1865
|
-
const
|
|
1866
|
-
for (const
|
|
1867
|
-
const
|
|
1868
|
-
if (
|
|
1869
|
-
const
|
|
1870
|
-
|
|
1941
|
+
f.push(N);
|
|
1942
|
+
}
|
|
1943
|
+
for (const [N, m] of a) {
|
|
1944
|
+
const g = J(e, N), O = J(t, N);
|
|
1945
|
+
if (!Array.isArray(g) || !Array.isArray(O)) {
|
|
1946
|
+
const p = /* @__PURE__ */ new Map();
|
|
1947
|
+
for (const v of m) {
|
|
1948
|
+
const R = v.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1949
|
+
if (R) {
|
|
1950
|
+
const P = R[1];
|
|
1951
|
+
p.has(P) || p.set(P, []), (y = p.get(P)) == null || y.push(v);
|
|
1871
1952
|
}
|
|
1872
1953
|
}
|
|
1873
|
-
for (const [
|
|
1874
|
-
s.push(...
|
|
1954
|
+
for (const [v, R] of p)
|
|
1955
|
+
s.push(...st(v, R, e, t, void 0)), c.add(v);
|
|
1875
1956
|
continue;
|
|
1876
1957
|
}
|
|
1877
|
-
const
|
|
1958
|
+
const u = r ? Ze(r, N, e) : null, A = u != null && u.items ? Array.isArray(u.items) && u.items[0] ? u.items[0] : Array.isArray(u.items) ? null : u.items : null, S = A && typeof A == "object" ? A : null;
|
|
1878
1959
|
if (S) {
|
|
1879
|
-
const
|
|
1880
|
-
for (const [
|
|
1881
|
-
|
|
1882
|
-
const
|
|
1883
|
-
for (const
|
|
1884
|
-
const
|
|
1885
|
-
if (
|
|
1886
|
-
const
|
|
1887
|
-
let
|
|
1888
|
-
if (
|
|
1889
|
-
|
|
1890
|
-
const
|
|
1891
|
-
|
|
1960
|
+
const p = Cr(g, O, S), v = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map();
|
|
1961
|
+
for (const [B, F] of p.entries())
|
|
1962
|
+
F.input1 !== void 0 && v.set(F.input1, B), F.input2 !== void 0 && R.set(F.input2, B);
|
|
1963
|
+
const P = /* @__PURE__ */ new Map(), x = [];
|
|
1964
|
+
for (const B of m) {
|
|
1965
|
+
const F = B.path.match(/^\/[^/]+(?:\/[^/]+)*\/(\d+)(?:\/|$)/);
|
|
1966
|
+
if (F) {
|
|
1967
|
+
const L = Number.parseInt(F[1], 10);
|
|
1968
|
+
let I;
|
|
1969
|
+
if (B.op === "add" ? I = R.get(L) : I = v.get(L), I) {
|
|
1970
|
+
P.has(I) || P.set(I, []);
|
|
1971
|
+
const D = P.get(I);
|
|
1972
|
+
D && D.push(B);
|
|
1892
1973
|
} else
|
|
1893
|
-
|
|
1974
|
+
x.push(B);
|
|
1894
1975
|
}
|
|
1895
1976
|
}
|
|
1896
|
-
for (const [
|
|
1897
|
-
const
|
|
1898
|
-
if (!
|
|
1899
|
-
const
|
|
1900
|
-
s.push(...
|
|
1977
|
+
for (const [B, F] of P) {
|
|
1978
|
+
const L = p.get(B);
|
|
1979
|
+
if (!L) continue;
|
|
1980
|
+
const I = L.input1 !== void 0 ? `${N}/${L.input1}` : `${N}/${L.input2}`;
|
|
1981
|
+
s.push(...st(I, F, e, t, void 0)), c.add(I);
|
|
1901
1982
|
}
|
|
1902
1983
|
const M = /* @__PURE__ */ new Map();
|
|
1903
|
-
for (const
|
|
1904
|
-
const
|
|
1905
|
-
if (
|
|
1906
|
-
const
|
|
1907
|
-
M.has(
|
|
1984
|
+
for (const B of x) {
|
|
1985
|
+
const F = B.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1986
|
+
if (F) {
|
|
1987
|
+
const L = F[1];
|
|
1988
|
+
M.has(L) || M.set(L, []), (d = M.get(L)) == null || d.push(B);
|
|
1908
1989
|
}
|
|
1909
1990
|
}
|
|
1910
|
-
for (const [
|
|
1911
|
-
c.has(
|
|
1991
|
+
for (const [B, F] of M)
|
|
1992
|
+
c.has(B) || (s.push(...st(B, F, e, t, void 0)), c.add(B));
|
|
1912
1993
|
} else {
|
|
1913
|
-
const
|
|
1914
|
-
for (const
|
|
1915
|
-
const
|
|
1916
|
-
if (
|
|
1917
|
-
const
|
|
1918
|
-
|
|
1994
|
+
const p = /* @__PURE__ */ new Map();
|
|
1995
|
+
for (const v of m) {
|
|
1996
|
+
const R = v.path.match(/^(\/[^/]+(?:\/[^/]+)*\/\d+)(?:\/|$)/);
|
|
1997
|
+
if (R) {
|
|
1998
|
+
const P = R[1];
|
|
1999
|
+
p.has(P) || p.set(P, []), (h = p.get(P)) == null || h.push(v);
|
|
1919
2000
|
}
|
|
1920
2001
|
}
|
|
1921
|
-
for (const [
|
|
1922
|
-
s.push(...
|
|
2002
|
+
for (const [v, R] of p)
|
|
2003
|
+
s.push(...st(v, R, e, t, void 0)), c.add(v);
|
|
1923
2004
|
}
|
|
1924
2005
|
}
|
|
1925
2006
|
const l = /* @__PURE__ */ new Map();
|
|
1926
|
-
for (const N of
|
|
1927
|
-
const
|
|
1928
|
-
l.has(
|
|
2007
|
+
for (const N of f) {
|
|
2008
|
+
const m = N.path.split("/").filter(Boolean), g = m.length > 0 ? `/${m[0]}` : "/";
|
|
2009
|
+
l.has(g) || l.set(g, []), (T = l.get(g)) == null || T.push(N);
|
|
1929
2010
|
}
|
|
1930
|
-
for (const [N,
|
|
1931
|
-
s.push(...
|
|
2011
|
+
for (const [N, m] of l)
|
|
2012
|
+
s.push(...st(N, m, e, t, void 0));
|
|
1932
2013
|
return s;
|
|
1933
2014
|
}
|
|
1934
|
-
function
|
|
1935
|
-
const i = o !== void 0 ?
|
|
1936
|
-
for (const
|
|
1937
|
-
const
|
|
1938
|
-
let
|
|
1939
|
-
|
|
2015
|
+
function st(e, t, r, n, o) {
|
|
2016
|
+
const i = o !== void 0 ? J(o, e) : void 0, s = J(r, e), c = J(n, e), a = [], f = [];
|
|
2017
|
+
for (const u of t) {
|
|
2018
|
+
const A = u.path, S = J(r, A), p = J(n, A);
|
|
2019
|
+
let v = !1, R = !1;
|
|
2020
|
+
u.op === "add" ? (v = !1, R = p !== void 0) : u.op === "remove" ? (v = S !== void 0, R = !1) : u.op === "replace" && (v = S !== void 0 && !he(S, p), R = p !== void 0 && !he(S, p)), A === e && (v = !0, R = !0), v && a.push(u), R && f.push(u);
|
|
1940
2021
|
}
|
|
1941
|
-
if (a.length === 0 &&
|
|
2022
|
+
if (a.length === 0 && f.length === 0 && i !== void 0 && s !== void 0 && c !== void 0 && he(i, s) && he(i, c))
|
|
1942
2023
|
return [];
|
|
1943
|
-
const l = a.length > 0 ? a : t, y =
|
|
1944
|
-
if (
|
|
2024
|
+
const l = a.length > 0 ? a : t, y = f.length > 0 ? f : t, d = [...l, ...y], h = d.some((u) => u.op === "add"), T = d.some((u) => u.op === "remove"), N = d.some((u) => u.op === "replace");
|
|
2025
|
+
if (h && !N && !T) {
|
|
1945
2026
|
if (s !== void 0 && c === void 0)
|
|
1946
2027
|
return [
|
|
1947
2028
|
{
|
|
@@ -1949,7 +2030,7 @@ function Ze(e, t, r, n, o) {
|
|
|
1949
2030
|
baseValue: void 0,
|
|
1950
2031
|
input1Value: s,
|
|
1951
2032
|
input2Value: void 0,
|
|
1952
|
-
conflictType:
|
|
2033
|
+
conflictType: $.INPUT1_ONLY,
|
|
1953
2034
|
patches1: l,
|
|
1954
2035
|
// Highlight on input1 (new content) - use filtered patches1
|
|
1955
2036
|
patches2: []
|
|
@@ -1963,7 +2044,7 @@ function Ze(e, t, r, n, o) {
|
|
|
1963
2044
|
baseValue: void 0,
|
|
1964
2045
|
input1Value: void 0,
|
|
1965
2046
|
input2Value: c,
|
|
1966
|
-
conflictType:
|
|
2047
|
+
conflictType: $.INPUT2_ONLY,
|
|
1967
2048
|
patches1: [],
|
|
1968
2049
|
// No highlighting on input1 (doesn't exist there)
|
|
1969
2050
|
patches2: y
|
|
@@ -1971,7 +2052,7 @@ function Ze(e, t, r, n, o) {
|
|
|
1971
2052
|
}
|
|
1972
2053
|
];
|
|
1973
2054
|
}
|
|
1974
|
-
if (
|
|
2055
|
+
if (T && !h && !N) {
|
|
1975
2056
|
if (s !== void 0 && c === void 0)
|
|
1976
2057
|
return [
|
|
1977
2058
|
{
|
|
@@ -1979,7 +2060,7 @@ function Ze(e, t, r, n, o) {
|
|
|
1979
2060
|
baseValue: s,
|
|
1980
2061
|
input1Value: s,
|
|
1981
2062
|
input2Value: void 0,
|
|
1982
|
-
conflictType:
|
|
2063
|
+
conflictType: $.INPUT1_ONLY,
|
|
1983
2064
|
patches1: l,
|
|
1984
2065
|
// Highlight on input1 (removed content) - use filtered patches1
|
|
1985
2066
|
patches2: []
|
|
@@ -1993,7 +2074,7 @@ function Ze(e, t, r, n, o) {
|
|
|
1993
2074
|
baseValue: c,
|
|
1994
2075
|
input1Value: void 0,
|
|
1995
2076
|
input2Value: c,
|
|
1996
|
-
conflictType:
|
|
2077
|
+
conflictType: $.INPUT2_ONLY,
|
|
1997
2078
|
patches1: [],
|
|
1998
2079
|
// No highlighting on input1 (doesn't exist there)
|
|
1999
2080
|
patches2: y
|
|
@@ -2001,20 +2082,20 @@ function Ze(e, t, r, n, o) {
|
|
|
2001
2082
|
}
|
|
2002
2083
|
];
|
|
2003
2084
|
}
|
|
2004
|
-
const
|
|
2005
|
-
let
|
|
2006
|
-
switch (
|
|
2007
|
-
case
|
|
2008
|
-
|
|
2085
|
+
const m = Ut(i, s, c);
|
|
2086
|
+
let g = [], O = [];
|
|
2087
|
+
switch (m) {
|
|
2088
|
+
case $.INPUT1_ONLY:
|
|
2089
|
+
g = l, O = [];
|
|
2009
2090
|
break;
|
|
2010
|
-
case
|
|
2011
|
-
|
|
2091
|
+
case $.INPUT2_ONLY:
|
|
2092
|
+
g = [], O = y;
|
|
2012
2093
|
break;
|
|
2013
|
-
case
|
|
2014
|
-
|
|
2094
|
+
case $.SAME_CHANGE:
|
|
2095
|
+
g = l, O = y;
|
|
2015
2096
|
break;
|
|
2016
|
-
case
|
|
2017
|
-
|
|
2097
|
+
case $.TRUE_CONFLICT:
|
|
2098
|
+
g = l, O = y;
|
|
2018
2099
|
break;
|
|
2019
2100
|
}
|
|
2020
2101
|
return [
|
|
@@ -2023,194 +2104,194 @@ function Ze(e, t, r, n, o) {
|
|
|
2023
2104
|
baseValue: i,
|
|
2024
2105
|
input1Value: s,
|
|
2025
2106
|
input2Value: c,
|
|
2026
|
-
conflictType:
|
|
2027
|
-
patches1:
|
|
2028
|
-
patches2:
|
|
2107
|
+
conflictType: m,
|
|
2108
|
+
patches1: g,
|
|
2109
|
+
patches2: O
|
|
2029
2110
|
}
|
|
2030
2111
|
];
|
|
2031
2112
|
}
|
|
2032
|
-
function
|
|
2113
|
+
function jt(e, t) {
|
|
2033
2114
|
if (!t || t.length === 0)
|
|
2034
2115
|
return { start: 1, end: 1 };
|
|
2035
2116
|
let r = Number.MAX_SAFE_INTEGER, n = 0, o = !1;
|
|
2036
2117
|
for (const i of t) {
|
|
2037
|
-
const s =
|
|
2118
|
+
const s = xe(e, i.path);
|
|
2038
2119
|
s.start === 1 && s.end === 1 || (r = Math.min(r, s.start), n = Math.max(n, s.end), o = !0);
|
|
2039
2120
|
}
|
|
2040
2121
|
return !o || r === Number.MAX_SAFE_INTEGER || n === 0 ? { start: 1, end: 1 } : { start: r, end: n };
|
|
2041
2122
|
}
|
|
2042
|
-
function
|
|
2043
|
-
var i, s, c, a,
|
|
2123
|
+
function Zr(e, t, r, n) {
|
|
2124
|
+
var i, s, c, a, f, l;
|
|
2044
2125
|
const o = [];
|
|
2045
2126
|
for (let y = 0; y < e.length; y++) {
|
|
2046
|
-
const
|
|
2047
|
-
let
|
|
2048
|
-
(((i =
|
|
2049
|
-
const
|
|
2050
|
-
let
|
|
2051
|
-
switch (
|
|
2052
|
-
case
|
|
2053
|
-
|
|
2127
|
+
const d = e[y];
|
|
2128
|
+
let h, T, N;
|
|
2129
|
+
(((i = d.patches1) == null ? void 0 : i.length) ?? 0) === 0 && (((s = d.patches2) == null ? void 0 : s.length) ?? 0) === 0 ? (h = t ? xe(t, d.path) : { start: 1, end: 1 }, T = xe(r, d.path), N = xe(n, d.path)) : (h = jt(t, [...d.patches1 || [], ...d.patches2 || []]), T = jt(r, d.patches1 || []), N = jt(n, d.patches2 || []));
|
|
2130
|
+
const m = d.conflictType === $.TRUE_CONFLICT;
|
|
2131
|
+
let g = oe.excluded, O = oe.excluded;
|
|
2132
|
+
switch (d.conflictType) {
|
|
2133
|
+
case $.SAME_CHANGE:
|
|
2134
|
+
g = oe.first, O = oe.first;
|
|
2054
2135
|
break;
|
|
2055
|
-
case
|
|
2056
|
-
|
|
2136
|
+
case $.INPUT1_ONLY:
|
|
2137
|
+
g = oe.first;
|
|
2057
2138
|
break;
|
|
2058
|
-
case
|
|
2059
|
-
|
|
2139
|
+
case $.INPUT2_ONLY:
|
|
2140
|
+
O = oe.first;
|
|
2060
2141
|
break;
|
|
2061
|
-
case
|
|
2062
|
-
|
|
2142
|
+
case $.TRUE_CONFLICT:
|
|
2143
|
+
O = oe.first;
|
|
2063
2144
|
break;
|
|
2064
2145
|
}
|
|
2065
|
-
const
|
|
2066
|
-
if (
|
|
2067
|
-
for (const
|
|
2068
|
-
const
|
|
2069
|
-
if (
|
|
2146
|
+
const u = [], A = [];
|
|
2147
|
+
if (d.patches1 && (d.patches1.length ?? 0) > 0)
|
|
2148
|
+
for (const p of d.patches1) {
|
|
2149
|
+
const v = !t || t.trim() === "";
|
|
2150
|
+
if (p.op === "remove" && !v)
|
|
2070
2151
|
continue;
|
|
2071
|
-
const
|
|
2072
|
-
if (
|
|
2073
|
-
for (let
|
|
2074
|
-
|
|
2075
|
-
}
|
|
2076
|
-
else if ((((c =
|
|
2077
|
-
const
|
|
2078
|
-
(
|
|
2079
|
-
}
|
|
2080
|
-
if (
|
|
2081
|
-
for (const
|
|
2082
|
-
if (
|
|
2152
|
+
const R = xe(r, p.path);
|
|
2153
|
+
if (R.start !== 1 || R.end !== 1)
|
|
2154
|
+
for (let P = R.start; P <= R.end; P++)
|
|
2155
|
+
u.push({ line: P });
|
|
2156
|
+
}
|
|
2157
|
+
else if ((((c = d.patches1) == null ? void 0 : c.length) ?? 0) === 0 && (((a = d.patches2) == null ? void 0 : a.length) ?? 0) === 0) {
|
|
2158
|
+
const p = xe(r, d.path);
|
|
2159
|
+
(p.start !== 1 || p.end !== 1) && u.push({ line: p.start });
|
|
2160
|
+
}
|
|
2161
|
+
if (d.patches2 && (d.patches2.length ?? 0) > 0)
|
|
2162
|
+
for (const p of d.patches2) {
|
|
2163
|
+
if (p.op === "remove")
|
|
2083
2164
|
continue;
|
|
2084
|
-
const
|
|
2085
|
-
if (
|
|
2086
|
-
for (let
|
|
2087
|
-
|
|
2165
|
+
const v = xe(n, p.path);
|
|
2166
|
+
if (v.start !== 1 || v.end !== 1)
|
|
2167
|
+
for (let R = v.start; R <= v.end; R++)
|
|
2168
|
+
A.push({ line: R });
|
|
2088
2169
|
}
|
|
2089
|
-
else if ((((
|
|
2090
|
-
const
|
|
2091
|
-
(
|
|
2170
|
+
else if ((((f = d.patches1) == null ? void 0 : f.length) ?? 0) === 0 && (((l = d.patches2) == null ? void 0 : l.length) ?? 0) === 0) {
|
|
2171
|
+
const p = xe(n, d.path);
|
|
2172
|
+
(p.start !== 1 || p.end !== 1) && A.push({ line: p.start });
|
|
2092
2173
|
}
|
|
2093
2174
|
const S = {
|
|
2094
2175
|
id: `conflict-${y}`,
|
|
2095
|
-
path:
|
|
2176
|
+
path: d.path,
|
|
2096
2177
|
// Include path for value extraction during resolution
|
|
2097
2178
|
baseRange: {
|
|
2098
|
-
startLineNumber:
|
|
2099
|
-
endLineNumberExclusive:
|
|
2179
|
+
startLineNumber: h.start,
|
|
2180
|
+
endLineNumberExclusive: h.end + 1
|
|
2100
2181
|
},
|
|
2101
2182
|
input1Range: {
|
|
2102
|
-
startLineNumber:
|
|
2103
|
-
endLineNumberExclusive:
|
|
2183
|
+
startLineNumber: T.start,
|
|
2184
|
+
endLineNumberExclusive: T.end + 1
|
|
2104
2185
|
},
|
|
2105
2186
|
input2Range: {
|
|
2106
2187
|
startLineNumber: N.start,
|
|
2107
2188
|
endLineNumberExclusive: N.end + 1
|
|
2108
2189
|
},
|
|
2109
|
-
input1Diffs:
|
|
2110
|
-
input2Diffs:
|
|
2111
|
-
isConflicting:
|
|
2112
|
-
conflictType:
|
|
2113
|
-
input1State:
|
|
2114
|
-
input2State:
|
|
2115
|
-
handled:
|
|
2190
|
+
input1Diffs: u,
|
|
2191
|
+
input2Diffs: A,
|
|
2192
|
+
isConflicting: m,
|
|
2193
|
+
conflictType: d.conflictType,
|
|
2194
|
+
input1State: g,
|
|
2195
|
+
input2State: O,
|
|
2196
|
+
handled: d.conflictType === $.SAME_CHANGE,
|
|
2116
2197
|
focused: !1
|
|
2117
2198
|
};
|
|
2118
2199
|
o.push(S);
|
|
2119
2200
|
}
|
|
2120
2201
|
return o;
|
|
2121
2202
|
}
|
|
2122
|
-
function
|
|
2203
|
+
function eo(e, t, r, n = {}) {
|
|
2123
2204
|
const { comparisonMode: o = "split", schema: i } = n;
|
|
2124
2205
|
if (!t || !r)
|
|
2125
2206
|
throw new Error("JSON Patch diff requires non-empty input1 and input2 strings");
|
|
2126
2207
|
try {
|
|
2127
2208
|
const s = e ? JSON.parse(e) : void 0, c = JSON.parse(t), a = JSON.parse(r);
|
|
2128
|
-
let
|
|
2209
|
+
let f;
|
|
2129
2210
|
if (s === void 0)
|
|
2130
|
-
|
|
2211
|
+
f = Qr(c, a, i);
|
|
2131
2212
|
else if (o === "split")
|
|
2132
|
-
|
|
2213
|
+
f = Kr(s, c, a, i);
|
|
2133
2214
|
else {
|
|
2134
|
-
const l =
|
|
2135
|
-
l.forEach((
|
|
2136
|
-
|
|
2137
|
-
}), y.forEach((
|
|
2138
|
-
|
|
2139
|
-
}),
|
|
2140
|
-
const
|
|
2141
|
-
let
|
|
2142
|
-
return
|
|
2143
|
-
path:
|
|
2144
|
-
baseValue:
|
|
2215
|
+
const l = Qe(s, c), y = Qe(c, a), d = /* @__PURE__ */ new Set();
|
|
2216
|
+
l.forEach((h) => {
|
|
2217
|
+
d.add(h.path);
|
|
2218
|
+
}), y.forEach((h) => {
|
|
2219
|
+
d.add(h.path);
|
|
2220
|
+
}), f = Array.from(d).map((h) => {
|
|
2221
|
+
const T = J(s, h), N = J(c, h), m = J(a, h), g = !he(T, N), O = !he(N, m);
|
|
2222
|
+
let u;
|
|
2223
|
+
return g && O ? u = $.TRUE_CONFLICT : g ? u = $.INPUT1_ONLY : O ? u = $.INPUT2_ONLY : u = $.SAME_CHANGE, {
|
|
2224
|
+
path: h,
|
|
2225
|
+
baseValue: T,
|
|
2145
2226
|
input1Value: N,
|
|
2146
|
-
input2Value:
|
|
2147
|
-
conflictType:
|
|
2227
|
+
input2Value: m,
|
|
2228
|
+
conflictType: u
|
|
2148
2229
|
};
|
|
2149
2230
|
});
|
|
2150
2231
|
}
|
|
2151
|
-
return
|
|
2232
|
+
return Zr(f, e, t, r);
|
|
2152
2233
|
} catch (s) {
|
|
2153
2234
|
const c = s instanceof Error ? s.message : String(s);
|
|
2154
2235
|
throw new Error(`JSON Patch diff computation failed: ${c}`);
|
|
2155
2236
|
}
|
|
2156
2237
|
}
|
|
2157
|
-
function
|
|
2238
|
+
function to(e, t, r) {
|
|
2158
2239
|
const n = e !== t, o = e !== r;
|
|
2159
2240
|
let i;
|
|
2160
|
-
return n && o ? t === r ? i =
|
|
2241
|
+
return n && o ? t === r ? i = $.SAME_CHANGE : i = $.TRUE_CONFLICT : n ? i = $.INPUT1_ONLY : i = $.INPUT2_ONLY, { conflictType: i, input1Changed: n, input2Changed: o };
|
|
2161
2242
|
}
|
|
2162
|
-
function
|
|
2163
|
-
var
|
|
2243
|
+
function yo(e, t, r) {
|
|
2244
|
+
var f, l, y;
|
|
2164
2245
|
const n = [], o = [];
|
|
2165
|
-
for (let
|
|
2166
|
-
const
|
|
2167
|
-
(
|
|
2168
|
-
line:
|
|
2169
|
-
input1Changed:
|
|
2170
|
-
input2Changed:
|
|
2171
|
-
baseLine:
|
|
2172
|
-
input1Line:
|
|
2246
|
+
for (let d = 0; d < Math.max(e.length, t.length, r.length); d++) {
|
|
2247
|
+
const h = e[d] !== void 0 ? e[d] : "", T = t[d] !== void 0 ? t[d] : "", N = r[d] !== void 0 ? r[d] : "", { conflictType: m, input1Changed: g, input2Changed: O } = to(h, T, N);
|
|
2248
|
+
(g || O) && o.push({
|
|
2249
|
+
line: d + 1,
|
|
2250
|
+
input1Changed: g,
|
|
2251
|
+
input2Changed: O,
|
|
2252
|
+
baseLine: h,
|
|
2253
|
+
input1Line: T,
|
|
2173
2254
|
input2Line: N,
|
|
2174
|
-
conflictType:
|
|
2255
|
+
conflictType: m
|
|
2175
2256
|
});
|
|
2176
2257
|
}
|
|
2177
2258
|
if (o.length === 0)
|
|
2178
2259
|
return [];
|
|
2179
|
-
let i = ((
|
|
2180
|
-
for (let
|
|
2181
|
-
const
|
|
2182
|
-
if (
|
|
2183
|
-
const
|
|
2260
|
+
let i = ((f = o[0]) == null ? void 0 : f.line) ?? 1, s = (l = o[0]) == null ? void 0 : l.conflictType, c = [], a = [];
|
|
2261
|
+
for (let d = 0; d <= o.length; d++) {
|
|
2262
|
+
const h = o[d], T = d === o.length, N = !T && h && o[d - 1] && h.line > (((y = o[d - 1]) == null ? void 0 : y.line) ?? 0) + 1, m = !T && h && h.conflictType !== s;
|
|
2263
|
+
if (T || N || m) {
|
|
2264
|
+
const g = o[d - 1], O = g ? g.line + 1 : i + 1, u = c.length > 0, A = a.length > 0, S = s === $.TRUE_CONFLICT, p = {
|
|
2184
2265
|
id: `conflict-${n.length}`,
|
|
2185
2266
|
baseRange: {
|
|
2186
2267
|
startLineNumber: i,
|
|
2187
|
-
endLineNumberExclusive:
|
|
2268
|
+
endLineNumberExclusive: O
|
|
2188
2269
|
},
|
|
2189
2270
|
input1Range: {
|
|
2190
2271
|
startLineNumber: i,
|
|
2191
|
-
endLineNumberExclusive:
|
|
2272
|
+
endLineNumberExclusive: O
|
|
2192
2273
|
},
|
|
2193
2274
|
input2Range: {
|
|
2194
2275
|
startLineNumber: i,
|
|
2195
|
-
endLineNumberExclusive:
|
|
2276
|
+
endLineNumberExclusive: O
|
|
2196
2277
|
},
|
|
2197
2278
|
input1Diffs: c,
|
|
2198
2279
|
input2Diffs: a,
|
|
2199
2280
|
isConflicting: S,
|
|
2200
2281
|
conflictType: s,
|
|
2201
2282
|
// Default: accept input2 (ours) by default, or both if same change
|
|
2202
|
-
input1State: s ===
|
|
2203
|
-
input2State:
|
|
2204
|
-
handled: s ===
|
|
2283
|
+
input1State: s === $.SAME_CHANGE && u ? oe.first : oe.excluded,
|
|
2284
|
+
input2State: A ? oe.first : oe.excluded,
|
|
2285
|
+
handled: s === $.SAME_CHANGE,
|
|
2205
2286
|
focused: !1
|
|
2206
2287
|
};
|
|
2207
|
-
n.push(
|
|
2288
|
+
n.push(p), !T && h && (i = h.line, s = h.conflictType, c = [], a = []);
|
|
2208
2289
|
}
|
|
2209
|
-
!
|
|
2290
|
+
!T && h && (h.input1Changed && c.push({ line: h.line }), h.input2Changed && a.push({ line: h.line }));
|
|
2210
2291
|
}
|
|
2211
2292
|
return n;
|
|
2212
2293
|
}
|
|
2213
|
-
function
|
|
2294
|
+
function no(e, t, r) {
|
|
2214
2295
|
if (!t || t === "/") {
|
|
2215
2296
|
if (typeof e == "object" && e !== null && !Array.isArray(e) && typeof r == "object" && r !== null && !Array.isArray(r)) {
|
|
2216
2297
|
Object.assign(e, r);
|
|
@@ -2221,11 +2302,11 @@ function Gr(e, t, r) {
|
|
|
2221
2302
|
const n = t.split("/").filter((c) => c !== "");
|
|
2222
2303
|
let o = e;
|
|
2223
2304
|
for (let c = 0; c < n.length - 1; c++) {
|
|
2224
|
-
const a = n[c],
|
|
2225
|
-
if (!Number.isNaN(
|
|
2305
|
+
const a = n[c], f = Number.parseInt(a, 10);
|
|
2306
|
+
if (!Number.isNaN(f) && String(f) === a) {
|
|
2226
2307
|
if (!Array.isArray(o))
|
|
2227
2308
|
throw new Error(`Path ${t}: segment ${a} expects array but got ${typeof o}`);
|
|
2228
|
-
o = o[
|
|
2309
|
+
o = o[f];
|
|
2229
2310
|
} else {
|
|
2230
2311
|
if (!o || typeof o != "object" || Array.isArray(o))
|
|
2231
2312
|
throw new Error(`Path ${t}: segment ${a} expects object but got ${typeof o}`);
|
|
@@ -2244,43 +2325,43 @@ function Gr(e, t, r) {
|
|
|
2244
2325
|
o[i] = r;
|
|
2245
2326
|
}
|
|
2246
2327
|
}
|
|
2247
|
-
function
|
|
2328
|
+
function ro(e, t) {
|
|
2248
2329
|
try {
|
|
2249
|
-
const r =
|
|
2330
|
+
const r = bn(e);
|
|
2250
2331
|
if (!r) return null;
|
|
2251
2332
|
const n = t.split("/").filter((l) => l !== "").map((l) => {
|
|
2252
2333
|
const y = Number.parseInt(l, 10);
|
|
2253
2334
|
return !Number.isNaN(y) && String(y) === l ? y : l;
|
|
2254
|
-
}), o =
|
|
2335
|
+
}), o = wn(r, n);
|
|
2255
2336
|
if (!o) return null;
|
|
2256
2337
|
const s = e.substring(0, o.offset).split(`
|
|
2257
|
-
`).length, c = o.offset + o.length,
|
|
2338
|
+
`).length, c = o.offset + o.length, f = e.substring(0, c).split(`
|
|
2258
2339
|
`).length;
|
|
2259
|
-
return { startLine: s, endLine:
|
|
2340
|
+
return { startLine: s, endLine: f };
|
|
2260
2341
|
} catch {
|
|
2261
2342
|
return null;
|
|
2262
2343
|
}
|
|
2263
2344
|
}
|
|
2264
|
-
function
|
|
2345
|
+
function In(e, t, r, n = "") {
|
|
2265
2346
|
if (JSON.stringify(e) === JSON.stringify(t))
|
|
2266
2347
|
return e;
|
|
2267
2348
|
if (e !== null && t !== null && typeof e == "object" && typeof t == "object" && !Array.isArray(e) && !Array.isArray(t)) {
|
|
2268
|
-
const o = e, i = t, s = { ...o }, c = r ?
|
|
2349
|
+
const o = e, i = t, s = { ...o }, c = r ? Ze(r, n, e) : null, a = c != null && c.properties && typeof c.properties == "object" && !Array.isArray(c.properties) ? c.properties : void 0, f = c == null ? void 0 : c.additionalProperties;
|
|
2269
2350
|
for (const l of Object.keys(i))
|
|
2270
2351
|
if (l in s) {
|
|
2271
2352
|
if (JSON.stringify(s[l]) !== JSON.stringify(i[l])) {
|
|
2272
|
-
const y = a == null ? void 0 : a[l],
|
|
2273
|
-
if (
|
|
2274
|
-
s[l] =
|
|
2353
|
+
const y = a == null ? void 0 : a[l], d = n ? `${n}/${l}` : `/${l}`, h = In(s[l], i[l], y, d);
|
|
2354
|
+
if (h !== null)
|
|
2355
|
+
s[l] = h;
|
|
2275
2356
|
else
|
|
2276
2357
|
return null;
|
|
2277
2358
|
}
|
|
2278
|
-
} else if (
|
|
2359
|
+
} else if (f === !0 || f === void 0 || (a == null ? void 0 : a[l]) !== void 0)
|
|
2279
2360
|
s[l] = i[l];
|
|
2280
2361
|
else {
|
|
2281
|
-
if (
|
|
2362
|
+
if (f === !1)
|
|
2282
2363
|
return null;
|
|
2283
|
-
if (typeof
|
|
2364
|
+
if (typeof f == "object")
|
|
2284
2365
|
s[l] = i[l];
|
|
2285
2366
|
else
|
|
2286
2367
|
return null;
|
|
@@ -2289,169 +2370,169 @@ function mn(e, t, r, n = "") {
|
|
|
2289
2370
|
}
|
|
2290
2371
|
return null;
|
|
2291
2372
|
}
|
|
2292
|
-
function
|
|
2373
|
+
function oo(e, t, r, n, o) {
|
|
2293
2374
|
var S;
|
|
2294
2375
|
const i = [], s = [], c = e.join(`
|
|
2295
2376
|
`), a = t.join(`
|
|
2296
|
-
`),
|
|
2377
|
+
`), f = r.join(`
|
|
2297
2378
|
`);
|
|
2298
|
-
let l, y,
|
|
2379
|
+
let l, y, d;
|
|
2299
2380
|
try {
|
|
2300
|
-
l = c ? JSON.parse(c) : {}, y = a ? JSON.parse(a) : {},
|
|
2301
|
-
} catch (
|
|
2381
|
+
l = c ? JSON.parse(c) : {}, y = a ? JSON.parse(a) : {}, d = f ? JSON.parse(f) : {};
|
|
2382
|
+
} catch (p) {
|
|
2302
2383
|
return {
|
|
2303
2384
|
content: c || "",
|
|
2304
2385
|
isValid: !1,
|
|
2305
|
-
validationError: `Failed to parse input JSON: ${
|
|
2386
|
+
validationError: `Failed to parse input JSON: ${p instanceof Error ? p.message : String(p)}`,
|
|
2306
2387
|
warnings: i
|
|
2307
2388
|
};
|
|
2308
2389
|
}
|
|
2309
|
-
let
|
|
2310
|
-
!l || typeof l == "object" && l !== null && Object.keys(l).length === 0 ?
|
|
2311
|
-
const
|
|
2312
|
-
for (const
|
|
2313
|
-
const
|
|
2314
|
-
let
|
|
2315
|
-
if (!
|
|
2316
|
-
|
|
2390
|
+
let h;
|
|
2391
|
+
!l || typeof l == "object" && l !== null && Object.keys(l).length === 0 ? h = JSON.parse(JSON.stringify(d)) : h = JSON.parse(JSON.stringify(l));
|
|
2392
|
+
const T = /* @__PURE__ */ new Set(), N = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), g = (p, v, R) => null;
|
|
2393
|
+
for (const p of n) {
|
|
2394
|
+
const v = p.input1State === oe.first || p.input1State === oe.second, R = p.input2State === oe.first || p.input2State === oe.second;
|
|
2395
|
+
let P = p.path;
|
|
2396
|
+
if (!P && (P = g(p.baseRange.startLineNumber, p.baseRange.endLineNumberExclusive) || void 0, !P)) {
|
|
2397
|
+
p.conflictType === $.INPUT2_ONLY && R ? h = JSON.parse(JSON.stringify(d)) : p.conflictType === $.INPUT1_ONLY && v ? h = JSON.parse(JSON.stringify(y)) : p.conflictType === $.SAME_CHANGE && (v || R) || R ? h = JSON.parse(JSON.stringify(d)) : v && (h = JSON.parse(JSON.stringify(y)));
|
|
2317
2398
|
continue;
|
|
2318
2399
|
}
|
|
2319
2400
|
try {
|
|
2320
|
-
let
|
|
2321
|
-
const
|
|
2322
|
-
let
|
|
2323
|
-
if (
|
|
2324
|
-
const
|
|
2325
|
-
if (
|
|
2326
|
-
const
|
|
2327
|
-
/^\d+$/.test(
|
|
2401
|
+
let x, M = P;
|
|
2402
|
+
const B = (S = p.path) == null ? void 0 : S.match(/^(.*\/\d+)(?:\/.*)?$/);
|
|
2403
|
+
let F = !1, L = "";
|
|
2404
|
+
if (B) {
|
|
2405
|
+
const D = B[1].split("/").filter((K) => K !== "");
|
|
2406
|
+
if (D.length >= 2) {
|
|
2407
|
+
const K = D[D.length - 1];
|
|
2408
|
+
/^\d+$/.test(K) && (F = !0, L = `/${D.slice(0, -1).join("/")}`);
|
|
2328
2409
|
}
|
|
2329
2410
|
}
|
|
2330
|
-
if (
|
|
2331
|
-
if (
|
|
2332
|
-
|
|
2411
|
+
if (v && R)
|
|
2412
|
+
if (p.conflictType === $.SAME_CHANGE)
|
|
2413
|
+
F ? (x = J(d, L), M = L) : x = J(d, P);
|
|
2333
2414
|
else {
|
|
2334
|
-
const
|
|
2335
|
-
ae !== null ? (
|
|
2415
|
+
const I = F ? L : P, D = J(y, I), K = J(d, I), ie = o && l && typeof l == "object" && Ze(o, I, l) || void 0, ae = In(D, K, ie, I);
|
|
2416
|
+
ae !== null ? (x = ae, M = I, i.push(`Smart-merged conflict at path ${I}`)) : (x = K, M = I, i.push(`Merge failed at path ${I}, using input2 value`));
|
|
2336
2417
|
}
|
|
2337
|
-
else if (
|
|
2338
|
-
if (
|
|
2339
|
-
|
|
2418
|
+
else if (v)
|
|
2419
|
+
if (F)
|
|
2420
|
+
x = J(y, L), M = L;
|
|
2340
2421
|
else {
|
|
2341
|
-
const
|
|
2342
|
-
if (
|
|
2343
|
-
const
|
|
2344
|
-
if (!
|
|
2345
|
-
const
|
|
2346
|
-
if (typeof
|
|
2347
|
-
const
|
|
2348
|
-
if (typeof
|
|
2349
|
-
for (const [ae,
|
|
2350
|
-
const
|
|
2351
|
-
N.has(
|
|
2422
|
+
const I = P.split("/").filter(Boolean);
|
|
2423
|
+
if (I.length > 1) {
|
|
2424
|
+
const D = `/${I.slice(0, -1).join("/")}`;
|
|
2425
|
+
if (!m.has(D)) {
|
|
2426
|
+
const K = J(y, D);
|
|
2427
|
+
if (typeof K == "object" && K !== null && !Array.isArray(K)) {
|
|
2428
|
+
const ie = J(h, D);
|
|
2429
|
+
if (typeof ie == "object" && ie !== null && !Array.isArray(ie)) {
|
|
2430
|
+
for (const [ae, ge] of Object.entries(K)) {
|
|
2431
|
+
const Pe = `${D}/${ae}`;
|
|
2432
|
+
N.has(Pe) || (ie[ae] = ge);
|
|
2352
2433
|
}
|
|
2353
|
-
|
|
2434
|
+
m.add(D);
|
|
2354
2435
|
}
|
|
2355
2436
|
}
|
|
2356
2437
|
}
|
|
2357
|
-
|
|
2438
|
+
x = J(y, P);
|
|
2358
2439
|
} else
|
|
2359
|
-
|
|
2440
|
+
x = J(y, P);
|
|
2360
2441
|
}
|
|
2361
|
-
else if (
|
|
2362
|
-
if (
|
|
2363
|
-
|
|
2442
|
+
else if (R)
|
|
2443
|
+
if (F)
|
|
2444
|
+
x = J(d, L), M = L;
|
|
2364
2445
|
else {
|
|
2365
|
-
const
|
|
2366
|
-
if (
|
|
2367
|
-
const
|
|
2368
|
-
if (!
|
|
2369
|
-
const
|
|
2370
|
-
if (typeof
|
|
2371
|
-
const
|
|
2372
|
-
if (typeof
|
|
2373
|
-
for (const [ae,
|
|
2374
|
-
const
|
|
2375
|
-
N.has(
|
|
2446
|
+
const I = P.split("/").filter(Boolean);
|
|
2447
|
+
if (I.length > 1) {
|
|
2448
|
+
const D = `/${I.slice(0, -1).join("/")}`;
|
|
2449
|
+
if (!m.has(D)) {
|
|
2450
|
+
const K = J(d, D);
|
|
2451
|
+
if (typeof K == "object" && K !== null && !Array.isArray(K)) {
|
|
2452
|
+
const ie = J(h, D);
|
|
2453
|
+
if (typeof ie == "object" && ie !== null && !Array.isArray(ie)) {
|
|
2454
|
+
for (const [ae, ge] of Object.entries(K)) {
|
|
2455
|
+
const Pe = `${D}/${ae}`;
|
|
2456
|
+
N.has(Pe) || (ie[ae] = ge);
|
|
2376
2457
|
}
|
|
2377
|
-
|
|
2458
|
+
m.add(D);
|
|
2378
2459
|
}
|
|
2379
2460
|
}
|
|
2380
2461
|
}
|
|
2381
|
-
|
|
2462
|
+
x = J(d, P);
|
|
2382
2463
|
} else
|
|
2383
|
-
|
|
2464
|
+
x = J(d, P);
|
|
2384
2465
|
}
|
|
2385
2466
|
else {
|
|
2386
|
-
const
|
|
2387
|
-
if (
|
|
2388
|
-
|
|
2467
|
+
const I = F ? L : P, D = J(l, I);
|
|
2468
|
+
if (D !== void 0)
|
|
2469
|
+
x = D, M = I;
|
|
2389
2470
|
else
|
|
2390
2471
|
continue;
|
|
2391
2472
|
}
|
|
2392
|
-
|
|
2393
|
-
} catch (
|
|
2394
|
-
i.push(`Failed to apply conflict at path ${
|
|
2395
|
-
}
|
|
2396
|
-
}
|
|
2397
|
-
const
|
|
2398
|
-
for (const
|
|
2399
|
-
const
|
|
2400
|
-
if (!
|
|
2401
|
-
const
|
|
2402
|
-
if (
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2405
|
-
conflictId:
|
|
2406
|
-
conflictPath:
|
|
2473
|
+
x !== void 0 && (no(h, M, x), T.add(M), N.add(M));
|
|
2474
|
+
} catch (x) {
|
|
2475
|
+
i.push(`Failed to apply conflict at path ${P || p.id}: ${x instanceof Error ? x.message : String(x)}`);
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
const O = JSON.stringify(h, null, 2);
|
|
2479
|
+
for (const p of n) {
|
|
2480
|
+
const v = p.path;
|
|
2481
|
+
if (!v) continue;
|
|
2482
|
+
const R = p.input1State === oe.first || p.input1State === oe.second, P = p.input2State === oe.first || p.input2State === oe.second;
|
|
2483
|
+
if (R && P && p.conflictType === $.TRUE_CONFLICT) {
|
|
2484
|
+
const x = ro(O, v);
|
|
2485
|
+
x && s.push({
|
|
2486
|
+
conflictId: p.id,
|
|
2487
|
+
conflictPath: v,
|
|
2407
2488
|
type: "warning",
|
|
2408
2489
|
message: "Both conflicting changes were accepted - please review and manually resolve",
|
|
2409
|
-
startLine:
|
|
2410
|
-
endLine:
|
|
2490
|
+
startLine: x.startLine,
|
|
2491
|
+
endLine: x.endLine
|
|
2411
2492
|
});
|
|
2412
2493
|
}
|
|
2413
2494
|
}
|
|
2414
|
-
let
|
|
2495
|
+
let u = !0, A;
|
|
2415
2496
|
try {
|
|
2416
|
-
JSON.parse(
|
|
2417
|
-
} catch (
|
|
2418
|
-
|
|
2497
|
+
JSON.parse(O);
|
|
2498
|
+
} catch (p) {
|
|
2499
|
+
u = !1, A = p instanceof Error ? p.message : "Invalid JSON", s.push({
|
|
2419
2500
|
conflictId: "validation-error",
|
|
2420
2501
|
conflictPath: "/",
|
|
2421
2502
|
type: "error",
|
|
2422
|
-
message:
|
|
2503
|
+
message: A,
|
|
2423
2504
|
startLine: 1,
|
|
2424
|
-
endLine:
|
|
2505
|
+
endLine: O.split(`
|
|
2425
2506
|
`).length
|
|
2426
2507
|
});
|
|
2427
2508
|
}
|
|
2428
2509
|
return {
|
|
2429
|
-
content:
|
|
2430
|
-
isValid:
|
|
2431
|
-
validationError:
|
|
2510
|
+
content: O,
|
|
2511
|
+
isValid: u,
|
|
2512
|
+
validationError: A,
|
|
2432
2513
|
warnings: i.length > 0 ? i : void 0,
|
|
2433
2514
|
conflictIssues: s.length > 0 ? s : void 0
|
|
2434
2515
|
};
|
|
2435
2516
|
}
|
|
2436
|
-
function
|
|
2437
|
-
let n = "", o = "", i = "", s = "", c = "", a = "",
|
|
2517
|
+
function io(e, t, r) {
|
|
2518
|
+
let n = "", o = "", i = "", s = "", c = "", a = "", f = "", l = "";
|
|
2438
2519
|
switch (e.conflictType) {
|
|
2439
|
-
case
|
|
2520
|
+
case $.SAME_CHANGE: {
|
|
2440
2521
|
const y = e.baseRange.startLineNumber === 1 && e.baseRange.endLineNumberExclusive === 2 && // Default "not found" range
|
|
2441
2522
|
e.input1Range.startLineNumber !== 1 && e.input2Range.startLineNumber !== 1;
|
|
2442
|
-
t ? y ? (n = "merge-2way-deletion", o = "merge-same-change", s = r.baseOverviewColor, c = r.changeOverviewColor, a = "",
|
|
2523
|
+
t ? y ? (n = "merge-2way-deletion", o = "merge-same-change", s = r.baseOverviewColor, c = r.changeOverviewColor, a = "", f = "-", l = "+") : (n = "merge-2way-deletion", o = "merge-same-change", i = "merge-change-base", s = r.baseOverviewColor, c = r.changeOverviewColor, a = "", f = "-", l = "") : y ? (n = "merge-same-change", o = "merge-same-change", i = "", s = r.changeOverviewColor, c = r.changeOverviewColor, a = "", f = "+", l = "+") : (n = "merge-change-incoming", o = "merge-same-change", i = "merge-change-base", s = r.changeOverviewColor, c = r.changeOverviewColor, a = r.baseOverviewColor, f = "", l = "");
|
|
2443
2524
|
break;
|
|
2444
2525
|
}
|
|
2445
|
-
case
|
|
2446
|
-
t ? (n = "merge-2way-deletion", o = "", s = r.baseOverviewColor, c = "",
|
|
2526
|
+
case $.INPUT1_ONLY:
|
|
2527
|
+
t ? (n = "merge-2way-deletion", o = "", s = r.baseOverviewColor, c = "", f = "-", l = "") : (n = "merge-change-incoming", o = "", i = "merge-change-base", s = r.conflictOverviewColor, c = "", a = r.baseOverviewColor, f = "-", l = "");
|
|
2447
2528
|
break;
|
|
2448
|
-
case
|
|
2449
|
-
n = "", o = "merge-change-current", i = t ? "" : "merge-change-base", s = "", c = r.changeOverviewColor, a = t ? "" : r.baseOverviewColor,
|
|
2529
|
+
case $.INPUT2_ONLY:
|
|
2530
|
+
n = "", o = "merge-change-current", i = t ? "" : "merge-change-base", s = "", c = r.changeOverviewColor, a = t ? "" : r.baseOverviewColor, f = "", l = "+";
|
|
2450
2531
|
break;
|
|
2451
|
-
case
|
|
2532
|
+
case $.TRUE_CONFLICT: {
|
|
2452
2533
|
const y = e.baseRange.startLineNumber === 1 && e.baseRange.endLineNumberExclusive === 2 && // Default "not found" range
|
|
2453
2534
|
e.input1Range.startLineNumber !== 1 && e.input2Range.startLineNumber !== 1;
|
|
2454
|
-
t ? y ? (n = "merge-2way-deletion", o = "merge-change-current", s = r.baseOverviewColor, c = r.changeOverviewColor, a = "",
|
|
2535
|
+
t ? y ? (n = "merge-2way-deletion", o = "merge-change-current", s = r.baseOverviewColor, c = r.changeOverviewColor, a = "", f = "-", l = "+") : (n = "merge-2way-deletion", o = "merge-conflict-current", i = "merge-conflict-base", s = r.baseOverviewColor, c = r.conflictOverviewColor, a = r.baseOverviewColor, f = "-", l = "+") : y ? (n = "merge-change-incoming", o = "merge-change-current", i = "", s = r.changeOverviewColor, c = r.changeOverviewColor, a = "", f = "+", l = "+") : (n = "merge-conflict-incoming", o = "merge-conflict-current", i = "merge-conflict-base", s = r.conflictOverviewColor, c = r.conflictOverviewColor, a = r.baseOverviewColor, f = "", l = "");
|
|
2455
2536
|
break;
|
|
2456
2537
|
}
|
|
2457
2538
|
}
|
|
@@ -2462,11 +2543,11 @@ function Yr(e, t, r) {
|
|
|
2462
2543
|
input1OverviewColor: s,
|
|
2463
2544
|
input2OverviewColor: c,
|
|
2464
2545
|
baseOverviewColor: a,
|
|
2465
|
-
input1Symbol:
|
|
2546
|
+
input1Symbol: f,
|
|
2466
2547
|
input2Symbol: l
|
|
2467
2548
|
};
|
|
2468
2549
|
}
|
|
2469
|
-
function
|
|
2550
|
+
function Ln(e) {
|
|
2470
2551
|
const t = /* @__PURE__ */ new Set();
|
|
2471
2552
|
for (const r of e)
|
|
2472
2553
|
if (r && typeof r == "object" && "line" in r) {
|
|
@@ -2475,11 +2556,11 @@ function yn(e) {
|
|
|
2475
2556
|
}
|
|
2476
2557
|
return Array.from(t).sort((r, n) => r - n);
|
|
2477
2558
|
}
|
|
2478
|
-
function
|
|
2559
|
+
function so(e, t, r) {
|
|
2479
2560
|
const n = [];
|
|
2480
2561
|
if (t.input1Class) {
|
|
2481
2562
|
if (e.input1Diffs.length > 0) {
|
|
2482
|
-
const o =
|
|
2563
|
+
const o = Ln(e.input1Diffs);
|
|
2483
2564
|
for (const i of o)
|
|
2484
2565
|
n.push({
|
|
2485
2566
|
range: new r.Range(i, 1, i, Number.MAX_SAFE_INTEGER),
|
|
@@ -2497,7 +2578,7 @@ function zr(e, t, r) {
|
|
|
2497
2578
|
} : void 0
|
|
2498
2579
|
}
|
|
2499
2580
|
});
|
|
2500
|
-
} else if (e.conflictType ===
|
|
2581
|
+
} else if (e.conflictType === $.INPUT1_ONLY) {
|
|
2501
2582
|
const o = e.input1Range.startLineNumber, i = e.input1Range.endLineNumberExclusive - 1;
|
|
2502
2583
|
for (let s = o; s <= i; s++)
|
|
2503
2584
|
n.push({
|
|
@@ -2520,10 +2601,10 @@ function zr(e, t, r) {
|
|
|
2520
2601
|
}
|
|
2521
2602
|
return n;
|
|
2522
2603
|
}
|
|
2523
|
-
function
|
|
2604
|
+
function co(e, t, r) {
|
|
2524
2605
|
const n = [];
|
|
2525
2606
|
if (e.input2Diffs.length > 0 && t.input2Class) {
|
|
2526
|
-
const o =
|
|
2607
|
+
const o = Ln(e.input2Diffs);
|
|
2527
2608
|
for (const i of o)
|
|
2528
2609
|
n.push({
|
|
2529
2610
|
range: new r.Range(i, 1, i, Number.MAX_SAFE_INTEGER),
|
|
@@ -2544,7 +2625,7 @@ function Xr(e, t, r) {
|
|
|
2544
2625
|
}
|
|
2545
2626
|
return n;
|
|
2546
2627
|
}
|
|
2547
|
-
function
|
|
2628
|
+
function ao(e, t, r) {
|
|
2548
2629
|
const n = [], o = e.baseRange.startLineNumber === 1 && e.baseRange.endLineNumberExclusive === 2;
|
|
2549
2630
|
return (e.input1Diffs.length > 0 || e.input2Diffs.length > 0) && !o && n.push({
|
|
2550
2631
|
range: new r.Range(
|
|
@@ -2567,18 +2648,18 @@ function Qr(e, t, r) {
|
|
|
2567
2648
|
}
|
|
2568
2649
|
}), n;
|
|
2569
2650
|
}
|
|
2570
|
-
function
|
|
2571
|
-
const o =
|
|
2651
|
+
function lo(e, t, r, n) {
|
|
2652
|
+
const o = io(e, t, r);
|
|
2572
2653
|
return {
|
|
2573
|
-
input1Decorations:
|
|
2574
|
-
input2Decorations:
|
|
2575
|
-
baseDecorations:
|
|
2654
|
+
input1Decorations: so(e, o, n),
|
|
2655
|
+
input2Decorations: co(e, o, n),
|
|
2656
|
+
baseDecorations: ao(e, o, n)
|
|
2576
2657
|
};
|
|
2577
2658
|
}
|
|
2578
|
-
function
|
|
2659
|
+
function uo(e, t, r, n) {
|
|
2579
2660
|
const o = [], i = [], s = [];
|
|
2580
2661
|
for (const c of e) {
|
|
2581
|
-
const a =
|
|
2662
|
+
const a = lo(c, t, r, n);
|
|
2582
2663
|
o.push(...a.input1Decorations), i.push(...a.input2Decorations), s.push(...a.baseDecorations);
|
|
2583
2664
|
}
|
|
2584
2665
|
return {
|
|
@@ -2587,8 +2668,8 @@ function Cr(e, t, r, n) {
|
|
|
2587
2668
|
baseDecorations: s
|
|
2588
2669
|
};
|
|
2589
2670
|
}
|
|
2590
|
-
const
|
|
2591
|
-
function
|
|
2671
|
+
const fo = () => /* @__PURE__ */ gt("div", { style: { padding: "20px", textAlign: "center", color: "#888" }, children: "Loading Monaco Editor..." }), Dt = "⚠";
|
|
2672
|
+
function vo(e) {
|
|
2592
2673
|
const {
|
|
2593
2674
|
original: t = "",
|
|
2594
2675
|
modified: r = "",
|
|
@@ -2598,333 +2679,334 @@ function ro(e) {
|
|
|
2598
2679
|
width: s = "100%",
|
|
2599
2680
|
height: c = "100%",
|
|
2600
2681
|
className: a,
|
|
2601
|
-
loading:
|
|
2682
|
+
loading: f,
|
|
2602
2683
|
onMount: l,
|
|
2603
2684
|
onMergeResolve: y,
|
|
2604
|
-
showResultColumn:
|
|
2605
|
-
baseIndex:
|
|
2606
|
-
comparisonMode:
|
|
2685
|
+
showResultColumn: d,
|
|
2686
|
+
baseIndex: h = 1,
|
|
2687
|
+
comparisonMode: T = "split",
|
|
2607
2688
|
schema: N,
|
|
2608
|
-
patches:
|
|
2609
|
-
labels:
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2689
|
+
patches: m,
|
|
2690
|
+
labels: g,
|
|
2691
|
+
sortKeys: O = !1
|
|
2692
|
+
} = e, u = n ? d : !1, A = !n || n === "", S = "json", [p, v] = _e(!1), [R, P] = _e(!0), [x, M] = _e([]), [B, F] = _e(null), [L, I] = _e([]), [D, K] = _e([]), [ie, ae] = _e(!1), [ge, Pe] = _e(/* @__PURE__ */ new Set()), Ae = se(""), $e = Ne((_, b, E, w) => {
|
|
2693
|
+
const k = document.createElement("div");
|
|
2694
|
+
k.className = "native-checkbox-container";
|
|
2613
2695
|
const U = document.createElement("input");
|
|
2614
|
-
return U.type = "checkbox", U.className = "native-checkbox", U.checked =
|
|
2615
|
-
|
|
2616
|
-
|
|
2696
|
+
return U.type = "checkbox", U.className = "native-checkbox", U.checked = _ === oe.first || _ === oe.second, U.setAttribute("aria-label", U.checked ? "Undo accept" : "Accept change"), U.addEventListener("click", (X) => {
|
|
2697
|
+
X.preventDefault(), X.stopPropagation(), requestAnimationFrame(() => {
|
|
2698
|
+
w();
|
|
2617
2699
|
});
|
|
2618
|
-
}),
|
|
2619
|
-
}, []), [
|
|
2700
|
+
}), k.appendChild(U), k;
|
|
2701
|
+
}, []), [Ee, Be] = _e(0), Z = se(null), pe = se(null), ee = se(null), G = se(null), be = se(null), et = se(null), Fe = se(!1), Et = se(!1), Ge = se(null), tt = se(null), Re = se(null), We = se(/* @__PURE__ */ new Map()), Te = se(null), je = se(/* @__PURE__ */ new Map()), qe = se(null), Ye = se(null), ze = se(null);
|
|
2620
2702
|
Se(() => {
|
|
2621
|
-
let
|
|
2622
|
-
const
|
|
2623
|
-
return
|
|
2624
|
-
|
|
2625
|
-
}).catch((
|
|
2626
|
-
|
|
2703
|
+
let _ = !0;
|
|
2704
|
+
const b = wr.init();
|
|
2705
|
+
return b.then((E) => {
|
|
2706
|
+
_ && (be.current = E, P(!1), v(!0));
|
|
2707
|
+
}).catch((E) => {
|
|
2708
|
+
_ && (E == null ? void 0 : E.type) !== "cancelation" && console.error("Monaco initialization: error:", E);
|
|
2627
2709
|
}), () => {
|
|
2628
|
-
|
|
2710
|
+
_ = !1, Fe.current || b.cancel();
|
|
2629
2711
|
};
|
|
2630
2712
|
}, []);
|
|
2631
|
-
const
|
|
2632
|
-
(
|
|
2633
|
-
if (!
|
|
2634
|
-
const
|
|
2713
|
+
const Yt = Ne(
|
|
2714
|
+
(_, b, E) => {
|
|
2715
|
+
if (!be.current) return [];
|
|
2716
|
+
const w = (_ == null ? void 0 : _.getValue()) || "", k = b.getValue(), U = E.getValue();
|
|
2635
2717
|
try {
|
|
2636
|
-
const
|
|
2637
|
-
comparisonMode:
|
|
2718
|
+
const X = performance.now(), Y = eo(w, k, U, {
|
|
2719
|
+
comparisonMode: T,
|
|
2638
2720
|
schema: N,
|
|
2639
|
-
patches:
|
|
2640
|
-
}),
|
|
2641
|
-
return
|
|
2642
|
-
} catch (
|
|
2643
|
-
const Y =
|
|
2721
|
+
patches: m
|
|
2722
|
+
}), j = performance.now() - X;
|
|
2723
|
+
return j > 100 && console.warn(`JSON Patch diff took ${j.toFixed(2)}ms`), Y;
|
|
2724
|
+
} catch (X) {
|
|
2725
|
+
const Y = X instanceof Error ? X.message : String(X);
|
|
2644
2726
|
return console.error("JSON Patch diff error:", Y), [];
|
|
2645
2727
|
}
|
|
2646
2728
|
},
|
|
2647
|
-
[
|
|
2648
|
-
),
|
|
2729
|
+
[T, N, m]
|
|
2730
|
+
), nt = Ne((_) => {
|
|
2649
2731
|
try {
|
|
2650
|
-
return
|
|
2732
|
+
return _.getLayoutInfo().decorationsLeft || 0;
|
|
2651
2733
|
} catch {
|
|
2652
2734
|
return 0;
|
|
2653
2735
|
}
|
|
2654
|
-
}, []),
|
|
2736
|
+
}, []), rt = Ne((_) => {
|
|
2655
2737
|
try {
|
|
2656
|
-
return
|
|
2738
|
+
return _.getLayoutInfo().decorationsWidth || 0;
|
|
2657
2739
|
} catch {
|
|
2658
2740
|
return 0;
|
|
2659
2741
|
}
|
|
2660
|
-
}, []),
|
|
2661
|
-
(
|
|
2662
|
-
if (!
|
|
2742
|
+
}, []), ft = Ne(
|
|
2743
|
+
(_) => {
|
|
2744
|
+
if (!u || !G.current || !Re.current)
|
|
2663
2745
|
return;
|
|
2664
|
-
const
|
|
2665
|
-
if (!
|
|
2666
|
-
const
|
|
2667
|
-
|
|
2668
|
-
const U =
|
|
2669
|
-
if (
|
|
2670
|
-
|
|
2671
|
-
for (const Y of
|
|
2672
|
-
const
|
|
2673
|
-
|
|
2674
|
-
const
|
|
2675
|
-
|
|
2746
|
+
const b = be.current;
|
|
2747
|
+
if (!b) return;
|
|
2748
|
+
const E = o === "vs-dark" || typeof o == "string" && o.includes("dark"), w = nt(G.current), k = rt(G.current);
|
|
2749
|
+
Re.current.style.left = `${w}px`, Re.current.style.width = `${k}px`;
|
|
2750
|
+
const U = G.current.getScrollTop();
|
|
2751
|
+
if (G.current.getModel()) {
|
|
2752
|
+
Re.current.innerHTML = "";
|
|
2753
|
+
for (const Y of _) {
|
|
2754
|
+
const j = Y.startLine, ue = Y.endLine, ne = G.current.getTopForLineNumber(j) - U, W = G.current.getTopForLineNumber(ue) - U, V = G.current.getOption(b.editor.EditorOption.lineHeight), le = ue > j ? W - ne + V : V, H = document.createElement("div");
|
|
2755
|
+
H.className = `conflict-issue-marker conflict-issue-${Y.type}`, H.setAttribute("data-conflict-id", Y.conflictId), H.setAttribute("data-issue-type", Y.type), H.title = Y.message, H.style.position = "absolute", H.style.top = `${Math.max(0, ne)}px`, H.style.height = `${le}px`, H.style.width = "26px", H.style.display = "flex", H.style.alignItems = "center", H.style.justifyContent = "center", H.style.cursor = "help", H.style.pointerEvents = "auto";
|
|
2756
|
+
const te = document.createElement("div");
|
|
2757
|
+
te.className = "issue-icon", Y.type === "error" ? (te.textContent = "✗", te.style.color = E ? "#ff6666" : "#cc0000") : Y.type === "warning" ? (te.textContent = Dt, te.style.color = E ? "#ffaa00" : "#ff8800") : Y.type === "smart-merge" && (te.textContent = "↕", te.style.color = E ? "#0096ff" : "#0078d4"), te.style.fontSize = "14px", te.style.fontWeight = "bold", H.appendChild(te), Re.current.appendChild(H);
|
|
2676
2758
|
}
|
|
2677
2759
|
}
|
|
2678
2760
|
},
|
|
2679
|
-
[
|
|
2680
|
-
),
|
|
2681
|
-
(
|
|
2682
|
-
var
|
|
2683
|
-
if (
|
|
2761
|
+
[u, o, nt, rt]
|
|
2762
|
+
), pt = Ne(
|
|
2763
|
+
(_) => {
|
|
2764
|
+
var re, le, H, te;
|
|
2765
|
+
if (!G.current || ie)
|
|
2684
2766
|
return;
|
|
2685
|
-
const
|
|
2686
|
-
if (!
|
|
2767
|
+
const b = G.current.getModel(), E = (re = Z.current) == null ? void 0 : re.getModel(), w = (le = ee.current) == null ? void 0 : le.getModel(), k = (H = pe.current) == null ? void 0 : H.getModel();
|
|
2768
|
+
if (!b || !E || !w || !k)
|
|
2687
2769
|
return;
|
|
2688
|
-
const U =
|
|
2689
|
-
if (
|
|
2690
|
-
const z = (
|
|
2691
|
-
|
|
2692
|
-
`)) : (
|
|
2693
|
-
}
|
|
2694
|
-
if (
|
|
2695
|
-
const z =
|
|
2696
|
-
if (
|
|
2697
|
-
const
|
|
2698
|
-
lineNumber: Math.min(z.lineNumber,
|
|
2699
|
-
column: z.lineNumber <=
|
|
2770
|
+
const U = k.getLinesContent(), X = E.getLinesContent(), Y = w.getLinesContent(), j = oo(U, X, Y, _, N);
|
|
2771
|
+
if (F(j.isValid ? null : j.validationError || "Invalid JSON"), I(j.warnings || []), K(j.conflictIssues || []), Te.current) {
|
|
2772
|
+
const z = (g == null ? void 0 : g.result) || "Result";
|
|
2773
|
+
j.isValid ? j.warnings && j.warnings.length > 0 ? (Te.current.textContent = `${z} ${Dt}`, Te.current.title = j.warnings.join(`
|
|
2774
|
+
`)) : (Te.current.textContent = z, Te.current.style.color = "", Te.current.title = "") : (Te.current.textContent = `${z} ${Dt} Invalid JSON`, Te.current.style.color = "#ff4444", Te.current.title = j.validationError || "Invalid JSON - please fix manually");
|
|
2775
|
+
}
|
|
2776
|
+
if (b.getValue() !== j.content) {
|
|
2777
|
+
const z = G.current.getPosition(), q = G.current.getSelection();
|
|
2778
|
+
if (Et.current = !0, b.setValue(j.content), Et.current = !1, z) {
|
|
2779
|
+
const de = b.getLineCount(), me = b.getLineLength(de), C = {
|
|
2780
|
+
lineNumber: Math.min(z.lineNumber, de),
|
|
2781
|
+
column: z.lineNumber <= de ? Math.min(z.column, b.getLineLength(z.lineNumber) + 1) : me + 1
|
|
2700
2782
|
};
|
|
2701
|
-
|
|
2783
|
+
G.current.setPosition(C), q && !q.isEmpty() && G.current.setSelection(q);
|
|
2702
2784
|
}
|
|
2703
2785
|
}
|
|
2704
|
-
const
|
|
2705
|
-
let
|
|
2706
|
-
if (!
|
|
2786
|
+
const ne = be.current, W = b;
|
|
2787
|
+
let V = W._invalidDecorations;
|
|
2788
|
+
if (!j.isValid && G.current && ne ? (V || (V = G.current.createDecorationsCollection([]), W._invalidDecorations = V), V.set([
|
|
2707
2789
|
{
|
|
2708
|
-
range: new
|
|
2790
|
+
range: new ne.Range(1, 1, b.getLineCount(), Number.MAX_SAFE_INTEGER),
|
|
2709
2791
|
options: {
|
|
2710
2792
|
isWholeLine: !1,
|
|
2711
2793
|
className: "merge-result-invalid",
|
|
2712
|
-
hoverMessage: { value:
|
|
2794
|
+
hoverMessage: { value: j.validationError || "Invalid JSON - please fix manually" }
|
|
2713
2795
|
}
|
|
2714
2796
|
}
|
|
2715
|
-
])) :
|
|
2716
|
-
if (
|
|
2717
|
-
const z =
|
|
2797
|
+
])) : j.isValid && V && G.current && V.set([]), j.conflictIssues && j.conflictIssues.length > 0) {
|
|
2798
|
+
if (ft(j.conflictIssues), G.current && ne) {
|
|
2799
|
+
const z = b;
|
|
2718
2800
|
if (!z._conflictIssueDecorations) {
|
|
2719
|
-
const
|
|
2801
|
+
const me = G.current.createDecorationsCollection(
|
|
2720
2802
|
[]
|
|
2721
2803
|
);
|
|
2722
|
-
z._conflictIssueDecorations =
|
|
2804
|
+
z._conflictIssueDecorations = me;
|
|
2723
2805
|
}
|
|
2724
|
-
const q = z._conflictIssueDecorations,
|
|
2725
|
-
let
|
|
2726
|
-
return
|
|
2727
|
-
range: new
|
|
2806
|
+
const q = z._conflictIssueDecorations, de = j.conflictIssues.map((me) => {
|
|
2807
|
+
let C, ye;
|
|
2808
|
+
return me.type === "error" ? (C = o === "vs-dark" ? "rgba(255, 0, 0, 0.1)" : "rgba(255, 0, 0, 0.05)", ye = o === "vs-dark" ? "#ff6666" : "#cc0000") : me.type === "warning" ? (C = o === "vs-dark" ? "rgba(255, 170, 0, 0.1)" : "rgba(255, 136, 0, 0.05)", ye = o === "vs-dark" ? "#ffaa00" : "#ff8800") : (C = o === "vs-dark" ? "rgba(0, 150, 255, 0.1)" : "rgba(0, 120, 212, 0.05)", ye = o === "vs-dark" ? "#0096ff" : "#0078d4"), {
|
|
2809
|
+
range: new ne.Range(me.startLine, 1, me.endLine, Number.MAX_SAFE_INTEGER),
|
|
2728
2810
|
options: {
|
|
2729
2811
|
isWholeLine: !0,
|
|
2730
|
-
className: `conflict-issue-line conflict-issue-${
|
|
2731
|
-
linesDecorationsClassName: `conflict-issue-line-decoration conflict-issue-${
|
|
2732
|
-
backgroundColor:
|
|
2812
|
+
className: `conflict-issue-line conflict-issue-${me.type}`,
|
|
2813
|
+
linesDecorationsClassName: `conflict-issue-line-decoration conflict-issue-${me.type}`,
|
|
2814
|
+
backgroundColor: C,
|
|
2733
2815
|
overviewRuler: {
|
|
2734
|
-
color:
|
|
2735
|
-
position:
|
|
2816
|
+
color: ye,
|
|
2817
|
+
position: ne.editor.OverviewRulerLane.Right
|
|
2736
2818
|
},
|
|
2737
2819
|
minimap: {
|
|
2738
|
-
color:
|
|
2739
|
-
position:
|
|
2820
|
+
color: ye,
|
|
2821
|
+
position: ne.editor.MinimapPosition.Inline
|
|
2740
2822
|
}
|
|
2741
2823
|
}
|
|
2742
2824
|
};
|
|
2743
2825
|
});
|
|
2744
|
-
q.set(
|
|
2826
|
+
q.set(de);
|
|
2745
2827
|
}
|
|
2746
|
-
} else if (
|
|
2747
|
-
const z =
|
|
2748
|
-
z._conflictIssueDecorations && z._conflictIssueDecorations.set([]),
|
|
2828
|
+
} else if (G.current) {
|
|
2829
|
+
const z = b;
|
|
2830
|
+
z._conflictIssueDecorations && z._conflictIssueDecorations.set([]), Re.current && u && (Re.current.innerHTML = "");
|
|
2749
2831
|
}
|
|
2750
2832
|
if (y) {
|
|
2751
|
-
const z = `${
|
|
2752
|
-
|
|
2753
|
-
y(
|
|
2754
|
-
isValid:
|
|
2755
|
-
validationError:
|
|
2756
|
-
warnings:
|
|
2757
|
-
conflictIssues:
|
|
2833
|
+
const z = `${j.content}|${j.isValid}|${(te = j.warnings) == null ? void 0 : te.join(",")}`;
|
|
2834
|
+
Ae.current !== z && (Ae.current = z, queueMicrotask(() => {
|
|
2835
|
+
y(j.content, {
|
|
2836
|
+
isValid: j.isValid,
|
|
2837
|
+
validationError: j.validationError,
|
|
2838
|
+
warnings: j.warnings,
|
|
2839
|
+
conflictIssues: j.conflictIssues
|
|
2758
2840
|
});
|
|
2759
2841
|
}));
|
|
2760
2842
|
}
|
|
2761
2843
|
},
|
|
2762
|
-
[y, N,
|
|
2763
|
-
),
|
|
2764
|
-
(
|
|
2765
|
-
|
|
2766
|
-
const
|
|
2767
|
-
if (
|
|
2768
|
-
const
|
|
2769
|
-
return
|
|
2844
|
+
[y, N, g, o, ft, u, ie]
|
|
2845
|
+
), Tt = Ne(
|
|
2846
|
+
(_, b) => {
|
|
2847
|
+
ae(!1), M((E) => {
|
|
2848
|
+
const w = E.map((k) => {
|
|
2849
|
+
if (k.id !== _) return k;
|
|
2850
|
+
const X = (b === 1 ? k.input1State : k.input2State) === oe.excluded ? oe.first : oe.excluded;
|
|
2851
|
+
return b === 1 ? { ...k, input1State: X } : { ...k, input2State: X };
|
|
2770
2852
|
});
|
|
2771
|
-
return
|
|
2853
|
+
return u && G.current && pt(w), w;
|
|
2772
2854
|
});
|
|
2773
2855
|
},
|
|
2774
|
-
[
|
|
2775
|
-
),
|
|
2776
|
-
(
|
|
2777
|
-
if (!
|
|
2778
|
-
const
|
|
2779
|
-
if (!
|
|
2780
|
-
const ue =
|
|
2781
|
-
if (!
|
|
2782
|
-
const
|
|
2783
|
-
if (
|
|
2856
|
+
[u, pt]
|
|
2857
|
+
), It = Ne(
|
|
2858
|
+
(_, b, E, w, k, U, X) => {
|
|
2859
|
+
if (!be.current) return;
|
|
2860
|
+
const j = w === 1 ? Z.current : ee.current;
|
|
2861
|
+
if (!j) return;
|
|
2862
|
+
const ue = w === 1 ? E.input1Range : E.input2Range, ne = w === 1 ? E.input1State : E.input2State, W = j.getModel();
|
|
2863
|
+
if (!W) return;
|
|
2864
|
+
const V = W.getLineCount(), re = Math.max(1, Math.min(ue.startLineNumber, V)), le = Math.max(1, Math.min(ue.endLineNumberExclusive - 1, V));
|
|
2865
|
+
if (re > V || le < 1 || re > le)
|
|
2784
2866
|
return;
|
|
2785
|
-
const
|
|
2786
|
-
let q =
|
|
2867
|
+
const H = j.getTopForLineNumber(re) - k, z = j.getBottomForLineNumber(le) - k - H;
|
|
2868
|
+
let q = We.current.get(b);
|
|
2787
2869
|
if (!q) {
|
|
2788
2870
|
q = document.createElement("div"), q.className = "merge-accept-gutter-marker";
|
|
2789
|
-
const
|
|
2790
|
-
|
|
2791
|
-
const
|
|
2792
|
-
|
|
2793
|
-
const
|
|
2794
|
-
|
|
2795
|
-
const
|
|
2796
|
-
|
|
2797
|
-
}
|
|
2798
|
-
q.style.top = `${
|
|
2799
|
-
const
|
|
2800
|
-
if (
|
|
2801
|
-
|
|
2802
|
-
const
|
|
2803
|
-
|
|
2804
|
-
}
|
|
2805
|
-
const
|
|
2806
|
-
q.className = "merge-accept-gutter-marker",
|
|
2807
|
-
const
|
|
2808
|
-
if (
|
|
2809
|
-
const
|
|
2810
|
-
let
|
|
2811
|
-
const
|
|
2812
|
-
|
|
2871
|
+
const Ie = document.createElement("div");
|
|
2872
|
+
Ie.className = "background", q.appendChild(Ie);
|
|
2873
|
+
const fe = document.createElement("div");
|
|
2874
|
+
fe.className = "checkbox";
|
|
2875
|
+
const Q = document.createElement("div");
|
|
2876
|
+
Q.className = "checkbox-background";
|
|
2877
|
+
const ve = $e(ne, w, E.id, () => Tt(E.id, w));
|
|
2878
|
+
Q.appendChild(ve), fe.appendChild(Q), q.appendChild(fe), _.appendChild(q), We.current.set(b, q);
|
|
2879
|
+
}
|
|
2880
|
+
q.style.top = `${H}px`, q.style.height = `${z}px`;
|
|
2881
|
+
const de = q.querySelector(".checkbox-background");
|
|
2882
|
+
if (de) {
|
|
2883
|
+
de.innerHTML = "";
|
|
2884
|
+
const Ie = $e(ne, w, E.id, () => Tt(E.id, w));
|
|
2885
|
+
de.appendChild(Ie);
|
|
2886
|
+
}
|
|
2887
|
+
const me = E.handled, C = E.focused, ye = z > 30;
|
|
2888
|
+
q.className = "merge-accept-gutter-marker", me && q.classList.add("handled"), C && q.classList.add("focused"), ye ? q.classList.add("multi-line") : q.classList.add("single-line");
|
|
2889
|
+
const Ue = q.querySelector(".checkbox");
|
|
2890
|
+
if (Ue) {
|
|
2891
|
+
const fe = z / 2 - 12, Q = 24;
|
|
2892
|
+
let ve = fe;
|
|
2893
|
+
const De = Q, Le = U - Q - 24, ke = Q, Ve = z - 24 - Q;
|
|
2894
|
+
ke < Ve && (ve = Math.max(De, Math.min(ve + H, Le)) - H, ve = Math.max(ke, Math.min(ve, Ve))), Ue.style.top = `${ve + 5}px`;
|
|
2813
2895
|
}
|
|
2814
2896
|
},
|
|
2815
|
-
[
|
|
2816
|
-
),
|
|
2817
|
-
if (!
|
|
2818
|
-
const
|
|
2819
|
-
for (const [
|
|
2820
|
-
|
|
2897
|
+
[Tt, $e]
|
|
2898
|
+
), dt = Ne(() => {
|
|
2899
|
+
if (!u) {
|
|
2900
|
+
const W = We.current;
|
|
2901
|
+
for (const [V, re] of W.entries())
|
|
2902
|
+
re.remove(), W.delete(V);
|
|
2821
2903
|
return;
|
|
2822
2904
|
}
|
|
2823
|
-
if (!
|
|
2905
|
+
if (!Z.current || !ee.current || !Ge.current || !tt.current || !be.current)
|
|
2824
2906
|
return;
|
|
2825
|
-
const
|
|
2826
|
-
|
|
2827
|
-
const
|
|
2828
|
-
if (!
|
|
2829
|
-
const Y =
|
|
2830
|
-
for (const
|
|
2831
|
-
if (!(
|
|
2832
|
-
if (
|
|
2833
|
-
const
|
|
2834
|
-
ue.add(
|
|
2907
|
+
const b = o === "vs-dark" || typeof o == "string" && o.includes("dark"), E = nt(Z.current), w = rt(Z.current), k = nt(ee.current), U = rt(ee.current);
|
|
2908
|
+
Ge.current.style.left = `${E}px`, Ge.current.style.width = `${w}px`, tt.current.style.left = `${k}px`, tt.current.style.width = `${U}px`;
|
|
2909
|
+
const X = Z.current.getVisibleRanges();
|
|
2910
|
+
if (!X || X.length === 0) return;
|
|
2911
|
+
const Y = Z.current.getScrollTop(), j = Ge.current.clientHeight, ue = /* @__PURE__ */ new Set();
|
|
2912
|
+
for (const W of x)
|
|
2913
|
+
if (!(W.input1Diffs.length === 0 && W.input2Diffs.length === 0)) {
|
|
2914
|
+
if (W.input1Diffs.length > 0) {
|
|
2915
|
+
const V = `${W.id}-input1`;
|
|
2916
|
+
ue.add(V), It(Ge.current, V, W, 1, Y, j, b);
|
|
2835
2917
|
}
|
|
2836
|
-
if (
|
|
2837
|
-
const
|
|
2838
|
-
ue.add(
|
|
2918
|
+
if (W.input2Diffs.length > 0) {
|
|
2919
|
+
const V = `${W.id}-input2`;
|
|
2920
|
+
ue.add(V), It(tt.current, V, W, 2, Y, j, b);
|
|
2839
2921
|
}
|
|
2840
2922
|
}
|
|
2841
|
-
const
|
|
2842
|
-
for (const [
|
|
2843
|
-
ue.has(
|
|
2844
|
-
}, [
|
|
2845
|
-
var
|
|
2923
|
+
const ne = We.current;
|
|
2924
|
+
for (const [W, V] of ne.entries())
|
|
2925
|
+
ue.has(W) || (V.remove(), ne.delete(W));
|
|
2926
|
+
}, [x, o, u, nt, rt, It]), we = Ne((_, b) => {
|
|
2927
|
+
var E, w, k;
|
|
2846
2928
|
try {
|
|
2847
|
-
if (
|
|
2848
|
-
const U = (
|
|
2849
|
-
if ((
|
|
2850
|
-
return U.colors[
|
|
2929
|
+
if (be.current) {
|
|
2930
|
+
const U = (w = (E = be.current.editor).getTheme) == null ? void 0 : w.call(E);
|
|
2931
|
+
if ((k = U == null ? void 0 : U.colors) != null && k[_])
|
|
2932
|
+
return U.colors[_];
|
|
2851
2933
|
}
|
|
2852
2934
|
} catch {
|
|
2853
2935
|
}
|
|
2854
|
-
return
|
|
2855
|
-
}, []),
|
|
2856
|
-
if (!
|
|
2936
|
+
return b;
|
|
2937
|
+
}, []), zt = Ne(() => {
|
|
2938
|
+
if (!be.current || !Z.current || !ee.current)
|
|
2857
2939
|
return;
|
|
2858
|
-
const
|
|
2940
|
+
const _ = be.current, b = o === "vs-dark" || typeof o == "string" && o.includes("dark"), E = we("mergeEditor.change.background", b ? "rgba(255, 166, 0, 0.2)" : "rgba(255, 166, 0, 0.15)"), w = we(
|
|
2859
2941
|
"diffEditor.insertedTextBackground",
|
|
2860
|
-
|
|
2861
|
-
),
|
|
2942
|
+
b ? "rgba(155, 185, 85, 0.2)" : "rgba(155, 185, 85, 0.15)"
|
|
2943
|
+
), k = we(
|
|
2862
2944
|
"mergeEditor.changeBase.background",
|
|
2863
|
-
|
|
2864
|
-
), U =
|
|
2945
|
+
b ? "rgba(255, 100, 100, 0.2)" : "rgba(255, 100, 100, 0.15)"
|
|
2946
|
+
), U = we(
|
|
2865
2947
|
"editorOverviewRuler.modifiedForeground",
|
|
2866
|
-
|
|
2867
|
-
),
|
|
2948
|
+
b ? "rgba(255, 166, 0, 0.8)" : "rgba(255, 166, 0, 1)"
|
|
2949
|
+
), X = we(
|
|
2868
2950
|
"editorOverviewRuler.addedForeground",
|
|
2869
|
-
|
|
2870
|
-
), Y =
|
|
2951
|
+
b ? "rgba(155, 185, 85, 0.8)" : "rgba(155, 185, 85, 1)"
|
|
2952
|
+
), Y = we(
|
|
2871
2953
|
"editorOverviewRuler.deletedForeground",
|
|
2872
|
-
|
|
2873
|
-
),
|
|
2954
|
+
b ? "rgba(255, 100, 100, 0.8)" : "rgba(255, 100, 100, 1)"
|
|
2955
|
+
), j = A, ue = {
|
|
2874
2956
|
conflictOverviewColor: U,
|
|
2875
|
-
changeOverviewColor:
|
|
2957
|
+
changeOverviewColor: X,
|
|
2876
2958
|
baseOverviewColor: Y
|
|
2877
|
-
}, { input1Decorations:
|
|
2878
|
-
|
|
2879
|
-
|
|
2959
|
+
}, { input1Decorations: ne, input2Decorations: W, baseDecorations: V } = uo(
|
|
2960
|
+
x,
|
|
2961
|
+
j,
|
|
2880
2962
|
ue,
|
|
2881
|
-
|
|
2882
|
-
),
|
|
2963
|
+
_
|
|
2964
|
+
), re = we("input.background", b ? "#3c3c3c" : "#f3f3f3"), le = we("input.border", b ? "#6b6b6b" : "#c8c8c8"), H = we("focusBorder", b ? "#007acc" : "#0078d4"), te = we("inputOption.activeForeground", b ? "#3794ff" : "#0078d4"), z = "monaco-three-way-diff-dynamic";
|
|
2883
2965
|
let q = document.getElementById(z);
|
|
2884
2966
|
q || (q = document.createElement("style"), q.id = z, document.head.appendChild(q));
|
|
2885
|
-
const
|
|
2967
|
+
const de = we(
|
|
2886
2968
|
"diffEditor.insertedTextBackground",
|
|
2887
|
-
|
|
2888
|
-
),
|
|
2969
|
+
b ? "rgba(100, 100, 255, 0.15)" : "rgba(100, 100, 255, 0.1)"
|
|
2970
|
+
), me = we(
|
|
2889
2971
|
"diffEditor.insertedTextBackground",
|
|
2890
|
-
|
|
2972
|
+
b ? "rgba(155, 185, 85, 0.2)" : "rgba(155, 185, 85, 0.15)"
|
|
2891
2973
|
);
|
|
2892
2974
|
q.textContent = `
|
|
2893
2975
|
/* True conflict - both sides changed differently (orange/amber) */
|
|
2894
2976
|
.monaco-editor .merge-conflict-incoming,
|
|
2895
2977
|
.monaco-editor .merge-conflict-current {
|
|
2896
|
-
background-color: ${
|
|
2978
|
+
background-color: ${E};
|
|
2897
2979
|
}
|
|
2898
2980
|
|
|
2899
2981
|
/* 2-way diff mode: red for deletions (input1 column) - must override merge-change-incoming */
|
|
2900
2982
|
.monaco-editor .merge-2way-deletion,
|
|
2901
2983
|
.monaco-editor .monaco-editor .merge-2way-deletion {
|
|
2902
|
-
background-color: ${
|
|
2984
|
+
background-color: ${k} !important;
|
|
2903
2985
|
}
|
|
2904
2986
|
|
|
2905
2987
|
/* Single-side change (green for input2/ours, orange for input1/theirs in 3-way) */
|
|
2906
2988
|
.monaco-editor .merge-change-incoming {
|
|
2907
|
-
background-color: ${
|
|
2989
|
+
background-color: ${me};
|
|
2908
2990
|
}
|
|
2909
2991
|
.monaco-editor .merge-change-current {
|
|
2910
|
-
background-color: ${
|
|
2992
|
+
background-color: ${w};
|
|
2911
2993
|
}
|
|
2912
2994
|
|
|
2913
2995
|
/* Same change on both sides (blue/purple) */
|
|
2914
2996
|
.monaco-editor .merge-same-change {
|
|
2915
|
-
background-color: ${
|
|
2997
|
+
background-color: ${de};
|
|
2916
2998
|
}
|
|
2917
2999
|
|
|
2918
3000
|
/* Base changes */
|
|
2919
3001
|
.monaco-editor .merge-conflict-base,
|
|
2920
3002
|
.monaco-editor .merge-change-base {
|
|
2921
|
-
background-color: ${
|
|
3003
|
+
background-color: ${k};
|
|
2922
3004
|
}
|
|
2923
3005
|
|
|
2924
3006
|
/* Invalid JSON in result column */
|
|
2925
3007
|
.monaco-editor .merge-result-invalid {
|
|
2926
|
-
background-color: ${
|
|
2927
|
-
outline: 1px solid ${
|
|
3008
|
+
background-color: ${b ? "rgba(255, 0, 0, 0.2)" : "rgba(255, 0, 0, 0.1)"};
|
|
3009
|
+
outline: 1px solid ${b ? "rgba(255, 100, 100, 0.5)" : "rgba(255, 0, 0, 0.3)"};
|
|
2928
3010
|
}
|
|
2929
3011
|
|
|
2930
3012
|
/* Diff symbols (+ and -) in line decorations - positioned in code area */
|
|
@@ -2956,7 +3038,7 @@ function ro(e) {
|
|
|
2956
3038
|
pointer-events: none;
|
|
2957
3039
|
font-family: "Courier New", monospace;
|
|
2958
3040
|
width: 20px;
|
|
2959
|
-
color: ${
|
|
3041
|
+
color: ${b ? "#9BB955" : "#6A9955"};
|
|
2960
3042
|
}
|
|
2961
3043
|
|
|
2962
3044
|
.monaco-editor .diff-symbol.diff-symbol-minus::before {
|
|
@@ -2975,7 +3057,7 @@ function ro(e) {
|
|
|
2975
3057
|
pointer-events: none;
|
|
2976
3058
|
font-family: "Courier New", monospace;
|
|
2977
3059
|
width: 20px;
|
|
2978
|
-
color: ${
|
|
3060
|
+
color: ${b ? "#FF6464" : "#CC0000"};
|
|
2979
3061
|
}
|
|
2980
3062
|
|
|
2981
3063
|
/* VSCode-style checkbox gutter - positioned at Monaco's glyph margin */
|
|
@@ -3018,12 +3100,12 @@ function ro(e) {
|
|
|
3018
3100
|
width: 14px;
|
|
3019
3101
|
height: 14px;
|
|
3020
3102
|
border-radius: 3px;
|
|
3021
|
-
background-color: ${
|
|
3022
|
-
border: 1px solid ${
|
|
3103
|
+
background-color: ${re};
|
|
3104
|
+
border: 1px solid ${le};
|
|
3023
3105
|
}
|
|
3024
3106
|
|
|
3025
3107
|
.merge-accept-gutter-marker.focused .checkbox-background {
|
|
3026
|
-
border-color: ${
|
|
3108
|
+
border-color: ${H};
|
|
3027
3109
|
border-width: 2px;
|
|
3028
3110
|
}
|
|
3029
3111
|
|
|
@@ -3046,7 +3128,7 @@ function ro(e) {
|
|
|
3046
3128
|
height: 16px;
|
|
3047
3129
|
cursor: pointer;
|
|
3048
3130
|
margin: 0;
|
|
3049
|
-
accent-color: ${
|
|
3131
|
+
accent-color: ${te};
|
|
3050
3132
|
}
|
|
3051
3133
|
|
|
3052
3134
|
/* Result column status indicator */
|
|
@@ -3071,172 +3153,228 @@ function ro(e) {
|
|
|
3071
3153
|
}
|
|
3072
3154
|
|
|
3073
3155
|
.native-checkbox:focus {
|
|
3074
|
-
outline: 2px solid ${
|
|
3156
|
+
outline: 2px solid ${H};
|
|
3075
3157
|
outline-offset: 2px;
|
|
3076
3158
|
}
|
|
3077
|
-
`,
|
|
3078
|
-
}, [
|
|
3079
|
-
if (!
|
|
3080
|
-
const
|
|
3081
|
-
|
|
3082
|
-
const O = document.createElement("div");
|
|
3083
|
-
O.style.display = "flex", O.style.height = "100%", O.style.width = "100%";
|
|
3084
|
-
const I = o === "vs-dark" || typeof o == "string" && o.includes("dark"), B = I ? "#444" : "#ddd", P = I ? "#fff" : "#333", U = (ee, ve) => {
|
|
3085
|
-
var Ae, Oe, ge;
|
|
3159
|
+
`, qe.current || (qe.current = Z.current.createDecorationsCollection([])), qe.current.set(ne), Ye.current || (Ye.current = ee.current.createDecorationsCollection([])), Ye.current.set(W), pe.current && (ze.current || (ze.current = pe.current.createDecorationsCollection([])), ze.current.set(V));
|
|
3160
|
+
}, [x, o, A, we]), Ct = Ne(() => {
|
|
3161
|
+
if (!Fe.current && et.current && be.current && !R) {
|
|
3162
|
+
const _ = be.current, b = (C) => {
|
|
3163
|
+
if (!O || !C) return C;
|
|
3086
3164
|
try {
|
|
3087
|
-
const
|
|
3088
|
-
|
|
3089
|
-
return pe.colors[ee];
|
|
3165
|
+
const ye = JSON.parse(C);
|
|
3166
|
+
return Wr(ye);
|
|
3090
3167
|
} catch {
|
|
3168
|
+
return C;
|
|
3091
3169
|
}
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
const
|
|
3111
|
-
|
|
3112
|
-
|
|
3170
|
+
};
|
|
3171
|
+
et.current.innerHTML = "", je.current.clear();
|
|
3172
|
+
const E = document.createElement("div");
|
|
3173
|
+
E.style.display = "flex", E.style.height = "100%", E.style.width = "100%";
|
|
3174
|
+
const w = o === "vs-dark" || typeof o == "string" && o.includes("dark"), k = w ? "#444" : "#ddd", U = w ? "#fff" : "#333", X = (C, ye) => {
|
|
3175
|
+
var Ue, Ie, fe;
|
|
3176
|
+
try {
|
|
3177
|
+
const Q = (Ie = (Ue = _.editor).getTheme) == null ? void 0 : Ie.call(Ue);
|
|
3178
|
+
if ((fe = Q == null ? void 0 : Q.colors) != null && fe[C])
|
|
3179
|
+
return Q.colors[C];
|
|
3180
|
+
} catch {
|
|
3181
|
+
}
|
|
3182
|
+
return ye;
|
|
3183
|
+
}, Y = X("mergeEditor.conflict.input1.header.background", w ? "#4B1818" : "#FFE6E6"), j = X("editorGutter.background", w ? "#333" : "#f0f0f0"), ue = X("mergeEditor.conflict.input2.header.background", w ? "#1B4B18" : "#E6FFE6"), ne = X("mergeEditor.result.header.background", w ? "#7F5F00" : "#FFECB3"), W = (C, ye, Ue, Ie = !1) => {
|
|
3184
|
+
const fe = document.createElement("div");
|
|
3185
|
+
fe.style.flex = "1", fe.style.display = "flex", fe.style.flexDirection = "column", fe.style.borderRight = `1px solid ${k}`, fe.style.overflow = "hidden", fe.style.transition = "flex 0.2s ease, min-width 0.2s ease, max-width 0.2s ease", fe.dataset.columnKey = C;
|
|
3186
|
+
const Q = document.createElement("div");
|
|
3187
|
+
Q.style.padding = "4px 8px", Q.style.fontSize = "11px", Q.style.fontWeight = "500", Q.style.backgroundColor = Ue, Q.style.color = U, Q.style.borderBottom = `1px solid ${k}`, Q.style.display = "flex", Q.style.alignItems = "center", Q.style.gap = "4px", Q.style.height = "22px", Q.style.boxSizing = "content-box", Q.style.whiteSpace = "nowrap", Q.style.overflow = "hidden";
|
|
3188
|
+
const ve = document.createElement("span");
|
|
3189
|
+
ve.textContent = ye, ve.style.flex = "1", ve.style.overflow = "hidden", ve.style.textOverflow = "ellipsis", Q.appendChild(ve);
|
|
3190
|
+
const De = document.createElement("div");
|
|
3191
|
+
De.className = "column-collapse-icon", De.title = "Collapse column", De.innerHTML = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" style="display:block"><path d="M8 2L4 6L8 10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>', De.addEventListener("click", (kn) => {
|
|
3192
|
+
kn.stopPropagation(), Pe((en) => {
|
|
3193
|
+
const ot = new Set(en);
|
|
3194
|
+
if (ot.has(C))
|
|
3195
|
+
ot.delete(C);
|
|
3196
|
+
else {
|
|
3197
|
+
if (Array.from(je.current.keys()).filter((Sn) => !ot.has(Sn)).length <= 1) return en;
|
|
3198
|
+
ot.add(C);
|
|
3199
|
+
}
|
|
3200
|
+
return ot;
|
|
3201
|
+
});
|
|
3202
|
+
}), Q.appendChild(De), fe.appendChild(Q);
|
|
3203
|
+
const Le = document.createElement("div");
|
|
3204
|
+
Le.style.flex = "1", Le.style.position = "relative", Le.style.overflow = "hidden", Le.style.transition = "opacity 0.2s ease";
|
|
3205
|
+
const ke = document.createElement("div");
|
|
3206
|
+
ke.style.position = "absolute", ke.style.left = "0", ke.style.right = "0", ke.style.top = "0", ke.style.bottom = "0", Le.appendChild(ke);
|
|
3207
|
+
let Ve = null;
|
|
3208
|
+
return Ie && (Ve = document.createElement("div"), Ve.className = "merge-editor-gutter", Le.appendChild(Ve)), fe.appendChild(Le), je.current.set(C, { container: fe, editorWrapper: Le, labelDiv: Q, labelText: ve, collapseIcon: De }), { container: fe, editorDiv: ke, gutterDiv: Ve };
|
|
3209
|
+
}, V = W("input1", (g == null ? void 0 : g.input1) || "Theirs", Y, u), re = W("input2", (g == null ? void 0 : g.input2) || "Ours", ue, u);
|
|
3210
|
+
V.gutterDiv && (Ge.current = V.gutterDiv), re.gutterDiv && (tt.current = re.gutterDiv);
|
|
3211
|
+
const le = !!n;
|
|
3212
|
+
let H = null;
|
|
3213
|
+
if (le) {
|
|
3214
|
+
H = W("base", (g == null ? void 0 : g.base) || "Base", j, !1);
|
|
3215
|
+
const C = [];
|
|
3216
|
+
h === 0 ? C.push(H.container, V.container, re.container) : h === 1 ? C.push(V.container, H.container, re.container) : h === 2 && C.push(V.container, re.container, H.container), C.forEach((ye) => {
|
|
3217
|
+
E.appendChild(ye);
|
|
3113
3218
|
});
|
|
3114
3219
|
} else
|
|
3115
|
-
|
|
3116
|
-
let
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3220
|
+
E.appendChild(V.container), E.appendChild(re.container);
|
|
3221
|
+
let te = null;
|
|
3222
|
+
if (u && le) {
|
|
3223
|
+
te = W("result", (g == null ? void 0 : g.result) || "Result", ne, !0);
|
|
3224
|
+
const C = je.current.get("result");
|
|
3225
|
+
Te.current = (C == null ? void 0 : C.labelText) ?? te.container.querySelector("span"), te.gutterDiv && (Re.current = te.gutterDiv), E.appendChild(te.container);
|
|
3226
|
+
}
|
|
3227
|
+
et.current.appendChild(E);
|
|
3228
|
+
const z = _.editor.createModel(b(t || ""), S), q = le ? _.editor.createModel(b(n || ""), S) : null, de = _.editor.createModel(b(r || ""), S);
|
|
3229
|
+
if (Z.current = _.editor.create(V.editorDiv, {
|
|
3230
|
+
model: z,
|
|
3121
3231
|
readOnly: !0,
|
|
3122
3232
|
automaticLayout: !0,
|
|
3123
|
-
folding: !
|
|
3233
|
+
folding: !u,
|
|
3124
3234
|
glyphMargin: !1,
|
|
3125
3235
|
...i,
|
|
3126
|
-
lineDecorationsWidth:
|
|
3127
|
-
}),
|
|
3128
|
-
model:
|
|
3236
|
+
lineDecorationsWidth: u ? 26 : 10
|
|
3237
|
+
}), le && H && (pe.current = _.editor.create(H.editorDiv, {
|
|
3238
|
+
model: q,
|
|
3129
3239
|
readOnly: !0,
|
|
3130
3240
|
automaticLayout: !0,
|
|
3131
|
-
folding: !
|
|
3241
|
+
folding: !u,
|
|
3132
3242
|
glyphMargin: !1,
|
|
3133
3243
|
...i,
|
|
3134
3244
|
lineDecorationsWidth: 10
|
|
3135
|
-
})),
|
|
3136
|
-
model:
|
|
3245
|
+
})), ee.current = _.editor.create(re.editorDiv, {
|
|
3246
|
+
model: de,
|
|
3137
3247
|
readOnly: !0,
|
|
3138
3248
|
automaticLayout: !0,
|
|
3139
|
-
folding: !
|
|
3249
|
+
folding: !u,
|
|
3140
3250
|
glyphMargin: !1,
|
|
3141
3251
|
...i,
|
|
3142
|
-
lineDecorationsWidth:
|
|
3143
|
-
}),
|
|
3144
|
-
const
|
|
3145
|
-
|
|
3146
|
-
model:
|
|
3252
|
+
lineDecorationsWidth: u ? 26 : 10
|
|
3253
|
+
}), u && te) {
|
|
3254
|
+
const C = _.editor.createModel(b(r || ""), S);
|
|
3255
|
+
G.current = _.editor.create(te.editorDiv, {
|
|
3256
|
+
model: C,
|
|
3147
3257
|
automaticLayout: !0,
|
|
3148
|
-
folding: !
|
|
3258
|
+
folding: !u,
|
|
3149
3259
|
glyphMargin: !1,
|
|
3150
3260
|
...i,
|
|
3151
3261
|
readOnly: !1,
|
|
3152
3262
|
lineDecorationsWidth: 26
|
|
3153
|
-
}),
|
|
3154
|
-
|
|
3263
|
+
}), C.onDidChangeContent(() => {
|
|
3264
|
+
Et.current || ae(!0);
|
|
3155
3265
|
});
|
|
3156
3266
|
}
|
|
3157
|
-
|
|
3158
|
-
const
|
|
3159
|
-
|
|
3267
|
+
_.editor.setTheme(o);
|
|
3268
|
+
const me = Yt(q, z, de);
|
|
3269
|
+
M(me), Fe.current = !0, l && Z.current && ee.current && l(
|
|
3160
3270
|
{
|
|
3161
|
-
input1:
|
|
3162
|
-
input2:
|
|
3163
|
-
base:
|
|
3164
|
-
result:
|
|
3271
|
+
input1: Z.current,
|
|
3272
|
+
input2: ee.current,
|
|
3273
|
+
base: pe.current,
|
|
3274
|
+
result: G.current
|
|
3165
3275
|
},
|
|
3166
|
-
|
|
3276
|
+
_
|
|
3167
3277
|
);
|
|
3168
3278
|
}
|
|
3169
|
-
}, [
|
|
3279
|
+
}, [
|
|
3280
|
+
i,
|
|
3281
|
+
o,
|
|
3282
|
+
t,
|
|
3283
|
+
r,
|
|
3284
|
+
n,
|
|
3285
|
+
u,
|
|
3286
|
+
h,
|
|
3287
|
+
R,
|
|
3288
|
+
Yt,
|
|
3289
|
+
l,
|
|
3290
|
+
g,
|
|
3291
|
+
O
|
|
3292
|
+
]), Xt = se(u), Kt = se(h), Qt = se(T), Zt = se(n);
|
|
3170
3293
|
return Se(() => {
|
|
3171
|
-
var
|
|
3172
|
-
const
|
|
3173
|
-
if ((
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
}),
|
|
3177
|
-
const
|
|
3178
|
-
(
|
|
3179
|
-
}
|
|
3180
|
-
}, [
|
|
3181
|
-
!
|
|
3182
|
-
}, [
|
|
3183
|
-
!
|
|
3184
|
-
}, [i,
|
|
3185
|
-
|
|
3186
|
-
}, [
|
|
3187
|
-
|
|
3188
|
-
}, [
|
|
3189
|
-
if (!
|
|
3190
|
-
const
|
|
3191
|
-
|
|
3192
|
-
},
|
|
3193
|
-
|
|
3294
|
+
var k, U, X, Y, j, ue, ne, W, V, re, le;
|
|
3295
|
+
const _ = Xt.current !== u, b = Kt.current !== h, E = Qt.current !== T, w = Zt.current !== n;
|
|
3296
|
+
if ((_ || b || E || w) && Fe.current) {
|
|
3297
|
+
Xt.current = u, Kt.current = h, Qt.current = T, Zt.current = n, We.current.forEach((de) => {
|
|
3298
|
+
de.remove();
|
|
3299
|
+
}), We.current.clear(), je.current.clear(), Pe(/* @__PURE__ */ new Set()), (k = qe.current) == null || k.set([]), (U = Ye.current) == null || U.set([]), (X = ze.current) == null || X.set([]), qe.current = null, Ye.current = null, ze.current = null;
|
|
3300
|
+
const H = (Y = Z.current) == null ? void 0 : Y.getModel(), te = (j = pe.current) == null ? void 0 : j.getModel(), z = (ue = ee.current) == null ? void 0 : ue.getModel(), q = (ne = G.current) == null ? void 0 : ne.getModel();
|
|
3301
|
+
(W = Z.current) == null || W.dispose(), (V = pe.current) == null || V.dispose(), (re = ee.current) == null || re.dispose(), (le = G.current) == null || le.dispose(), H == null || H.dispose(), te == null || te.dispose(), z == null || z.dispose(), q == null || q.dispose(), Fe.current = !1, Be((de) => de + 1);
|
|
3302
|
+
}
|
|
3303
|
+
}, [u, h, T, n]), Se(() => {
|
|
3304
|
+
!R && be.current && et.current && !Fe.current && Ct();
|
|
3305
|
+
}, [R, Ct]), Se(() => {
|
|
3306
|
+
!p || !i || (Z.current && Z.current.updateOptions(i), ee.current && ee.current.updateOptions(i), pe.current && pe.current.updateOptions(i), G.current && G.current.updateOptions(i));
|
|
3307
|
+
}, [i, p]), Se(() => {
|
|
3308
|
+
p && x.length > 0 && (zt(), u && dt());
|
|
3309
|
+
}, [p, x, zt, dt, u]), Se(() => {
|
|
3310
|
+
p && x.length > 0 && u && G.current && pt(x);
|
|
3311
|
+
}, [p, x, u, pt]), Se(() => {
|
|
3312
|
+
if (!p) return;
|
|
3313
|
+
const _ = () => {
|
|
3314
|
+
D.length > 0 && ft(D);
|
|
3315
|
+
}, b = [], E = () => {
|
|
3316
|
+
dt();
|
|
3194
3317
|
};
|
|
3195
|
-
return
|
|
3196
|
-
|
|
3197
|
-
|
|
3318
|
+
return Z.current && b.push(Z.current.onDidScrollChange(E)), ee.current && b.push(ee.current.onDidScrollChange(E)), G.current && u && (b.push(G.current.onDidScrollChange(_)), b.push(G.current.onDidLayoutChange(_))), Z.current && b.push(Z.current.onDidLayoutChange(E)), ee.current && b.push(ee.current.onDidLayoutChange(E)), () => {
|
|
3319
|
+
b.forEach((w) => {
|
|
3320
|
+
w == null || w.dispose();
|
|
3198
3321
|
});
|
|
3199
3322
|
};
|
|
3200
|
-
}, [
|
|
3201
|
-
if (!
|
|
3202
|
-
const
|
|
3203
|
-
|
|
3204
|
-
const
|
|
3205
|
-
let
|
|
3206
|
-
const
|
|
3207
|
-
if (
|
|
3208
|
-
|
|
3209
|
-
const U =
|
|
3210
|
-
|
|
3211
|
-
Y && Y !==
|
|
3323
|
+
}, [p, dt, ft, u, D]), Se(() => {
|
|
3324
|
+
if (!p) return;
|
|
3325
|
+
const _ = [Z.current, pe.current, ee.current];
|
|
3326
|
+
u && G.current && _.push(G.current);
|
|
3327
|
+
const b = [];
|
|
3328
|
+
let E = !1;
|
|
3329
|
+
const w = (k) => {
|
|
3330
|
+
if (E) return;
|
|
3331
|
+
E = !0;
|
|
3332
|
+
const U = k.getScrollTop(), X = k.getScrollLeft();
|
|
3333
|
+
_.forEach((Y) => {
|
|
3334
|
+
Y && Y !== k && (Y.setScrollTop(U), Y.setScrollLeft(X));
|
|
3212
3335
|
}), setTimeout(() => {
|
|
3213
|
-
|
|
3336
|
+
E = !1;
|
|
3214
3337
|
}, 10);
|
|
3215
3338
|
};
|
|
3216
|
-
return
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3339
|
+
return _.forEach((k) => {
|
|
3340
|
+
k && b.push(
|
|
3341
|
+
k.onDidScrollChange(() => {
|
|
3342
|
+
w(k);
|
|
3220
3343
|
})
|
|
3221
3344
|
);
|
|
3222
3345
|
}), () => {
|
|
3223
|
-
|
|
3224
|
-
|
|
3346
|
+
b.forEach((k) => {
|
|
3347
|
+
k == null || k.dispose();
|
|
3225
3348
|
});
|
|
3226
3349
|
};
|
|
3227
|
-
}, [
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3350
|
+
}, [p, u]), Se(() => {
|
|
3351
|
+
if (!p) return;
|
|
3352
|
+
const b = Array.from(je.current.keys()).filter((E) => !ge.has(E)).length;
|
|
3353
|
+
for (const [E, w] of je.current.entries()) {
|
|
3354
|
+
const k = ge.has(E), U = b > 1 || k;
|
|
3355
|
+
k ? (w.container.style.flex = "0 0 28px", w.container.style.minWidth = "28px", w.container.style.maxWidth = "28px", w.editorWrapper.style.opacity = "0", w.editorWrapper.style.pointerEvents = "none", w.labelDiv.style.justifyContent = "center", w.labelText.style.display = "none", w.collapseIcon.style.transform = "rotate(180deg)", w.collapseIcon.title = "Expand column") : (w.container.style.flex = "1", w.container.style.minWidth = "", w.container.style.maxWidth = "", w.editorWrapper.style.opacity = "1", w.editorWrapper.style.pointerEvents = "", w.labelDiv.style.justifyContent = "", w.labelText.style.display = "", w.collapseIcon.style.transform = "", w.collapseIcon.title = "Collapse column"), !k && !U ? (w.collapseIcon.classList.add("column-collapse-icon--disabled"), w.collapseIcon.title = "Cannot collapse last column") : w.collapseIcon.classList.remove("column-collapse-icon--disabled");
|
|
3356
|
+
}
|
|
3357
|
+
requestAnimationFrame(() => {
|
|
3358
|
+
var E;
|
|
3359
|
+
for (const [w] of je.current.entries())
|
|
3360
|
+
if (!ge.has(w)) {
|
|
3361
|
+
const k = w === "input1" ? Z : w === "input2" ? ee : w === "base" ? pe : w === "result" ? G : null;
|
|
3362
|
+
(E = k == null ? void 0 : k.current) == null || E.layout();
|
|
3363
|
+
}
|
|
3364
|
+
});
|
|
3365
|
+
}, [p, ge]), Se(() => () => {
|
|
3366
|
+
var k, U, X, Y, j, ue, ne, W, V, re, le;
|
|
3367
|
+
(k = qe.current) == null || k.set([]), (U = Ye.current) == null || U.set([]), (X = ze.current) == null || X.set([]);
|
|
3368
|
+
const _ = (Y = Z.current) == null ? void 0 : Y.getModel(), b = (j = pe.current) == null ? void 0 : j.getModel(), E = (ue = ee.current) == null ? void 0 : ue.getModel(), w = (ne = G.current) == null ? void 0 : ne.getModel();
|
|
3369
|
+
(W = Z.current) == null || W.dispose(), (V = pe.current) == null || V.dispose(), (re = ee.current) == null || re.dispose(), (le = G.current) == null || le.dispose(), _ == null || _.dispose(), b == null || b.dispose(), E == null || E.dispose(), w == null || w.dispose(), Fe.current = !1, v(!1);
|
|
3370
|
+
}, []), R || !p ? /* @__PURE__ */ gt(Pn, { children: f ?? /* @__PURE__ */ gt(fo, {}) }) : /* @__PURE__ */ gt("div", { ref: et, style: { width: s, height: c }, className: a });
|
|
3233
3371
|
}
|
|
3234
3372
|
export {
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3373
|
+
vo as JsonDiffMergeEditor,
|
|
3374
|
+
Kr as analyzeConflicts,
|
|
3375
|
+
Qr as analyzeTwoWayConflicts,
|
|
3376
|
+
yo as computeDiffs,
|
|
3377
|
+
eo as computeDiffsJsonPatch,
|
|
3378
|
+
to as computeLineConflictType
|
|
3241
3379
|
};
|
|
3242
3380
|
//# sourceMappingURL=index.mjs.map
|