@ailaw/venus 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/attorney.js +2 -0
- package/dist/company.js +2 -0
- package/dist/hooks/useMe/index.d.ts +2 -0
- package/dist/hooks/useMe/me.gql.d.ts +1 -0
- package/dist/hooks/useMe/types.d.ts +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/individual.js +2 -0
- package/dist/profile-select/gqls/profile.gql.d.ts +2 -0
- package/dist/profile-select/hooks/useCreateProfile.d.ts +5 -0
- package/dist/profile-select/hooks/useProfiles.d.ts +6 -0
- package/dist/profile-select/index.vue.d.ts +30 -0
- package/dist/profile-select/profile-create-modal.vue.d.ts +54 -0
- package/dist/profile-select/profile-select-item.vue.d.ts +15 -0
- package/dist/profile-select/profile-selector.vue.d.ts +41 -0
- package/dist/profile-select/profile-type-select.vue.d.ts +32 -0
- package/dist/profile-type-icon/index.vue.d.ts +19 -0
- package/dist/style.css +1 -0
- package/dist/types/profile.d.ts +8 -0
- package/dist/venus.es.js +4023 -0
- package/package.json +48 -0
package/dist/venus.es.js
ADDED
|
@@ -0,0 +1,4023 @@
|
|
|
1
|
+
import Vue from "vue";
|
|
2
|
+
import { Select, Modal, Form, Input, Checkbox, Divider, Button } from "ant-design-vue";
|
|
3
|
+
import { useQuery, useResult, useMutation } from "@vue/apollo-composable";
|
|
4
|
+
var index$1 = "";
|
|
5
|
+
var toString = function(x) {
|
|
6
|
+
return Object.prototype.toString.call(x);
|
|
7
|
+
};
|
|
8
|
+
function isNative(Ctor) {
|
|
9
|
+
return typeof Ctor === "function" && /native code/.test(Ctor.toString());
|
|
10
|
+
}
|
|
11
|
+
var hasSymbol = typeof Symbol !== "undefined" && isNative(Symbol) && typeof Reflect !== "undefined" && isNative(Reflect.ownKeys);
|
|
12
|
+
var noopFn = function(_) {
|
|
13
|
+
return _;
|
|
14
|
+
};
|
|
15
|
+
function proxy(target, key, _a) {
|
|
16
|
+
var get2 = _a.get, set2 = _a.set;
|
|
17
|
+
Object.defineProperty(target, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
get: get2 || noopFn,
|
|
21
|
+
set: set2 || noopFn
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function def(obj, key, val, enumerable) {
|
|
25
|
+
Object.defineProperty(obj, key, {
|
|
26
|
+
value: val,
|
|
27
|
+
enumerable: !!enumerable,
|
|
28
|
+
writable: true,
|
|
29
|
+
configurable: true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function hasOwn(obj, key) {
|
|
33
|
+
return Object.hasOwnProperty.call(obj, key);
|
|
34
|
+
}
|
|
35
|
+
function assert(condition, msg) {
|
|
36
|
+
if (!condition) {
|
|
37
|
+
throw new Error("[vue-composition-api] " + msg);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function isArray(x) {
|
|
41
|
+
return Array.isArray(x);
|
|
42
|
+
}
|
|
43
|
+
var objectToString = Object.prototype.toString;
|
|
44
|
+
var toTypeString = function(value) {
|
|
45
|
+
return objectToString.call(value);
|
|
46
|
+
};
|
|
47
|
+
var isMap = function(val) {
|
|
48
|
+
return toTypeString(val) === "[object Map]";
|
|
49
|
+
};
|
|
50
|
+
var isSet = function(val) {
|
|
51
|
+
return toTypeString(val) === "[object Set]";
|
|
52
|
+
};
|
|
53
|
+
var MAX_VALID_ARRAY_LENGTH = 4294967295;
|
|
54
|
+
function isValidArrayIndex(val) {
|
|
55
|
+
var n = parseFloat(String(val));
|
|
56
|
+
return n >= 0 && Math.floor(n) === n && isFinite(val) && n <= MAX_VALID_ARRAY_LENGTH;
|
|
57
|
+
}
|
|
58
|
+
function isObject(val) {
|
|
59
|
+
return val !== null && typeof val === "object";
|
|
60
|
+
}
|
|
61
|
+
function isPlainObject(x) {
|
|
62
|
+
return toString(x) === "[object Object]";
|
|
63
|
+
}
|
|
64
|
+
function isFunction(x) {
|
|
65
|
+
return typeof x === "function";
|
|
66
|
+
}
|
|
67
|
+
function logError(err, vm, info) {
|
|
68
|
+
if (typeof window !== "undefined" && typeof console !== "undefined") {
|
|
69
|
+
console.error(err);
|
|
70
|
+
} else {
|
|
71
|
+
throw err;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/*! *****************************************************************************
|
|
75
|
+
Copyright (c) Microsoft Corporation.
|
|
76
|
+
|
|
77
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
78
|
+
purpose with or without fee is hereby granted.
|
|
79
|
+
|
|
80
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
81
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
82
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
83
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
84
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
85
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
86
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
87
|
+
***************************************************************************** */
|
|
88
|
+
var extendStatics = function(d, b) {
|
|
89
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
90
|
+
d2.__proto__ = b2;
|
|
91
|
+
} || function(d2, b2) {
|
|
92
|
+
for (var p in b2)
|
|
93
|
+
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
94
|
+
d2[p] = b2[p];
|
|
95
|
+
};
|
|
96
|
+
return extendStatics(d, b);
|
|
97
|
+
};
|
|
98
|
+
function __extends(d, b) {
|
|
99
|
+
if (typeof b !== "function" && b !== null)
|
|
100
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
101
|
+
extendStatics(d, b);
|
|
102
|
+
function __() {
|
|
103
|
+
this.constructor = d;
|
|
104
|
+
}
|
|
105
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
106
|
+
}
|
|
107
|
+
var __assign = function() {
|
|
108
|
+
__assign = Object.assign || function __assign2(t) {
|
|
109
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
110
|
+
s = arguments[i];
|
|
111
|
+
for (var p in s)
|
|
112
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
113
|
+
t[p] = s[p];
|
|
114
|
+
}
|
|
115
|
+
return t;
|
|
116
|
+
};
|
|
117
|
+
return __assign.apply(this, arguments);
|
|
118
|
+
};
|
|
119
|
+
function __values(o) {
|
|
120
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
121
|
+
if (m)
|
|
122
|
+
return m.call(o);
|
|
123
|
+
if (o && typeof o.length === "number")
|
|
124
|
+
return {
|
|
125
|
+
next: function() {
|
|
126
|
+
if (o && i >= o.length)
|
|
127
|
+
o = void 0;
|
|
128
|
+
return { value: o && o[i++], done: !o };
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
132
|
+
}
|
|
133
|
+
function __read(o, n) {
|
|
134
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
135
|
+
if (!m)
|
|
136
|
+
return o;
|
|
137
|
+
var i = m.call(o), r, ar = [], e;
|
|
138
|
+
try {
|
|
139
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
140
|
+
ar.push(r.value);
|
|
141
|
+
} catch (error) {
|
|
142
|
+
e = { error };
|
|
143
|
+
} finally {
|
|
144
|
+
try {
|
|
145
|
+
if (r && !r.done && (m = i["return"]))
|
|
146
|
+
m.call(i);
|
|
147
|
+
} finally {
|
|
148
|
+
if (e)
|
|
149
|
+
throw e.error;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return ar;
|
|
153
|
+
}
|
|
154
|
+
function __spreadArray(to, from) {
|
|
155
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
156
|
+
to[j] = from[i];
|
|
157
|
+
return to;
|
|
158
|
+
}
|
|
159
|
+
var activeEffectScope;
|
|
160
|
+
var effectScopeStack = [];
|
|
161
|
+
var EffectScopeImpl = function() {
|
|
162
|
+
function EffectScopeImpl2(vm) {
|
|
163
|
+
this.active = true;
|
|
164
|
+
this.effects = [];
|
|
165
|
+
this.cleanups = [];
|
|
166
|
+
this.vm = vm;
|
|
167
|
+
}
|
|
168
|
+
EffectScopeImpl2.prototype.run = function(fn) {
|
|
169
|
+
if (this.active) {
|
|
170
|
+
try {
|
|
171
|
+
this.on();
|
|
172
|
+
return fn();
|
|
173
|
+
} finally {
|
|
174
|
+
this.off();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return;
|
|
178
|
+
};
|
|
179
|
+
EffectScopeImpl2.prototype.on = function() {
|
|
180
|
+
if (this.active) {
|
|
181
|
+
effectScopeStack.push(this);
|
|
182
|
+
activeEffectScope = this;
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
EffectScopeImpl2.prototype.off = function() {
|
|
186
|
+
if (this.active) {
|
|
187
|
+
effectScopeStack.pop();
|
|
188
|
+
activeEffectScope = effectScopeStack[effectScopeStack.length - 1];
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
EffectScopeImpl2.prototype.stop = function() {
|
|
192
|
+
if (this.active) {
|
|
193
|
+
this.vm.$destroy();
|
|
194
|
+
this.effects.forEach(function(e) {
|
|
195
|
+
return e.stop();
|
|
196
|
+
});
|
|
197
|
+
this.cleanups.forEach(function(cleanup) {
|
|
198
|
+
return cleanup();
|
|
199
|
+
});
|
|
200
|
+
this.active = false;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
return EffectScopeImpl2;
|
|
204
|
+
}();
|
|
205
|
+
(function(_super) {
|
|
206
|
+
__extends(EffectScope, _super);
|
|
207
|
+
function EffectScope(detached) {
|
|
208
|
+
if (detached === void 0) {
|
|
209
|
+
detached = false;
|
|
210
|
+
}
|
|
211
|
+
var _this = this;
|
|
212
|
+
var vm = void 0;
|
|
213
|
+
withCurrentInstanceTrackingDisabled(function() {
|
|
214
|
+
vm = defineComponentInstance(getVueConstructor());
|
|
215
|
+
});
|
|
216
|
+
_this = _super.call(this, vm) || this;
|
|
217
|
+
if (!detached) {
|
|
218
|
+
recordEffectScope(_this);
|
|
219
|
+
}
|
|
220
|
+
return _this;
|
|
221
|
+
}
|
|
222
|
+
return EffectScope;
|
|
223
|
+
})(EffectScopeImpl);
|
|
224
|
+
function recordEffectScope(effect, scope) {
|
|
225
|
+
var _a;
|
|
226
|
+
scope = scope || activeEffectScope;
|
|
227
|
+
if (scope && scope.active) {
|
|
228
|
+
scope.effects.push(effect);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
var vm = (_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy;
|
|
232
|
+
vm && vm.$on("hook:destroyed", function() {
|
|
233
|
+
return effect.stop();
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function getCurrentScope() {
|
|
237
|
+
return activeEffectScope;
|
|
238
|
+
}
|
|
239
|
+
function getCurrentScopeVM() {
|
|
240
|
+
var _a, _b;
|
|
241
|
+
return ((_a = getCurrentScope()) === null || _a === void 0 ? void 0 : _a.vm) || ((_b = getCurrentInstance()) === null || _b === void 0 ? void 0 : _b.proxy);
|
|
242
|
+
}
|
|
243
|
+
function bindCurrentScopeToVM(vm) {
|
|
244
|
+
if (!vm.scope) {
|
|
245
|
+
var scope_1 = new EffectScopeImpl(vm.proxy);
|
|
246
|
+
vm.scope = scope_1;
|
|
247
|
+
vm.proxy.$on("hook:destroyed", function() {
|
|
248
|
+
return scope_1.stop();
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
return vm.scope;
|
|
252
|
+
}
|
|
253
|
+
var vueDependency = void 0;
|
|
254
|
+
try {
|
|
255
|
+
var requiredVue = require("vue");
|
|
256
|
+
if (requiredVue && isVue(requiredVue)) {
|
|
257
|
+
vueDependency = requiredVue;
|
|
258
|
+
} else if (requiredVue && "default" in requiredVue && isVue(requiredVue.default)) {
|
|
259
|
+
vueDependency = requiredVue.default;
|
|
260
|
+
}
|
|
261
|
+
} catch (_a) {
|
|
262
|
+
}
|
|
263
|
+
var vueConstructor = null;
|
|
264
|
+
var currentInstance = null;
|
|
265
|
+
var currentInstanceTracking = true;
|
|
266
|
+
var PluginInstalledFlag = "__composition_api_installed__";
|
|
267
|
+
function isVue(obj) {
|
|
268
|
+
return obj && isFunction(obj) && obj.name === "Vue";
|
|
269
|
+
}
|
|
270
|
+
function isVueRegistered(Vue2) {
|
|
271
|
+
return vueConstructor && hasOwn(Vue2, PluginInstalledFlag);
|
|
272
|
+
}
|
|
273
|
+
function getVueConstructor() {
|
|
274
|
+
return vueConstructor;
|
|
275
|
+
}
|
|
276
|
+
function getRegisteredVueOrDefault() {
|
|
277
|
+
var constructor = vueConstructor || vueDependency;
|
|
278
|
+
return constructor;
|
|
279
|
+
}
|
|
280
|
+
function setVueConstructor(Vue2) {
|
|
281
|
+
vueConstructor = Vue2;
|
|
282
|
+
Object.defineProperty(Vue2, PluginInstalledFlag, {
|
|
283
|
+
configurable: true,
|
|
284
|
+
writable: true,
|
|
285
|
+
value: true
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
function withCurrentInstanceTrackingDisabled(fn) {
|
|
289
|
+
var prev = currentInstanceTracking;
|
|
290
|
+
currentInstanceTracking = false;
|
|
291
|
+
try {
|
|
292
|
+
fn();
|
|
293
|
+
} finally {
|
|
294
|
+
currentInstanceTracking = prev;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
function setCurrentInstance(instance) {
|
|
298
|
+
if (!currentInstanceTracking)
|
|
299
|
+
return;
|
|
300
|
+
var prev = currentInstance;
|
|
301
|
+
prev === null || prev === void 0 ? void 0 : prev.scope.off();
|
|
302
|
+
currentInstance = instance;
|
|
303
|
+
currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope.on();
|
|
304
|
+
}
|
|
305
|
+
function getCurrentInstance() {
|
|
306
|
+
return currentInstance;
|
|
307
|
+
}
|
|
308
|
+
var instanceMapCache = new WeakMap();
|
|
309
|
+
function toVue3ComponentInstance(vm) {
|
|
310
|
+
if (instanceMapCache.has(vm)) {
|
|
311
|
+
return instanceMapCache.get(vm);
|
|
312
|
+
}
|
|
313
|
+
var instance = {
|
|
314
|
+
proxy: vm,
|
|
315
|
+
update: vm.$forceUpdate,
|
|
316
|
+
type: vm.$options,
|
|
317
|
+
uid: vm._uid,
|
|
318
|
+
emit: vm.$emit.bind(vm),
|
|
319
|
+
parent: null,
|
|
320
|
+
root: null
|
|
321
|
+
};
|
|
322
|
+
bindCurrentScopeToVM(instance);
|
|
323
|
+
var instanceProps = [
|
|
324
|
+
"data",
|
|
325
|
+
"props",
|
|
326
|
+
"attrs",
|
|
327
|
+
"refs",
|
|
328
|
+
"vnode",
|
|
329
|
+
"slots"
|
|
330
|
+
];
|
|
331
|
+
instanceProps.forEach(function(prop) {
|
|
332
|
+
proxy(instance, prop, {
|
|
333
|
+
get: function() {
|
|
334
|
+
return vm["$" + prop];
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
proxy(instance, "isMounted", {
|
|
339
|
+
get: function() {
|
|
340
|
+
return vm._isMounted;
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
proxy(instance, "isUnmounted", {
|
|
344
|
+
get: function() {
|
|
345
|
+
return vm._isDestroyed;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
proxy(instance, "isDeactivated", {
|
|
349
|
+
get: function() {
|
|
350
|
+
return vm._inactive;
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
proxy(instance, "emitted", {
|
|
354
|
+
get: function() {
|
|
355
|
+
return vm._events;
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
instanceMapCache.set(vm, instance);
|
|
359
|
+
if (vm.$parent) {
|
|
360
|
+
instance.parent = toVue3ComponentInstance(vm.$parent);
|
|
361
|
+
}
|
|
362
|
+
if (vm.$root) {
|
|
363
|
+
instance.root = toVue3ComponentInstance(vm.$root);
|
|
364
|
+
}
|
|
365
|
+
return instance;
|
|
366
|
+
}
|
|
367
|
+
function defineComponentInstance(Ctor, options) {
|
|
368
|
+
if (options === void 0) {
|
|
369
|
+
options = {};
|
|
370
|
+
}
|
|
371
|
+
var silent = Ctor.config.silent;
|
|
372
|
+
Ctor.config.silent = true;
|
|
373
|
+
var vm = new Ctor(options);
|
|
374
|
+
Ctor.config.silent = silent;
|
|
375
|
+
return vm;
|
|
376
|
+
}
|
|
377
|
+
function isComponentInstance(obj) {
|
|
378
|
+
var Vue2 = getVueConstructor();
|
|
379
|
+
return Vue2 && obj instanceof Vue2;
|
|
380
|
+
}
|
|
381
|
+
function createSlotProxy(vm, slotName) {
|
|
382
|
+
return function() {
|
|
383
|
+
var args = [];
|
|
384
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
385
|
+
args[_i] = arguments[_i];
|
|
386
|
+
}
|
|
387
|
+
if (!vm.$scopedSlots[slotName]) {
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
return vm.$scopedSlots[slotName].apply(vm, args);
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
function resolveSlots(slots, normalSlots) {
|
|
394
|
+
var res;
|
|
395
|
+
if (!slots) {
|
|
396
|
+
res = {};
|
|
397
|
+
} else if (slots._normalized) {
|
|
398
|
+
return slots._normalized;
|
|
399
|
+
} else {
|
|
400
|
+
res = {};
|
|
401
|
+
for (var key in slots) {
|
|
402
|
+
if (slots[key] && key[0] !== "$") {
|
|
403
|
+
res[key] = true;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
for (var key in normalSlots) {
|
|
408
|
+
if (!(key in res)) {
|
|
409
|
+
res[key] = true;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return res;
|
|
413
|
+
}
|
|
414
|
+
var vueInternalClasses;
|
|
415
|
+
var getVueInternalClasses = function() {
|
|
416
|
+
if (!vueInternalClasses) {
|
|
417
|
+
var vm = defineComponentInstance(getVueConstructor(), {
|
|
418
|
+
computed: {
|
|
419
|
+
value: function() {
|
|
420
|
+
return 0;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
var Watcher = vm._computedWatchers.value.constructor;
|
|
425
|
+
var Dep = vm._data.__ob__.dep.constructor;
|
|
426
|
+
vueInternalClasses = {
|
|
427
|
+
Watcher,
|
|
428
|
+
Dep
|
|
429
|
+
};
|
|
430
|
+
vm.$destroy();
|
|
431
|
+
}
|
|
432
|
+
return vueInternalClasses;
|
|
433
|
+
};
|
|
434
|
+
function createSymbol(name) {
|
|
435
|
+
return hasSymbol ? Symbol.for(name) : name;
|
|
436
|
+
}
|
|
437
|
+
var WatcherPreFlushQueueKey = createSymbol("composition-api.preFlushQueue");
|
|
438
|
+
var WatcherPostFlushQueueKey = createSymbol("composition-api.postFlushQueue");
|
|
439
|
+
var RefKey = "composition-api.refKey";
|
|
440
|
+
var accessModifiedSet = new WeakMap();
|
|
441
|
+
var readonlySet = new WeakMap();
|
|
442
|
+
function set$1(target, key, val) {
|
|
443
|
+
var Vue2 = getVueConstructor();
|
|
444
|
+
var _a = Vue2.util;
|
|
445
|
+
_a.warn;
|
|
446
|
+
var defineReactive = _a.defineReactive;
|
|
447
|
+
var ob = target.__ob__;
|
|
448
|
+
function ssrMockReactivity() {
|
|
449
|
+
if (ob && isObject(val) && !hasOwn(val, "__ob__")) {
|
|
450
|
+
mockReactivityDeep(val);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
if (isArray(target)) {
|
|
454
|
+
if (isValidArrayIndex(key)) {
|
|
455
|
+
target.length = Math.max(target.length, key);
|
|
456
|
+
target.splice(key, 1, val);
|
|
457
|
+
ssrMockReactivity();
|
|
458
|
+
return val;
|
|
459
|
+
} else if (key === "length" && val !== target.length) {
|
|
460
|
+
target.length = val;
|
|
461
|
+
ob === null || ob === void 0 ? void 0 : ob.dep.notify();
|
|
462
|
+
return val;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if (key in target && !(key in Object.prototype)) {
|
|
466
|
+
target[key] = val;
|
|
467
|
+
ssrMockReactivity();
|
|
468
|
+
return val;
|
|
469
|
+
}
|
|
470
|
+
if (target._isVue || ob && ob.vmCount) {
|
|
471
|
+
return val;
|
|
472
|
+
}
|
|
473
|
+
if (!ob) {
|
|
474
|
+
target[key] = val;
|
|
475
|
+
return val;
|
|
476
|
+
}
|
|
477
|
+
defineReactive(ob.value, key, val);
|
|
478
|
+
defineAccessControl(target, key, val);
|
|
479
|
+
ssrMockReactivity();
|
|
480
|
+
ob.dep.notify();
|
|
481
|
+
return val;
|
|
482
|
+
}
|
|
483
|
+
var RefImpl = function() {
|
|
484
|
+
function RefImpl2(_a) {
|
|
485
|
+
var get2 = _a.get, set2 = _a.set;
|
|
486
|
+
proxy(this, "value", {
|
|
487
|
+
get: get2,
|
|
488
|
+
set: set2
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
return RefImpl2;
|
|
492
|
+
}();
|
|
493
|
+
function createRef(options, isReadonly, isComputed) {
|
|
494
|
+
if (isReadonly === void 0) {
|
|
495
|
+
isReadonly = false;
|
|
496
|
+
}
|
|
497
|
+
if (isComputed === void 0) {
|
|
498
|
+
isComputed = false;
|
|
499
|
+
}
|
|
500
|
+
var r = new RefImpl(options);
|
|
501
|
+
if (isComputed)
|
|
502
|
+
r.effect = true;
|
|
503
|
+
var sealed = Object.seal(r);
|
|
504
|
+
if (isReadonly)
|
|
505
|
+
readonlySet.set(sealed, true);
|
|
506
|
+
return sealed;
|
|
507
|
+
}
|
|
508
|
+
function ref(raw) {
|
|
509
|
+
var _a;
|
|
510
|
+
if (isRef(raw)) {
|
|
511
|
+
return raw;
|
|
512
|
+
}
|
|
513
|
+
var value = reactive((_a = {}, _a[RefKey] = raw, _a));
|
|
514
|
+
return createRef({
|
|
515
|
+
get: function() {
|
|
516
|
+
return value[RefKey];
|
|
517
|
+
},
|
|
518
|
+
set: function(v) {
|
|
519
|
+
return value[RefKey] = v;
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
function isRef(value) {
|
|
524
|
+
return value instanceof RefImpl;
|
|
525
|
+
}
|
|
526
|
+
function toRefs(obj) {
|
|
527
|
+
if (!isPlainObject(obj))
|
|
528
|
+
return obj;
|
|
529
|
+
var ret = {};
|
|
530
|
+
for (var key in obj) {
|
|
531
|
+
ret[key] = toRef(obj, key);
|
|
532
|
+
}
|
|
533
|
+
return ret;
|
|
534
|
+
}
|
|
535
|
+
function toRef(object, key) {
|
|
536
|
+
if (!(key in object))
|
|
537
|
+
set$1(object, key, void 0);
|
|
538
|
+
var v = object[key];
|
|
539
|
+
if (isRef(v))
|
|
540
|
+
return v;
|
|
541
|
+
return createRef({
|
|
542
|
+
get: function() {
|
|
543
|
+
return object[key];
|
|
544
|
+
},
|
|
545
|
+
set: function(v2) {
|
|
546
|
+
return object[key] = v2;
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
function isRaw(obj) {
|
|
551
|
+
var _a;
|
|
552
|
+
return Boolean(obj && hasOwn(obj, "__ob__") && typeof obj.__ob__ === "object" && ((_a = obj.__ob__) === null || _a === void 0 ? void 0 : _a.__raw__));
|
|
553
|
+
}
|
|
554
|
+
function isReactive(obj) {
|
|
555
|
+
var _a;
|
|
556
|
+
return Boolean(obj && hasOwn(obj, "__ob__") && typeof obj.__ob__ === "object" && !((_a = obj.__ob__) === null || _a === void 0 ? void 0 : _a.__raw__));
|
|
557
|
+
}
|
|
558
|
+
function setupAccessControl(target) {
|
|
559
|
+
if (!isPlainObject(target) || isRaw(target) || isArray(target) || isRef(target) || isComponentInstance(target) || accessModifiedSet.has(target))
|
|
560
|
+
return;
|
|
561
|
+
accessModifiedSet.set(target, true);
|
|
562
|
+
var keys = Object.keys(target);
|
|
563
|
+
for (var i = 0; i < keys.length; i++) {
|
|
564
|
+
defineAccessControl(target, keys[i]);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
function defineAccessControl(target, key, val) {
|
|
568
|
+
if (key === "__ob__")
|
|
569
|
+
return;
|
|
570
|
+
if (isRaw(target[key]))
|
|
571
|
+
return;
|
|
572
|
+
var getter;
|
|
573
|
+
var setter;
|
|
574
|
+
var property = Object.getOwnPropertyDescriptor(target, key);
|
|
575
|
+
if (property) {
|
|
576
|
+
if (property.configurable === false) {
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
getter = property.get;
|
|
580
|
+
setter = property.set;
|
|
581
|
+
if ((!getter || setter) && arguments.length === 2) {
|
|
582
|
+
val = target[key];
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
setupAccessControl(val);
|
|
586
|
+
proxy(target, key, {
|
|
587
|
+
get: function getterHandler() {
|
|
588
|
+
var value = getter ? getter.call(target) : val;
|
|
589
|
+
if (key !== RefKey && isRef(value)) {
|
|
590
|
+
return value.value;
|
|
591
|
+
} else {
|
|
592
|
+
return value;
|
|
593
|
+
}
|
|
594
|
+
},
|
|
595
|
+
set: function setterHandler(newVal) {
|
|
596
|
+
if (getter && !setter)
|
|
597
|
+
return;
|
|
598
|
+
if (key !== RefKey && isRef(val) && !isRef(newVal)) {
|
|
599
|
+
val.value = newVal;
|
|
600
|
+
} else if (setter) {
|
|
601
|
+
setter.call(target, newVal);
|
|
602
|
+
val = newVal;
|
|
603
|
+
} else {
|
|
604
|
+
val = newVal;
|
|
605
|
+
}
|
|
606
|
+
setupAccessControl(newVal);
|
|
607
|
+
}
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
function observe(obj) {
|
|
611
|
+
var Vue2 = getRegisteredVueOrDefault();
|
|
612
|
+
var observed;
|
|
613
|
+
if (Vue2.observable) {
|
|
614
|
+
observed = Vue2.observable(obj);
|
|
615
|
+
} else {
|
|
616
|
+
var vm = defineComponentInstance(Vue2, {
|
|
617
|
+
data: {
|
|
618
|
+
$$state: obj
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
observed = vm._data.$$state;
|
|
622
|
+
}
|
|
623
|
+
if (!hasOwn(observed, "__ob__")) {
|
|
624
|
+
mockReactivityDeep(observed);
|
|
625
|
+
}
|
|
626
|
+
return observed;
|
|
627
|
+
}
|
|
628
|
+
function mockReactivityDeep(obj, seen) {
|
|
629
|
+
var e_1, _a;
|
|
630
|
+
if (seen === void 0) {
|
|
631
|
+
seen = new Set();
|
|
632
|
+
}
|
|
633
|
+
if (seen.has(obj) || hasOwn(obj, "__ob__") || !Object.isExtensible(obj))
|
|
634
|
+
return;
|
|
635
|
+
def(obj, "__ob__", mockObserver(obj));
|
|
636
|
+
seen.add(obj);
|
|
637
|
+
try {
|
|
638
|
+
for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
639
|
+
var key = _c.value;
|
|
640
|
+
var value = obj[key];
|
|
641
|
+
if (!(isPlainObject(value) || isArray(value)) || isRaw(value) || !Object.isExtensible(value)) {
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
644
|
+
mockReactivityDeep(value, seen);
|
|
645
|
+
}
|
|
646
|
+
} catch (e_1_1) {
|
|
647
|
+
e_1 = { error: e_1_1 };
|
|
648
|
+
} finally {
|
|
649
|
+
try {
|
|
650
|
+
if (_c && !_c.done && (_a = _b.return))
|
|
651
|
+
_a.call(_b);
|
|
652
|
+
} finally {
|
|
653
|
+
if (e_1)
|
|
654
|
+
throw e_1.error;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
function mockObserver(value) {
|
|
659
|
+
if (value === void 0) {
|
|
660
|
+
value = {};
|
|
661
|
+
}
|
|
662
|
+
return {
|
|
663
|
+
value,
|
|
664
|
+
dep: {
|
|
665
|
+
notify: noopFn,
|
|
666
|
+
depend: noopFn,
|
|
667
|
+
addSub: noopFn,
|
|
668
|
+
removeSub: noopFn
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
function createObserver() {
|
|
673
|
+
return observe({}).__ob__;
|
|
674
|
+
}
|
|
675
|
+
function reactive(obj) {
|
|
676
|
+
if (!isObject(obj)) {
|
|
677
|
+
return obj;
|
|
678
|
+
}
|
|
679
|
+
if (!(isPlainObject(obj) || isArray(obj)) || isRaw(obj) || !Object.isExtensible(obj)) {
|
|
680
|
+
return obj;
|
|
681
|
+
}
|
|
682
|
+
var observed = observe(obj);
|
|
683
|
+
setupAccessControl(observed);
|
|
684
|
+
return observed;
|
|
685
|
+
}
|
|
686
|
+
var fallbackVM;
|
|
687
|
+
function flushPreQueue() {
|
|
688
|
+
flushQueue(this, WatcherPreFlushQueueKey);
|
|
689
|
+
}
|
|
690
|
+
function flushPostQueue() {
|
|
691
|
+
flushQueue(this, WatcherPostFlushQueueKey);
|
|
692
|
+
}
|
|
693
|
+
function hasWatchEnv(vm) {
|
|
694
|
+
return vm[WatcherPreFlushQueueKey] !== void 0;
|
|
695
|
+
}
|
|
696
|
+
function installWatchEnv(vm) {
|
|
697
|
+
vm[WatcherPreFlushQueueKey] = [];
|
|
698
|
+
vm[WatcherPostFlushQueueKey] = [];
|
|
699
|
+
vm.$on("hook:beforeUpdate", flushPreQueue);
|
|
700
|
+
vm.$on("hook:updated", flushPostQueue);
|
|
701
|
+
}
|
|
702
|
+
function getWatcherOption(options) {
|
|
703
|
+
return __assign({
|
|
704
|
+
immediate: false,
|
|
705
|
+
deep: false,
|
|
706
|
+
flush: "pre"
|
|
707
|
+
}, options);
|
|
708
|
+
}
|
|
709
|
+
function getWatcherVM() {
|
|
710
|
+
var vm = getCurrentScopeVM();
|
|
711
|
+
if (!vm) {
|
|
712
|
+
if (!fallbackVM) {
|
|
713
|
+
fallbackVM = defineComponentInstance(getVueConstructor());
|
|
714
|
+
}
|
|
715
|
+
vm = fallbackVM;
|
|
716
|
+
} else if (!hasWatchEnv(vm)) {
|
|
717
|
+
installWatchEnv(vm);
|
|
718
|
+
}
|
|
719
|
+
return vm;
|
|
720
|
+
}
|
|
721
|
+
function flushQueue(vm, key) {
|
|
722
|
+
var queue = vm[key];
|
|
723
|
+
for (var index2 = 0; index2 < queue.length; index2++) {
|
|
724
|
+
queue[index2]();
|
|
725
|
+
}
|
|
726
|
+
queue.length = 0;
|
|
727
|
+
}
|
|
728
|
+
function queueFlushJob(vm, fn, mode) {
|
|
729
|
+
var fallbackFlush = function() {
|
|
730
|
+
vm.$nextTick(function() {
|
|
731
|
+
if (vm[WatcherPreFlushQueueKey].length) {
|
|
732
|
+
flushQueue(vm, WatcherPreFlushQueueKey);
|
|
733
|
+
}
|
|
734
|
+
if (vm[WatcherPostFlushQueueKey].length) {
|
|
735
|
+
flushQueue(vm, WatcherPostFlushQueueKey);
|
|
736
|
+
}
|
|
737
|
+
});
|
|
738
|
+
};
|
|
739
|
+
switch (mode) {
|
|
740
|
+
case "pre":
|
|
741
|
+
fallbackFlush();
|
|
742
|
+
vm[WatcherPreFlushQueueKey].push(fn);
|
|
743
|
+
break;
|
|
744
|
+
case "post":
|
|
745
|
+
fallbackFlush();
|
|
746
|
+
vm[WatcherPostFlushQueueKey].push(fn);
|
|
747
|
+
break;
|
|
748
|
+
default:
|
|
749
|
+
assert(false, 'flush must be one of ["post", "pre", "sync"], but got ' + mode);
|
|
750
|
+
break;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
function createVueWatcher(vm, getter, callback, options) {
|
|
754
|
+
var index2 = vm._watchers.length;
|
|
755
|
+
vm.$watch(getter, callback, {
|
|
756
|
+
immediate: options.immediateInvokeCallback,
|
|
757
|
+
deep: options.deep,
|
|
758
|
+
lazy: options.noRun,
|
|
759
|
+
sync: options.sync,
|
|
760
|
+
before: options.before
|
|
761
|
+
});
|
|
762
|
+
return vm._watchers[index2];
|
|
763
|
+
}
|
|
764
|
+
function patchWatcherTeardown(watcher, runCleanup) {
|
|
765
|
+
var _teardown = watcher.teardown;
|
|
766
|
+
watcher.teardown = function() {
|
|
767
|
+
var args = [];
|
|
768
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
769
|
+
args[_i] = arguments[_i];
|
|
770
|
+
}
|
|
771
|
+
_teardown.apply(watcher, args);
|
|
772
|
+
runCleanup();
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
function createWatcher(vm, source, cb, options) {
|
|
776
|
+
var _a;
|
|
777
|
+
var flushMode = options.flush;
|
|
778
|
+
var isSync = flushMode === "sync";
|
|
779
|
+
var cleanup;
|
|
780
|
+
var registerCleanup = function(fn) {
|
|
781
|
+
cleanup = function() {
|
|
782
|
+
try {
|
|
783
|
+
fn();
|
|
784
|
+
} catch (error) {
|
|
785
|
+
logError(error);
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
};
|
|
789
|
+
var runCleanup = function() {
|
|
790
|
+
if (cleanup) {
|
|
791
|
+
cleanup();
|
|
792
|
+
cleanup = null;
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
var createScheduler = function(fn) {
|
|
796
|
+
if (isSync || vm === fallbackVM) {
|
|
797
|
+
return fn;
|
|
798
|
+
}
|
|
799
|
+
return function() {
|
|
800
|
+
var args = [];
|
|
801
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
802
|
+
args[_i] = arguments[_i];
|
|
803
|
+
}
|
|
804
|
+
return queueFlushJob(vm, function() {
|
|
805
|
+
fn.apply(void 0, __spreadArray([], __read(args)));
|
|
806
|
+
}, flushMode);
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
if (cb === null) {
|
|
810
|
+
var running_1 = false;
|
|
811
|
+
var getter_1 = function() {
|
|
812
|
+
if (running_1) {
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
try {
|
|
816
|
+
running_1 = true;
|
|
817
|
+
source(registerCleanup);
|
|
818
|
+
} finally {
|
|
819
|
+
running_1 = false;
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
var watcher_1 = createVueWatcher(vm, getter_1, noopFn, {
|
|
823
|
+
deep: options.deep || false,
|
|
824
|
+
sync: isSync,
|
|
825
|
+
before: runCleanup
|
|
826
|
+
});
|
|
827
|
+
patchWatcherTeardown(watcher_1, runCleanup);
|
|
828
|
+
watcher_1.lazy = false;
|
|
829
|
+
var originGet = watcher_1.get.bind(watcher_1);
|
|
830
|
+
watcher_1.get = createScheduler(originGet);
|
|
831
|
+
return function() {
|
|
832
|
+
watcher_1.teardown();
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
var deep = options.deep;
|
|
836
|
+
var isMultiSource = false;
|
|
837
|
+
var getter;
|
|
838
|
+
if (isRef(source)) {
|
|
839
|
+
getter = function() {
|
|
840
|
+
return source.value;
|
|
841
|
+
};
|
|
842
|
+
} else if (isReactive(source)) {
|
|
843
|
+
getter = function() {
|
|
844
|
+
return source;
|
|
845
|
+
};
|
|
846
|
+
deep = true;
|
|
847
|
+
} else if (isArray(source)) {
|
|
848
|
+
isMultiSource = true;
|
|
849
|
+
getter = function() {
|
|
850
|
+
return source.map(function(s) {
|
|
851
|
+
if (isRef(s)) {
|
|
852
|
+
return s.value;
|
|
853
|
+
} else if (isReactive(s)) {
|
|
854
|
+
return traverse(s);
|
|
855
|
+
} else if (isFunction(s)) {
|
|
856
|
+
return s();
|
|
857
|
+
} else {
|
|
858
|
+
return noopFn;
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
};
|
|
862
|
+
} else if (isFunction(source)) {
|
|
863
|
+
getter = source;
|
|
864
|
+
} else {
|
|
865
|
+
getter = noopFn;
|
|
866
|
+
}
|
|
867
|
+
if (deep) {
|
|
868
|
+
var baseGetter_1 = getter;
|
|
869
|
+
getter = function() {
|
|
870
|
+
return traverse(baseGetter_1());
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
var applyCb = function(n, o) {
|
|
874
|
+
if (!deep && isMultiSource && n.every(function(v, i) {
|
|
875
|
+
return Object.is(v, o[i]);
|
|
876
|
+
}))
|
|
877
|
+
return;
|
|
878
|
+
runCleanup();
|
|
879
|
+
return cb(n, o, registerCleanup);
|
|
880
|
+
};
|
|
881
|
+
var callback = createScheduler(applyCb);
|
|
882
|
+
if (options.immediate) {
|
|
883
|
+
var originalCallback_1 = callback;
|
|
884
|
+
var shiftCallback_1 = function(n, o) {
|
|
885
|
+
shiftCallback_1 = originalCallback_1;
|
|
886
|
+
return applyCb(n, isArray(n) ? [] : o);
|
|
887
|
+
};
|
|
888
|
+
callback = function(n, o) {
|
|
889
|
+
return shiftCallback_1(n, o);
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
var stop = vm.$watch(getter, callback, {
|
|
893
|
+
immediate: options.immediate,
|
|
894
|
+
deep,
|
|
895
|
+
sync: isSync
|
|
896
|
+
});
|
|
897
|
+
var watcher = vm._watchers[vm._watchers.length - 1];
|
|
898
|
+
if (isReactive(watcher.value) && ((_a = watcher.value.__ob__) === null || _a === void 0 ? void 0 : _a.dep) && deep) {
|
|
899
|
+
watcher.value.__ob__.dep.addSub({
|
|
900
|
+
update: function() {
|
|
901
|
+
watcher.run();
|
|
902
|
+
}
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
patchWatcherTeardown(watcher, runCleanup);
|
|
906
|
+
return function() {
|
|
907
|
+
stop();
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
function watch(source, cb, options) {
|
|
911
|
+
var callback = null;
|
|
912
|
+
if (isFunction(cb)) {
|
|
913
|
+
callback = cb;
|
|
914
|
+
} else {
|
|
915
|
+
options = cb;
|
|
916
|
+
callback = null;
|
|
917
|
+
}
|
|
918
|
+
var opts = getWatcherOption(options);
|
|
919
|
+
var vm = getWatcherVM();
|
|
920
|
+
return createWatcher(vm, source, callback, opts);
|
|
921
|
+
}
|
|
922
|
+
function traverse(value, seen) {
|
|
923
|
+
if (seen === void 0) {
|
|
924
|
+
seen = new Set();
|
|
925
|
+
}
|
|
926
|
+
if (!isObject(value) || seen.has(value)) {
|
|
927
|
+
return value;
|
|
928
|
+
}
|
|
929
|
+
seen.add(value);
|
|
930
|
+
if (isRef(value)) {
|
|
931
|
+
traverse(value.value, seen);
|
|
932
|
+
} else if (isArray(value)) {
|
|
933
|
+
for (var i = 0; i < value.length; i++) {
|
|
934
|
+
traverse(value[i], seen);
|
|
935
|
+
}
|
|
936
|
+
} else if (isSet(value) || isMap(value)) {
|
|
937
|
+
value.forEach(function(v) {
|
|
938
|
+
traverse(v, seen);
|
|
939
|
+
});
|
|
940
|
+
} else if (isPlainObject(value)) {
|
|
941
|
+
for (var key in value) {
|
|
942
|
+
traverse(value[key], seen);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
return value;
|
|
946
|
+
}
|
|
947
|
+
function computed(getterOrOptions) {
|
|
948
|
+
var vm = getCurrentScopeVM();
|
|
949
|
+
var getter;
|
|
950
|
+
var setter;
|
|
951
|
+
if (isFunction(getterOrOptions)) {
|
|
952
|
+
getter = getterOrOptions;
|
|
953
|
+
} else {
|
|
954
|
+
getter = getterOrOptions.get;
|
|
955
|
+
setter = getterOrOptions.set;
|
|
956
|
+
}
|
|
957
|
+
var computedSetter;
|
|
958
|
+
var computedGetter;
|
|
959
|
+
if (vm && !vm.$isServer) {
|
|
960
|
+
var _a = getVueInternalClasses(), Watcher_1 = _a.Watcher, Dep_1 = _a.Dep;
|
|
961
|
+
var watcher_1;
|
|
962
|
+
computedGetter = function() {
|
|
963
|
+
if (!watcher_1) {
|
|
964
|
+
watcher_1 = new Watcher_1(vm, getter, noopFn, { lazy: true });
|
|
965
|
+
}
|
|
966
|
+
if (watcher_1.dirty) {
|
|
967
|
+
watcher_1.evaluate();
|
|
968
|
+
}
|
|
969
|
+
if (Dep_1.target) {
|
|
970
|
+
watcher_1.depend();
|
|
971
|
+
}
|
|
972
|
+
return watcher_1.value;
|
|
973
|
+
};
|
|
974
|
+
computedSetter = function(v) {
|
|
975
|
+
if (setter) {
|
|
976
|
+
setter(v);
|
|
977
|
+
}
|
|
978
|
+
};
|
|
979
|
+
} else {
|
|
980
|
+
var computedHost_1 = defineComponentInstance(getVueConstructor(), {
|
|
981
|
+
computed: {
|
|
982
|
+
$$state: {
|
|
983
|
+
get: getter,
|
|
984
|
+
set: setter
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
});
|
|
988
|
+
vm && vm.$on("hook:destroyed", function() {
|
|
989
|
+
return computedHost_1.$destroy();
|
|
990
|
+
});
|
|
991
|
+
computedGetter = function() {
|
|
992
|
+
return computedHost_1.$$state;
|
|
993
|
+
};
|
|
994
|
+
computedSetter = function(v) {
|
|
995
|
+
computedHost_1.$$state = v;
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
return createRef({
|
|
999
|
+
get: computedGetter,
|
|
1000
|
+
set: computedSetter
|
|
1001
|
+
}, !setter, true);
|
|
1002
|
+
}
|
|
1003
|
+
function set(vm, key, value) {
|
|
1004
|
+
var state = vm.__composition_api_state__ = vm.__composition_api_state__ || {};
|
|
1005
|
+
state[key] = value;
|
|
1006
|
+
}
|
|
1007
|
+
function get(vm, key) {
|
|
1008
|
+
return (vm.__composition_api_state__ || {})[key];
|
|
1009
|
+
}
|
|
1010
|
+
var vmStateManager = {
|
|
1011
|
+
set,
|
|
1012
|
+
get
|
|
1013
|
+
};
|
|
1014
|
+
function asVmProperty(vm, propName, propValue) {
|
|
1015
|
+
var props = vm.$options.props;
|
|
1016
|
+
if (!(propName in vm) && !(props && hasOwn(props, propName))) {
|
|
1017
|
+
if (isRef(propValue)) {
|
|
1018
|
+
proxy(vm, propName, {
|
|
1019
|
+
get: function() {
|
|
1020
|
+
return propValue.value;
|
|
1021
|
+
},
|
|
1022
|
+
set: function(val) {
|
|
1023
|
+
propValue.value = val;
|
|
1024
|
+
}
|
|
1025
|
+
});
|
|
1026
|
+
} else {
|
|
1027
|
+
proxy(vm, propName, {
|
|
1028
|
+
get: function() {
|
|
1029
|
+
if (isReactive(propValue)) {
|
|
1030
|
+
propValue.__ob__.dep.depend();
|
|
1031
|
+
}
|
|
1032
|
+
return propValue;
|
|
1033
|
+
},
|
|
1034
|
+
set: function(val) {
|
|
1035
|
+
propValue = val;
|
|
1036
|
+
}
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
function updateTemplateRef(vm) {
|
|
1042
|
+
var rawBindings = vmStateManager.get(vm, "rawBindings") || {};
|
|
1043
|
+
if (!rawBindings || !Object.keys(rawBindings).length)
|
|
1044
|
+
return;
|
|
1045
|
+
var refs = vm.$refs;
|
|
1046
|
+
var oldRefKeys = vmStateManager.get(vm, "refs") || [];
|
|
1047
|
+
for (var index2 = 0; index2 < oldRefKeys.length; index2++) {
|
|
1048
|
+
var key = oldRefKeys[index2];
|
|
1049
|
+
var setupValue = rawBindings[key];
|
|
1050
|
+
if (!refs[key] && setupValue && isRef(setupValue)) {
|
|
1051
|
+
setupValue.value = null;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
var newKeys = Object.keys(refs);
|
|
1055
|
+
var validNewKeys = [];
|
|
1056
|
+
for (var index2 = 0; index2 < newKeys.length; index2++) {
|
|
1057
|
+
var key = newKeys[index2];
|
|
1058
|
+
var setupValue = rawBindings[key];
|
|
1059
|
+
if (refs[key] && setupValue && isRef(setupValue)) {
|
|
1060
|
+
setupValue.value = refs[key];
|
|
1061
|
+
validNewKeys.push(key);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
vmStateManager.set(vm, "refs", validNewKeys);
|
|
1065
|
+
}
|
|
1066
|
+
function updateVmAttrs(vm, ctx) {
|
|
1067
|
+
var e_1, _a;
|
|
1068
|
+
if (!vm) {
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1071
|
+
var attrBindings = vmStateManager.get(vm, "attrBindings");
|
|
1072
|
+
if (!attrBindings && !ctx) {
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
if (!attrBindings) {
|
|
1076
|
+
var observedData = reactive({});
|
|
1077
|
+
attrBindings = { ctx, data: observedData };
|
|
1078
|
+
vmStateManager.set(vm, "attrBindings", attrBindings);
|
|
1079
|
+
proxy(ctx, "attrs", {
|
|
1080
|
+
get: function() {
|
|
1081
|
+
return attrBindings === null || attrBindings === void 0 ? void 0 : attrBindings.data;
|
|
1082
|
+
},
|
|
1083
|
+
set: function() {
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
var source = vm.$attrs;
|
|
1088
|
+
var _loop_1 = function(attr2) {
|
|
1089
|
+
if (!hasOwn(attrBindings.data, attr2)) {
|
|
1090
|
+
proxy(attrBindings.data, attr2, {
|
|
1091
|
+
get: function() {
|
|
1092
|
+
return vm.$attrs[attr2];
|
|
1093
|
+
}
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
};
|
|
1097
|
+
try {
|
|
1098
|
+
for (var _b = __values(Object.keys(source)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1099
|
+
var attr = _c.value;
|
|
1100
|
+
_loop_1(attr);
|
|
1101
|
+
}
|
|
1102
|
+
} catch (e_1_1) {
|
|
1103
|
+
e_1 = { error: e_1_1 };
|
|
1104
|
+
} finally {
|
|
1105
|
+
try {
|
|
1106
|
+
if (_c && !_c.done && (_a = _b.return))
|
|
1107
|
+
_a.call(_b);
|
|
1108
|
+
} finally {
|
|
1109
|
+
if (e_1)
|
|
1110
|
+
throw e_1.error;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
function resolveScopedSlots(vm, slotsProxy) {
|
|
1115
|
+
var parentVNode = vm.$options._parentVnode;
|
|
1116
|
+
if (!parentVNode)
|
|
1117
|
+
return;
|
|
1118
|
+
var prevSlots = vmStateManager.get(vm, "slots") || [];
|
|
1119
|
+
var curSlots = resolveSlots(parentVNode.data.scopedSlots, vm.$slots);
|
|
1120
|
+
for (var index2 = 0; index2 < prevSlots.length; index2++) {
|
|
1121
|
+
var key = prevSlots[index2];
|
|
1122
|
+
if (!curSlots[key]) {
|
|
1123
|
+
delete slotsProxy[key];
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
var slotNames = Object.keys(curSlots);
|
|
1127
|
+
for (var index2 = 0; index2 < slotNames.length; index2++) {
|
|
1128
|
+
var key = slotNames[index2];
|
|
1129
|
+
if (!slotsProxy[key]) {
|
|
1130
|
+
slotsProxy[key] = createSlotProxy(vm, key);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
vmStateManager.set(vm, "slots", slotNames);
|
|
1134
|
+
}
|
|
1135
|
+
function activateCurrentInstance(instance, fn, onError) {
|
|
1136
|
+
var preVm = getCurrentInstance();
|
|
1137
|
+
setCurrentInstance(instance);
|
|
1138
|
+
try {
|
|
1139
|
+
return fn(instance);
|
|
1140
|
+
} catch (err) {
|
|
1141
|
+
if (onError) {
|
|
1142
|
+
onError(err);
|
|
1143
|
+
} else {
|
|
1144
|
+
throw err;
|
|
1145
|
+
}
|
|
1146
|
+
} finally {
|
|
1147
|
+
setCurrentInstance(preVm);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
function mixin(Vue2) {
|
|
1151
|
+
Vue2.mixin({
|
|
1152
|
+
beforeCreate: functionApiInit,
|
|
1153
|
+
mounted: function() {
|
|
1154
|
+
updateTemplateRef(this);
|
|
1155
|
+
},
|
|
1156
|
+
beforeUpdate: function() {
|
|
1157
|
+
updateVmAttrs(this);
|
|
1158
|
+
},
|
|
1159
|
+
updated: function() {
|
|
1160
|
+
var _a;
|
|
1161
|
+
updateTemplateRef(this);
|
|
1162
|
+
if ((_a = this.$vnode) === null || _a === void 0 ? void 0 : _a.context) {
|
|
1163
|
+
updateTemplateRef(this.$vnode.context);
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
function functionApiInit() {
|
|
1168
|
+
var vm = this;
|
|
1169
|
+
var $options = vm.$options;
|
|
1170
|
+
var setup = $options.setup, render2 = $options.render;
|
|
1171
|
+
if (render2) {
|
|
1172
|
+
$options.render = function() {
|
|
1173
|
+
var _this = this;
|
|
1174
|
+
var args = [];
|
|
1175
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1176
|
+
args[_i] = arguments[_i];
|
|
1177
|
+
}
|
|
1178
|
+
return activateCurrentInstance(toVue3ComponentInstance(vm), function() {
|
|
1179
|
+
return render2.apply(_this, args);
|
|
1180
|
+
});
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
if (!setup) {
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1186
|
+
if (!isFunction(setup)) {
|
|
1187
|
+
return;
|
|
1188
|
+
}
|
|
1189
|
+
var data = $options.data;
|
|
1190
|
+
$options.data = function wrappedData() {
|
|
1191
|
+
initSetup(vm, vm.$props);
|
|
1192
|
+
return isFunction(data) ? data.call(vm, vm) : data || {};
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
function initSetup(vm, props) {
|
|
1196
|
+
if (props === void 0) {
|
|
1197
|
+
props = {};
|
|
1198
|
+
}
|
|
1199
|
+
var setup = vm.$options.setup;
|
|
1200
|
+
var ctx = createSetupContext(vm);
|
|
1201
|
+
var instance = toVue3ComponentInstance(vm);
|
|
1202
|
+
instance.setupContext = ctx;
|
|
1203
|
+
def(props, "__ob__", createObserver());
|
|
1204
|
+
resolveScopedSlots(vm, ctx.slots);
|
|
1205
|
+
var binding;
|
|
1206
|
+
activateCurrentInstance(instance, function() {
|
|
1207
|
+
binding = setup(props, ctx);
|
|
1208
|
+
});
|
|
1209
|
+
if (!binding)
|
|
1210
|
+
return;
|
|
1211
|
+
if (isFunction(binding)) {
|
|
1212
|
+
var bindingFunc_1 = binding;
|
|
1213
|
+
vm.$options.render = function() {
|
|
1214
|
+
resolveScopedSlots(vm, ctx.slots);
|
|
1215
|
+
return activateCurrentInstance(instance, function() {
|
|
1216
|
+
return bindingFunc_1();
|
|
1217
|
+
});
|
|
1218
|
+
};
|
|
1219
|
+
return;
|
|
1220
|
+
} else if (isObject(binding)) {
|
|
1221
|
+
if (isReactive(binding)) {
|
|
1222
|
+
binding = toRefs(binding);
|
|
1223
|
+
}
|
|
1224
|
+
vmStateManager.set(vm, "rawBindings", binding);
|
|
1225
|
+
var bindingObj_1 = binding;
|
|
1226
|
+
Object.keys(bindingObj_1).forEach(function(name) {
|
|
1227
|
+
var bindingValue = bindingObj_1[name];
|
|
1228
|
+
if (!isRef(bindingValue)) {
|
|
1229
|
+
if (!isReactive(bindingValue)) {
|
|
1230
|
+
if (isFunction(bindingValue)) {
|
|
1231
|
+
var copy_1 = bindingValue;
|
|
1232
|
+
bindingValue = bindingValue.bind(vm);
|
|
1233
|
+
Object.keys(copy_1).forEach(function(ele) {
|
|
1234
|
+
bindingValue[ele] = copy_1[ele];
|
|
1235
|
+
});
|
|
1236
|
+
} else if (!isObject(bindingValue)) {
|
|
1237
|
+
bindingValue = ref(bindingValue);
|
|
1238
|
+
} else if (hasReactiveArrayChild(bindingValue)) {
|
|
1239
|
+
customReactive(bindingValue);
|
|
1240
|
+
}
|
|
1241
|
+
} else if (isArray(bindingValue)) {
|
|
1242
|
+
bindingValue = ref(bindingValue);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
asVmProperty(vm, name, bindingValue);
|
|
1246
|
+
});
|
|
1247
|
+
return;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
function customReactive(target, seen) {
|
|
1251
|
+
if (seen === void 0) {
|
|
1252
|
+
seen = new Set();
|
|
1253
|
+
}
|
|
1254
|
+
if (seen.has(target))
|
|
1255
|
+
return;
|
|
1256
|
+
if (!isPlainObject(target) || isRef(target) || isReactive(target) || isRaw(target))
|
|
1257
|
+
return;
|
|
1258
|
+
var Vue3 = getVueConstructor();
|
|
1259
|
+
var defineReactive = Vue3.util.defineReactive;
|
|
1260
|
+
Object.keys(target).forEach(function(k) {
|
|
1261
|
+
var val = target[k];
|
|
1262
|
+
defineReactive(target, k, val);
|
|
1263
|
+
if (val) {
|
|
1264
|
+
seen.add(val);
|
|
1265
|
+
customReactive(val, seen);
|
|
1266
|
+
}
|
|
1267
|
+
return;
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
function hasReactiveArrayChild(target, visited) {
|
|
1271
|
+
if (visited === void 0) {
|
|
1272
|
+
visited = new Map();
|
|
1273
|
+
}
|
|
1274
|
+
if (visited.has(target)) {
|
|
1275
|
+
return visited.get(target);
|
|
1276
|
+
}
|
|
1277
|
+
visited.set(target, false);
|
|
1278
|
+
if (isArray(target) && isReactive(target)) {
|
|
1279
|
+
visited.set(target, true);
|
|
1280
|
+
return true;
|
|
1281
|
+
}
|
|
1282
|
+
if (!isPlainObject(target) || isRaw(target) || isRef(target)) {
|
|
1283
|
+
return false;
|
|
1284
|
+
}
|
|
1285
|
+
return Object.keys(target).some(function(x) {
|
|
1286
|
+
return hasReactiveArrayChild(target[x], visited);
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
function createSetupContext(vm) {
|
|
1290
|
+
var ctx = { slots: {} };
|
|
1291
|
+
var propsPlain = [
|
|
1292
|
+
"root",
|
|
1293
|
+
"parent",
|
|
1294
|
+
"refs",
|
|
1295
|
+
"listeners",
|
|
1296
|
+
"isServer",
|
|
1297
|
+
"ssrContext"
|
|
1298
|
+
];
|
|
1299
|
+
var methodReturnVoid = ["emit"];
|
|
1300
|
+
propsPlain.forEach(function(key) {
|
|
1301
|
+
var srcKey = "$" + key;
|
|
1302
|
+
proxy(ctx, key, {
|
|
1303
|
+
get: function() {
|
|
1304
|
+
return vm[srcKey];
|
|
1305
|
+
},
|
|
1306
|
+
set: function() {
|
|
1307
|
+
}
|
|
1308
|
+
});
|
|
1309
|
+
});
|
|
1310
|
+
updateVmAttrs(vm, ctx);
|
|
1311
|
+
methodReturnVoid.forEach(function(key) {
|
|
1312
|
+
var srcKey = "$" + key;
|
|
1313
|
+
proxy(ctx, key, {
|
|
1314
|
+
get: function() {
|
|
1315
|
+
return function() {
|
|
1316
|
+
var args = [];
|
|
1317
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1318
|
+
args[_i] = arguments[_i];
|
|
1319
|
+
}
|
|
1320
|
+
var fn = vm[srcKey];
|
|
1321
|
+
fn.apply(vm, args);
|
|
1322
|
+
};
|
|
1323
|
+
}
|
|
1324
|
+
});
|
|
1325
|
+
});
|
|
1326
|
+
return ctx;
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
function mergeData(from, to) {
|
|
1330
|
+
if (!from)
|
|
1331
|
+
return to;
|
|
1332
|
+
if (!to)
|
|
1333
|
+
return from;
|
|
1334
|
+
var key;
|
|
1335
|
+
var toVal;
|
|
1336
|
+
var fromVal;
|
|
1337
|
+
var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from);
|
|
1338
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1339
|
+
key = keys[i];
|
|
1340
|
+
if (key === "__ob__")
|
|
1341
|
+
continue;
|
|
1342
|
+
toVal = to[key];
|
|
1343
|
+
fromVal = from[key];
|
|
1344
|
+
if (!hasOwn(to, key)) {
|
|
1345
|
+
to[key] = fromVal;
|
|
1346
|
+
} else if (toVal !== fromVal && isPlainObject(toVal) && !isRef(toVal) && isPlainObject(fromVal) && !isRef(fromVal)) {
|
|
1347
|
+
mergeData(fromVal, toVal);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
return to;
|
|
1351
|
+
}
|
|
1352
|
+
function install$1(Vue2) {
|
|
1353
|
+
if (isVueRegistered(Vue2)) {
|
|
1354
|
+
return;
|
|
1355
|
+
}
|
|
1356
|
+
Vue2.config.optionMergeStrategies.setup = function(parent, child) {
|
|
1357
|
+
return function mergedSetupFn(props, context) {
|
|
1358
|
+
return mergeData(isFunction(parent) ? parent(props, context) || {} : void 0, isFunction(child) ? child(props, context) || {} : void 0);
|
|
1359
|
+
};
|
|
1360
|
+
};
|
|
1361
|
+
setVueConstructor(Vue2);
|
|
1362
|
+
mixin(Vue2);
|
|
1363
|
+
}
|
|
1364
|
+
var Plugin = {
|
|
1365
|
+
install: function(Vue2) {
|
|
1366
|
+
return install$1(Vue2);
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
function defineComponent(options) {
|
|
1370
|
+
return options;
|
|
1371
|
+
}
|
|
1372
|
+
if (typeof window !== "undefined" && window.Vue) {
|
|
1373
|
+
window.Vue.use(Plugin);
|
|
1374
|
+
}
|
|
1375
|
+
function install(_vue) {
|
|
1376
|
+
_vue = _vue || Vue;
|
|
1377
|
+
if (_vue && !_vue["__composition_api_installed__"])
|
|
1378
|
+
Vue.use(Plugin);
|
|
1379
|
+
}
|
|
1380
|
+
install(Vue);
|
|
1381
|
+
Vue.version;
|
|
1382
|
+
function __variableDynamicImportRuntime0__(path3) {
|
|
1383
|
+
switch (path3) {
|
|
1384
|
+
case "./icons/attorney.svg":
|
|
1385
|
+
return import("./attorney.js");
|
|
1386
|
+
case "./icons/company.svg":
|
|
1387
|
+
return import("./company.js");
|
|
1388
|
+
case "./icons/individual.svg":
|
|
1389
|
+
return import("./individual.js");
|
|
1390
|
+
default:
|
|
1391
|
+
return new Promise(function(resolve, reject) {
|
|
1392
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path3)));
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
var __vue2_script$5 = defineComponent({
|
|
1397
|
+
props: {
|
|
1398
|
+
type: {
|
|
1399
|
+
type: String,
|
|
1400
|
+
required: true
|
|
1401
|
+
}
|
|
1402
|
+
},
|
|
1403
|
+
setup(props) {
|
|
1404
|
+
const iconUrl = ref();
|
|
1405
|
+
watch(() => props.type, (value) => {
|
|
1406
|
+
let iconName = "";
|
|
1407
|
+
switch (value) {
|
|
1408
|
+
case "USERPROFILE":
|
|
1409
|
+
iconName = "individual";
|
|
1410
|
+
break;
|
|
1411
|
+
case "CLIENTPROFILE":
|
|
1412
|
+
iconName = "company";
|
|
1413
|
+
break;
|
|
1414
|
+
default:
|
|
1415
|
+
iconName = "attorney";
|
|
1416
|
+
break;
|
|
1417
|
+
}
|
|
1418
|
+
__variableDynamicImportRuntime0__(`./icons/${iconName}.svg`).then((result) => iconUrl.value = result.default);
|
|
1419
|
+
}, { immediate: true });
|
|
1420
|
+
return { iconUrl };
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
var render$5 = function() {
|
|
1424
|
+
var _vm = this;
|
|
1425
|
+
var _h = _vm.$createElement;
|
|
1426
|
+
var _c = _vm._self._c || _h;
|
|
1427
|
+
return _c("img", { staticClass: "w-6 h-6", attrs: { "src": _vm.iconUrl, "alt": _vm.type } });
|
|
1428
|
+
};
|
|
1429
|
+
var staticRenderFns$5 = [];
|
|
1430
|
+
function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
1431
|
+
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
1432
|
+
if (render2) {
|
|
1433
|
+
options.render = render2;
|
|
1434
|
+
options.staticRenderFns = staticRenderFns2;
|
|
1435
|
+
options._compiled = true;
|
|
1436
|
+
}
|
|
1437
|
+
if (functionalTemplate) {
|
|
1438
|
+
options.functional = true;
|
|
1439
|
+
}
|
|
1440
|
+
if (scopeId) {
|
|
1441
|
+
options._scopeId = "data-v-" + scopeId;
|
|
1442
|
+
}
|
|
1443
|
+
var hook;
|
|
1444
|
+
if (moduleIdentifier) {
|
|
1445
|
+
hook = function(context) {
|
|
1446
|
+
context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
1447
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
|
|
1448
|
+
context = __VUE_SSR_CONTEXT__;
|
|
1449
|
+
}
|
|
1450
|
+
if (injectStyles) {
|
|
1451
|
+
injectStyles.call(this, context);
|
|
1452
|
+
}
|
|
1453
|
+
if (context && context._registeredComponents) {
|
|
1454
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
options._ssrRegister = hook;
|
|
1458
|
+
} else if (injectStyles) {
|
|
1459
|
+
hook = shadowMode ? function() {
|
|
1460
|
+
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
|
|
1461
|
+
} : injectStyles;
|
|
1462
|
+
}
|
|
1463
|
+
if (hook) {
|
|
1464
|
+
if (options.functional) {
|
|
1465
|
+
options._injectStyles = hook;
|
|
1466
|
+
var originalRender = options.render;
|
|
1467
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
1468
|
+
hook.call(context);
|
|
1469
|
+
return originalRender(h, context);
|
|
1470
|
+
};
|
|
1471
|
+
} else {
|
|
1472
|
+
var existing = options.beforeCreate;
|
|
1473
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
return {
|
|
1477
|
+
exports: scriptExports,
|
|
1478
|
+
options
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
const __cssModules$5 = {};
|
|
1482
|
+
var __component__$5 = /* @__PURE__ */ normalizeComponent(__vue2_script$5, render$5, staticRenderFns$5, false, __vue2_injectStyles$5, null, null, null);
|
|
1483
|
+
function __vue2_injectStyles$5(context) {
|
|
1484
|
+
for (let o in __cssModules$5) {
|
|
1485
|
+
this[o] = __cssModules$5[o];
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
var ProfileTypeIcon = /* @__PURE__ */ function() {
|
|
1489
|
+
return __component__$5.exports;
|
|
1490
|
+
}();
|
|
1491
|
+
var __vue2_script$4 = defineComponent({
|
|
1492
|
+
props: {
|
|
1493
|
+
source: {
|
|
1494
|
+
type: Object,
|
|
1495
|
+
required: true
|
|
1496
|
+
}
|
|
1497
|
+
},
|
|
1498
|
+
components: { ProfileTypeIcon }
|
|
1499
|
+
});
|
|
1500
|
+
var render$4 = function() {
|
|
1501
|
+
var _vm = this;
|
|
1502
|
+
var _h = _vm.$createElement;
|
|
1503
|
+
var _c = _vm._self._c || _h;
|
|
1504
|
+
return _c("div", { staticClass: "flex space-x-1 items-center" }, [_c("ProfileTypeIcon", { attrs: { "type": _vm.source.profileType } }), _c("div", { staticClass: "text-secondary" }, [_vm._v(_vm._s(_vm.source.profileName))])], 1);
|
|
1505
|
+
};
|
|
1506
|
+
var staticRenderFns$4 = [];
|
|
1507
|
+
const __cssModules$4 = {};
|
|
1508
|
+
var __component__$4 = /* @__PURE__ */ normalizeComponent(__vue2_script$4, render$4, staticRenderFns$4, false, __vue2_injectStyles$4, null, null, null);
|
|
1509
|
+
function __vue2_injectStyles$4(context) {
|
|
1510
|
+
for (let o in __cssModules$4) {
|
|
1511
|
+
this[o] = __cssModules$4[o];
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
var ProfileSelectItem = /* @__PURE__ */ function() {
|
|
1515
|
+
return __component__$4.exports;
|
|
1516
|
+
}();
|
|
1517
|
+
function getAugmentedNamespace(n) {
|
|
1518
|
+
if (n.__esModule)
|
|
1519
|
+
return n;
|
|
1520
|
+
var a = Object.defineProperty({}, "__esModule", { value: true });
|
|
1521
|
+
Object.keys(n).forEach(function(k) {
|
|
1522
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
1523
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
1524
|
+
enumerable: true,
|
|
1525
|
+
get: function() {
|
|
1526
|
+
return n[k];
|
|
1527
|
+
}
|
|
1528
|
+
});
|
|
1529
|
+
});
|
|
1530
|
+
return a;
|
|
1531
|
+
}
|
|
1532
|
+
function _typeof$2(obj) {
|
|
1533
|
+
"@babel/helpers - typeof";
|
|
1534
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
1535
|
+
_typeof$2 = function _typeof2(obj2) {
|
|
1536
|
+
return typeof obj2;
|
|
1537
|
+
};
|
|
1538
|
+
} else {
|
|
1539
|
+
_typeof$2 = function _typeof2(obj2) {
|
|
1540
|
+
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
return _typeof$2(obj);
|
|
1544
|
+
}
|
|
1545
|
+
function isObjectLike(value) {
|
|
1546
|
+
return _typeof$2(value) == "object" && value !== null;
|
|
1547
|
+
}
|
|
1548
|
+
var SYMBOL_TO_STRING_TAG = typeof Symbol === "function" && Symbol.toStringTag != null ? Symbol.toStringTag : "@@toStringTag";
|
|
1549
|
+
function getLocation(source, position) {
|
|
1550
|
+
var lineRegexp = /\r\n|[\n\r]/g;
|
|
1551
|
+
var line = 1;
|
|
1552
|
+
var column = position + 1;
|
|
1553
|
+
var match;
|
|
1554
|
+
while ((match = lineRegexp.exec(source.body)) && match.index < position) {
|
|
1555
|
+
line += 1;
|
|
1556
|
+
column = position + 1 - (match.index + match[0].length);
|
|
1557
|
+
}
|
|
1558
|
+
return {
|
|
1559
|
+
line,
|
|
1560
|
+
column
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
function printLocation(location) {
|
|
1564
|
+
return printSourceLocation(location.source, getLocation(location.source, location.start));
|
|
1565
|
+
}
|
|
1566
|
+
function printSourceLocation(source, sourceLocation) {
|
|
1567
|
+
var firstLineColumnOffset = source.locationOffset.column - 1;
|
|
1568
|
+
var body = whitespace(firstLineColumnOffset) + source.body;
|
|
1569
|
+
var lineIndex = sourceLocation.line - 1;
|
|
1570
|
+
var lineOffset = source.locationOffset.line - 1;
|
|
1571
|
+
var lineNum = sourceLocation.line + lineOffset;
|
|
1572
|
+
var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;
|
|
1573
|
+
var columnNum = sourceLocation.column + columnOffset;
|
|
1574
|
+
var locationStr = "".concat(source.name, ":").concat(lineNum, ":").concat(columnNum, "\n");
|
|
1575
|
+
var lines = body.split(/\r\n|[\n\r]/g);
|
|
1576
|
+
var locationLine = lines[lineIndex];
|
|
1577
|
+
if (locationLine.length > 120) {
|
|
1578
|
+
var subLineIndex = Math.floor(columnNum / 80);
|
|
1579
|
+
var subLineColumnNum = columnNum % 80;
|
|
1580
|
+
var subLines = [];
|
|
1581
|
+
for (var i = 0; i < locationLine.length; i += 80) {
|
|
1582
|
+
subLines.push(locationLine.slice(i, i + 80));
|
|
1583
|
+
}
|
|
1584
|
+
return locationStr + printPrefixedLines([["".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function(subLine) {
|
|
1585
|
+
return ["", subLine];
|
|
1586
|
+
}), [[" ", whitespace(subLineColumnNum - 1) + "^"], ["", subLines[subLineIndex + 1]]]));
|
|
1587
|
+
}
|
|
1588
|
+
return locationStr + printPrefixedLines([
|
|
1589
|
+
["".concat(lineNum - 1), lines[lineIndex - 1]],
|
|
1590
|
+
["".concat(lineNum), locationLine],
|
|
1591
|
+
["", whitespace(columnNum - 1) + "^"],
|
|
1592
|
+
["".concat(lineNum + 1), lines[lineIndex + 1]]
|
|
1593
|
+
]);
|
|
1594
|
+
}
|
|
1595
|
+
function printPrefixedLines(lines) {
|
|
1596
|
+
var existingLines = lines.filter(function(_ref) {
|
|
1597
|
+
_ref[0];
|
|
1598
|
+
var line = _ref[1];
|
|
1599
|
+
return line !== void 0;
|
|
1600
|
+
});
|
|
1601
|
+
var padLen = Math.max.apply(Math, existingLines.map(function(_ref2) {
|
|
1602
|
+
var prefix = _ref2[0];
|
|
1603
|
+
return prefix.length;
|
|
1604
|
+
}));
|
|
1605
|
+
return existingLines.map(function(_ref3) {
|
|
1606
|
+
var prefix = _ref3[0], line = _ref3[1];
|
|
1607
|
+
return leftPad(padLen, prefix) + (line ? " | " + line : " |");
|
|
1608
|
+
}).join("\n");
|
|
1609
|
+
}
|
|
1610
|
+
function whitespace(len) {
|
|
1611
|
+
return Array(len + 1).join(" ");
|
|
1612
|
+
}
|
|
1613
|
+
function leftPad(len, str) {
|
|
1614
|
+
return whitespace(len - str.length) + str;
|
|
1615
|
+
}
|
|
1616
|
+
function _typeof$1(obj) {
|
|
1617
|
+
"@babel/helpers - typeof";
|
|
1618
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
1619
|
+
_typeof$1 = function _typeof2(obj2) {
|
|
1620
|
+
return typeof obj2;
|
|
1621
|
+
};
|
|
1622
|
+
} else {
|
|
1623
|
+
_typeof$1 = function _typeof2(obj2) {
|
|
1624
|
+
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
1625
|
+
};
|
|
1626
|
+
}
|
|
1627
|
+
return _typeof$1(obj);
|
|
1628
|
+
}
|
|
1629
|
+
function ownKeys(object, enumerableOnly) {
|
|
1630
|
+
var keys = Object.keys(object);
|
|
1631
|
+
if (Object.getOwnPropertySymbols) {
|
|
1632
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
1633
|
+
if (enumerableOnly)
|
|
1634
|
+
symbols = symbols.filter(function(sym) {
|
|
1635
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
1636
|
+
});
|
|
1637
|
+
keys.push.apply(keys, symbols);
|
|
1638
|
+
}
|
|
1639
|
+
return keys;
|
|
1640
|
+
}
|
|
1641
|
+
function _objectSpread(target) {
|
|
1642
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1643
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
1644
|
+
if (i % 2) {
|
|
1645
|
+
ownKeys(Object(source), true).forEach(function(key) {
|
|
1646
|
+
_defineProperty(target, key, source[key]);
|
|
1647
|
+
});
|
|
1648
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
1649
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1650
|
+
} else {
|
|
1651
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
1652
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
return target;
|
|
1657
|
+
}
|
|
1658
|
+
function _defineProperty(obj, key, value) {
|
|
1659
|
+
if (key in obj) {
|
|
1660
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
1661
|
+
} else {
|
|
1662
|
+
obj[key] = value;
|
|
1663
|
+
}
|
|
1664
|
+
return obj;
|
|
1665
|
+
}
|
|
1666
|
+
function _classCallCheck(instance, Constructor) {
|
|
1667
|
+
if (!(instance instanceof Constructor)) {
|
|
1668
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
function _defineProperties$1(target, props) {
|
|
1672
|
+
for (var i = 0; i < props.length; i++) {
|
|
1673
|
+
var descriptor = props[i];
|
|
1674
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
1675
|
+
descriptor.configurable = true;
|
|
1676
|
+
if ("value" in descriptor)
|
|
1677
|
+
descriptor.writable = true;
|
|
1678
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
1682
|
+
if (protoProps)
|
|
1683
|
+
_defineProperties$1(Constructor.prototype, protoProps);
|
|
1684
|
+
if (staticProps)
|
|
1685
|
+
_defineProperties$1(Constructor, staticProps);
|
|
1686
|
+
return Constructor;
|
|
1687
|
+
}
|
|
1688
|
+
function _inherits(subClass, superClass) {
|
|
1689
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
1690
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
1691
|
+
}
|
|
1692
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
1693
|
+
if (superClass)
|
|
1694
|
+
_setPrototypeOf(subClass, superClass);
|
|
1695
|
+
}
|
|
1696
|
+
function _createSuper(Derived) {
|
|
1697
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
1698
|
+
return function _createSuperInternal() {
|
|
1699
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
1700
|
+
if (hasNativeReflectConstruct) {
|
|
1701
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
1702
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
1703
|
+
} else {
|
|
1704
|
+
result = Super.apply(this, arguments);
|
|
1705
|
+
}
|
|
1706
|
+
return _possibleConstructorReturn(this, result);
|
|
1707
|
+
};
|
|
1708
|
+
}
|
|
1709
|
+
function _possibleConstructorReturn(self, call) {
|
|
1710
|
+
if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
|
|
1711
|
+
return call;
|
|
1712
|
+
}
|
|
1713
|
+
return _assertThisInitialized(self);
|
|
1714
|
+
}
|
|
1715
|
+
function _assertThisInitialized(self) {
|
|
1716
|
+
if (self === void 0) {
|
|
1717
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1718
|
+
}
|
|
1719
|
+
return self;
|
|
1720
|
+
}
|
|
1721
|
+
function _wrapNativeSuper(Class) {
|
|
1722
|
+
var _cache = typeof Map === "function" ? new Map() : void 0;
|
|
1723
|
+
_wrapNativeSuper = function _wrapNativeSuper2(Class2) {
|
|
1724
|
+
if (Class2 === null || !_isNativeFunction(Class2))
|
|
1725
|
+
return Class2;
|
|
1726
|
+
if (typeof Class2 !== "function") {
|
|
1727
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
1728
|
+
}
|
|
1729
|
+
if (typeof _cache !== "undefined") {
|
|
1730
|
+
if (_cache.has(Class2))
|
|
1731
|
+
return _cache.get(Class2);
|
|
1732
|
+
_cache.set(Class2, Wrapper);
|
|
1733
|
+
}
|
|
1734
|
+
function Wrapper() {
|
|
1735
|
+
return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
|
|
1736
|
+
}
|
|
1737
|
+
Wrapper.prototype = Object.create(Class2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });
|
|
1738
|
+
return _setPrototypeOf(Wrapper, Class2);
|
|
1739
|
+
};
|
|
1740
|
+
return _wrapNativeSuper(Class);
|
|
1741
|
+
}
|
|
1742
|
+
function _construct(Parent, args, Class) {
|
|
1743
|
+
if (_isNativeReflectConstruct()) {
|
|
1744
|
+
_construct = Reflect.construct;
|
|
1745
|
+
} else {
|
|
1746
|
+
_construct = function _construct2(Parent2, args2, Class2) {
|
|
1747
|
+
var a = [null];
|
|
1748
|
+
a.push.apply(a, args2);
|
|
1749
|
+
var Constructor = Function.bind.apply(Parent2, a);
|
|
1750
|
+
var instance = new Constructor();
|
|
1751
|
+
if (Class2)
|
|
1752
|
+
_setPrototypeOf(instance, Class2.prototype);
|
|
1753
|
+
return instance;
|
|
1754
|
+
};
|
|
1755
|
+
}
|
|
1756
|
+
return _construct.apply(null, arguments);
|
|
1757
|
+
}
|
|
1758
|
+
function _isNativeReflectConstruct() {
|
|
1759
|
+
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
1760
|
+
return false;
|
|
1761
|
+
if (Reflect.construct.sham)
|
|
1762
|
+
return false;
|
|
1763
|
+
if (typeof Proxy === "function")
|
|
1764
|
+
return true;
|
|
1765
|
+
try {
|
|
1766
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], function() {
|
|
1767
|
+
}));
|
|
1768
|
+
return true;
|
|
1769
|
+
} catch (e) {
|
|
1770
|
+
return false;
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
function _isNativeFunction(fn) {
|
|
1774
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
1775
|
+
}
|
|
1776
|
+
function _setPrototypeOf(o, p) {
|
|
1777
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
|
|
1778
|
+
o2.__proto__ = p2;
|
|
1779
|
+
return o2;
|
|
1780
|
+
};
|
|
1781
|
+
return _setPrototypeOf(o, p);
|
|
1782
|
+
}
|
|
1783
|
+
function _getPrototypeOf(o) {
|
|
1784
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
|
|
1785
|
+
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
1786
|
+
};
|
|
1787
|
+
return _getPrototypeOf(o);
|
|
1788
|
+
}
|
|
1789
|
+
var GraphQLError = /* @__PURE__ */ function(_Error) {
|
|
1790
|
+
_inherits(GraphQLError2, _Error);
|
|
1791
|
+
var _super = _createSuper(GraphQLError2);
|
|
1792
|
+
function GraphQLError2(message, nodes, source, positions, path3, originalError, extensions) {
|
|
1793
|
+
var _nodeLocations, _nodeLocations2, _nodeLocations3;
|
|
1794
|
+
var _this;
|
|
1795
|
+
_classCallCheck(this, GraphQLError2);
|
|
1796
|
+
_this = _super.call(this, message);
|
|
1797
|
+
_this.name = "GraphQLError";
|
|
1798
|
+
_this.originalError = originalError !== null && originalError !== void 0 ? originalError : void 0;
|
|
1799
|
+
_this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : void 0);
|
|
1800
|
+
var nodeLocations = [];
|
|
1801
|
+
for (var _i2 = 0, _ref3 = (_this$nodes = _this.nodes) !== null && _this$nodes !== void 0 ? _this$nodes : []; _i2 < _ref3.length; _i2++) {
|
|
1802
|
+
var _this$nodes;
|
|
1803
|
+
var _ref4 = _ref3[_i2];
|
|
1804
|
+
var loc = _ref4.loc;
|
|
1805
|
+
if (loc != null) {
|
|
1806
|
+
nodeLocations.push(loc);
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
nodeLocations = undefinedIfEmpty(nodeLocations);
|
|
1810
|
+
_this.source = source !== null && source !== void 0 ? source : (_nodeLocations = nodeLocations) === null || _nodeLocations === void 0 ? void 0 : _nodeLocations[0].source;
|
|
1811
|
+
_this.positions = positions !== null && positions !== void 0 ? positions : (_nodeLocations2 = nodeLocations) === null || _nodeLocations2 === void 0 ? void 0 : _nodeLocations2.map(function(loc2) {
|
|
1812
|
+
return loc2.start;
|
|
1813
|
+
});
|
|
1814
|
+
_this.locations = positions && source ? positions.map(function(pos) {
|
|
1815
|
+
return getLocation(source, pos);
|
|
1816
|
+
}) : (_nodeLocations3 = nodeLocations) === null || _nodeLocations3 === void 0 ? void 0 : _nodeLocations3.map(function(loc2) {
|
|
1817
|
+
return getLocation(loc2.source, loc2.start);
|
|
1818
|
+
});
|
|
1819
|
+
_this.path = path3 !== null && path3 !== void 0 ? path3 : void 0;
|
|
1820
|
+
var originalExtensions = originalError === null || originalError === void 0 ? void 0 : originalError.extensions;
|
|
1821
|
+
if (extensions == null && isObjectLike(originalExtensions)) {
|
|
1822
|
+
_this.extensions = _objectSpread({}, originalExtensions);
|
|
1823
|
+
} else {
|
|
1824
|
+
_this.extensions = extensions !== null && extensions !== void 0 ? extensions : {};
|
|
1825
|
+
}
|
|
1826
|
+
Object.defineProperties(_assertThisInitialized(_this), {
|
|
1827
|
+
message: {
|
|
1828
|
+
enumerable: true
|
|
1829
|
+
},
|
|
1830
|
+
locations: {
|
|
1831
|
+
enumerable: _this.locations != null
|
|
1832
|
+
},
|
|
1833
|
+
path: {
|
|
1834
|
+
enumerable: _this.path != null
|
|
1835
|
+
},
|
|
1836
|
+
extensions: {
|
|
1837
|
+
enumerable: _this.extensions != null && Object.keys(_this.extensions).length > 0
|
|
1838
|
+
},
|
|
1839
|
+
name: {
|
|
1840
|
+
enumerable: false
|
|
1841
|
+
},
|
|
1842
|
+
nodes: {
|
|
1843
|
+
enumerable: false
|
|
1844
|
+
},
|
|
1845
|
+
source: {
|
|
1846
|
+
enumerable: false
|
|
1847
|
+
},
|
|
1848
|
+
positions: {
|
|
1849
|
+
enumerable: false
|
|
1850
|
+
},
|
|
1851
|
+
originalError: {
|
|
1852
|
+
enumerable: false
|
|
1853
|
+
}
|
|
1854
|
+
});
|
|
1855
|
+
if (originalError !== null && originalError !== void 0 && originalError.stack) {
|
|
1856
|
+
Object.defineProperty(_assertThisInitialized(_this), "stack", {
|
|
1857
|
+
value: originalError.stack,
|
|
1858
|
+
writable: true,
|
|
1859
|
+
configurable: true
|
|
1860
|
+
});
|
|
1861
|
+
return _possibleConstructorReturn(_this);
|
|
1862
|
+
}
|
|
1863
|
+
if (Error.captureStackTrace) {
|
|
1864
|
+
Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError2);
|
|
1865
|
+
} else {
|
|
1866
|
+
Object.defineProperty(_assertThisInitialized(_this), "stack", {
|
|
1867
|
+
value: Error().stack,
|
|
1868
|
+
writable: true,
|
|
1869
|
+
configurable: true
|
|
1870
|
+
});
|
|
1871
|
+
}
|
|
1872
|
+
return _this;
|
|
1873
|
+
}
|
|
1874
|
+
_createClass$1(GraphQLError2, [{
|
|
1875
|
+
key: "toString",
|
|
1876
|
+
value: function toString2() {
|
|
1877
|
+
return printError(this);
|
|
1878
|
+
}
|
|
1879
|
+
}, {
|
|
1880
|
+
key: SYMBOL_TO_STRING_TAG,
|
|
1881
|
+
get: function get2() {
|
|
1882
|
+
return "Object";
|
|
1883
|
+
}
|
|
1884
|
+
}]);
|
|
1885
|
+
return GraphQLError2;
|
|
1886
|
+
}(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
1887
|
+
function undefinedIfEmpty(array) {
|
|
1888
|
+
return array === void 0 || array.length === 0 ? void 0 : array;
|
|
1889
|
+
}
|
|
1890
|
+
function printError(error) {
|
|
1891
|
+
var output = error.message;
|
|
1892
|
+
if (error.nodes) {
|
|
1893
|
+
for (var _i4 = 0, _error$nodes2 = error.nodes; _i4 < _error$nodes2.length; _i4++) {
|
|
1894
|
+
var node = _error$nodes2[_i4];
|
|
1895
|
+
if (node.loc) {
|
|
1896
|
+
output += "\n\n" + printLocation(node.loc);
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
} else if (error.source && error.locations) {
|
|
1900
|
+
for (var _i6 = 0, _error$locations2 = error.locations; _i6 < _error$locations2.length; _i6++) {
|
|
1901
|
+
var location = _error$locations2[_i6];
|
|
1902
|
+
output += "\n\n" + printSourceLocation(error.source, location);
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
return output;
|
|
1906
|
+
}
|
|
1907
|
+
function syntaxError(source, position, description) {
|
|
1908
|
+
return new GraphQLError("Syntax Error: ".concat(description), void 0, source, [position]);
|
|
1909
|
+
}
|
|
1910
|
+
var Kind = Object.freeze({
|
|
1911
|
+
NAME: "Name",
|
|
1912
|
+
DOCUMENT: "Document",
|
|
1913
|
+
OPERATION_DEFINITION: "OperationDefinition",
|
|
1914
|
+
VARIABLE_DEFINITION: "VariableDefinition",
|
|
1915
|
+
SELECTION_SET: "SelectionSet",
|
|
1916
|
+
FIELD: "Field",
|
|
1917
|
+
ARGUMENT: "Argument",
|
|
1918
|
+
FRAGMENT_SPREAD: "FragmentSpread",
|
|
1919
|
+
INLINE_FRAGMENT: "InlineFragment",
|
|
1920
|
+
FRAGMENT_DEFINITION: "FragmentDefinition",
|
|
1921
|
+
VARIABLE: "Variable",
|
|
1922
|
+
INT: "IntValue",
|
|
1923
|
+
FLOAT: "FloatValue",
|
|
1924
|
+
STRING: "StringValue",
|
|
1925
|
+
BOOLEAN: "BooleanValue",
|
|
1926
|
+
NULL: "NullValue",
|
|
1927
|
+
ENUM: "EnumValue",
|
|
1928
|
+
LIST: "ListValue",
|
|
1929
|
+
OBJECT: "ObjectValue",
|
|
1930
|
+
OBJECT_FIELD: "ObjectField",
|
|
1931
|
+
DIRECTIVE: "Directive",
|
|
1932
|
+
NAMED_TYPE: "NamedType",
|
|
1933
|
+
LIST_TYPE: "ListType",
|
|
1934
|
+
NON_NULL_TYPE: "NonNullType",
|
|
1935
|
+
SCHEMA_DEFINITION: "SchemaDefinition",
|
|
1936
|
+
OPERATION_TYPE_DEFINITION: "OperationTypeDefinition",
|
|
1937
|
+
SCALAR_TYPE_DEFINITION: "ScalarTypeDefinition",
|
|
1938
|
+
OBJECT_TYPE_DEFINITION: "ObjectTypeDefinition",
|
|
1939
|
+
FIELD_DEFINITION: "FieldDefinition",
|
|
1940
|
+
INPUT_VALUE_DEFINITION: "InputValueDefinition",
|
|
1941
|
+
INTERFACE_TYPE_DEFINITION: "InterfaceTypeDefinition",
|
|
1942
|
+
UNION_TYPE_DEFINITION: "UnionTypeDefinition",
|
|
1943
|
+
ENUM_TYPE_DEFINITION: "EnumTypeDefinition",
|
|
1944
|
+
ENUM_VALUE_DEFINITION: "EnumValueDefinition",
|
|
1945
|
+
INPUT_OBJECT_TYPE_DEFINITION: "InputObjectTypeDefinition",
|
|
1946
|
+
DIRECTIVE_DEFINITION: "DirectiveDefinition",
|
|
1947
|
+
SCHEMA_EXTENSION: "SchemaExtension",
|
|
1948
|
+
SCALAR_TYPE_EXTENSION: "ScalarTypeExtension",
|
|
1949
|
+
OBJECT_TYPE_EXTENSION: "ObjectTypeExtension",
|
|
1950
|
+
INTERFACE_TYPE_EXTENSION: "InterfaceTypeExtension",
|
|
1951
|
+
UNION_TYPE_EXTENSION: "UnionTypeExtension",
|
|
1952
|
+
ENUM_TYPE_EXTENSION: "EnumTypeExtension",
|
|
1953
|
+
INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension"
|
|
1954
|
+
});
|
|
1955
|
+
function invariant(condition, message) {
|
|
1956
|
+
var booleanCondition = Boolean(condition);
|
|
1957
|
+
if (!booleanCondition) {
|
|
1958
|
+
throw new Error(message != null ? message : "Unexpected invariant triggered.");
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
var nodejsCustomInspectSymbol = typeof Symbol === "function" && typeof Symbol.for === "function" ? Symbol.for("nodejs.util.inspect.custom") : void 0;
|
|
1962
|
+
var nodejsCustomInspectSymbol$1 = nodejsCustomInspectSymbol;
|
|
1963
|
+
function defineInspect(classObject) {
|
|
1964
|
+
var fn = classObject.prototype.toJSON;
|
|
1965
|
+
typeof fn === "function" || invariant(0);
|
|
1966
|
+
classObject.prototype.inspect = fn;
|
|
1967
|
+
if (nodejsCustomInspectSymbol$1) {
|
|
1968
|
+
classObject.prototype[nodejsCustomInspectSymbol$1] = fn;
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
var Location = /* @__PURE__ */ function() {
|
|
1972
|
+
function Location2(startToken, endToken, source) {
|
|
1973
|
+
this.start = startToken.start;
|
|
1974
|
+
this.end = endToken.end;
|
|
1975
|
+
this.startToken = startToken;
|
|
1976
|
+
this.endToken = endToken;
|
|
1977
|
+
this.source = source;
|
|
1978
|
+
}
|
|
1979
|
+
var _proto = Location2.prototype;
|
|
1980
|
+
_proto.toJSON = function toJSON() {
|
|
1981
|
+
return {
|
|
1982
|
+
start: this.start,
|
|
1983
|
+
end: this.end
|
|
1984
|
+
};
|
|
1985
|
+
};
|
|
1986
|
+
return Location2;
|
|
1987
|
+
}();
|
|
1988
|
+
defineInspect(Location);
|
|
1989
|
+
var Token = /* @__PURE__ */ function() {
|
|
1990
|
+
function Token2(kind, start, end, line, column, prev, value) {
|
|
1991
|
+
this.kind = kind;
|
|
1992
|
+
this.start = start;
|
|
1993
|
+
this.end = end;
|
|
1994
|
+
this.line = line;
|
|
1995
|
+
this.column = column;
|
|
1996
|
+
this.value = value;
|
|
1997
|
+
this.prev = prev;
|
|
1998
|
+
this.next = null;
|
|
1999
|
+
}
|
|
2000
|
+
var _proto2 = Token2.prototype;
|
|
2001
|
+
_proto2.toJSON = function toJSON() {
|
|
2002
|
+
return {
|
|
2003
|
+
kind: this.kind,
|
|
2004
|
+
value: this.value,
|
|
2005
|
+
line: this.line,
|
|
2006
|
+
column: this.column
|
|
2007
|
+
};
|
|
2008
|
+
};
|
|
2009
|
+
return Token2;
|
|
2010
|
+
}();
|
|
2011
|
+
defineInspect(Token);
|
|
2012
|
+
var TokenKind = Object.freeze({
|
|
2013
|
+
SOF: "<SOF>",
|
|
2014
|
+
EOF: "<EOF>",
|
|
2015
|
+
BANG: "!",
|
|
2016
|
+
DOLLAR: "$",
|
|
2017
|
+
AMP: "&",
|
|
2018
|
+
PAREN_L: "(",
|
|
2019
|
+
PAREN_R: ")",
|
|
2020
|
+
SPREAD: "...",
|
|
2021
|
+
COLON: ":",
|
|
2022
|
+
EQUALS: "=",
|
|
2023
|
+
AT: "@",
|
|
2024
|
+
BRACKET_L: "[",
|
|
2025
|
+
BRACKET_R: "]",
|
|
2026
|
+
BRACE_L: "{",
|
|
2027
|
+
PIPE: "|",
|
|
2028
|
+
BRACE_R: "}",
|
|
2029
|
+
NAME: "Name",
|
|
2030
|
+
INT: "Int",
|
|
2031
|
+
FLOAT: "Float",
|
|
2032
|
+
STRING: "String",
|
|
2033
|
+
BLOCK_STRING: "BlockString",
|
|
2034
|
+
COMMENT: "Comment"
|
|
2035
|
+
});
|
|
2036
|
+
function _typeof(obj) {
|
|
2037
|
+
"@babel/helpers - typeof";
|
|
2038
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
2039
|
+
_typeof = function _typeof2(obj2) {
|
|
2040
|
+
return typeof obj2;
|
|
2041
|
+
};
|
|
2042
|
+
} else {
|
|
2043
|
+
_typeof = function _typeof2(obj2) {
|
|
2044
|
+
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
2045
|
+
};
|
|
2046
|
+
}
|
|
2047
|
+
return _typeof(obj);
|
|
2048
|
+
}
|
|
2049
|
+
var MAX_ARRAY_LENGTH = 10;
|
|
2050
|
+
var MAX_RECURSIVE_DEPTH = 2;
|
|
2051
|
+
function inspect(value) {
|
|
2052
|
+
return formatValue(value, []);
|
|
2053
|
+
}
|
|
2054
|
+
function formatValue(value, seenValues) {
|
|
2055
|
+
switch (_typeof(value)) {
|
|
2056
|
+
case "string":
|
|
2057
|
+
return JSON.stringify(value);
|
|
2058
|
+
case "function":
|
|
2059
|
+
return value.name ? "[function ".concat(value.name, "]") : "[function]";
|
|
2060
|
+
case "object":
|
|
2061
|
+
if (value === null) {
|
|
2062
|
+
return "null";
|
|
2063
|
+
}
|
|
2064
|
+
return formatObjectValue(value, seenValues);
|
|
2065
|
+
default:
|
|
2066
|
+
return String(value);
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
function formatObjectValue(value, previouslySeenValues) {
|
|
2070
|
+
if (previouslySeenValues.indexOf(value) !== -1) {
|
|
2071
|
+
return "[Circular]";
|
|
2072
|
+
}
|
|
2073
|
+
var seenValues = [].concat(previouslySeenValues, [value]);
|
|
2074
|
+
var customInspectFn = getCustomFn(value);
|
|
2075
|
+
if (customInspectFn !== void 0) {
|
|
2076
|
+
var customValue = customInspectFn.call(value);
|
|
2077
|
+
if (customValue !== value) {
|
|
2078
|
+
return typeof customValue === "string" ? customValue : formatValue(customValue, seenValues);
|
|
2079
|
+
}
|
|
2080
|
+
} else if (Array.isArray(value)) {
|
|
2081
|
+
return formatArray(value, seenValues);
|
|
2082
|
+
}
|
|
2083
|
+
return formatObject(value, seenValues);
|
|
2084
|
+
}
|
|
2085
|
+
function formatObject(object, seenValues) {
|
|
2086
|
+
var keys = Object.keys(object);
|
|
2087
|
+
if (keys.length === 0) {
|
|
2088
|
+
return "{}";
|
|
2089
|
+
}
|
|
2090
|
+
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
2091
|
+
return "[" + getObjectTag(object) + "]";
|
|
2092
|
+
}
|
|
2093
|
+
var properties = keys.map(function(key) {
|
|
2094
|
+
var value = formatValue(object[key], seenValues);
|
|
2095
|
+
return key + ": " + value;
|
|
2096
|
+
});
|
|
2097
|
+
return "{ " + properties.join(", ") + " }";
|
|
2098
|
+
}
|
|
2099
|
+
function formatArray(array, seenValues) {
|
|
2100
|
+
if (array.length === 0) {
|
|
2101
|
+
return "[]";
|
|
2102
|
+
}
|
|
2103
|
+
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
2104
|
+
return "[Array]";
|
|
2105
|
+
}
|
|
2106
|
+
var len = Math.min(MAX_ARRAY_LENGTH, array.length);
|
|
2107
|
+
var remaining = array.length - len;
|
|
2108
|
+
var items = [];
|
|
2109
|
+
for (var i = 0; i < len; ++i) {
|
|
2110
|
+
items.push(formatValue(array[i], seenValues));
|
|
2111
|
+
}
|
|
2112
|
+
if (remaining === 1) {
|
|
2113
|
+
items.push("... 1 more item");
|
|
2114
|
+
} else if (remaining > 1) {
|
|
2115
|
+
items.push("... ".concat(remaining, " more items"));
|
|
2116
|
+
}
|
|
2117
|
+
return "[" + items.join(", ") + "]";
|
|
2118
|
+
}
|
|
2119
|
+
function getCustomFn(object) {
|
|
2120
|
+
var customInspectFn = object[String(nodejsCustomInspectSymbol$1)];
|
|
2121
|
+
if (typeof customInspectFn === "function") {
|
|
2122
|
+
return customInspectFn;
|
|
2123
|
+
}
|
|
2124
|
+
if (typeof object.inspect === "function") {
|
|
2125
|
+
return object.inspect;
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
function getObjectTag(object) {
|
|
2129
|
+
var tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
|
|
2130
|
+
if (tag === "Object" && typeof object.constructor === "function") {
|
|
2131
|
+
var name = object.constructor.name;
|
|
2132
|
+
if (typeof name === "string" && name !== "") {
|
|
2133
|
+
return name;
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
return tag;
|
|
2137
|
+
}
|
|
2138
|
+
function devAssert(condition, message) {
|
|
2139
|
+
var booleanCondition = Boolean(condition);
|
|
2140
|
+
if (!booleanCondition) {
|
|
2141
|
+
throw new Error(message);
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
var instanceOf = function instanceOf2(value, constructor) {
|
|
2145
|
+
return value instanceof constructor;
|
|
2146
|
+
};
|
|
2147
|
+
function _defineProperties(target, props) {
|
|
2148
|
+
for (var i = 0; i < props.length; i++) {
|
|
2149
|
+
var descriptor = props[i];
|
|
2150
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
2151
|
+
descriptor.configurable = true;
|
|
2152
|
+
if ("value" in descriptor)
|
|
2153
|
+
descriptor.writable = true;
|
|
2154
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
2158
|
+
if (protoProps)
|
|
2159
|
+
_defineProperties(Constructor.prototype, protoProps);
|
|
2160
|
+
if (staticProps)
|
|
2161
|
+
_defineProperties(Constructor, staticProps);
|
|
2162
|
+
return Constructor;
|
|
2163
|
+
}
|
|
2164
|
+
var Source = /* @__PURE__ */ function() {
|
|
2165
|
+
function Source2(body) {
|
|
2166
|
+
var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "GraphQL request";
|
|
2167
|
+
var locationOffset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
2168
|
+
line: 1,
|
|
2169
|
+
column: 1
|
|
2170
|
+
};
|
|
2171
|
+
typeof body === "string" || devAssert(0, "Body must be a string. Received: ".concat(inspect(body), "."));
|
|
2172
|
+
this.body = body;
|
|
2173
|
+
this.name = name;
|
|
2174
|
+
this.locationOffset = locationOffset;
|
|
2175
|
+
this.locationOffset.line > 0 || devAssert(0, "line in locationOffset is 1-indexed and must be positive.");
|
|
2176
|
+
this.locationOffset.column > 0 || devAssert(0, "column in locationOffset is 1-indexed and must be positive.");
|
|
2177
|
+
}
|
|
2178
|
+
_createClass(Source2, [{
|
|
2179
|
+
key: SYMBOL_TO_STRING_TAG,
|
|
2180
|
+
get: function get2() {
|
|
2181
|
+
return "Source";
|
|
2182
|
+
}
|
|
2183
|
+
}]);
|
|
2184
|
+
return Source2;
|
|
2185
|
+
}();
|
|
2186
|
+
function isSource(source) {
|
|
2187
|
+
return instanceOf(source, Source);
|
|
2188
|
+
}
|
|
2189
|
+
var DirectiveLocation = Object.freeze({
|
|
2190
|
+
QUERY: "QUERY",
|
|
2191
|
+
MUTATION: "MUTATION",
|
|
2192
|
+
SUBSCRIPTION: "SUBSCRIPTION",
|
|
2193
|
+
FIELD: "FIELD",
|
|
2194
|
+
FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION",
|
|
2195
|
+
FRAGMENT_SPREAD: "FRAGMENT_SPREAD",
|
|
2196
|
+
INLINE_FRAGMENT: "INLINE_FRAGMENT",
|
|
2197
|
+
VARIABLE_DEFINITION: "VARIABLE_DEFINITION",
|
|
2198
|
+
SCHEMA: "SCHEMA",
|
|
2199
|
+
SCALAR: "SCALAR",
|
|
2200
|
+
OBJECT: "OBJECT",
|
|
2201
|
+
FIELD_DEFINITION: "FIELD_DEFINITION",
|
|
2202
|
+
ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION",
|
|
2203
|
+
INTERFACE: "INTERFACE",
|
|
2204
|
+
UNION: "UNION",
|
|
2205
|
+
ENUM: "ENUM",
|
|
2206
|
+
ENUM_VALUE: "ENUM_VALUE",
|
|
2207
|
+
INPUT_OBJECT: "INPUT_OBJECT",
|
|
2208
|
+
INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION"
|
|
2209
|
+
});
|
|
2210
|
+
function dedentBlockStringValue(rawString) {
|
|
2211
|
+
var lines = rawString.split(/\r\n|[\n\r]/g);
|
|
2212
|
+
var commonIndent = getBlockStringIndentation(rawString);
|
|
2213
|
+
if (commonIndent !== 0) {
|
|
2214
|
+
for (var i = 1; i < lines.length; i++) {
|
|
2215
|
+
lines[i] = lines[i].slice(commonIndent);
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
var startLine = 0;
|
|
2219
|
+
while (startLine < lines.length && isBlank(lines[startLine])) {
|
|
2220
|
+
++startLine;
|
|
2221
|
+
}
|
|
2222
|
+
var endLine = lines.length;
|
|
2223
|
+
while (endLine > startLine && isBlank(lines[endLine - 1])) {
|
|
2224
|
+
--endLine;
|
|
2225
|
+
}
|
|
2226
|
+
return lines.slice(startLine, endLine).join("\n");
|
|
2227
|
+
}
|
|
2228
|
+
function isBlank(str) {
|
|
2229
|
+
for (var i = 0; i < str.length; ++i) {
|
|
2230
|
+
if (str[i] !== " " && str[i] !== " ") {
|
|
2231
|
+
return false;
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
return true;
|
|
2235
|
+
}
|
|
2236
|
+
function getBlockStringIndentation(value) {
|
|
2237
|
+
var _commonIndent;
|
|
2238
|
+
var isFirstLine = true;
|
|
2239
|
+
var isEmptyLine = true;
|
|
2240
|
+
var indent = 0;
|
|
2241
|
+
var commonIndent = null;
|
|
2242
|
+
for (var i = 0; i < value.length; ++i) {
|
|
2243
|
+
switch (value.charCodeAt(i)) {
|
|
2244
|
+
case 13:
|
|
2245
|
+
if (value.charCodeAt(i + 1) === 10) {
|
|
2246
|
+
++i;
|
|
2247
|
+
}
|
|
2248
|
+
case 10:
|
|
2249
|
+
isFirstLine = false;
|
|
2250
|
+
isEmptyLine = true;
|
|
2251
|
+
indent = 0;
|
|
2252
|
+
break;
|
|
2253
|
+
case 9:
|
|
2254
|
+
case 32:
|
|
2255
|
+
++indent;
|
|
2256
|
+
break;
|
|
2257
|
+
default:
|
|
2258
|
+
if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) {
|
|
2259
|
+
commonIndent = indent;
|
|
2260
|
+
}
|
|
2261
|
+
isEmptyLine = false;
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;
|
|
2265
|
+
}
|
|
2266
|
+
var Lexer = /* @__PURE__ */ function() {
|
|
2267
|
+
function Lexer2(source) {
|
|
2268
|
+
var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);
|
|
2269
|
+
this.source = source;
|
|
2270
|
+
this.lastToken = startOfFileToken;
|
|
2271
|
+
this.token = startOfFileToken;
|
|
2272
|
+
this.line = 1;
|
|
2273
|
+
this.lineStart = 0;
|
|
2274
|
+
}
|
|
2275
|
+
var _proto = Lexer2.prototype;
|
|
2276
|
+
_proto.advance = function advance() {
|
|
2277
|
+
this.lastToken = this.token;
|
|
2278
|
+
var token = this.token = this.lookahead();
|
|
2279
|
+
return token;
|
|
2280
|
+
};
|
|
2281
|
+
_proto.lookahead = function lookahead() {
|
|
2282
|
+
var token = this.token;
|
|
2283
|
+
if (token.kind !== TokenKind.EOF) {
|
|
2284
|
+
do {
|
|
2285
|
+
var _token$next;
|
|
2286
|
+
token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token);
|
|
2287
|
+
} while (token.kind === TokenKind.COMMENT);
|
|
2288
|
+
}
|
|
2289
|
+
return token;
|
|
2290
|
+
};
|
|
2291
|
+
return Lexer2;
|
|
2292
|
+
}();
|
|
2293
|
+
function isPunctuatorTokenKind(kind) {
|
|
2294
|
+
return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;
|
|
2295
|
+
}
|
|
2296
|
+
function printCharCode(code) {
|
|
2297
|
+
return isNaN(code) ? TokenKind.EOF : code < 127 ? JSON.stringify(String.fromCharCode(code)) : '"\\u'.concat(("00" + code.toString(16).toUpperCase()).slice(-4), '"');
|
|
2298
|
+
}
|
|
2299
|
+
function readToken(lexer, prev) {
|
|
2300
|
+
var source = lexer.source;
|
|
2301
|
+
var body = source.body;
|
|
2302
|
+
var bodyLength = body.length;
|
|
2303
|
+
var pos = prev.end;
|
|
2304
|
+
while (pos < bodyLength) {
|
|
2305
|
+
var code = body.charCodeAt(pos);
|
|
2306
|
+
var _line = lexer.line;
|
|
2307
|
+
var _col = 1 + pos - lexer.lineStart;
|
|
2308
|
+
switch (code) {
|
|
2309
|
+
case 65279:
|
|
2310
|
+
case 9:
|
|
2311
|
+
case 32:
|
|
2312
|
+
case 44:
|
|
2313
|
+
++pos;
|
|
2314
|
+
continue;
|
|
2315
|
+
case 10:
|
|
2316
|
+
++pos;
|
|
2317
|
+
++lexer.line;
|
|
2318
|
+
lexer.lineStart = pos;
|
|
2319
|
+
continue;
|
|
2320
|
+
case 13:
|
|
2321
|
+
if (body.charCodeAt(pos + 1) === 10) {
|
|
2322
|
+
pos += 2;
|
|
2323
|
+
} else {
|
|
2324
|
+
++pos;
|
|
2325
|
+
}
|
|
2326
|
+
++lexer.line;
|
|
2327
|
+
lexer.lineStart = pos;
|
|
2328
|
+
continue;
|
|
2329
|
+
case 33:
|
|
2330
|
+
return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);
|
|
2331
|
+
case 35:
|
|
2332
|
+
return readComment(source, pos, _line, _col, prev);
|
|
2333
|
+
case 36:
|
|
2334
|
+
return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);
|
|
2335
|
+
case 38:
|
|
2336
|
+
return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);
|
|
2337
|
+
case 40:
|
|
2338
|
+
return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);
|
|
2339
|
+
case 41:
|
|
2340
|
+
return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);
|
|
2341
|
+
case 46:
|
|
2342
|
+
if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {
|
|
2343
|
+
return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);
|
|
2344
|
+
}
|
|
2345
|
+
break;
|
|
2346
|
+
case 58:
|
|
2347
|
+
return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);
|
|
2348
|
+
case 61:
|
|
2349
|
+
return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);
|
|
2350
|
+
case 64:
|
|
2351
|
+
return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);
|
|
2352
|
+
case 91:
|
|
2353
|
+
return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);
|
|
2354
|
+
case 93:
|
|
2355
|
+
return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);
|
|
2356
|
+
case 123:
|
|
2357
|
+
return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);
|
|
2358
|
+
case 124:
|
|
2359
|
+
return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);
|
|
2360
|
+
case 125:
|
|
2361
|
+
return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);
|
|
2362
|
+
case 34:
|
|
2363
|
+
if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {
|
|
2364
|
+
return readBlockString(source, pos, _line, _col, prev, lexer);
|
|
2365
|
+
}
|
|
2366
|
+
return readString(source, pos, _line, _col, prev);
|
|
2367
|
+
case 45:
|
|
2368
|
+
case 48:
|
|
2369
|
+
case 49:
|
|
2370
|
+
case 50:
|
|
2371
|
+
case 51:
|
|
2372
|
+
case 52:
|
|
2373
|
+
case 53:
|
|
2374
|
+
case 54:
|
|
2375
|
+
case 55:
|
|
2376
|
+
case 56:
|
|
2377
|
+
case 57:
|
|
2378
|
+
return readNumber(source, pos, code, _line, _col, prev);
|
|
2379
|
+
case 65:
|
|
2380
|
+
case 66:
|
|
2381
|
+
case 67:
|
|
2382
|
+
case 68:
|
|
2383
|
+
case 69:
|
|
2384
|
+
case 70:
|
|
2385
|
+
case 71:
|
|
2386
|
+
case 72:
|
|
2387
|
+
case 73:
|
|
2388
|
+
case 74:
|
|
2389
|
+
case 75:
|
|
2390
|
+
case 76:
|
|
2391
|
+
case 77:
|
|
2392
|
+
case 78:
|
|
2393
|
+
case 79:
|
|
2394
|
+
case 80:
|
|
2395
|
+
case 81:
|
|
2396
|
+
case 82:
|
|
2397
|
+
case 83:
|
|
2398
|
+
case 84:
|
|
2399
|
+
case 85:
|
|
2400
|
+
case 86:
|
|
2401
|
+
case 87:
|
|
2402
|
+
case 88:
|
|
2403
|
+
case 89:
|
|
2404
|
+
case 90:
|
|
2405
|
+
case 95:
|
|
2406
|
+
case 97:
|
|
2407
|
+
case 98:
|
|
2408
|
+
case 99:
|
|
2409
|
+
case 100:
|
|
2410
|
+
case 101:
|
|
2411
|
+
case 102:
|
|
2412
|
+
case 103:
|
|
2413
|
+
case 104:
|
|
2414
|
+
case 105:
|
|
2415
|
+
case 106:
|
|
2416
|
+
case 107:
|
|
2417
|
+
case 108:
|
|
2418
|
+
case 109:
|
|
2419
|
+
case 110:
|
|
2420
|
+
case 111:
|
|
2421
|
+
case 112:
|
|
2422
|
+
case 113:
|
|
2423
|
+
case 114:
|
|
2424
|
+
case 115:
|
|
2425
|
+
case 116:
|
|
2426
|
+
case 117:
|
|
2427
|
+
case 118:
|
|
2428
|
+
case 119:
|
|
2429
|
+
case 120:
|
|
2430
|
+
case 121:
|
|
2431
|
+
case 122:
|
|
2432
|
+
return readName(source, pos, _line, _col, prev);
|
|
2433
|
+
}
|
|
2434
|
+
throw syntaxError(source, pos, unexpectedCharacterMessage(code));
|
|
2435
|
+
}
|
|
2436
|
+
var line = lexer.line;
|
|
2437
|
+
var col = 1 + pos - lexer.lineStart;
|
|
2438
|
+
return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);
|
|
2439
|
+
}
|
|
2440
|
+
function unexpectedCharacterMessage(code) {
|
|
2441
|
+
if (code < 32 && code !== 9 && code !== 10 && code !== 13) {
|
|
2442
|
+
return "Cannot contain the invalid character ".concat(printCharCode(code), ".");
|
|
2443
|
+
}
|
|
2444
|
+
if (code === 39) {
|
|
2445
|
+
return `Unexpected single quote character ('), did you mean to use a double quote (")?`;
|
|
2446
|
+
}
|
|
2447
|
+
return "Cannot parse the unexpected character ".concat(printCharCode(code), ".");
|
|
2448
|
+
}
|
|
2449
|
+
function readComment(source, start, line, col, prev) {
|
|
2450
|
+
var body = source.body;
|
|
2451
|
+
var code;
|
|
2452
|
+
var position = start;
|
|
2453
|
+
do {
|
|
2454
|
+
code = body.charCodeAt(++position);
|
|
2455
|
+
} while (!isNaN(code) && (code > 31 || code === 9));
|
|
2456
|
+
return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));
|
|
2457
|
+
}
|
|
2458
|
+
function readNumber(source, start, firstCode, line, col, prev) {
|
|
2459
|
+
var body = source.body;
|
|
2460
|
+
var code = firstCode;
|
|
2461
|
+
var position = start;
|
|
2462
|
+
var isFloat = false;
|
|
2463
|
+
if (code === 45) {
|
|
2464
|
+
code = body.charCodeAt(++position);
|
|
2465
|
+
}
|
|
2466
|
+
if (code === 48) {
|
|
2467
|
+
code = body.charCodeAt(++position);
|
|
2468
|
+
if (code >= 48 && code <= 57) {
|
|
2469
|
+
throw syntaxError(source, position, "Invalid number, unexpected digit after 0: ".concat(printCharCode(code), "."));
|
|
2470
|
+
}
|
|
2471
|
+
} else {
|
|
2472
|
+
position = readDigits(source, position, code);
|
|
2473
|
+
code = body.charCodeAt(position);
|
|
2474
|
+
}
|
|
2475
|
+
if (code === 46) {
|
|
2476
|
+
isFloat = true;
|
|
2477
|
+
code = body.charCodeAt(++position);
|
|
2478
|
+
position = readDigits(source, position, code);
|
|
2479
|
+
code = body.charCodeAt(position);
|
|
2480
|
+
}
|
|
2481
|
+
if (code === 69 || code === 101) {
|
|
2482
|
+
isFloat = true;
|
|
2483
|
+
code = body.charCodeAt(++position);
|
|
2484
|
+
if (code === 43 || code === 45) {
|
|
2485
|
+
code = body.charCodeAt(++position);
|
|
2486
|
+
}
|
|
2487
|
+
position = readDigits(source, position, code);
|
|
2488
|
+
code = body.charCodeAt(position);
|
|
2489
|
+
}
|
|
2490
|
+
if (code === 46 || isNameStart(code)) {
|
|
2491
|
+
throw syntaxError(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), "."));
|
|
2492
|
+
}
|
|
2493
|
+
return new Token(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position));
|
|
2494
|
+
}
|
|
2495
|
+
function readDigits(source, start, firstCode) {
|
|
2496
|
+
var body = source.body;
|
|
2497
|
+
var position = start;
|
|
2498
|
+
var code = firstCode;
|
|
2499
|
+
if (code >= 48 && code <= 57) {
|
|
2500
|
+
do {
|
|
2501
|
+
code = body.charCodeAt(++position);
|
|
2502
|
+
} while (code >= 48 && code <= 57);
|
|
2503
|
+
return position;
|
|
2504
|
+
}
|
|
2505
|
+
throw syntaxError(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), "."));
|
|
2506
|
+
}
|
|
2507
|
+
function readString(source, start, line, col, prev) {
|
|
2508
|
+
var body = source.body;
|
|
2509
|
+
var position = start + 1;
|
|
2510
|
+
var chunkStart = position;
|
|
2511
|
+
var code = 0;
|
|
2512
|
+
var value = "";
|
|
2513
|
+
while (position < body.length && !isNaN(code = body.charCodeAt(position)) && code !== 10 && code !== 13) {
|
|
2514
|
+
if (code === 34) {
|
|
2515
|
+
value += body.slice(chunkStart, position);
|
|
2516
|
+
return new Token(TokenKind.STRING, start, position + 1, line, col, prev, value);
|
|
2517
|
+
}
|
|
2518
|
+
if (code < 32 && code !== 9) {
|
|
2519
|
+
throw syntaxError(source, position, "Invalid character within String: ".concat(printCharCode(code), "."));
|
|
2520
|
+
}
|
|
2521
|
+
++position;
|
|
2522
|
+
if (code === 92) {
|
|
2523
|
+
value += body.slice(chunkStart, position - 1);
|
|
2524
|
+
code = body.charCodeAt(position);
|
|
2525
|
+
switch (code) {
|
|
2526
|
+
case 34:
|
|
2527
|
+
value += '"';
|
|
2528
|
+
break;
|
|
2529
|
+
case 47:
|
|
2530
|
+
value += "/";
|
|
2531
|
+
break;
|
|
2532
|
+
case 92:
|
|
2533
|
+
value += "\\";
|
|
2534
|
+
break;
|
|
2535
|
+
case 98:
|
|
2536
|
+
value += "\b";
|
|
2537
|
+
break;
|
|
2538
|
+
case 102:
|
|
2539
|
+
value += "\f";
|
|
2540
|
+
break;
|
|
2541
|
+
case 110:
|
|
2542
|
+
value += "\n";
|
|
2543
|
+
break;
|
|
2544
|
+
case 114:
|
|
2545
|
+
value += "\r";
|
|
2546
|
+
break;
|
|
2547
|
+
case 116:
|
|
2548
|
+
value += " ";
|
|
2549
|
+
break;
|
|
2550
|
+
case 117: {
|
|
2551
|
+
var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4));
|
|
2552
|
+
if (charCode < 0) {
|
|
2553
|
+
var invalidSequence = body.slice(position + 1, position + 5);
|
|
2554
|
+
throw syntaxError(source, position, "Invalid character escape sequence: \\u".concat(invalidSequence, "."));
|
|
2555
|
+
}
|
|
2556
|
+
value += String.fromCharCode(charCode);
|
|
2557
|
+
position += 4;
|
|
2558
|
+
break;
|
|
2559
|
+
}
|
|
2560
|
+
default:
|
|
2561
|
+
throw syntaxError(source, position, "Invalid character escape sequence: \\".concat(String.fromCharCode(code), "."));
|
|
2562
|
+
}
|
|
2563
|
+
++position;
|
|
2564
|
+
chunkStart = position;
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
throw syntaxError(source, position, "Unterminated string.");
|
|
2568
|
+
}
|
|
2569
|
+
function readBlockString(source, start, line, col, prev, lexer) {
|
|
2570
|
+
var body = source.body;
|
|
2571
|
+
var position = start + 3;
|
|
2572
|
+
var chunkStart = position;
|
|
2573
|
+
var code = 0;
|
|
2574
|
+
var rawValue = "";
|
|
2575
|
+
while (position < body.length && !isNaN(code = body.charCodeAt(position))) {
|
|
2576
|
+
if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {
|
|
2577
|
+
rawValue += body.slice(chunkStart, position);
|
|
2578
|
+
return new Token(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue));
|
|
2579
|
+
}
|
|
2580
|
+
if (code < 32 && code !== 9 && code !== 10 && code !== 13) {
|
|
2581
|
+
throw syntaxError(source, position, "Invalid character within String: ".concat(printCharCode(code), "."));
|
|
2582
|
+
}
|
|
2583
|
+
if (code === 10) {
|
|
2584
|
+
++position;
|
|
2585
|
+
++lexer.line;
|
|
2586
|
+
lexer.lineStart = position;
|
|
2587
|
+
} else if (code === 13) {
|
|
2588
|
+
if (body.charCodeAt(position + 1) === 10) {
|
|
2589
|
+
position += 2;
|
|
2590
|
+
} else {
|
|
2591
|
+
++position;
|
|
2592
|
+
}
|
|
2593
|
+
++lexer.line;
|
|
2594
|
+
lexer.lineStart = position;
|
|
2595
|
+
} else if (code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {
|
|
2596
|
+
rawValue += body.slice(chunkStart, position) + '"""';
|
|
2597
|
+
position += 4;
|
|
2598
|
+
chunkStart = position;
|
|
2599
|
+
} else {
|
|
2600
|
+
++position;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
throw syntaxError(source, position, "Unterminated string.");
|
|
2604
|
+
}
|
|
2605
|
+
function uniCharCode(a, b, c, d) {
|
|
2606
|
+
return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);
|
|
2607
|
+
}
|
|
2608
|
+
function char2hex(a) {
|
|
2609
|
+
return a >= 48 && a <= 57 ? a - 48 : a >= 65 && a <= 70 ? a - 55 : a >= 97 && a <= 102 ? a - 87 : -1;
|
|
2610
|
+
}
|
|
2611
|
+
function readName(source, start, line, col, prev) {
|
|
2612
|
+
var body = source.body;
|
|
2613
|
+
var bodyLength = body.length;
|
|
2614
|
+
var position = start + 1;
|
|
2615
|
+
var code = 0;
|
|
2616
|
+
while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122)) {
|
|
2617
|
+
++position;
|
|
2618
|
+
}
|
|
2619
|
+
return new Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));
|
|
2620
|
+
}
|
|
2621
|
+
function isNameStart(code) {
|
|
2622
|
+
return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
2623
|
+
}
|
|
2624
|
+
function parse$1(source, options) {
|
|
2625
|
+
var parser2 = new Parser(source, options);
|
|
2626
|
+
return parser2.parseDocument();
|
|
2627
|
+
}
|
|
2628
|
+
function parseValue(source, options) {
|
|
2629
|
+
var parser2 = new Parser(source, options);
|
|
2630
|
+
parser2.expectToken(TokenKind.SOF);
|
|
2631
|
+
var value = parser2.parseValueLiteral(false);
|
|
2632
|
+
parser2.expectToken(TokenKind.EOF);
|
|
2633
|
+
return value;
|
|
2634
|
+
}
|
|
2635
|
+
function parseType(source, options) {
|
|
2636
|
+
var parser2 = new Parser(source, options);
|
|
2637
|
+
parser2.expectToken(TokenKind.SOF);
|
|
2638
|
+
var type = parser2.parseTypeReference();
|
|
2639
|
+
parser2.expectToken(TokenKind.EOF);
|
|
2640
|
+
return type;
|
|
2641
|
+
}
|
|
2642
|
+
var Parser = /* @__PURE__ */ function() {
|
|
2643
|
+
function Parser2(source, options) {
|
|
2644
|
+
var sourceObj = isSource(source) ? source : new Source(source);
|
|
2645
|
+
this._lexer = new Lexer(sourceObj);
|
|
2646
|
+
this._options = options;
|
|
2647
|
+
}
|
|
2648
|
+
var _proto = Parser2.prototype;
|
|
2649
|
+
_proto.parseName = function parseName() {
|
|
2650
|
+
var token = this.expectToken(TokenKind.NAME);
|
|
2651
|
+
return {
|
|
2652
|
+
kind: Kind.NAME,
|
|
2653
|
+
value: token.value,
|
|
2654
|
+
loc: this.loc(token)
|
|
2655
|
+
};
|
|
2656
|
+
};
|
|
2657
|
+
_proto.parseDocument = function parseDocument2() {
|
|
2658
|
+
var start = this._lexer.token;
|
|
2659
|
+
return {
|
|
2660
|
+
kind: Kind.DOCUMENT,
|
|
2661
|
+
definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF),
|
|
2662
|
+
loc: this.loc(start)
|
|
2663
|
+
};
|
|
2664
|
+
};
|
|
2665
|
+
_proto.parseDefinition = function parseDefinition() {
|
|
2666
|
+
if (this.peek(TokenKind.NAME)) {
|
|
2667
|
+
switch (this._lexer.token.value) {
|
|
2668
|
+
case "query":
|
|
2669
|
+
case "mutation":
|
|
2670
|
+
case "subscription":
|
|
2671
|
+
return this.parseOperationDefinition();
|
|
2672
|
+
case "fragment":
|
|
2673
|
+
return this.parseFragmentDefinition();
|
|
2674
|
+
case "schema":
|
|
2675
|
+
case "scalar":
|
|
2676
|
+
case "type":
|
|
2677
|
+
case "interface":
|
|
2678
|
+
case "union":
|
|
2679
|
+
case "enum":
|
|
2680
|
+
case "input":
|
|
2681
|
+
case "directive":
|
|
2682
|
+
return this.parseTypeSystemDefinition();
|
|
2683
|
+
case "extend":
|
|
2684
|
+
return this.parseTypeSystemExtension();
|
|
2685
|
+
}
|
|
2686
|
+
} else if (this.peek(TokenKind.BRACE_L)) {
|
|
2687
|
+
return this.parseOperationDefinition();
|
|
2688
|
+
} else if (this.peekDescription()) {
|
|
2689
|
+
return this.parseTypeSystemDefinition();
|
|
2690
|
+
}
|
|
2691
|
+
throw this.unexpected();
|
|
2692
|
+
};
|
|
2693
|
+
_proto.parseOperationDefinition = function parseOperationDefinition() {
|
|
2694
|
+
var start = this._lexer.token;
|
|
2695
|
+
if (this.peek(TokenKind.BRACE_L)) {
|
|
2696
|
+
return {
|
|
2697
|
+
kind: Kind.OPERATION_DEFINITION,
|
|
2698
|
+
operation: "query",
|
|
2699
|
+
name: void 0,
|
|
2700
|
+
variableDefinitions: [],
|
|
2701
|
+
directives: [],
|
|
2702
|
+
selectionSet: this.parseSelectionSet(),
|
|
2703
|
+
loc: this.loc(start)
|
|
2704
|
+
};
|
|
2705
|
+
}
|
|
2706
|
+
var operation = this.parseOperationType();
|
|
2707
|
+
var name;
|
|
2708
|
+
if (this.peek(TokenKind.NAME)) {
|
|
2709
|
+
name = this.parseName();
|
|
2710
|
+
}
|
|
2711
|
+
return {
|
|
2712
|
+
kind: Kind.OPERATION_DEFINITION,
|
|
2713
|
+
operation,
|
|
2714
|
+
name,
|
|
2715
|
+
variableDefinitions: this.parseVariableDefinitions(),
|
|
2716
|
+
directives: this.parseDirectives(false),
|
|
2717
|
+
selectionSet: this.parseSelectionSet(),
|
|
2718
|
+
loc: this.loc(start)
|
|
2719
|
+
};
|
|
2720
|
+
};
|
|
2721
|
+
_proto.parseOperationType = function parseOperationType() {
|
|
2722
|
+
var operationToken = this.expectToken(TokenKind.NAME);
|
|
2723
|
+
switch (operationToken.value) {
|
|
2724
|
+
case "query":
|
|
2725
|
+
return "query";
|
|
2726
|
+
case "mutation":
|
|
2727
|
+
return "mutation";
|
|
2728
|
+
case "subscription":
|
|
2729
|
+
return "subscription";
|
|
2730
|
+
}
|
|
2731
|
+
throw this.unexpected(operationToken);
|
|
2732
|
+
};
|
|
2733
|
+
_proto.parseVariableDefinitions = function parseVariableDefinitions() {
|
|
2734
|
+
return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);
|
|
2735
|
+
};
|
|
2736
|
+
_proto.parseVariableDefinition = function parseVariableDefinition() {
|
|
2737
|
+
var start = this._lexer.token;
|
|
2738
|
+
return {
|
|
2739
|
+
kind: Kind.VARIABLE_DEFINITION,
|
|
2740
|
+
variable: this.parseVariable(),
|
|
2741
|
+
type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),
|
|
2742
|
+
defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : void 0,
|
|
2743
|
+
directives: this.parseDirectives(true),
|
|
2744
|
+
loc: this.loc(start)
|
|
2745
|
+
};
|
|
2746
|
+
};
|
|
2747
|
+
_proto.parseVariable = function parseVariable() {
|
|
2748
|
+
var start = this._lexer.token;
|
|
2749
|
+
this.expectToken(TokenKind.DOLLAR);
|
|
2750
|
+
return {
|
|
2751
|
+
kind: Kind.VARIABLE,
|
|
2752
|
+
name: this.parseName(),
|
|
2753
|
+
loc: this.loc(start)
|
|
2754
|
+
};
|
|
2755
|
+
};
|
|
2756
|
+
_proto.parseSelectionSet = function parseSelectionSet() {
|
|
2757
|
+
var start = this._lexer.token;
|
|
2758
|
+
return {
|
|
2759
|
+
kind: Kind.SELECTION_SET,
|
|
2760
|
+
selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R),
|
|
2761
|
+
loc: this.loc(start)
|
|
2762
|
+
};
|
|
2763
|
+
};
|
|
2764
|
+
_proto.parseSelection = function parseSelection() {
|
|
2765
|
+
return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();
|
|
2766
|
+
};
|
|
2767
|
+
_proto.parseField = function parseField() {
|
|
2768
|
+
var start = this._lexer.token;
|
|
2769
|
+
var nameOrAlias = this.parseName();
|
|
2770
|
+
var alias;
|
|
2771
|
+
var name;
|
|
2772
|
+
if (this.expectOptionalToken(TokenKind.COLON)) {
|
|
2773
|
+
alias = nameOrAlias;
|
|
2774
|
+
name = this.parseName();
|
|
2775
|
+
} else {
|
|
2776
|
+
name = nameOrAlias;
|
|
2777
|
+
}
|
|
2778
|
+
return {
|
|
2779
|
+
kind: Kind.FIELD,
|
|
2780
|
+
alias,
|
|
2781
|
+
name,
|
|
2782
|
+
arguments: this.parseArguments(false),
|
|
2783
|
+
directives: this.parseDirectives(false),
|
|
2784
|
+
selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : void 0,
|
|
2785
|
+
loc: this.loc(start)
|
|
2786
|
+
};
|
|
2787
|
+
};
|
|
2788
|
+
_proto.parseArguments = function parseArguments(isConst) {
|
|
2789
|
+
var item = isConst ? this.parseConstArgument : this.parseArgument;
|
|
2790
|
+
return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);
|
|
2791
|
+
};
|
|
2792
|
+
_proto.parseArgument = function parseArgument() {
|
|
2793
|
+
var start = this._lexer.token;
|
|
2794
|
+
var name = this.parseName();
|
|
2795
|
+
this.expectToken(TokenKind.COLON);
|
|
2796
|
+
return {
|
|
2797
|
+
kind: Kind.ARGUMENT,
|
|
2798
|
+
name,
|
|
2799
|
+
value: this.parseValueLiteral(false),
|
|
2800
|
+
loc: this.loc(start)
|
|
2801
|
+
};
|
|
2802
|
+
};
|
|
2803
|
+
_proto.parseConstArgument = function parseConstArgument() {
|
|
2804
|
+
var start = this._lexer.token;
|
|
2805
|
+
return {
|
|
2806
|
+
kind: Kind.ARGUMENT,
|
|
2807
|
+
name: this.parseName(),
|
|
2808
|
+
value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)),
|
|
2809
|
+
loc: this.loc(start)
|
|
2810
|
+
};
|
|
2811
|
+
};
|
|
2812
|
+
_proto.parseFragment = function parseFragment() {
|
|
2813
|
+
var start = this._lexer.token;
|
|
2814
|
+
this.expectToken(TokenKind.SPREAD);
|
|
2815
|
+
var hasTypeCondition = this.expectOptionalKeyword("on");
|
|
2816
|
+
if (!hasTypeCondition && this.peek(TokenKind.NAME)) {
|
|
2817
|
+
return {
|
|
2818
|
+
kind: Kind.FRAGMENT_SPREAD,
|
|
2819
|
+
name: this.parseFragmentName(),
|
|
2820
|
+
directives: this.parseDirectives(false),
|
|
2821
|
+
loc: this.loc(start)
|
|
2822
|
+
};
|
|
2823
|
+
}
|
|
2824
|
+
return {
|
|
2825
|
+
kind: Kind.INLINE_FRAGMENT,
|
|
2826
|
+
typeCondition: hasTypeCondition ? this.parseNamedType() : void 0,
|
|
2827
|
+
directives: this.parseDirectives(false),
|
|
2828
|
+
selectionSet: this.parseSelectionSet(),
|
|
2829
|
+
loc: this.loc(start)
|
|
2830
|
+
};
|
|
2831
|
+
};
|
|
2832
|
+
_proto.parseFragmentDefinition = function parseFragmentDefinition() {
|
|
2833
|
+
var _this$_options;
|
|
2834
|
+
var start = this._lexer.token;
|
|
2835
|
+
this.expectKeyword("fragment");
|
|
2836
|
+
if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) {
|
|
2837
|
+
return {
|
|
2838
|
+
kind: Kind.FRAGMENT_DEFINITION,
|
|
2839
|
+
name: this.parseFragmentName(),
|
|
2840
|
+
variableDefinitions: this.parseVariableDefinitions(),
|
|
2841
|
+
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
2842
|
+
directives: this.parseDirectives(false),
|
|
2843
|
+
selectionSet: this.parseSelectionSet(),
|
|
2844
|
+
loc: this.loc(start)
|
|
2845
|
+
};
|
|
2846
|
+
}
|
|
2847
|
+
return {
|
|
2848
|
+
kind: Kind.FRAGMENT_DEFINITION,
|
|
2849
|
+
name: this.parseFragmentName(),
|
|
2850
|
+
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
2851
|
+
directives: this.parseDirectives(false),
|
|
2852
|
+
selectionSet: this.parseSelectionSet(),
|
|
2853
|
+
loc: this.loc(start)
|
|
2854
|
+
};
|
|
2855
|
+
};
|
|
2856
|
+
_proto.parseFragmentName = function parseFragmentName() {
|
|
2857
|
+
if (this._lexer.token.value === "on") {
|
|
2858
|
+
throw this.unexpected();
|
|
2859
|
+
}
|
|
2860
|
+
return this.parseName();
|
|
2861
|
+
};
|
|
2862
|
+
_proto.parseValueLiteral = function parseValueLiteral(isConst) {
|
|
2863
|
+
var token = this._lexer.token;
|
|
2864
|
+
switch (token.kind) {
|
|
2865
|
+
case TokenKind.BRACKET_L:
|
|
2866
|
+
return this.parseList(isConst);
|
|
2867
|
+
case TokenKind.BRACE_L:
|
|
2868
|
+
return this.parseObject(isConst);
|
|
2869
|
+
case TokenKind.INT:
|
|
2870
|
+
this._lexer.advance();
|
|
2871
|
+
return {
|
|
2872
|
+
kind: Kind.INT,
|
|
2873
|
+
value: token.value,
|
|
2874
|
+
loc: this.loc(token)
|
|
2875
|
+
};
|
|
2876
|
+
case TokenKind.FLOAT:
|
|
2877
|
+
this._lexer.advance();
|
|
2878
|
+
return {
|
|
2879
|
+
kind: Kind.FLOAT,
|
|
2880
|
+
value: token.value,
|
|
2881
|
+
loc: this.loc(token)
|
|
2882
|
+
};
|
|
2883
|
+
case TokenKind.STRING:
|
|
2884
|
+
case TokenKind.BLOCK_STRING:
|
|
2885
|
+
return this.parseStringLiteral();
|
|
2886
|
+
case TokenKind.NAME:
|
|
2887
|
+
this._lexer.advance();
|
|
2888
|
+
switch (token.value) {
|
|
2889
|
+
case "true":
|
|
2890
|
+
return {
|
|
2891
|
+
kind: Kind.BOOLEAN,
|
|
2892
|
+
value: true,
|
|
2893
|
+
loc: this.loc(token)
|
|
2894
|
+
};
|
|
2895
|
+
case "false":
|
|
2896
|
+
return {
|
|
2897
|
+
kind: Kind.BOOLEAN,
|
|
2898
|
+
value: false,
|
|
2899
|
+
loc: this.loc(token)
|
|
2900
|
+
};
|
|
2901
|
+
case "null":
|
|
2902
|
+
return {
|
|
2903
|
+
kind: Kind.NULL,
|
|
2904
|
+
loc: this.loc(token)
|
|
2905
|
+
};
|
|
2906
|
+
default:
|
|
2907
|
+
return {
|
|
2908
|
+
kind: Kind.ENUM,
|
|
2909
|
+
value: token.value,
|
|
2910
|
+
loc: this.loc(token)
|
|
2911
|
+
};
|
|
2912
|
+
}
|
|
2913
|
+
case TokenKind.DOLLAR:
|
|
2914
|
+
if (!isConst) {
|
|
2915
|
+
return this.parseVariable();
|
|
2916
|
+
}
|
|
2917
|
+
break;
|
|
2918
|
+
}
|
|
2919
|
+
throw this.unexpected();
|
|
2920
|
+
};
|
|
2921
|
+
_proto.parseStringLiteral = function parseStringLiteral() {
|
|
2922
|
+
var token = this._lexer.token;
|
|
2923
|
+
this._lexer.advance();
|
|
2924
|
+
return {
|
|
2925
|
+
kind: Kind.STRING,
|
|
2926
|
+
value: token.value,
|
|
2927
|
+
block: token.kind === TokenKind.BLOCK_STRING,
|
|
2928
|
+
loc: this.loc(token)
|
|
2929
|
+
};
|
|
2930
|
+
};
|
|
2931
|
+
_proto.parseList = function parseList(isConst) {
|
|
2932
|
+
var _this = this;
|
|
2933
|
+
var start = this._lexer.token;
|
|
2934
|
+
var item = function item2() {
|
|
2935
|
+
return _this.parseValueLiteral(isConst);
|
|
2936
|
+
};
|
|
2937
|
+
return {
|
|
2938
|
+
kind: Kind.LIST,
|
|
2939
|
+
values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),
|
|
2940
|
+
loc: this.loc(start)
|
|
2941
|
+
};
|
|
2942
|
+
};
|
|
2943
|
+
_proto.parseObject = function parseObject(isConst) {
|
|
2944
|
+
var _this2 = this;
|
|
2945
|
+
var start = this._lexer.token;
|
|
2946
|
+
var item = function item2() {
|
|
2947
|
+
return _this2.parseObjectField(isConst);
|
|
2948
|
+
};
|
|
2949
|
+
return {
|
|
2950
|
+
kind: Kind.OBJECT,
|
|
2951
|
+
fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),
|
|
2952
|
+
loc: this.loc(start)
|
|
2953
|
+
};
|
|
2954
|
+
};
|
|
2955
|
+
_proto.parseObjectField = function parseObjectField(isConst) {
|
|
2956
|
+
var start = this._lexer.token;
|
|
2957
|
+
var name = this.parseName();
|
|
2958
|
+
this.expectToken(TokenKind.COLON);
|
|
2959
|
+
return {
|
|
2960
|
+
kind: Kind.OBJECT_FIELD,
|
|
2961
|
+
name,
|
|
2962
|
+
value: this.parseValueLiteral(isConst),
|
|
2963
|
+
loc: this.loc(start)
|
|
2964
|
+
};
|
|
2965
|
+
};
|
|
2966
|
+
_proto.parseDirectives = function parseDirectives(isConst) {
|
|
2967
|
+
var directives = [];
|
|
2968
|
+
while (this.peek(TokenKind.AT)) {
|
|
2969
|
+
directives.push(this.parseDirective(isConst));
|
|
2970
|
+
}
|
|
2971
|
+
return directives;
|
|
2972
|
+
};
|
|
2973
|
+
_proto.parseDirective = function parseDirective(isConst) {
|
|
2974
|
+
var start = this._lexer.token;
|
|
2975
|
+
this.expectToken(TokenKind.AT);
|
|
2976
|
+
return {
|
|
2977
|
+
kind: Kind.DIRECTIVE,
|
|
2978
|
+
name: this.parseName(),
|
|
2979
|
+
arguments: this.parseArguments(isConst),
|
|
2980
|
+
loc: this.loc(start)
|
|
2981
|
+
};
|
|
2982
|
+
};
|
|
2983
|
+
_proto.parseTypeReference = function parseTypeReference() {
|
|
2984
|
+
var start = this._lexer.token;
|
|
2985
|
+
var type;
|
|
2986
|
+
if (this.expectOptionalToken(TokenKind.BRACKET_L)) {
|
|
2987
|
+
type = this.parseTypeReference();
|
|
2988
|
+
this.expectToken(TokenKind.BRACKET_R);
|
|
2989
|
+
type = {
|
|
2990
|
+
kind: Kind.LIST_TYPE,
|
|
2991
|
+
type,
|
|
2992
|
+
loc: this.loc(start)
|
|
2993
|
+
};
|
|
2994
|
+
} else {
|
|
2995
|
+
type = this.parseNamedType();
|
|
2996
|
+
}
|
|
2997
|
+
if (this.expectOptionalToken(TokenKind.BANG)) {
|
|
2998
|
+
return {
|
|
2999
|
+
kind: Kind.NON_NULL_TYPE,
|
|
3000
|
+
type,
|
|
3001
|
+
loc: this.loc(start)
|
|
3002
|
+
};
|
|
3003
|
+
}
|
|
3004
|
+
return type;
|
|
3005
|
+
};
|
|
3006
|
+
_proto.parseNamedType = function parseNamedType() {
|
|
3007
|
+
var start = this._lexer.token;
|
|
3008
|
+
return {
|
|
3009
|
+
kind: Kind.NAMED_TYPE,
|
|
3010
|
+
name: this.parseName(),
|
|
3011
|
+
loc: this.loc(start)
|
|
3012
|
+
};
|
|
3013
|
+
};
|
|
3014
|
+
_proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() {
|
|
3015
|
+
var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token;
|
|
3016
|
+
if (keywordToken.kind === TokenKind.NAME) {
|
|
3017
|
+
switch (keywordToken.value) {
|
|
3018
|
+
case "schema":
|
|
3019
|
+
return this.parseSchemaDefinition();
|
|
3020
|
+
case "scalar":
|
|
3021
|
+
return this.parseScalarTypeDefinition();
|
|
3022
|
+
case "type":
|
|
3023
|
+
return this.parseObjectTypeDefinition();
|
|
3024
|
+
case "interface":
|
|
3025
|
+
return this.parseInterfaceTypeDefinition();
|
|
3026
|
+
case "union":
|
|
3027
|
+
return this.parseUnionTypeDefinition();
|
|
3028
|
+
case "enum":
|
|
3029
|
+
return this.parseEnumTypeDefinition();
|
|
3030
|
+
case "input":
|
|
3031
|
+
return this.parseInputObjectTypeDefinition();
|
|
3032
|
+
case "directive":
|
|
3033
|
+
return this.parseDirectiveDefinition();
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
throw this.unexpected(keywordToken);
|
|
3037
|
+
};
|
|
3038
|
+
_proto.peekDescription = function peekDescription() {
|
|
3039
|
+
return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);
|
|
3040
|
+
};
|
|
3041
|
+
_proto.parseDescription = function parseDescription() {
|
|
3042
|
+
if (this.peekDescription()) {
|
|
3043
|
+
return this.parseStringLiteral();
|
|
3044
|
+
}
|
|
3045
|
+
};
|
|
3046
|
+
_proto.parseSchemaDefinition = function parseSchemaDefinition() {
|
|
3047
|
+
var start = this._lexer.token;
|
|
3048
|
+
var description = this.parseDescription();
|
|
3049
|
+
this.expectKeyword("schema");
|
|
3050
|
+
var directives = this.parseDirectives(true);
|
|
3051
|
+
var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
|
|
3052
|
+
return {
|
|
3053
|
+
kind: Kind.SCHEMA_DEFINITION,
|
|
3054
|
+
description,
|
|
3055
|
+
directives,
|
|
3056
|
+
operationTypes,
|
|
3057
|
+
loc: this.loc(start)
|
|
3058
|
+
};
|
|
3059
|
+
};
|
|
3060
|
+
_proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() {
|
|
3061
|
+
var start = this._lexer.token;
|
|
3062
|
+
var operation = this.parseOperationType();
|
|
3063
|
+
this.expectToken(TokenKind.COLON);
|
|
3064
|
+
var type = this.parseNamedType();
|
|
3065
|
+
return {
|
|
3066
|
+
kind: Kind.OPERATION_TYPE_DEFINITION,
|
|
3067
|
+
operation,
|
|
3068
|
+
type,
|
|
3069
|
+
loc: this.loc(start)
|
|
3070
|
+
};
|
|
3071
|
+
};
|
|
3072
|
+
_proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() {
|
|
3073
|
+
var start = this._lexer.token;
|
|
3074
|
+
var description = this.parseDescription();
|
|
3075
|
+
this.expectKeyword("scalar");
|
|
3076
|
+
var name = this.parseName();
|
|
3077
|
+
var directives = this.parseDirectives(true);
|
|
3078
|
+
return {
|
|
3079
|
+
kind: Kind.SCALAR_TYPE_DEFINITION,
|
|
3080
|
+
description,
|
|
3081
|
+
name,
|
|
3082
|
+
directives,
|
|
3083
|
+
loc: this.loc(start)
|
|
3084
|
+
};
|
|
3085
|
+
};
|
|
3086
|
+
_proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() {
|
|
3087
|
+
var start = this._lexer.token;
|
|
3088
|
+
var description = this.parseDescription();
|
|
3089
|
+
this.expectKeyword("type");
|
|
3090
|
+
var name = this.parseName();
|
|
3091
|
+
var interfaces = this.parseImplementsInterfaces();
|
|
3092
|
+
var directives = this.parseDirectives(true);
|
|
3093
|
+
var fields = this.parseFieldsDefinition();
|
|
3094
|
+
return {
|
|
3095
|
+
kind: Kind.OBJECT_TYPE_DEFINITION,
|
|
3096
|
+
description,
|
|
3097
|
+
name,
|
|
3098
|
+
interfaces,
|
|
3099
|
+
directives,
|
|
3100
|
+
fields,
|
|
3101
|
+
loc: this.loc(start)
|
|
3102
|
+
};
|
|
3103
|
+
};
|
|
3104
|
+
_proto.parseImplementsInterfaces = function parseImplementsInterfaces() {
|
|
3105
|
+
var _this$_options2;
|
|
3106
|
+
if (!this.expectOptionalKeyword("implements")) {
|
|
3107
|
+
return [];
|
|
3108
|
+
}
|
|
3109
|
+
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
3110
|
+
var types = [];
|
|
3111
|
+
this.expectOptionalToken(TokenKind.AMP);
|
|
3112
|
+
do {
|
|
3113
|
+
types.push(this.parseNamedType());
|
|
3114
|
+
} while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME));
|
|
3115
|
+
return types;
|
|
3116
|
+
}
|
|
3117
|
+
return this.delimitedMany(TokenKind.AMP, this.parseNamedType);
|
|
3118
|
+
};
|
|
3119
|
+
_proto.parseFieldsDefinition = function parseFieldsDefinition() {
|
|
3120
|
+
var _this$_options3;
|
|
3121
|
+
if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) {
|
|
3122
|
+
this._lexer.advance();
|
|
3123
|
+
this._lexer.advance();
|
|
3124
|
+
return [];
|
|
3125
|
+
}
|
|
3126
|
+
return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);
|
|
3127
|
+
};
|
|
3128
|
+
_proto.parseFieldDefinition = function parseFieldDefinition() {
|
|
3129
|
+
var start = this._lexer.token;
|
|
3130
|
+
var description = this.parseDescription();
|
|
3131
|
+
var name = this.parseName();
|
|
3132
|
+
var args = this.parseArgumentDefs();
|
|
3133
|
+
this.expectToken(TokenKind.COLON);
|
|
3134
|
+
var type = this.parseTypeReference();
|
|
3135
|
+
var directives = this.parseDirectives(true);
|
|
3136
|
+
return {
|
|
3137
|
+
kind: Kind.FIELD_DEFINITION,
|
|
3138
|
+
description,
|
|
3139
|
+
name,
|
|
3140
|
+
arguments: args,
|
|
3141
|
+
type,
|
|
3142
|
+
directives,
|
|
3143
|
+
loc: this.loc(start)
|
|
3144
|
+
};
|
|
3145
|
+
};
|
|
3146
|
+
_proto.parseArgumentDefs = function parseArgumentDefs() {
|
|
3147
|
+
return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);
|
|
3148
|
+
};
|
|
3149
|
+
_proto.parseInputValueDef = function parseInputValueDef() {
|
|
3150
|
+
var start = this._lexer.token;
|
|
3151
|
+
var description = this.parseDescription();
|
|
3152
|
+
var name = this.parseName();
|
|
3153
|
+
this.expectToken(TokenKind.COLON);
|
|
3154
|
+
var type = this.parseTypeReference();
|
|
3155
|
+
var defaultValue;
|
|
3156
|
+
if (this.expectOptionalToken(TokenKind.EQUALS)) {
|
|
3157
|
+
defaultValue = this.parseValueLiteral(true);
|
|
3158
|
+
}
|
|
3159
|
+
var directives = this.parseDirectives(true);
|
|
3160
|
+
return {
|
|
3161
|
+
kind: Kind.INPUT_VALUE_DEFINITION,
|
|
3162
|
+
description,
|
|
3163
|
+
name,
|
|
3164
|
+
type,
|
|
3165
|
+
defaultValue,
|
|
3166
|
+
directives,
|
|
3167
|
+
loc: this.loc(start)
|
|
3168
|
+
};
|
|
3169
|
+
};
|
|
3170
|
+
_proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() {
|
|
3171
|
+
var start = this._lexer.token;
|
|
3172
|
+
var description = this.parseDescription();
|
|
3173
|
+
this.expectKeyword("interface");
|
|
3174
|
+
var name = this.parseName();
|
|
3175
|
+
var interfaces = this.parseImplementsInterfaces();
|
|
3176
|
+
var directives = this.parseDirectives(true);
|
|
3177
|
+
var fields = this.parseFieldsDefinition();
|
|
3178
|
+
return {
|
|
3179
|
+
kind: Kind.INTERFACE_TYPE_DEFINITION,
|
|
3180
|
+
description,
|
|
3181
|
+
name,
|
|
3182
|
+
interfaces,
|
|
3183
|
+
directives,
|
|
3184
|
+
fields,
|
|
3185
|
+
loc: this.loc(start)
|
|
3186
|
+
};
|
|
3187
|
+
};
|
|
3188
|
+
_proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() {
|
|
3189
|
+
var start = this._lexer.token;
|
|
3190
|
+
var description = this.parseDescription();
|
|
3191
|
+
this.expectKeyword("union");
|
|
3192
|
+
var name = this.parseName();
|
|
3193
|
+
var directives = this.parseDirectives(true);
|
|
3194
|
+
var types = this.parseUnionMemberTypes();
|
|
3195
|
+
return {
|
|
3196
|
+
kind: Kind.UNION_TYPE_DEFINITION,
|
|
3197
|
+
description,
|
|
3198
|
+
name,
|
|
3199
|
+
directives,
|
|
3200
|
+
types,
|
|
3201
|
+
loc: this.loc(start)
|
|
3202
|
+
};
|
|
3203
|
+
};
|
|
3204
|
+
_proto.parseUnionMemberTypes = function parseUnionMemberTypes() {
|
|
3205
|
+
return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];
|
|
3206
|
+
};
|
|
3207
|
+
_proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() {
|
|
3208
|
+
var start = this._lexer.token;
|
|
3209
|
+
var description = this.parseDescription();
|
|
3210
|
+
this.expectKeyword("enum");
|
|
3211
|
+
var name = this.parseName();
|
|
3212
|
+
var directives = this.parseDirectives(true);
|
|
3213
|
+
var values = this.parseEnumValuesDefinition();
|
|
3214
|
+
return {
|
|
3215
|
+
kind: Kind.ENUM_TYPE_DEFINITION,
|
|
3216
|
+
description,
|
|
3217
|
+
name,
|
|
3218
|
+
directives,
|
|
3219
|
+
values,
|
|
3220
|
+
loc: this.loc(start)
|
|
3221
|
+
};
|
|
3222
|
+
};
|
|
3223
|
+
_proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() {
|
|
3224
|
+
return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);
|
|
3225
|
+
};
|
|
3226
|
+
_proto.parseEnumValueDefinition = function parseEnumValueDefinition() {
|
|
3227
|
+
var start = this._lexer.token;
|
|
3228
|
+
var description = this.parseDescription();
|
|
3229
|
+
var name = this.parseName();
|
|
3230
|
+
var directives = this.parseDirectives(true);
|
|
3231
|
+
return {
|
|
3232
|
+
kind: Kind.ENUM_VALUE_DEFINITION,
|
|
3233
|
+
description,
|
|
3234
|
+
name,
|
|
3235
|
+
directives,
|
|
3236
|
+
loc: this.loc(start)
|
|
3237
|
+
};
|
|
3238
|
+
};
|
|
3239
|
+
_proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() {
|
|
3240
|
+
var start = this._lexer.token;
|
|
3241
|
+
var description = this.parseDescription();
|
|
3242
|
+
this.expectKeyword("input");
|
|
3243
|
+
var name = this.parseName();
|
|
3244
|
+
var directives = this.parseDirectives(true);
|
|
3245
|
+
var fields = this.parseInputFieldsDefinition();
|
|
3246
|
+
return {
|
|
3247
|
+
kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
3248
|
+
description,
|
|
3249
|
+
name,
|
|
3250
|
+
directives,
|
|
3251
|
+
fields,
|
|
3252
|
+
loc: this.loc(start)
|
|
3253
|
+
};
|
|
3254
|
+
};
|
|
3255
|
+
_proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() {
|
|
3256
|
+
return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);
|
|
3257
|
+
};
|
|
3258
|
+
_proto.parseTypeSystemExtension = function parseTypeSystemExtension() {
|
|
3259
|
+
var keywordToken = this._lexer.lookahead();
|
|
3260
|
+
if (keywordToken.kind === TokenKind.NAME) {
|
|
3261
|
+
switch (keywordToken.value) {
|
|
3262
|
+
case "schema":
|
|
3263
|
+
return this.parseSchemaExtension();
|
|
3264
|
+
case "scalar":
|
|
3265
|
+
return this.parseScalarTypeExtension();
|
|
3266
|
+
case "type":
|
|
3267
|
+
return this.parseObjectTypeExtension();
|
|
3268
|
+
case "interface":
|
|
3269
|
+
return this.parseInterfaceTypeExtension();
|
|
3270
|
+
case "union":
|
|
3271
|
+
return this.parseUnionTypeExtension();
|
|
3272
|
+
case "enum":
|
|
3273
|
+
return this.parseEnumTypeExtension();
|
|
3274
|
+
case "input":
|
|
3275
|
+
return this.parseInputObjectTypeExtension();
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
throw this.unexpected(keywordToken);
|
|
3279
|
+
};
|
|
3280
|
+
_proto.parseSchemaExtension = function parseSchemaExtension() {
|
|
3281
|
+
var start = this._lexer.token;
|
|
3282
|
+
this.expectKeyword("extend");
|
|
3283
|
+
this.expectKeyword("schema");
|
|
3284
|
+
var directives = this.parseDirectives(true);
|
|
3285
|
+
var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
|
|
3286
|
+
if (directives.length === 0 && operationTypes.length === 0) {
|
|
3287
|
+
throw this.unexpected();
|
|
3288
|
+
}
|
|
3289
|
+
return {
|
|
3290
|
+
kind: Kind.SCHEMA_EXTENSION,
|
|
3291
|
+
directives,
|
|
3292
|
+
operationTypes,
|
|
3293
|
+
loc: this.loc(start)
|
|
3294
|
+
};
|
|
3295
|
+
};
|
|
3296
|
+
_proto.parseScalarTypeExtension = function parseScalarTypeExtension() {
|
|
3297
|
+
var start = this._lexer.token;
|
|
3298
|
+
this.expectKeyword("extend");
|
|
3299
|
+
this.expectKeyword("scalar");
|
|
3300
|
+
var name = this.parseName();
|
|
3301
|
+
var directives = this.parseDirectives(true);
|
|
3302
|
+
if (directives.length === 0) {
|
|
3303
|
+
throw this.unexpected();
|
|
3304
|
+
}
|
|
3305
|
+
return {
|
|
3306
|
+
kind: Kind.SCALAR_TYPE_EXTENSION,
|
|
3307
|
+
name,
|
|
3308
|
+
directives,
|
|
3309
|
+
loc: this.loc(start)
|
|
3310
|
+
};
|
|
3311
|
+
};
|
|
3312
|
+
_proto.parseObjectTypeExtension = function parseObjectTypeExtension() {
|
|
3313
|
+
var start = this._lexer.token;
|
|
3314
|
+
this.expectKeyword("extend");
|
|
3315
|
+
this.expectKeyword("type");
|
|
3316
|
+
var name = this.parseName();
|
|
3317
|
+
var interfaces = this.parseImplementsInterfaces();
|
|
3318
|
+
var directives = this.parseDirectives(true);
|
|
3319
|
+
var fields = this.parseFieldsDefinition();
|
|
3320
|
+
if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {
|
|
3321
|
+
throw this.unexpected();
|
|
3322
|
+
}
|
|
3323
|
+
return {
|
|
3324
|
+
kind: Kind.OBJECT_TYPE_EXTENSION,
|
|
3325
|
+
name,
|
|
3326
|
+
interfaces,
|
|
3327
|
+
directives,
|
|
3328
|
+
fields,
|
|
3329
|
+
loc: this.loc(start)
|
|
3330
|
+
};
|
|
3331
|
+
};
|
|
3332
|
+
_proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() {
|
|
3333
|
+
var start = this._lexer.token;
|
|
3334
|
+
this.expectKeyword("extend");
|
|
3335
|
+
this.expectKeyword("interface");
|
|
3336
|
+
var name = this.parseName();
|
|
3337
|
+
var interfaces = this.parseImplementsInterfaces();
|
|
3338
|
+
var directives = this.parseDirectives(true);
|
|
3339
|
+
var fields = this.parseFieldsDefinition();
|
|
3340
|
+
if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {
|
|
3341
|
+
throw this.unexpected();
|
|
3342
|
+
}
|
|
3343
|
+
return {
|
|
3344
|
+
kind: Kind.INTERFACE_TYPE_EXTENSION,
|
|
3345
|
+
name,
|
|
3346
|
+
interfaces,
|
|
3347
|
+
directives,
|
|
3348
|
+
fields,
|
|
3349
|
+
loc: this.loc(start)
|
|
3350
|
+
};
|
|
3351
|
+
};
|
|
3352
|
+
_proto.parseUnionTypeExtension = function parseUnionTypeExtension() {
|
|
3353
|
+
var start = this._lexer.token;
|
|
3354
|
+
this.expectKeyword("extend");
|
|
3355
|
+
this.expectKeyword("union");
|
|
3356
|
+
var name = this.parseName();
|
|
3357
|
+
var directives = this.parseDirectives(true);
|
|
3358
|
+
var types = this.parseUnionMemberTypes();
|
|
3359
|
+
if (directives.length === 0 && types.length === 0) {
|
|
3360
|
+
throw this.unexpected();
|
|
3361
|
+
}
|
|
3362
|
+
return {
|
|
3363
|
+
kind: Kind.UNION_TYPE_EXTENSION,
|
|
3364
|
+
name,
|
|
3365
|
+
directives,
|
|
3366
|
+
types,
|
|
3367
|
+
loc: this.loc(start)
|
|
3368
|
+
};
|
|
3369
|
+
};
|
|
3370
|
+
_proto.parseEnumTypeExtension = function parseEnumTypeExtension() {
|
|
3371
|
+
var start = this._lexer.token;
|
|
3372
|
+
this.expectKeyword("extend");
|
|
3373
|
+
this.expectKeyword("enum");
|
|
3374
|
+
var name = this.parseName();
|
|
3375
|
+
var directives = this.parseDirectives(true);
|
|
3376
|
+
var values = this.parseEnumValuesDefinition();
|
|
3377
|
+
if (directives.length === 0 && values.length === 0) {
|
|
3378
|
+
throw this.unexpected();
|
|
3379
|
+
}
|
|
3380
|
+
return {
|
|
3381
|
+
kind: Kind.ENUM_TYPE_EXTENSION,
|
|
3382
|
+
name,
|
|
3383
|
+
directives,
|
|
3384
|
+
values,
|
|
3385
|
+
loc: this.loc(start)
|
|
3386
|
+
};
|
|
3387
|
+
};
|
|
3388
|
+
_proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() {
|
|
3389
|
+
var start = this._lexer.token;
|
|
3390
|
+
this.expectKeyword("extend");
|
|
3391
|
+
this.expectKeyword("input");
|
|
3392
|
+
var name = this.parseName();
|
|
3393
|
+
var directives = this.parseDirectives(true);
|
|
3394
|
+
var fields = this.parseInputFieldsDefinition();
|
|
3395
|
+
if (directives.length === 0 && fields.length === 0) {
|
|
3396
|
+
throw this.unexpected();
|
|
3397
|
+
}
|
|
3398
|
+
return {
|
|
3399
|
+
kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,
|
|
3400
|
+
name,
|
|
3401
|
+
directives,
|
|
3402
|
+
fields,
|
|
3403
|
+
loc: this.loc(start)
|
|
3404
|
+
};
|
|
3405
|
+
};
|
|
3406
|
+
_proto.parseDirectiveDefinition = function parseDirectiveDefinition() {
|
|
3407
|
+
var start = this._lexer.token;
|
|
3408
|
+
var description = this.parseDescription();
|
|
3409
|
+
this.expectKeyword("directive");
|
|
3410
|
+
this.expectToken(TokenKind.AT);
|
|
3411
|
+
var name = this.parseName();
|
|
3412
|
+
var args = this.parseArgumentDefs();
|
|
3413
|
+
var repeatable = this.expectOptionalKeyword("repeatable");
|
|
3414
|
+
this.expectKeyword("on");
|
|
3415
|
+
var locations = this.parseDirectiveLocations();
|
|
3416
|
+
return {
|
|
3417
|
+
kind: Kind.DIRECTIVE_DEFINITION,
|
|
3418
|
+
description,
|
|
3419
|
+
name,
|
|
3420
|
+
arguments: args,
|
|
3421
|
+
repeatable,
|
|
3422
|
+
locations,
|
|
3423
|
+
loc: this.loc(start)
|
|
3424
|
+
};
|
|
3425
|
+
};
|
|
3426
|
+
_proto.parseDirectiveLocations = function parseDirectiveLocations() {
|
|
3427
|
+
return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);
|
|
3428
|
+
};
|
|
3429
|
+
_proto.parseDirectiveLocation = function parseDirectiveLocation() {
|
|
3430
|
+
var start = this._lexer.token;
|
|
3431
|
+
var name = this.parseName();
|
|
3432
|
+
if (DirectiveLocation[name.value] !== void 0) {
|
|
3433
|
+
return name;
|
|
3434
|
+
}
|
|
3435
|
+
throw this.unexpected(start);
|
|
3436
|
+
};
|
|
3437
|
+
_proto.loc = function loc(startToken) {
|
|
3438
|
+
var _this$_options4;
|
|
3439
|
+
if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) {
|
|
3440
|
+
return new Location(startToken, this._lexer.lastToken, this._lexer.source);
|
|
3441
|
+
}
|
|
3442
|
+
};
|
|
3443
|
+
_proto.peek = function peek(kind) {
|
|
3444
|
+
return this._lexer.token.kind === kind;
|
|
3445
|
+
};
|
|
3446
|
+
_proto.expectToken = function expectToken(kind) {
|
|
3447
|
+
var token = this._lexer.token;
|
|
3448
|
+
if (token.kind === kind) {
|
|
3449
|
+
this._lexer.advance();
|
|
3450
|
+
return token;
|
|
3451
|
+
}
|
|
3452
|
+
throw syntaxError(this._lexer.source, token.start, "Expected ".concat(getTokenKindDesc(kind), ", found ").concat(getTokenDesc(token), "."));
|
|
3453
|
+
};
|
|
3454
|
+
_proto.expectOptionalToken = function expectOptionalToken(kind) {
|
|
3455
|
+
var token = this._lexer.token;
|
|
3456
|
+
if (token.kind === kind) {
|
|
3457
|
+
this._lexer.advance();
|
|
3458
|
+
return token;
|
|
3459
|
+
}
|
|
3460
|
+
return void 0;
|
|
3461
|
+
};
|
|
3462
|
+
_proto.expectKeyword = function expectKeyword(value) {
|
|
3463
|
+
var token = this._lexer.token;
|
|
3464
|
+
if (token.kind === TokenKind.NAME && token.value === value) {
|
|
3465
|
+
this._lexer.advance();
|
|
3466
|
+
} else {
|
|
3467
|
+
throw syntaxError(this._lexer.source, token.start, 'Expected "'.concat(value, '", found ').concat(getTokenDesc(token), "."));
|
|
3468
|
+
}
|
|
3469
|
+
};
|
|
3470
|
+
_proto.expectOptionalKeyword = function expectOptionalKeyword(value) {
|
|
3471
|
+
var token = this._lexer.token;
|
|
3472
|
+
if (token.kind === TokenKind.NAME && token.value === value) {
|
|
3473
|
+
this._lexer.advance();
|
|
3474
|
+
return true;
|
|
3475
|
+
}
|
|
3476
|
+
return false;
|
|
3477
|
+
};
|
|
3478
|
+
_proto.unexpected = function unexpected(atToken) {
|
|
3479
|
+
var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;
|
|
3480
|
+
return syntaxError(this._lexer.source, token.start, "Unexpected ".concat(getTokenDesc(token), "."));
|
|
3481
|
+
};
|
|
3482
|
+
_proto.any = function any(openKind, parseFn, closeKind) {
|
|
3483
|
+
this.expectToken(openKind);
|
|
3484
|
+
var nodes = [];
|
|
3485
|
+
while (!this.expectOptionalToken(closeKind)) {
|
|
3486
|
+
nodes.push(parseFn.call(this));
|
|
3487
|
+
}
|
|
3488
|
+
return nodes;
|
|
3489
|
+
};
|
|
3490
|
+
_proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) {
|
|
3491
|
+
if (this.expectOptionalToken(openKind)) {
|
|
3492
|
+
var nodes = [];
|
|
3493
|
+
do {
|
|
3494
|
+
nodes.push(parseFn.call(this));
|
|
3495
|
+
} while (!this.expectOptionalToken(closeKind));
|
|
3496
|
+
return nodes;
|
|
3497
|
+
}
|
|
3498
|
+
return [];
|
|
3499
|
+
};
|
|
3500
|
+
_proto.many = function many(openKind, parseFn, closeKind) {
|
|
3501
|
+
this.expectToken(openKind);
|
|
3502
|
+
var nodes = [];
|
|
3503
|
+
do {
|
|
3504
|
+
nodes.push(parseFn.call(this));
|
|
3505
|
+
} while (!this.expectOptionalToken(closeKind));
|
|
3506
|
+
return nodes;
|
|
3507
|
+
};
|
|
3508
|
+
_proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) {
|
|
3509
|
+
this.expectOptionalToken(delimiterKind);
|
|
3510
|
+
var nodes = [];
|
|
3511
|
+
do {
|
|
3512
|
+
nodes.push(parseFn.call(this));
|
|
3513
|
+
} while (this.expectOptionalToken(delimiterKind));
|
|
3514
|
+
return nodes;
|
|
3515
|
+
};
|
|
3516
|
+
return Parser2;
|
|
3517
|
+
}();
|
|
3518
|
+
function getTokenDesc(token) {
|
|
3519
|
+
var value = token.value;
|
|
3520
|
+
return getTokenKindDesc(token.kind) + (value != null ? ' "'.concat(value, '"') : "");
|
|
3521
|
+
}
|
|
3522
|
+
function getTokenKindDesc(kind) {
|
|
3523
|
+
return isPunctuatorTokenKind(kind) ? '"'.concat(kind, '"') : kind;
|
|
3524
|
+
}
|
|
3525
|
+
var parser$1 = /* @__PURE__ */ Object.freeze({
|
|
3526
|
+
__proto__: null,
|
|
3527
|
+
[Symbol.toStringTag]: "Module",
|
|
3528
|
+
parse: parse$1,
|
|
3529
|
+
parseValue,
|
|
3530
|
+
parseType,
|
|
3531
|
+
Parser
|
|
3532
|
+
});
|
|
3533
|
+
var require$$0 = /* @__PURE__ */ getAugmentedNamespace(parser$1);
|
|
3534
|
+
var parser = require$$0;
|
|
3535
|
+
var parse = parser.parse;
|
|
3536
|
+
function normalize(string) {
|
|
3537
|
+
return string.replace(/[\s,]+/g, " ").trim();
|
|
3538
|
+
}
|
|
3539
|
+
var docCache = {};
|
|
3540
|
+
var fragmentSourceMap = {};
|
|
3541
|
+
function cacheKeyFromLoc(loc) {
|
|
3542
|
+
return normalize(loc.source.body.substring(loc.start, loc.end));
|
|
3543
|
+
}
|
|
3544
|
+
function resetCaches() {
|
|
3545
|
+
docCache = {};
|
|
3546
|
+
fragmentSourceMap = {};
|
|
3547
|
+
}
|
|
3548
|
+
var printFragmentWarnings = true;
|
|
3549
|
+
function processFragments(ast) {
|
|
3550
|
+
var astFragmentMap = {};
|
|
3551
|
+
var definitions = [];
|
|
3552
|
+
for (var i = 0; i < ast.definitions.length; i++) {
|
|
3553
|
+
var fragmentDefinition = ast.definitions[i];
|
|
3554
|
+
if (fragmentDefinition.kind === "FragmentDefinition") {
|
|
3555
|
+
var fragmentName = fragmentDefinition.name.value;
|
|
3556
|
+
var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);
|
|
3557
|
+
if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {
|
|
3558
|
+
if (printFragmentWarnings) {
|
|
3559
|
+
console.warn("Warning: fragment with name " + fragmentName + " already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names");
|
|
3560
|
+
}
|
|
3561
|
+
fragmentSourceMap[fragmentName][sourceKey] = true;
|
|
3562
|
+
} else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {
|
|
3563
|
+
fragmentSourceMap[fragmentName] = {};
|
|
3564
|
+
fragmentSourceMap[fragmentName][sourceKey] = true;
|
|
3565
|
+
}
|
|
3566
|
+
if (!astFragmentMap[sourceKey]) {
|
|
3567
|
+
astFragmentMap[sourceKey] = true;
|
|
3568
|
+
definitions.push(fragmentDefinition);
|
|
3569
|
+
}
|
|
3570
|
+
} else {
|
|
3571
|
+
definitions.push(fragmentDefinition);
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
ast.definitions = definitions;
|
|
3575
|
+
return ast;
|
|
3576
|
+
}
|
|
3577
|
+
function disableFragmentWarnings() {
|
|
3578
|
+
printFragmentWarnings = false;
|
|
3579
|
+
}
|
|
3580
|
+
function stripLoc(doc, removeLocAtThisLevel) {
|
|
3581
|
+
var docType = Object.prototype.toString.call(doc);
|
|
3582
|
+
if (docType === "[object Array]") {
|
|
3583
|
+
return doc.map(function(d) {
|
|
3584
|
+
return stripLoc(d, removeLocAtThisLevel);
|
|
3585
|
+
});
|
|
3586
|
+
}
|
|
3587
|
+
if (docType !== "[object Object]") {
|
|
3588
|
+
throw new Error("Unexpected input.");
|
|
3589
|
+
}
|
|
3590
|
+
if (removeLocAtThisLevel && doc.loc) {
|
|
3591
|
+
delete doc.loc;
|
|
3592
|
+
}
|
|
3593
|
+
if (doc.loc) {
|
|
3594
|
+
delete doc.loc.startToken;
|
|
3595
|
+
delete doc.loc.endToken;
|
|
3596
|
+
}
|
|
3597
|
+
var keys = Object.keys(doc);
|
|
3598
|
+
var key;
|
|
3599
|
+
var value;
|
|
3600
|
+
var valueType;
|
|
3601
|
+
for (key in keys) {
|
|
3602
|
+
if (keys.hasOwnProperty(key)) {
|
|
3603
|
+
value = doc[keys[key]];
|
|
3604
|
+
valueType = Object.prototype.toString.call(value);
|
|
3605
|
+
if (valueType === "[object Object]" || valueType === "[object Array]") {
|
|
3606
|
+
doc[keys[key]] = stripLoc(value, true);
|
|
3607
|
+
}
|
|
3608
|
+
}
|
|
3609
|
+
}
|
|
3610
|
+
return doc;
|
|
3611
|
+
}
|
|
3612
|
+
var experimentalFragmentVariables = false;
|
|
3613
|
+
function parseDocument(doc) {
|
|
3614
|
+
var cacheKey = normalize(doc);
|
|
3615
|
+
if (docCache[cacheKey]) {
|
|
3616
|
+
return docCache[cacheKey];
|
|
3617
|
+
}
|
|
3618
|
+
var parsed = parse(doc, { experimentalFragmentVariables });
|
|
3619
|
+
if (!parsed || parsed.kind !== "Document") {
|
|
3620
|
+
throw new Error("Not a valid GraphQL document.");
|
|
3621
|
+
}
|
|
3622
|
+
parsed = processFragments(parsed);
|
|
3623
|
+
parsed = stripLoc(parsed, false);
|
|
3624
|
+
docCache[cacheKey] = parsed;
|
|
3625
|
+
return parsed;
|
|
3626
|
+
}
|
|
3627
|
+
function enableExperimentalFragmentVariables() {
|
|
3628
|
+
experimentalFragmentVariables = true;
|
|
3629
|
+
}
|
|
3630
|
+
function disableExperimentalFragmentVariables() {
|
|
3631
|
+
experimentalFragmentVariables = false;
|
|
3632
|
+
}
|
|
3633
|
+
function gql() {
|
|
3634
|
+
var args = Array.prototype.slice.call(arguments);
|
|
3635
|
+
var literals = args[0];
|
|
3636
|
+
var result = typeof literals === "string" ? literals : literals[0];
|
|
3637
|
+
for (var i = 1; i < args.length; i++) {
|
|
3638
|
+
if (args[i] && args[i].kind && args[i].kind === "Document") {
|
|
3639
|
+
result += args[i].loc.source.body;
|
|
3640
|
+
} else {
|
|
3641
|
+
result += args[i];
|
|
3642
|
+
}
|
|
3643
|
+
result += literals[i];
|
|
3644
|
+
}
|
|
3645
|
+
return parseDocument(result);
|
|
3646
|
+
}
|
|
3647
|
+
gql.default = gql;
|
|
3648
|
+
gql.resetCaches = resetCaches;
|
|
3649
|
+
gql.disableFragmentWarnings = disableFragmentWarnings;
|
|
3650
|
+
gql.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables;
|
|
3651
|
+
gql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables;
|
|
3652
|
+
var src = gql;
|
|
3653
|
+
const meQuery = src`
|
|
3654
|
+
query Me {
|
|
3655
|
+
me {
|
|
3656
|
+
id
|
|
3657
|
+
lawFirmId
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
`;
|
|
3661
|
+
function useMe() {
|
|
3662
|
+
const { result } = useQuery(meQuery);
|
|
3663
|
+
return useResult(result);
|
|
3664
|
+
}
|
|
3665
|
+
function _isPlaceholder(a) {
|
|
3666
|
+
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
|
3667
|
+
}
|
|
3668
|
+
function _curry1(fn) {
|
|
3669
|
+
return function f1(a) {
|
|
3670
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
|
3671
|
+
return f1;
|
|
3672
|
+
} else {
|
|
3673
|
+
return fn.apply(this, arguments);
|
|
3674
|
+
}
|
|
3675
|
+
};
|
|
3676
|
+
}
|
|
3677
|
+
function _curry2(fn) {
|
|
3678
|
+
return function f2(a, b) {
|
|
3679
|
+
switch (arguments.length) {
|
|
3680
|
+
case 0:
|
|
3681
|
+
return f2;
|
|
3682
|
+
case 1:
|
|
3683
|
+
return _isPlaceholder(a) ? f2 : _curry1(function(_b) {
|
|
3684
|
+
return fn(a, _b);
|
|
3685
|
+
});
|
|
3686
|
+
default:
|
|
3687
|
+
return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function(_a) {
|
|
3688
|
+
return fn(_a, b);
|
|
3689
|
+
}) : _isPlaceholder(b) ? _curry1(function(_b) {
|
|
3690
|
+
return fn(a, _b);
|
|
3691
|
+
}) : fn(a, b);
|
|
3692
|
+
}
|
|
3693
|
+
};
|
|
3694
|
+
}
|
|
3695
|
+
function _isString(x) {
|
|
3696
|
+
return Object.prototype.toString.call(x) === "[object String]";
|
|
3697
|
+
}
|
|
3698
|
+
var _isInteger = Number.isInteger || function _isInteger2(n) {
|
|
3699
|
+
return n << 0 === n;
|
|
3700
|
+
};
|
|
3701
|
+
var nth = /* @__PURE__ */ _curry2(function nth2(offset, list) {
|
|
3702
|
+
var idx = offset < 0 ? list.length + offset : offset;
|
|
3703
|
+
return _isString(list) ? list.charAt(idx) : list[idx];
|
|
3704
|
+
});
|
|
3705
|
+
var nth$1 = nth;
|
|
3706
|
+
var paths = /* @__PURE__ */ _curry2(function paths2(pathsArray, obj) {
|
|
3707
|
+
return pathsArray.map(function(paths3) {
|
|
3708
|
+
var val = obj;
|
|
3709
|
+
var idx = 0;
|
|
3710
|
+
var p;
|
|
3711
|
+
while (idx < paths3.length) {
|
|
3712
|
+
if (val == null) {
|
|
3713
|
+
return;
|
|
3714
|
+
}
|
|
3715
|
+
p = paths3[idx];
|
|
3716
|
+
val = _isInteger(p) ? nth$1(p, val) : val[p];
|
|
3717
|
+
idx += 1;
|
|
3718
|
+
}
|
|
3719
|
+
return val;
|
|
3720
|
+
});
|
|
3721
|
+
});
|
|
3722
|
+
var paths$1 = paths;
|
|
3723
|
+
var path = /* @__PURE__ */ _curry2(function path2(pathAr, obj) {
|
|
3724
|
+
return paths$1([pathAr], obj)[0];
|
|
3725
|
+
});
|
|
3726
|
+
var path$1 = path;
|
|
3727
|
+
const profilesQuery = src`
|
|
3728
|
+
query ProfileSearch(
|
|
3729
|
+
$lawFirmId: Int!
|
|
3730
|
+
$keywords: String
|
|
3731
|
+
$profileType: String
|
|
3732
|
+
) {
|
|
3733
|
+
profileSearch(
|
|
3734
|
+
query: {
|
|
3735
|
+
lawFirmId: $lawFirmId
|
|
3736
|
+
keywords: $keywords
|
|
3737
|
+
profileType: $profileType
|
|
3738
|
+
}
|
|
3739
|
+
) {
|
|
3740
|
+
numResult
|
|
3741
|
+
profileList(startIndex: 0, endIndex: 99) {
|
|
3742
|
+
id
|
|
3743
|
+
profileType
|
|
3744
|
+
profileName
|
|
3745
|
+
}
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
`;
|
|
3749
|
+
const addProfileUserMutation = src`
|
|
3750
|
+
mutation addProfileUser(
|
|
3751
|
+
$email: String
|
|
3752
|
+
$name: String
|
|
3753
|
+
$petitionerProfileName: String
|
|
3754
|
+
$lawFirmId: Int!
|
|
3755
|
+
) {
|
|
3756
|
+
addProfileUserNoNotify(
|
|
3757
|
+
email: $email
|
|
3758
|
+
name: $name
|
|
3759
|
+
petitionerProfileName: $petitionerProfileName
|
|
3760
|
+
selfLawFirmId: $lawFirmId
|
|
3761
|
+
) {
|
|
3762
|
+
profile {
|
|
3763
|
+
id
|
|
3764
|
+
profileName
|
|
3765
|
+
profileType
|
|
3766
|
+
}
|
|
3767
|
+
}
|
|
3768
|
+
}
|
|
3769
|
+
`;
|
|
3770
|
+
function useCreateProfile() {
|
|
3771
|
+
const me = useMe();
|
|
3772
|
+
const { mutate, loading } = useMutation(addProfileUserMutation);
|
|
3773
|
+
const createProfile = async (profile) => {
|
|
3774
|
+
var _a;
|
|
3775
|
+
const variables = {
|
|
3776
|
+
email: profile.email,
|
|
3777
|
+
lawFirmId: (_a = me.value) == null ? void 0 : _a.lawFirmId
|
|
3778
|
+
};
|
|
3779
|
+
if (profile.profileType === "USERPROFILE") {
|
|
3780
|
+
variables.name = profile.profileName;
|
|
3781
|
+
} else {
|
|
3782
|
+
variables.petitionerProfileName = profile.profileName;
|
|
3783
|
+
}
|
|
3784
|
+
const result = await mutate(variables);
|
|
3785
|
+
return path$1(["data", "addProfileUserNoNotify", "profile"], result);
|
|
3786
|
+
};
|
|
3787
|
+
return { createProfile, loading };
|
|
3788
|
+
}
|
|
3789
|
+
const profileTypes = {
|
|
3790
|
+
USERPROFILE: "Individual",
|
|
3791
|
+
CLIENTPROFILE: "Company",
|
|
3792
|
+
PREPARERPROFILE: "Attorney"
|
|
3793
|
+
};
|
|
3794
|
+
var __vue2_script$3 = defineComponent({
|
|
3795
|
+
props: {
|
|
3796
|
+
value: {
|
|
3797
|
+
type: String
|
|
3798
|
+
},
|
|
3799
|
+
enabledTypes: {
|
|
3800
|
+
type: Array,
|
|
3801
|
+
default: ["USERPROFILE", "CLIENTPROFILE", "PREPARERPROFILE"]
|
|
3802
|
+
}
|
|
3803
|
+
},
|
|
3804
|
+
components: {
|
|
3805
|
+
Select,
|
|
3806
|
+
Option: Select.Option,
|
|
3807
|
+
ProfileTypeIcon
|
|
3808
|
+
},
|
|
3809
|
+
setup(_, { emit }) {
|
|
3810
|
+
const handleChange = (value) => emit("input", value);
|
|
3811
|
+
return { profileTypes, handleChange };
|
|
3812
|
+
}
|
|
3813
|
+
});
|
|
3814
|
+
var render$3 = function() {
|
|
3815
|
+
var _vm = this;
|
|
3816
|
+
var _h = _vm.$createElement;
|
|
3817
|
+
var _c = _vm._self._c || _h;
|
|
3818
|
+
return _c("Select", { attrs: { "value": _vm.value }, on: { "change": _vm.handleChange } }, _vm._l(_vm.enabledTypes, function(key) {
|
|
3819
|
+
return _c("Option", { key, attrs: { "value": key } }, [_c("div", { staticClass: "flex items-center space-x-1" }, [_c("ProfileTypeIcon", { attrs: { "type": key } }), _c("div", { staticClass: "text-secondary" }, [_vm._v(_vm._s(_vm.profileTypes[key]))])], 1)]);
|
|
3820
|
+
}), 1);
|
|
3821
|
+
};
|
|
3822
|
+
var staticRenderFns$3 = [];
|
|
3823
|
+
const __cssModules$3 = {};
|
|
3824
|
+
var __component__$3 = /* @__PURE__ */ normalizeComponent(__vue2_script$3, render$3, staticRenderFns$3, false, __vue2_injectStyles$3, null, null, null);
|
|
3825
|
+
function __vue2_injectStyles$3(context) {
|
|
3826
|
+
for (let o in __cssModules$3) {
|
|
3827
|
+
this[o] = __cssModules$3[o];
|
|
3828
|
+
}
|
|
3829
|
+
}
|
|
3830
|
+
var ProfileTypeSelect = /* @__PURE__ */ function() {
|
|
3831
|
+
return __component__$3.exports;
|
|
3832
|
+
}();
|
|
3833
|
+
var __vue2_script$2 = defineComponent({
|
|
3834
|
+
components: {
|
|
3835
|
+
Modal,
|
|
3836
|
+
Form,
|
|
3837
|
+
FormItem: Form.Item,
|
|
3838
|
+
ProfileTypeSelect,
|
|
3839
|
+
Input,
|
|
3840
|
+
Checkbox
|
|
3841
|
+
},
|
|
3842
|
+
setup(_, { emit }) {
|
|
3843
|
+
const value = ref({});
|
|
3844
|
+
const shouldSendPassword = ref(false);
|
|
3845
|
+
const canSubmit = computed(() => value.value.profileName && value.value.profileType);
|
|
3846
|
+
const rules = {
|
|
3847
|
+
profileType: { required: true },
|
|
3848
|
+
profileName: { required: true },
|
|
3849
|
+
email: { type: "email" }
|
|
3850
|
+
};
|
|
3851
|
+
const clearValue = () => value.value = {};
|
|
3852
|
+
const { createProfile, loading } = useCreateProfile();
|
|
3853
|
+
const hide = () => emit("cancel");
|
|
3854
|
+
const handleSubmit = async () => {
|
|
3855
|
+
const profile = await createProfile(value.value);
|
|
3856
|
+
hide();
|
|
3857
|
+
emit("profile-created", profile);
|
|
3858
|
+
};
|
|
3859
|
+
return {
|
|
3860
|
+
value,
|
|
3861
|
+
rules,
|
|
3862
|
+
shouldSendPassword,
|
|
3863
|
+
clearValue,
|
|
3864
|
+
loading,
|
|
3865
|
+
canSubmit,
|
|
3866
|
+
handleSubmit
|
|
3867
|
+
};
|
|
3868
|
+
}
|
|
3869
|
+
});
|
|
3870
|
+
var render$2 = function() {
|
|
3871
|
+
var _vm = this;
|
|
3872
|
+
var _h = _vm.$createElement;
|
|
3873
|
+
var _c = _vm._self._c || _h;
|
|
3874
|
+
return _c("modal", _vm._g(_vm._b({ attrs: { "closable": false, "ok-text": "Create", "width": 320, "okButtonProps": { props: { disabled: !_vm.canSubmit, loading: _vm.loading } } }, on: { "cancel": _vm.clearValue, "ok": _vm.handleSubmit } }, "modal", _vm.$attrs, false), _vm.$listeners), [_c("Form", { attrs: { "layout": "vertical", "validate-trigger": "blur", "model": _vm.value, "rules": _vm.rules } }, [_c("form-item", { attrs: { "label": "Profile type", "name": "profileType" } }, [_c("profile-type-select", { attrs: { "enabledTypes": ["USERPROFILE", "CLIENTPROFILE"] }, model: { value: _vm.value.profileType, callback: function($$v) {
|
|
3875
|
+
_vm.$set(_vm.value, "profileType", $$v);
|
|
3876
|
+
}, expression: "value.profileType" } })], 1), _c("form-item", { attrs: { "label": "Name", "name": "profileName" } }, [_c("Input", { model: { value: _vm.value.profileName, callback: function($$v) {
|
|
3877
|
+
_vm.$set(_vm.value, "profileName", $$v);
|
|
3878
|
+
}, expression: "value.profileName" } })], 1), _c("form-item", { attrs: { "label": "Email" } }, [_c("Input", { model: { value: _vm.value.email, callback: function($$v) {
|
|
3879
|
+
_vm.$set(_vm.value, "email", $$v);
|
|
3880
|
+
}, expression: "value.email" } })], 1), _c("form-item", [_c("checkbox", { model: { value: _vm.shouldSendPassword, callback: function($$v) {
|
|
3881
|
+
_vm.shouldSendPassword = $$v;
|
|
3882
|
+
}, expression: "shouldSendPassword" } }, [_vm._v("Send client portal login password (System will email client a login password)")])], 1)], 1)], 1);
|
|
3883
|
+
};
|
|
3884
|
+
var staticRenderFns$2 = [];
|
|
3885
|
+
const __cssModules$2 = {};
|
|
3886
|
+
var __component__$2 = /* @__PURE__ */ normalizeComponent(__vue2_script$2, render$2, staticRenderFns$2, false, __vue2_injectStyles$2, null, null, null);
|
|
3887
|
+
function __vue2_injectStyles$2(context) {
|
|
3888
|
+
for (let o in __cssModules$2) {
|
|
3889
|
+
this[o] = __cssModules$2[o];
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
var ProfileCreateModal = /* @__PURE__ */ function() {
|
|
3893
|
+
return __component__$2.exports;
|
|
3894
|
+
}();
|
|
3895
|
+
var __vue2_script$1 = defineComponent({
|
|
3896
|
+
props: {
|
|
3897
|
+
value: {
|
|
3898
|
+
type: Object
|
|
3899
|
+
},
|
|
3900
|
+
keywords: {
|
|
3901
|
+
type: String,
|
|
3902
|
+
required: true
|
|
3903
|
+
},
|
|
3904
|
+
source: {
|
|
3905
|
+
type: Array,
|
|
3906
|
+
required: true
|
|
3907
|
+
}
|
|
3908
|
+
},
|
|
3909
|
+
components: {
|
|
3910
|
+
Select,
|
|
3911
|
+
Option: Select.Option,
|
|
3912
|
+
Divider,
|
|
3913
|
+
Button,
|
|
3914
|
+
ProfileSelectItem,
|
|
3915
|
+
ProfileCreateModal,
|
|
3916
|
+
VNodes: {
|
|
3917
|
+
functional: true,
|
|
3918
|
+
render: (_, ctx) => ctx.props.vnodes
|
|
3919
|
+
}
|
|
3920
|
+
},
|
|
3921
|
+
setup(props, { emit }) {
|
|
3922
|
+
const selectedId = computed(() => {
|
|
3923
|
+
var _a;
|
|
3924
|
+
return (_a = props.value) == null ? void 0 : _a.id;
|
|
3925
|
+
});
|
|
3926
|
+
const handleSelect = (value) => emit("input", props.source.find((v) => String(v.id) == value));
|
|
3927
|
+
const handleProfileCreate = () => emit("create-profile");
|
|
3928
|
+
return {
|
|
3929
|
+
selectedId,
|
|
3930
|
+
handleSelect,
|
|
3931
|
+
handleProfileCreate,
|
|
3932
|
+
menu: {}
|
|
3933
|
+
};
|
|
3934
|
+
}
|
|
3935
|
+
});
|
|
3936
|
+
var render$1 = function() {
|
|
3937
|
+
var _vm = this;
|
|
3938
|
+
var _h = _vm.$createElement;
|
|
3939
|
+
var _c = _vm._self._c || _h;
|
|
3940
|
+
return _c("Select", _vm._g(_vm._b({ staticClass: "w-72", attrs: { "allowClear": "", "showSearch": "", "optionFilterProp": "name", "value": _vm.selectedId }, on: { "select": _vm.handleSelect }, scopedSlots: _vm._u([{ key: "dropdownRender", fn: function(menu) {
|
|
3941
|
+
return _c("div", {}, [_c("v-nodes", { attrs: { "vnodes": menu } }), _c("Divider", { staticClass: "my-1" }), _c("div", { staticClass: "flex justify-end px-3 py-1" }, [_c("Button", { attrs: { "size": "small" }, on: { "click": _vm.handleProfileCreate } }, [_vm._v("Create new profile")])], 1)], 1);
|
|
3942
|
+
} }]) }, "Select", _vm.$attrs, false), _vm.$listeners), _vm._l(_vm.source, function(v) {
|
|
3943
|
+
return _c("Option", { key: v.id, attrs: { "value": v.id } }, [_c("ProfileSelectItem", { attrs: { "source": v } })], 1);
|
|
3944
|
+
}), 1);
|
|
3945
|
+
};
|
|
3946
|
+
var staticRenderFns$1 = [];
|
|
3947
|
+
const __cssModules$1 = {};
|
|
3948
|
+
var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, render$1, staticRenderFns$1, false, __vue2_injectStyles$1, null, null, null);
|
|
3949
|
+
function __vue2_injectStyles$1(context) {
|
|
3950
|
+
for (let o in __cssModules$1) {
|
|
3951
|
+
this[o] = __cssModules$1[o];
|
|
3952
|
+
}
|
|
3953
|
+
}
|
|
3954
|
+
var ProfileSelector = /* @__PURE__ */ function() {
|
|
3955
|
+
return __component__$1.exports;
|
|
3956
|
+
}();
|
|
3957
|
+
function useProfiles(keywords) {
|
|
3958
|
+
const me = useMe();
|
|
3959
|
+
const { result, loading } = useQuery(profilesQuery, () => {
|
|
3960
|
+
var _a;
|
|
3961
|
+
return {
|
|
3962
|
+
lawFirmId: (_a = me.value) == null ? void 0 : _a.lawFirmId,
|
|
3963
|
+
keywords: keywords.value
|
|
3964
|
+
};
|
|
3965
|
+
}, () => ({
|
|
3966
|
+
enabled: me.value != null
|
|
3967
|
+
}));
|
|
3968
|
+
const profiles = useResult(result, [], (data) => data.profileSearch.profileList);
|
|
3969
|
+
return { profiles, loading };
|
|
3970
|
+
}
|
|
3971
|
+
var __vue2_script = defineComponent({
|
|
3972
|
+
components: { ProfileSelector, ProfileCreateModal },
|
|
3973
|
+
props: {
|
|
3974
|
+
value: {
|
|
3975
|
+
type: Object
|
|
3976
|
+
}
|
|
3977
|
+
},
|
|
3978
|
+
setup(_, { emit }) {
|
|
3979
|
+
const keywords = ref("");
|
|
3980
|
+
const handleSearch = (value) => keywords.value = value;
|
|
3981
|
+
const { profiles: rawProfiles } = useProfiles(keywords);
|
|
3982
|
+
const createdProfile = ref();
|
|
3983
|
+
const profiles = computed(() => createdProfile.value ? [createdProfile.value, ...rawProfiles.value] : rawProfiles.value);
|
|
3984
|
+
const isModalVisible = ref(false);
|
|
3985
|
+
const toggleModal = (value) => isModalVisible.value = value;
|
|
3986
|
+
const updateValue = (value) => emit("input", value);
|
|
3987
|
+
const handleProfileCreated = (profile) => {
|
|
3988
|
+
createdProfile.value = profile;
|
|
3989
|
+
updateValue(profile);
|
|
3990
|
+
};
|
|
3991
|
+
return {
|
|
3992
|
+
profiles,
|
|
3993
|
+
isModalVisible,
|
|
3994
|
+
toggleModal,
|
|
3995
|
+
updateValue,
|
|
3996
|
+
handleProfileCreated,
|
|
3997
|
+
keywords,
|
|
3998
|
+
handleSearch
|
|
3999
|
+
};
|
|
4000
|
+
}
|
|
4001
|
+
});
|
|
4002
|
+
var render = function() {
|
|
4003
|
+
var _vm = this;
|
|
4004
|
+
var _h = _vm.$createElement;
|
|
4005
|
+
var _c = _vm._self._c || _h;
|
|
4006
|
+
return _c("div", [_c("profile-selector", _vm._g(_vm._b({ attrs: { "source": _vm.profiles, "value": _vm.value, "keywords": _vm.keywords }, on: { "search": _vm.handleSearch, "create-profile": function($event) {
|
|
4007
|
+
return _vm.toggleModal(true);
|
|
4008
|
+
}, "input": _vm.updateValue } }, "profile-selector", _vm.$attrs, false), _vm.$listeners)), _c("profile-create-modal", { attrs: { "visible": _vm.isModalVisible }, on: { "cancel": function($event) {
|
|
4009
|
+
return _vm.toggleModal(false);
|
|
4010
|
+
}, "profile-created": _vm.handleProfileCreated } })], 1);
|
|
4011
|
+
};
|
|
4012
|
+
var staticRenderFns = [];
|
|
4013
|
+
const __cssModules = {};
|
|
4014
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
|
|
4015
|
+
function __vue2_injectStyles(context) {
|
|
4016
|
+
for (let o in __cssModules) {
|
|
4017
|
+
this[o] = __cssModules[o];
|
|
4018
|
+
}
|
|
4019
|
+
}
|
|
4020
|
+
var index = /* @__PURE__ */ function() {
|
|
4021
|
+
return __component__.exports;
|
|
4022
|
+
}();
|
|
4023
|
+
export { index as ProfileSelect };
|