@sanity/client 6.15.14 → 6.15.15

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.
@@ -57,48 +57,10 @@
57
57
  if (!validUrl.test(options.url))
58
58
  throw new Error(`"${options.url}" is not a valid URL`);
59
59
  };
60
-
61
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
62
-
63
- function getDefaultExportFromCjs (x) {
64
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
60
+ function getDefaultExportFromCjs$1(x) {
61
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
65
62
  }
66
63
 
67
- var trim = function(string) {
68
- return string.replace(/^\s+|\s+$/g, '');
69
- }
70
- , isArray$3 = function(arg) {
71
- return Object.prototype.toString.call(arg) === '[object Array]';
72
- };
73
-
74
- var parseHeaders = function (headers) {
75
- if (!headers)
76
- return {}
77
-
78
- var result = {};
79
-
80
- var headersArr = trim(headers).split('\n');
81
-
82
- for (var i = 0; i < headersArr.length; i++) {
83
- var row = headersArr[i];
84
- var index = row.indexOf(':')
85
- , key = trim(row.slice(0, index)).toLowerCase()
86
- , value = trim(row.slice(index + 1));
87
-
88
- if (typeof(result[key]) === 'undefined') {
89
- result[key] = value;
90
- } else if (isArray$3(result[key])) {
91
- result[key].push(value);
92
- } else {
93
- result[key] = [ result[key], value ];
94
- }
95
- }
96
-
97
- return result
98
- };
99
-
100
- var parseHeaders$1 = /*@__PURE__*/getDefaultExportFromCjs(parseHeaders);
101
-
102
64
  const middlewareReducer = (middleware) => function(hook, defaultValue, ...args) {
103
65
  const bailEarly = hook === "onError";
104
66
  let value = defaultValue;
@@ -191,7 +153,20 @@
191
153
  }), loadedMiddleware.push(newMiddleware), request;
192
154
  }, request.clone = () => createRequester(loadedMiddleware, httpRequest), initMiddleware.forEach(request.use), request;
193
155
  }
194
- var __accessCheck$7 = (obj, member, msg) => {
156
+ var trim = function(string) {
157
+ return string.replace(/^\s+|\s+$/g, "");
158
+ }, isArray$3 = function(arg) {
159
+ return Object.prototype.toString.call(arg) === "[object Array]";
160
+ }, parseHeaders = function(headers) {
161
+ if (!headers)
162
+ return {};
163
+ for (var result = {}, headersArr = trim(headers).split(`
164
+ `), i = 0; i < headersArr.length; i++) {
165
+ var row = headersArr[i], index = row.indexOf(":"), key = trim(row.slice(0, index)).toLowerCase(), value = trim(row.slice(index + 1));
166
+ typeof result[key] > "u" ? result[key] = value : isArray$3(result[key]) ? result[key].push(value) : result[key] = [result[key], value];
167
+ }
168
+ return result;
169
+ }, parseHeaders$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(parseHeaders), __accessCheck$7 = (obj, member, msg) => {
195
170
  if (!member.has(obj))
196
171
  throw TypeError("Cannot " + msg);
197
172
  }, __privateGet$7 = (obj, member, getter) => (__accessCheck$7(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd$7 = (obj, member, value) => {
@@ -326,725 +301,304 @@
326
301
  }
327
302
  }, getIt = (initMiddleware = [], httpRequest = httpRequester) => createRequester(initMiddleware, httpRequest), environment = "browser";
328
303
 
329
- var browser$3 = {exports: {}};
330
-
331
- /**
332
- * Helpers.
333
- */
334
-
335
- var ms;
336
- var hasRequiredMs;
337
-
338
- function requireMs () {
339
- if (hasRequiredMs) return ms;
340
- hasRequiredMs = 1;
341
- var s = 1000;
342
- var m = s * 60;
343
- var h = m * 60;
344
- var d = h * 24;
345
- var w = d * 7;
346
- var y = d * 365.25;
347
-
348
- /**
349
- * Parse or format the given `val`.
350
- *
351
- * Options:
352
- *
353
- * - `long` verbose formatting [false]
354
- *
355
- * @param {String|Number} val
356
- * @param {Object} [options]
357
- * @throws {Error} throw an error if val is not a non-empty string or a number
358
- * @return {String|Number}
359
- * @api public
360
- */
361
-
362
- ms = function(val, options) {
363
- options = options || {};
364
- var type = typeof val;
365
- if (type === 'string' && val.length > 0) {
366
- return parse(val);
367
- } else if (type === 'number' && isFinite(val)) {
368
- return options.long ? fmtLong(val) : fmtShort(val);
369
- }
370
- throw new Error(
371
- 'val is not a non-empty string or a valid number. val=' +
372
- JSON.stringify(val)
373
- );
374
- };
375
-
376
- /**
377
- * Parse the given `str` and return milliseconds.
378
- *
379
- * @param {String} str
380
- * @return {Number}
381
- * @api private
382
- */
383
-
384
- function parse(str) {
385
- str = String(str);
386
- if (str.length > 100) {
387
- return;
388
- }
389
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
390
- str
391
- );
392
- if (!match) {
393
- return;
394
- }
395
- var n = parseFloat(match[1]);
396
- var type = (match[2] || 'ms').toLowerCase();
397
- switch (type) {
398
- case 'years':
399
- case 'year':
400
- case 'yrs':
401
- case 'yr':
402
- case 'y':
403
- return n * y;
404
- case 'weeks':
405
- case 'week':
406
- case 'w':
407
- return n * w;
408
- case 'days':
409
- case 'day':
410
- case 'd':
411
- return n * d;
412
- case 'hours':
413
- case 'hour':
414
- case 'hrs':
415
- case 'hr':
416
- case 'h':
417
- return n * h;
418
- case 'minutes':
419
- case 'minute':
420
- case 'mins':
421
- case 'min':
422
- case 'm':
423
- return n * m;
424
- case 'seconds':
425
- case 'second':
426
- case 'secs':
427
- case 'sec':
428
- case 's':
429
- return n * s;
430
- case 'milliseconds':
431
- case 'millisecond':
432
- case 'msecs':
433
- case 'msec':
434
- case 'ms':
435
- return n;
436
- default:
437
- return undefined;
438
- }
439
- }
440
-
441
- /**
442
- * Short format for `ms`.
443
- *
444
- * @param {Number} ms
445
- * @return {String}
446
- * @api private
447
- */
448
-
449
- function fmtShort(ms) {
450
- var msAbs = Math.abs(ms);
451
- if (msAbs >= d) {
452
- return Math.round(ms / d) + 'd';
453
- }
454
- if (msAbs >= h) {
455
- return Math.round(ms / h) + 'h';
456
- }
457
- if (msAbs >= m) {
458
- return Math.round(ms / m) + 'm';
459
- }
460
- if (msAbs >= s) {
461
- return Math.round(ms / s) + 's';
462
- }
463
- return ms + 'ms';
464
- }
465
-
466
- /**
467
- * Long format for `ms`.
468
- *
469
- * @param {Number} ms
470
- * @return {String}
471
- * @api private
472
- */
473
-
474
- function fmtLong(ms) {
475
- var msAbs = Math.abs(ms);
476
- if (msAbs >= d) {
477
- return plural(ms, msAbs, d, 'day');
478
- }
479
- if (msAbs >= h) {
480
- return plural(ms, msAbs, h, 'hour');
481
- }
482
- if (msAbs >= m) {
483
- return plural(ms, msAbs, m, 'minute');
484
- }
485
- if (msAbs >= s) {
486
- return plural(ms, msAbs, s, 'second');
487
- }
488
- return ms + ' ms';
489
- }
490
-
491
- /**
492
- * Pluralization helper.
493
- */
494
-
495
- function plural(ms, msAbs, n, name) {
496
- var isPlural = msAbs >= n * 1.5;
497
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
498
- }
499
- return ms;
304
+ var browser$3 = { exports: {} }, ms, hasRequiredMs;
305
+ function requireMs() {
306
+ if (hasRequiredMs)
307
+ return ms;
308
+ hasRequiredMs = 1;
309
+ var s = 1e3, m = s * 60, h = m * 60, d = h * 24, w = d * 7, y = d * 365.25;
310
+ ms = function(val, options) {
311
+ options = options || {};
312
+ var type = typeof val;
313
+ if (type === "string" && val.length > 0)
314
+ return parse(val);
315
+ if (type === "number" && isFinite(val))
316
+ return options.long ? fmtLong(val) : fmtShort(val);
317
+ throw new Error(
318
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
319
+ );
320
+ };
321
+ function parse(str) {
322
+ if (str = String(str), !(str.length > 100)) {
323
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
324
+ str
325
+ );
326
+ if (match) {
327
+ var n = parseFloat(match[1]), type = (match[2] || "ms").toLowerCase();
328
+ switch (type) {
329
+ case "years":
330
+ case "year":
331
+ case "yrs":
332
+ case "yr":
333
+ case "y":
334
+ return n * y;
335
+ case "weeks":
336
+ case "week":
337
+ case "w":
338
+ return n * w;
339
+ case "days":
340
+ case "day":
341
+ case "d":
342
+ return n * d;
343
+ case "hours":
344
+ case "hour":
345
+ case "hrs":
346
+ case "hr":
347
+ case "h":
348
+ return n * h;
349
+ case "minutes":
350
+ case "minute":
351
+ case "mins":
352
+ case "min":
353
+ case "m":
354
+ return n * m;
355
+ case "seconds":
356
+ case "second":
357
+ case "secs":
358
+ case "sec":
359
+ case "s":
360
+ return n * s;
361
+ case "milliseconds":
362
+ case "millisecond":
363
+ case "msecs":
364
+ case "msec":
365
+ case "ms":
366
+ return n;
367
+ default:
368
+ return;
369
+ }
370
+ }
371
+ }
372
+ }
373
+ function fmtShort(ms2) {
374
+ var msAbs = Math.abs(ms2);
375
+ return msAbs >= d ? Math.round(ms2 / d) + "d" : msAbs >= h ? Math.round(ms2 / h) + "h" : msAbs >= m ? Math.round(ms2 / m) + "m" : msAbs >= s ? Math.round(ms2 / s) + "s" : ms2 + "ms";
376
+ }
377
+ function fmtLong(ms2) {
378
+ var msAbs = Math.abs(ms2);
379
+ return msAbs >= d ? plural(ms2, msAbs, d, "day") : msAbs >= h ? plural(ms2, msAbs, h, "hour") : msAbs >= m ? plural(ms2, msAbs, m, "minute") : msAbs >= s ? plural(ms2, msAbs, s, "second") : ms2 + " ms";
380
+ }
381
+ function plural(ms2, msAbs, n, name) {
382
+ var isPlural = msAbs >= n * 1.5;
383
+ return Math.round(ms2 / n) + " " + name + (isPlural ? "s" : "");
384
+ }
385
+ return ms;
500
386
  }
501
-
502
- /**
503
- * This is the common logic for both the Node.js and web browser
504
- * implementations of `debug()`.
505
- */
506
-
507
387
  function setup(env) {
508
- createDebug.debug = createDebug;
509
- createDebug.default = createDebug;
510
- createDebug.coerce = coerce;
511
- createDebug.disable = disable;
512
- createDebug.enable = enable;
513
- createDebug.enabled = enabled;
514
- createDebug.humanize = requireMs();
515
- createDebug.destroy = destroy;
516
-
517
- Object.keys(env).forEach(key => {
518
- createDebug[key] = env[key];
519
- });
520
-
521
- /**
522
- * The currently active debug mode names, and names to skip.
523
- */
524
-
525
- createDebug.names = [];
526
- createDebug.skips = [];
527
-
528
- /**
529
- * Map of special "%n" handling functions, for the debug "format" argument.
530
- *
531
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
532
- */
533
- createDebug.formatters = {};
534
-
535
- /**
536
- * Selects a color for a debug namespace
537
- * @param {String} namespace The namespace string for the debug instance to be colored
538
- * @return {Number|String} An ANSI color code for the given namespace
539
- * @api private
540
- */
541
- function selectColor(namespace) {
542
- let hash = 0;
543
-
544
- for (let i = 0; i < namespace.length; i++) {
545
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
546
- hash |= 0; // Convert to 32bit integer
547
- }
548
-
549
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
550
- }
551
- createDebug.selectColor = selectColor;
552
-
553
- /**
554
- * Create a debugger with the given `namespace`.
555
- *
556
- * @param {String} namespace
557
- * @return {Function}
558
- * @api public
559
- */
560
- function createDebug(namespace) {
561
- let prevTime;
562
- let enableOverride = null;
563
- let namespacesCache;
564
- let enabledCache;
565
-
566
- function debug(...args) {
567
- // Disabled?
568
- if (!debug.enabled) {
569
- return;
570
- }
571
-
572
- const self = debug;
573
-
574
- // Set `diff` timestamp
575
- const curr = Number(new Date());
576
- const ms = curr - (prevTime || curr);
577
- self.diff = ms;
578
- self.prev = prevTime;
579
- self.curr = curr;
580
- prevTime = curr;
581
-
582
- args[0] = createDebug.coerce(args[0]);
583
-
584
- if (typeof args[0] !== 'string') {
585
- // Anything else let's inspect with %O
586
- args.unshift('%O');
587
- }
588
-
589
- // Apply any `formatters` transformations
590
- let index = 0;
591
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
592
- // If we encounter an escaped % then don't increase the array index
593
- if (match === '%%') {
594
- return '%';
595
- }
596
- index++;
597
- const formatter = createDebug.formatters[format];
598
- if (typeof formatter === 'function') {
599
- const val = args[index];
600
- match = formatter.call(self, val);
601
-
602
- // Now we need to remove `args[index]` since it's inlined in the `format`
603
- args.splice(index, 1);
604
- index--;
605
- }
606
- return match;
607
- });
608
-
609
- // Apply env-specific formatting (colors, etc.)
610
- createDebug.formatArgs.call(self, args);
611
-
612
- const logFn = self.log || createDebug.log;
613
- logFn.apply(self, args);
614
- }
615
-
616
- debug.namespace = namespace;
617
- debug.useColors = createDebug.useColors();
618
- debug.color = createDebug.selectColor(namespace);
619
- debug.extend = extend;
620
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
621
-
622
- Object.defineProperty(debug, 'enabled', {
623
- enumerable: true,
624
- configurable: false,
625
- get: () => {
626
- if (enableOverride !== null) {
627
- return enableOverride;
628
- }
629
- if (namespacesCache !== createDebug.namespaces) {
630
- namespacesCache = createDebug.namespaces;
631
- enabledCache = createDebug.enabled(namespace);
632
- }
633
-
634
- return enabledCache;
635
- },
636
- set: v => {
637
- enableOverride = v;
638
- }
639
- });
640
-
641
- // Env-specific initialization logic for debug instances
642
- if (typeof createDebug.init === 'function') {
643
- createDebug.init(debug);
644
- }
645
-
646
- return debug;
647
- }
648
-
649
- function extend(namespace, delimiter) {
650
- const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
651
- newDebug.log = this.log;
652
- return newDebug;
653
- }
654
-
655
- /**
656
- * Enables a debug mode by namespaces. This can include modes
657
- * separated by a colon and wildcards.
658
- *
659
- * @param {String} namespaces
660
- * @api public
661
- */
662
- function enable(namespaces) {
663
- createDebug.save(namespaces);
664
- createDebug.namespaces = namespaces;
665
-
666
- createDebug.names = [];
667
- createDebug.skips = [];
668
-
669
- let i;
670
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
671
- const len = split.length;
672
-
673
- for (i = 0; i < len; i++) {
674
- if (!split[i]) {
675
- // ignore empty strings
676
- continue;
677
- }
678
-
679
- namespaces = split[i].replace(/\*/g, '.*?');
680
-
681
- if (namespaces[0] === '-') {
682
- createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
683
- } else {
684
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
685
- }
686
- }
687
- }
688
-
689
- /**
690
- * Disable debug output.
691
- *
692
- * @return {String} namespaces
693
- * @api public
694
- */
695
- function disable() {
696
- const namespaces = [
697
- ...createDebug.names.map(toNamespace),
698
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
699
- ].join(',');
700
- createDebug.enable('');
701
- return namespaces;
702
- }
703
-
704
- /**
705
- * Returns true if the given mode name is enabled, false otherwise.
706
- *
707
- * @param {String} name
708
- * @return {Boolean}
709
- * @api public
710
- */
711
- function enabled(name) {
712
- if (name[name.length - 1] === '*') {
713
- return true;
714
- }
715
-
716
- let i;
717
- let len;
718
-
719
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
720
- if (createDebug.skips[i].test(name)) {
721
- return false;
722
- }
723
- }
724
-
725
- for (i = 0, len = createDebug.names.length; i < len; i++) {
726
- if (createDebug.names[i].test(name)) {
727
- return true;
728
- }
729
- }
730
-
731
- return false;
732
- }
733
-
734
- /**
735
- * Convert regexp to namespace
736
- *
737
- * @param {RegExp} regxep
738
- * @return {String} namespace
739
- * @api private
740
- */
741
- function toNamespace(regexp) {
742
- return regexp.toString()
743
- .substring(2, regexp.toString().length - 2)
744
- .replace(/\.\*\?$/, '*');
745
- }
746
-
747
- /**
748
- * Coerce `val`.
749
- *
750
- * @param {Mixed} val
751
- * @return {Mixed}
752
- * @api private
753
- */
754
- function coerce(val) {
755
- if (val instanceof Error) {
756
- return val.stack || val.message;
757
- }
758
- return val;
759
- }
760
-
761
- /**
762
- * XXX DO NOT USE. This is a temporary stub function.
763
- * XXX It WILL be removed in the next major release.
764
- */
765
- function destroy() {
766
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
767
- }
768
-
769
- createDebug.enable(createDebug.load());
770
-
771
- return createDebug;
388
+ createDebug.debug = createDebug, createDebug.default = createDebug, createDebug.coerce = coerce, createDebug.disable = disable, createDebug.enable = enable, createDebug.enabled = enabled, createDebug.humanize = requireMs(), createDebug.destroy = destroy, Object.keys(env).forEach((key) => {
389
+ createDebug[key] = env[key];
390
+ }), createDebug.names = [], createDebug.skips = [], createDebug.formatters = {};
391
+ function selectColor(namespace) {
392
+ let hash = 0;
393
+ for (let i = 0; i < namespace.length; i++)
394
+ hash = (hash << 5) - hash + namespace.charCodeAt(i), hash |= 0;
395
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
396
+ }
397
+ createDebug.selectColor = selectColor;
398
+ function createDebug(namespace) {
399
+ let prevTime, enableOverride = null, namespacesCache, enabledCache;
400
+ function debug2(...args) {
401
+ if (!debug2.enabled)
402
+ return;
403
+ const self2 = debug2, curr = Number(/* @__PURE__ */ new Date()), ms2 = curr - (prevTime || curr);
404
+ self2.diff = ms2, self2.prev = prevTime, self2.curr = curr, prevTime = curr, args[0] = createDebug.coerce(args[0]), typeof args[0] != "string" && args.unshift("%O");
405
+ let index = 0;
406
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
407
+ if (match === "%%")
408
+ return "%";
409
+ index++;
410
+ const formatter = createDebug.formatters[format];
411
+ if (typeof formatter == "function") {
412
+ const val = args[index];
413
+ match = formatter.call(self2, val), args.splice(index, 1), index--;
414
+ }
415
+ return match;
416
+ }), createDebug.formatArgs.call(self2, args), (self2.log || createDebug.log).apply(self2, args);
417
+ }
418
+ return debug2.namespace = namespace, debug2.useColors = createDebug.useColors(), debug2.color = createDebug.selectColor(namespace), debug2.extend = extend, debug2.destroy = createDebug.destroy, Object.defineProperty(debug2, "enabled", {
419
+ enumerable: !0,
420
+ configurable: !1,
421
+ get: () => enableOverride !== null ? enableOverride : (namespacesCache !== createDebug.namespaces && (namespacesCache = createDebug.namespaces, enabledCache = createDebug.enabled(namespace)), enabledCache),
422
+ set: (v2) => {
423
+ enableOverride = v2;
424
+ }
425
+ }), typeof createDebug.init == "function" && createDebug.init(debug2), debug2;
426
+ }
427
+ function extend(namespace, delimiter) {
428
+ const newDebug = createDebug(this.namespace + (typeof delimiter > "u" ? ":" : delimiter) + namespace);
429
+ return newDebug.log = this.log, newDebug;
430
+ }
431
+ function enable(namespaces) {
432
+ createDebug.save(namespaces), createDebug.namespaces = namespaces, createDebug.names = [], createDebug.skips = [];
433
+ let i;
434
+ const split = (typeof namespaces == "string" ? namespaces : "").split(/[\s,]+/), len = split.length;
435
+ for (i = 0; i < len; i++)
436
+ split[i] && (namespaces = split[i].replace(/\*/g, ".*?"), namespaces[0] === "-" ? createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")) : createDebug.names.push(new RegExp("^" + namespaces + "$")));
437
+ }
438
+ function disable() {
439
+ const namespaces = [
440
+ ...createDebug.names.map(toNamespace),
441
+ ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
442
+ ].join(",");
443
+ return createDebug.enable(""), namespaces;
444
+ }
445
+ function enabled(name) {
446
+ if (name[name.length - 1] === "*")
447
+ return !0;
448
+ let i, len;
449
+ for (i = 0, len = createDebug.skips.length; i < len; i++)
450
+ if (createDebug.skips[i].test(name))
451
+ return !1;
452
+ for (i = 0, len = createDebug.names.length; i < len; i++)
453
+ if (createDebug.names[i].test(name))
454
+ return !0;
455
+ return !1;
456
+ }
457
+ function toNamespace(regexp) {
458
+ return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
459
+ }
460
+ function coerce(val) {
461
+ return val instanceof Error ? val.stack || val.message : val;
462
+ }
463
+ function destroy() {
464
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
465
+ }
466
+ return createDebug.enable(createDebug.load()), createDebug;
772
467
  }
773
-
774
468
  var common = setup;
775
-
776
- /* eslint-env browser */
777
-
778
- (function (module, exports) {
779
- /**
780
- * This is the web browser implementation of `debug()`.
781
- */
782
-
783
- exports.formatArgs = formatArgs;
784
- exports.save = save;
785
- exports.load = load;
786
- exports.useColors = useColors;
787
- exports.storage = localstorage();
788
- exports.destroy = (() => {
789
- let warned = false;
790
-
791
- return () => {
792
- if (!warned) {
793
- warned = true;
794
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
795
- }
796
- };
797
- })();
798
-
799
- /**
800
- * Colors.
801
- */
802
-
803
- exports.colors = [
804
- '#0000CC',
805
- '#0000FF',
806
- '#0033CC',
807
- '#0033FF',
808
- '#0066CC',
809
- '#0066FF',
810
- '#0099CC',
811
- '#0099FF',
812
- '#00CC00',
813
- '#00CC33',
814
- '#00CC66',
815
- '#00CC99',
816
- '#00CCCC',
817
- '#00CCFF',
818
- '#3300CC',
819
- '#3300FF',
820
- '#3333CC',
821
- '#3333FF',
822
- '#3366CC',
823
- '#3366FF',
824
- '#3399CC',
825
- '#3399FF',
826
- '#33CC00',
827
- '#33CC33',
828
- '#33CC66',
829
- '#33CC99',
830
- '#33CCCC',
831
- '#33CCFF',
832
- '#6600CC',
833
- '#6600FF',
834
- '#6633CC',
835
- '#6633FF',
836
- '#66CC00',
837
- '#66CC33',
838
- '#9900CC',
839
- '#9900FF',
840
- '#9933CC',
841
- '#9933FF',
842
- '#99CC00',
843
- '#99CC33',
844
- '#CC0000',
845
- '#CC0033',
846
- '#CC0066',
847
- '#CC0099',
848
- '#CC00CC',
849
- '#CC00FF',
850
- '#CC3300',
851
- '#CC3333',
852
- '#CC3366',
853
- '#CC3399',
854
- '#CC33CC',
855
- '#CC33FF',
856
- '#CC6600',
857
- '#CC6633',
858
- '#CC9900',
859
- '#CC9933',
860
- '#CCCC00',
861
- '#CCCC33',
862
- '#FF0000',
863
- '#FF0033',
864
- '#FF0066',
865
- '#FF0099',
866
- '#FF00CC',
867
- '#FF00FF',
868
- '#FF3300',
869
- '#FF3333',
870
- '#FF3366',
871
- '#FF3399',
872
- '#FF33CC',
873
- '#FF33FF',
874
- '#FF6600',
875
- '#FF6633',
876
- '#FF9900',
877
- '#FF9933',
878
- '#FFCC00',
879
- '#FFCC33'
880
- ];
881
-
882
- /**
883
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
884
- * and the Firebug extension (any Firefox version) are known
885
- * to support "%c" CSS customizations.
886
- *
887
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
888
- */
889
-
890
- // eslint-disable-next-line complexity
891
- function useColors() {
892
- // NB: In an Electron preload script, document will be defined but not fully
893
- // initialized. Since we know we're in Chrome, we'll just detect this case
894
- // explicitly
895
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
896
- return true;
897
- }
898
-
899
- // Internet Explorer and Edge do not support colors.
900
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
901
- return false;
902
- }
903
-
904
- // Is webkit? http://stackoverflow.com/a/16459606/376773
905
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
906
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
907
- // Is firebug? http://stackoverflow.com/a/398120/376773
908
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
909
- // Is firefox >= v31?
910
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
911
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
912
- // Double check webkit in userAgent just in case we are in a worker
913
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
914
- }
915
-
916
- /**
917
- * Colorize log arguments if enabled.
918
- *
919
- * @api public
920
- */
921
-
922
- function formatArgs(args) {
923
- args[0] = (this.useColors ? '%c' : '') +
924
- this.namespace +
925
- (this.useColors ? ' %c' : ' ') +
926
- args[0] +
927
- (this.useColors ? '%c ' : ' ') +
928
- '+' + module.exports.humanize(this.diff);
929
-
930
- if (!this.useColors) {
931
- return;
932
- }
933
-
934
- const c = 'color: ' + this.color;
935
- args.splice(1, 0, c, 'color: inherit');
936
-
937
- // The final "%c" is somewhat tricky, because there could be other
938
- // arguments passed either before or after the %c, so we need to
939
- // figure out the correct index to insert the CSS into
940
- let index = 0;
941
- let lastC = 0;
942
- args[0].replace(/%[a-zA-Z%]/g, match => {
943
- if (match === '%%') {
944
- return;
945
- }
946
- index++;
947
- if (match === '%c') {
948
- // We only are interested in the *last* %c
949
- // (the user may have provided their own)
950
- lastC = index;
951
- }
952
- });
953
-
954
- args.splice(lastC, 0, c);
955
- }
956
-
957
- /**
958
- * Invokes `console.debug()` when available.
959
- * No-op when `console.debug` is not a "function".
960
- * If `console.debug` is not available, falls back
961
- * to `console.log`.
962
- *
963
- * @api public
964
- */
965
- exports.log = console.debug || console.log || (() => {});
966
-
967
- /**
968
- * Save `namespaces`.
969
- *
970
- * @param {String} namespaces
971
- * @api private
972
- */
973
- function save(namespaces) {
974
- try {
975
- if (namespaces) {
976
- exports.storage.setItem('debug', namespaces);
977
- } else {
978
- exports.storage.removeItem('debug');
979
- }
980
- } catch (error) {
981
- // Swallow
982
- // XXX (@Qix-) should we be logging these?
983
- }
984
- }
985
-
986
- /**
987
- * Load `namespaces`.
988
- *
989
- * @return {String} returns the previously persisted debug modes
990
- * @api private
991
- */
992
- function load() {
993
- let r;
994
- try {
995
- r = exports.storage.getItem('debug');
996
- } catch (error) {
997
- // Swallow
998
- // XXX (@Qix-) should we be logging these?
999
- }
1000
-
1001
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
1002
- if (!r && typeof process !== 'undefined' && 'env' in process) {
1003
- r = process.env.DEBUG;
1004
- }
1005
-
1006
- return r;
1007
- }
1008
-
1009
- /**
1010
- * Localstorage attempts to return the localstorage.
1011
- *
1012
- * This is necessary because safari throws
1013
- * when a user disables cookies/localstorage
1014
- * and you attempt to access it.
1015
- *
1016
- * @return {LocalStorage}
1017
- * @api private
1018
- */
1019
-
1020
- function localstorage() {
1021
- try {
1022
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
1023
- // The Browser also has localStorage in the global context.
1024
- return localStorage;
1025
- } catch (error) {
1026
- // Swallow
1027
- // XXX (@Qix-) should we be logging these?
1028
- }
1029
- }
1030
-
1031
- module.exports = common(exports);
1032
-
1033
- const {formatters} = module.exports;
1034
-
1035
- /**
1036
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
1037
- */
1038
-
1039
- formatters.j = function (v) {
1040
- try {
1041
- return JSON.stringify(v);
1042
- } catch (error) {
1043
- return '[UnexpectedJSONParseError]: ' + error.message;
1044
- }
1045
- };
1046
- } (browser$3, browser$3.exports));
1047
-
469
+ (function(module, exports) {
470
+ exports.formatArgs = formatArgs, exports.save = save, exports.load = load, exports.useColors = useColors, exports.storage = localstorage(), exports.destroy = /* @__PURE__ */ (() => {
471
+ let warned = !1;
472
+ return () => {
473
+ warned || (warned = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
474
+ };
475
+ })(), exports.colors = [
476
+ "#0000CC",
477
+ "#0000FF",
478
+ "#0033CC",
479
+ "#0033FF",
480
+ "#0066CC",
481
+ "#0066FF",
482
+ "#0099CC",
483
+ "#0099FF",
484
+ "#00CC00",
485
+ "#00CC33",
486
+ "#00CC66",
487
+ "#00CC99",
488
+ "#00CCCC",
489
+ "#00CCFF",
490
+ "#3300CC",
491
+ "#3300FF",
492
+ "#3333CC",
493
+ "#3333FF",
494
+ "#3366CC",
495
+ "#3366FF",
496
+ "#3399CC",
497
+ "#3399FF",
498
+ "#33CC00",
499
+ "#33CC33",
500
+ "#33CC66",
501
+ "#33CC99",
502
+ "#33CCCC",
503
+ "#33CCFF",
504
+ "#6600CC",
505
+ "#6600FF",
506
+ "#6633CC",
507
+ "#6633FF",
508
+ "#66CC00",
509
+ "#66CC33",
510
+ "#9900CC",
511
+ "#9900FF",
512
+ "#9933CC",
513
+ "#9933FF",
514
+ "#99CC00",
515
+ "#99CC33",
516
+ "#CC0000",
517
+ "#CC0033",
518
+ "#CC0066",
519
+ "#CC0099",
520
+ "#CC00CC",
521
+ "#CC00FF",
522
+ "#CC3300",
523
+ "#CC3333",
524
+ "#CC3366",
525
+ "#CC3399",
526
+ "#CC33CC",
527
+ "#CC33FF",
528
+ "#CC6600",
529
+ "#CC6633",
530
+ "#CC9900",
531
+ "#CC9933",
532
+ "#CCCC00",
533
+ "#CCCC33",
534
+ "#FF0000",
535
+ "#FF0033",
536
+ "#FF0066",
537
+ "#FF0099",
538
+ "#FF00CC",
539
+ "#FF00FF",
540
+ "#FF3300",
541
+ "#FF3333",
542
+ "#FF3366",
543
+ "#FF3399",
544
+ "#FF33CC",
545
+ "#FF33FF",
546
+ "#FF6600",
547
+ "#FF6633",
548
+ "#FF9900",
549
+ "#FF9933",
550
+ "#FFCC00",
551
+ "#FFCC33"
552
+ ];
553
+ function useColors() {
554
+ return typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs) ? !0 : typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/) ? !1 : typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
555
+ typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
556
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
557
+ typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
558
+ typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
559
+ }
560
+ function formatArgs(args) {
561
+ if (args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff), !this.useColors)
562
+ return;
563
+ const c = "color: " + this.color;
564
+ args.splice(1, 0, c, "color: inherit");
565
+ let index = 0, lastC = 0;
566
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
567
+ match !== "%%" && (index++, match === "%c" && (lastC = index));
568
+ }), args.splice(lastC, 0, c);
569
+ }
570
+ exports.log = console.debug || console.log || (() => {
571
+ });
572
+ function save(namespaces) {
573
+ try {
574
+ namespaces ? exports.storage.setItem("debug", namespaces) : exports.storage.removeItem("debug");
575
+ } catch {
576
+ }
577
+ }
578
+ function load() {
579
+ let r;
580
+ try {
581
+ r = exports.storage.getItem("debug");
582
+ } catch {
583
+ }
584
+ return !r && typeof process < "u" && "env" in process && (r = process.env.DEBUG), r;
585
+ }
586
+ function localstorage() {
587
+ try {
588
+ return localStorage;
589
+ } catch {
590
+ }
591
+ }
592
+ module.exports = common(exports);
593
+ const { formatters } = module.exports;
594
+ formatters.j = function(v2) {
595
+ try {
596
+ return JSON.stringify(v2);
597
+ } catch (error) {
598
+ return "[UnexpectedJSONParseError]: " + error.message;
599
+ }
600
+ };
601
+ })(browser$3, browser$3.exports);
1048
602
  const isBuffer = typeof Buffer > "u" ? () => !1 : (obj) => Buffer.isBuffer(obj);
1049
603
  /*!
1050
604
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
@@ -2360,16 +1914,17 @@
2360
1914
  return combineLatest.apply(void 0, __spreadArray([], __read(otherSources)));
2361
1915
  }
2362
1916
 
1917
+ var __defProp$3 = Object.defineProperty, __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField$3 = (obj, key, value) => (__defNormalProp$3(obj, typeof key != "symbol" ? key + "" : key, value), value);
2363
1918
  class ClientError extends Error {
2364
1919
  constructor(res) {
2365
1920
  const props = extractErrorProps(res);
2366
- super(props.message), this.statusCode = 400, Object.assign(this, props);
1921
+ super(props.message), __publicField$3(this, "response"), __publicField$3(this, "statusCode", 400), __publicField$3(this, "responseBody"), __publicField$3(this, "details"), Object.assign(this, props);
2367
1922
  }
2368
1923
  }
2369
1924
  class ServerError extends Error {
2370
1925
  constructor(res) {
2371
1926
  const props = extractErrorProps(res);
2372
- super(props.message), this.statusCode = 500, Object.assign(this, props);
1927
+ super(props.message), __publicField$3(this, "response"), __publicField$3(this, "statusCode", 500), __publicField$3(this, "responseBody"), __publicField$3(this, "details"), Object.assign(this, props);
2373
1928
  }
2374
1929
  }
2375
1930
  function extractErrorProps(res) {
@@ -2510,7 +2065,7 @@ ${selectionOpts}`);
2510
2065
  );
2511
2066
  return tag;
2512
2067
  };
2513
- var __accessCheck$6 = (obj, member, msg) => {
2068
+ var __defProp$2 = Object.defineProperty, __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField$2 = (obj, key, value) => (__defNormalProp$2(obj, typeof key != "symbol" ? key + "" : key, value), value), __accessCheck$6 = (obj, member, msg) => {
2514
2069
  if (!member.has(obj))
2515
2070
  throw TypeError("Cannot " + msg);
2516
2071
  }, __privateGet$6 = (obj, member, getter) => (__accessCheck$6(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd$6 = (obj, member, value) => {
@@ -2520,7 +2075,7 @@ ${selectionOpts}`);
2520
2075
  }, __privateSet$6 = (obj, member, value, setter) => (__accessCheck$6(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
2521
2076
  class BasePatch {
2522
2077
  constructor(selection, operations = {}) {
2523
- this.selection = selection, this.operations = operations;
2078
+ __publicField$2(this, "selection"), __publicField$2(this, "operations"), this.selection = selection, this.operations = operations;
2524
2079
  }
2525
2080
  /**
2526
2081
  * Sets the given attributes to the document. Does NOT merge objects.
@@ -2695,7 +2250,7 @@ ${selectionOpts}`);
2695
2250
  };
2696
2251
  _client2$5 = /* @__PURE__ */ new WeakMap();
2697
2252
  let Patch = _Patch;
2698
- var __accessCheck$5 = (obj, member, msg) => {
2253
+ var __defProp$1 = Object.defineProperty, __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField$1 = (obj, key, value) => (__defNormalProp$1(obj, typeof key != "symbol" ? key + "" : key, value), value), __accessCheck$5 = (obj, member, msg) => {
2699
2254
  if (!member.has(obj))
2700
2255
  throw TypeError("Cannot " + msg);
2701
2256
  }, __privateGet$5 = (obj, member, getter) => (__accessCheck$5(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd$5 = (obj, member, value) => {
@@ -2706,7 +2261,7 @@ ${selectionOpts}`);
2706
2261
  const defaultMutateOptions = { returnDocuments: !1 };
2707
2262
  class BaseTransaction {
2708
2263
  constructor(operations = [], transactionId) {
2709
- this.operations = operations, this.trxId = transactionId;
2264
+ __publicField$1(this, "operations"), __publicField$1(this, "trxId"), this.operations = operations, this.trxId = transactionId;
2710
2265
  }
2711
2266
  /**
2712
2267
  * Creates a new Sanity document. If `_id` is provided and already exists, the mutation will fail. If no `_id` is given, one will automatically be generated by the database.
@@ -3516,7 +3071,7 @@ ${selectionOpts}`);
3516
3071
  }
3517
3072
  }
3518
3073
  _client2 = /* @__PURE__ */ new WeakMap(), _httpRequest2$1 = /* @__PURE__ */ new WeakMap();
3519
- var __accessCheck = (obj, member, msg) => {
3074
+ var __defProp = Object.defineProperty, __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField = (obj, key, value) => (__defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value), value), __accessCheck = (obj, member, msg) => {
3520
3075
  if (!member.has(obj))
3521
3076
  throw TypeError("Cannot " + msg);
3522
3077
  }, __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => {
@@ -3526,7 +3081,7 @@ ${selectionOpts}`);
3526
3081
  }, __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), _clientConfig, _httpRequest;
3527
3082
  const _ObservableSanityClient = class _ObservableSanityClient2 {
3528
3083
  constructor(httpRequest, config = defaultConfig) {
3529
- __privateAdd(this, _clientConfig, void 0), __privateAdd(this, _httpRequest, void 0), this.listen = _listen, this.config(config), __privateSet(this, _httpRequest, httpRequest), this.assets = new ObservableAssetsClient(this, __privateGet(this, _httpRequest)), this.datasets = new ObservableDatasetsClient(this, __privateGet(this, _httpRequest)), this.projects = new ObservableProjectsClient(this, __privateGet(this, _httpRequest)), this.users = new ObservableUsersClient(this, __privateGet(this, _httpRequest));
3084
+ __publicField(this, "assets"), __publicField(this, "datasets"), __publicField(this, "projects"), __publicField(this, "users"), __privateAdd(this, _clientConfig, void 0), __privateAdd(this, _httpRequest, void 0), __publicField(this, "listen", _listen), this.config(config), __privateSet(this, _httpRequest, httpRequest), this.assets = new ObservableAssetsClient(this, __privateGet(this, _httpRequest)), this.datasets = new ObservableDatasetsClient(this, __privateGet(this, _httpRequest)), this.projects = new ObservableProjectsClient(this, __privateGet(this, _httpRequest)), this.users = new ObservableUsersClient(this, __privateGet(this, _httpRequest));
3530
3085
  }
3531
3086
  /**
3532
3087
  * Clone the client - returns a new instance
@@ -3655,7 +3210,7 @@ ${selectionOpts}`);
3655
3210
  var _clientConfig2, _httpRequest2;
3656
3211
  const _SanityClient = class _SanityClient2 {
3657
3212
  constructor(httpRequest, config = defaultConfig) {
3658
- __privateAdd(this, _clientConfig2, void 0), __privateAdd(this, _httpRequest2, void 0), this.listen = _listen, this.config(config), __privateSet(this, _httpRequest2, httpRequest), this.assets = new AssetsClient(this, __privateGet(this, _httpRequest2)), this.datasets = new DatasetsClient(this, __privateGet(this, _httpRequest2)), this.projects = new ProjectsClient(this, __privateGet(this, _httpRequest2)), this.users = new UsersClient(this, __privateGet(this, _httpRequest2)), this.observable = new ObservableSanityClient(httpRequest, config);
3213
+ __publicField(this, "assets"), __publicField(this, "datasets"), __publicField(this, "projects"), __publicField(this, "users"), __publicField(this, "observable"), __privateAdd(this, _clientConfig2, void 0), __privateAdd(this, _httpRequest2, void 0), __publicField(this, "listen", _listen), this.config(config), __privateSet(this, _httpRequest2, httpRequest), this.assets = new AssetsClient(this, __privateGet(this, _httpRequest2)), this.datasets = new DatasetsClient(this, __privateGet(this, _httpRequest2)), this.projects = new ProjectsClient(this, __privateGet(this, _httpRequest2)), this.users = new UsersClient(this, __privateGet(this, _httpRequest2)), this.observable = new ObservableSanityClient(httpRequest, config);
3659
3214
  }
3660
3215
  /**
3661
3216
  * Clone the client - returns a new instance
@@ -4156,6 +3711,12 @@ ${selectionOpts}`);
4156
3711
  s: stegaEncodeSourceMap
4157
3712
  });
4158
3713
 
3714
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
3715
+
3716
+ function getDefaultExportFromCjs (x) {
3717
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3718
+ }
3719
+
4159
3720
  var eventsource = {exports: {}};
4160
3721
 
4161
3722
  /** @license