@medplum/agent 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cjs/index.cjs +693 -687
  2. package/package.json +5 -5
@@ -12,13 +12,13 @@ var __export = (target, all) => {
12
12
  for (var name in all)
13
13
  __defProp(target, name, { get: all[name], enumerable: true });
14
14
  };
15
- var __copyProps = (to, from, except, desc) => {
15
+ var __copyProps = (to2, from, except, desc) => {
16
16
  if (from && typeof from === "object" || typeof from === "function") {
17
17
  for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ if (!__hasOwnProp.call(to2, key) && key !== except)
19
+ __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
20
  }
21
- return to;
21
+ return to2;
22
22
  };
23
23
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
24
  // If the importer is in node compatibility mode or this is not an ESM
@@ -50,7 +50,7 @@ var require_stream = __commonJS({
50
50
  this.emit("error", err);
51
51
  }
52
52
  }
53
- function createWebSocketStream2(ws, options) {
53
+ function createWebSocketStream2(ws2, options) {
54
54
  let terminateOnDestroy = true;
55
55
  const duplex = new Duplex({
56
56
  ...options,
@@ -59,73 +59,73 @@ var require_stream = __commonJS({
59
59
  objectMode: false,
60
60
  writableObjectMode: false
61
61
  });
62
- ws.on("message", function message(msg, isBinary) {
62
+ ws2.on("message", function message(msg, isBinary) {
63
63
  const data2 = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
64
64
  if (!duplex.push(data2))
65
- ws.pause();
65
+ ws2.pause();
66
66
  });
67
- ws.once("error", function error(err) {
67
+ ws2.once("error", function error(err) {
68
68
  if (duplex.destroyed)
69
69
  return;
70
70
  terminateOnDestroy = false;
71
71
  duplex.destroy(err);
72
72
  });
73
- ws.once("close", function close() {
73
+ ws2.once("close", function close() {
74
74
  if (duplex.destroyed)
75
75
  return;
76
76
  duplex.push(null);
77
77
  });
78
78
  duplex._destroy = function(err, callback) {
79
- if (ws.readyState === ws.CLOSED) {
79
+ if (ws2.readyState === ws2.CLOSED) {
80
80
  callback(err);
81
81
  process.nextTick(emitClose, duplex);
82
82
  return;
83
83
  }
84
84
  let called = false;
85
- ws.once("error", function error(err2) {
85
+ ws2.once("error", function error(err2) {
86
86
  called = true;
87
87
  callback(err2);
88
88
  });
89
- ws.once("close", function close() {
89
+ ws2.once("close", function close() {
90
90
  if (!called)
91
91
  callback(err);
92
92
  process.nextTick(emitClose, duplex);
93
93
  });
94
94
  if (terminateOnDestroy)
95
- ws.terminate();
95
+ ws2.terminate();
96
96
  };
97
97
  duplex._final = function(callback) {
98
- if (ws.readyState === ws.CONNECTING) {
99
- ws.once("open", function open() {
98
+ if (ws2.readyState === ws2.CONNECTING) {
99
+ ws2.once("open", function open() {
100
100
  duplex._final(callback);
101
101
  });
102
102
  return;
103
103
  }
104
- if (ws._socket === null)
104
+ if (ws2._socket === null)
105
105
  return;
106
- if (ws._socket._writableState.finished) {
106
+ if (ws2._socket._writableState.finished) {
107
107
  callback();
108
108
  if (duplex._readableState.endEmitted)
109
109
  duplex.destroy();
110
110
  } else {
111
- ws._socket.once("finish", function finish() {
111
+ ws2._socket.once("finish", function finish() {
112
112
  callback();
113
113
  });
114
- ws.close();
114
+ ws2.close();
115
115
  }
116
116
  };
117
117
  duplex._read = function() {
118
- if (ws.isPaused)
119
- ws.resume();
118
+ if (ws2.isPaused)
119
+ ws2.resume();
120
120
  };
121
121
  duplex._write = function(chunk, encoding, callback) {
122
- if (ws.readyState === ws.CONNECTING) {
123
- ws.once("open", function open() {
122
+ if (ws2.readyState === ws2.CONNECTING) {
123
+ ws2.once("open", function open() {
124
124
  duplex._write(chunk, encoding, callback);
125
125
  });
126
126
  return;
127
127
  }
128
- ws.send(chunk, callback);
128
+ ws2.send(chunk, callback);
129
129
  };
130
130
  duplex.on("end", duplexOnEnd);
131
131
  duplex.on("error", duplexOnError);
@@ -3535,12 +3535,12 @@ var require_websocket_server = __commonJS({
3535
3535
  "Connection: Upgrade",
3536
3536
  `Sec-WebSocket-Accept: ${digest}`
3537
3537
  ];
3538
- const ws = new this.options.WebSocket(null, void 0, this.options);
3538
+ const ws2 = new this.options.WebSocket(null, void 0, this.options);
3539
3539
  if (protocols.size) {
3540
3540
  const protocol = this.options.handleProtocols ? this.options.handleProtocols(protocols, req) : protocols.values().next().value;
3541
3541
  if (protocol) {
3542
3542
  headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
3543
- ws._protocol = protocol;
3543
+ ws2._protocol = protocol;
3544
3544
  }
3545
3545
  }
3546
3546
  if (extensions[PerMessageDeflate.extensionName]) {
@@ -3549,26 +3549,26 @@ var require_websocket_server = __commonJS({
3549
3549
  [PerMessageDeflate.extensionName]: [params]
3550
3550
  });
3551
3551
  headers.push(`Sec-WebSocket-Extensions: ${value}`);
3552
- ws._extensions = extensions;
3552
+ ws2._extensions = extensions;
3553
3553
  }
3554
3554
  this.emit("headers", headers, req);
3555
3555
  socket.write(headers.concat("\r\n").join("\r\n"));
3556
3556
  socket.removeListener("error", socketOnError);
3557
- ws.setSocket(socket, head, {
3557
+ ws2.setSocket(socket, head, {
3558
3558
  allowSynchronousEvents: this.options.allowSynchronousEvents,
3559
3559
  maxPayload: this.options.maxPayload,
3560
3560
  skipUTF8Validation: this.options.skipUTF8Validation
3561
3561
  });
3562
3562
  if (this.clients) {
3563
- this.clients.add(ws);
3564
- ws.on("close", () => {
3565
- this.clients.delete(ws);
3563
+ this.clients.add(ws2);
3564
+ ws2.on("close", () => {
3565
+ this.clients.delete(ws2);
3566
3566
  if (this._shouldEmitClose && !this.clients.size) {
3567
3567
  process.nextTick(emitClose, this);
3568
3568
  }
3569
3569
  });
3570
3570
  }
3571
- cb(ws, req);
3571
+ cb(ws2, req);
3572
3572
  }
3573
3573
  };
3574
3574
  module2.exports = WebSocketServer2;
@@ -3734,9 +3734,9 @@ var require_dcmjs = __commonJS({
3734
3734
  }
3735
3735
  interpolate(level) {
3736
3736
  return this.options.template.replace(/{{([^{}]*)}}/g, (stache, prop) => {
3737
- const fn2 = this.options[prop];
3738
- if (fn2) {
3739
- return fn2({ level, logger: this.logger });
3737
+ const fn = this.options[prop];
3738
+ if (fn) {
3739
+ return fn({ level, logger: this.logger });
3740
3740
  }
3741
3741
  return stache;
3742
3742
  });
@@ -4022,8 +4022,8 @@ var require_dcmjs = __commonJS({
4022
4022
  }
4023
4023
  return _construct.apply(null, arguments);
4024
4024
  }
4025
- function _isNativeFunction(fn2) {
4026
- return Function.toString.call(fn2).indexOf("[native code]") !== -1;
4025
+ function _isNativeFunction(fn) {
4026
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
4027
4027
  }
4028
4028
  function _wrapNativeSuper(Class) {
4029
4029
  var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
@@ -4130,23 +4130,23 @@ var require_dcmjs = __commonJS({
4130
4130
  var _arr = [];
4131
4131
  var _n2 = true;
4132
4132
  var _d = false;
4133
- var _s, _e2;
4133
+ var _s2, _e;
4134
4134
  try {
4135
- for (_i2 = _i2.call(arr); !(_n2 = (_s = _i2.next()).done); _n2 = true) {
4136
- _arr.push(_s.value);
4135
+ for (_i2 = _i2.call(arr); !(_n2 = (_s2 = _i2.next()).done); _n2 = true) {
4136
+ _arr.push(_s2.value);
4137
4137
  if (i2 && _arr.length === i2)
4138
4138
  break;
4139
4139
  }
4140
4140
  } catch (err2) {
4141
4141
  _d = true;
4142
- _e2 = err2;
4142
+ _e = err2;
4143
4143
  } finally {
4144
4144
  try {
4145
4145
  if (!_n2 && _i2["return"] != null)
4146
4146
  _i2["return"]();
4147
4147
  } finally {
4148
4148
  if (_d)
4149
- throw _e2;
4149
+ throw _e;
4150
4150
  }
4151
4151
  }
4152
4152
  return _arr;
@@ -4178,11 +4178,11 @@ var require_dcmjs = __commonJS({
4178
4178
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4179
4179
  }
4180
4180
  function _createForOfIteratorHelper(o, allowArrayLike) {
4181
- var it2 = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
4182
- if (!it2) {
4183
- if (Array.isArray(o) || (it2 = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
4184
- if (it2)
4185
- o = it2;
4181
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
4182
+ if (!it) {
4183
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
4184
+ if (it)
4185
+ o = it;
4186
4186
  var i2 = 0;
4187
4187
  var F2 = function() {
4188
4188
  };
@@ -4209,10 +4209,10 @@ var require_dcmjs = __commonJS({
4209
4209
  var normalCompletion = true, didErr = false, err2;
4210
4210
  return {
4211
4211
  s: function() {
4212
- it2 = it2.call(o);
4212
+ it = it.call(o);
4213
4213
  },
4214
4214
  n: function() {
4215
- var step = it2.next();
4215
+ var step = it.next();
4216
4216
  normalCompletion = step.done;
4217
4217
  return step;
4218
4218
  },
@@ -4222,8 +4222,8 @@ var require_dcmjs = __commonJS({
4222
4222
  },
4223
4223
  f: function() {
4224
4224
  try {
4225
- if (!normalCompletion && it2.return != null)
4226
- it2.return();
4225
+ if (!normalCompletion && it.return != null)
4226
+ it.return();
4227
4227
  } finally {
4228
4228
  if (didErr)
4229
4229
  throw err2;
@@ -11192,12 +11192,12 @@ var require_dcmjs = __commonJS({
11192
11192
  value: function xyz2LAB(xyz) {
11193
11193
  var whitePoint = Colors2.d65WhitePointXYZ();
11194
11194
  var X2 = xyz[0] / whitePoint[0];
11195
- var Y2 = xyz[1] / whitePoint[1];
11195
+ var Y = xyz[1] / whitePoint[1];
11196
11196
  var Z2 = xyz[2] / whitePoint[2];
11197
11197
  X2 = Colors2.labf(X2);
11198
- Y2 = Colors2.labf(Y2);
11198
+ Y = Colors2.labf(Y);
11199
11199
  Z2 = Colors2.labf(Z2);
11200
- return [116 * Y2 - 16, 500 * (X2 - Y2), 200 * (Y2 - Z2)];
11200
+ return [116 * Y - 16, 500 * (X2 - Y), 200 * (Y - Z2)];
11201
11201
  }
11202
11202
  }, {
11203
11203
  key: "lab2RGB",
@@ -14187,13 +14187,13 @@ var require_dcmjs = __commonJS({
14187
14187
  referencedFramesPerSegment.push([]);
14188
14188
  }
14189
14189
  }
14190
- for (var z = 0; z < images.length; z++) {
14191
- var imageId = images[z].imageId;
14190
+ for (var z2 = 0; z2 < images.length; z2++) {
14191
+ var imageId = images[z2].imageId;
14192
14192
  var imageIdSpecificToolState = toolState[imageId];
14193
14193
  for (var _i2 = 0; _i2 < segmentIndicies.length; _i2++) {
14194
14194
  var segIdx = segmentIndicies[_i2];
14195
14195
  if (imageIdSpecificToolState && imageIdSpecificToolState.brush && imageIdSpecificToolState.brush.data && imageIdSpecificToolState.brush.data[segIdx] && imageIdSpecificToolState.brush.data[segIdx].pixelData) {
14196
- referencedFramesPerSegment[_i2].push(z);
14196
+ referencedFramesPerSegment[_i2].push(z2);
14197
14197
  }
14198
14198
  }
14199
14199
  }
@@ -14431,14 +14431,14 @@ var require_dcmjs = __commonJS({
14431
14431
  function length(a) {
14432
14432
  var x2 = a[0];
14433
14433
  var y = a[1];
14434
- var z = a[2];
14435
- return Math.hypot(x2, y, z);
14434
+ var z2 = a[2];
14435
+ return Math.hypot(x2, y, z2);
14436
14436
  }
14437
- function fromValues(x2, y, z) {
14437
+ function fromValues(x2, y, z2) {
14438
14438
  var out = new ARRAY_TYPE(3);
14439
14439
  out[0] = x2;
14440
14440
  out[1] = y;
14441
- out[2] = z;
14441
+ out[2] = z2;
14442
14442
  return out;
14443
14443
  }
14444
14444
  function copy(out, a) {
@@ -14447,10 +14447,10 @@ var require_dcmjs = __commonJS({
14447
14447
  out[2] = a[2];
14448
14448
  return out;
14449
14449
  }
14450
- function set(out, x2, y, z) {
14450
+ function set(out, x2, y, z2) {
14451
14451
  out[0] = x2;
14452
14452
  out[1] = y;
14453
- out[2] = z;
14453
+ out[2] = z2;
14454
14454
  return out;
14455
14455
  }
14456
14456
  function add(out, a, b2) {
@@ -14522,20 +14522,20 @@ var require_dcmjs = __commonJS({
14522
14522
  function distance(a, b2) {
14523
14523
  var x2 = b2[0] - a[0];
14524
14524
  var y = b2[1] - a[1];
14525
- var z = b2[2] - a[2];
14526
- return Math.hypot(x2, y, z);
14525
+ var z2 = b2[2] - a[2];
14526
+ return Math.hypot(x2, y, z2);
14527
14527
  }
14528
14528
  function squaredDistance(a, b2) {
14529
14529
  var x2 = b2[0] - a[0];
14530
14530
  var y = b2[1] - a[1];
14531
- var z = b2[2] - a[2];
14532
- return x2 * x2 + y * y + z * z;
14531
+ var z2 = b2[2] - a[2];
14532
+ return x2 * x2 + y * y + z2 * z2;
14533
14533
  }
14534
14534
  function squaredLength(a) {
14535
14535
  var x2 = a[0];
14536
14536
  var y = a[1];
14537
- var z = a[2];
14538
- return x2 * x2 + y * y + z * z;
14537
+ var z2 = a[2];
14538
+ return x2 * x2 + y * y + z2 * z2;
14539
14539
  }
14540
14540
  function negate(out, a) {
14541
14541
  out[0] = -a[0];
@@ -14552,8 +14552,8 @@ var require_dcmjs = __commonJS({
14552
14552
  function normalize$1(out, a) {
14553
14553
  var x2 = a[0];
14554
14554
  var y = a[1];
14555
- var z = a[2];
14556
- var len2 = x2 * x2 + y * y + z * z;
14555
+ var z2 = a[2];
14556
+ var len2 = x2 * x2 + y * y + z2 * z2;
14557
14557
  if (len2 > 0) {
14558
14558
  len2 = 1 / Math.sqrt(len2);
14559
14559
  }
@@ -14609,33 +14609,33 @@ var require_dcmjs = __commonJS({
14609
14609
  function random(out, scale2) {
14610
14610
  scale2 = scale2 || 1;
14611
14611
  var r4 = RANDOM() * 2 * Math.PI;
14612
- var z = RANDOM() * 2 - 1;
14613
- var zScale = Math.sqrt(1 - z * z) * scale2;
14612
+ var z2 = RANDOM() * 2 - 1;
14613
+ var zScale = Math.sqrt(1 - z2 * z2) * scale2;
14614
14614
  out[0] = Math.cos(r4) * zScale;
14615
14615
  out[1] = Math.sin(r4) * zScale;
14616
- out[2] = z * scale2;
14616
+ out[2] = z2 * scale2;
14617
14617
  return out;
14618
14618
  }
14619
14619
  function transformMat4(out, a, m3) {
14620
- var x2 = a[0], y = a[1], z = a[2];
14621
- var w2 = m3[3] * x2 + m3[7] * y + m3[11] * z + m3[15];
14620
+ var x2 = a[0], y = a[1], z2 = a[2];
14621
+ var w2 = m3[3] * x2 + m3[7] * y + m3[11] * z2 + m3[15];
14622
14622
  w2 = w2 || 1;
14623
- out[0] = (m3[0] * x2 + m3[4] * y + m3[8] * z + m3[12]) / w2;
14624
- out[1] = (m3[1] * x2 + m3[5] * y + m3[9] * z + m3[13]) / w2;
14625
- out[2] = (m3[2] * x2 + m3[6] * y + m3[10] * z + m3[14]) / w2;
14623
+ out[0] = (m3[0] * x2 + m3[4] * y + m3[8] * z2 + m3[12]) / w2;
14624
+ out[1] = (m3[1] * x2 + m3[5] * y + m3[9] * z2 + m3[13]) / w2;
14625
+ out[2] = (m3[2] * x2 + m3[6] * y + m3[10] * z2 + m3[14]) / w2;
14626
14626
  return out;
14627
14627
  }
14628
14628
  function transformMat3(out, a, m3) {
14629
- var x2 = a[0], y = a[1], z = a[2];
14630
- out[0] = x2 * m3[0] + y * m3[3] + z * m3[6];
14631
- out[1] = x2 * m3[1] + y * m3[4] + z * m3[7];
14632
- out[2] = x2 * m3[2] + y * m3[5] + z * m3[8];
14629
+ var x2 = a[0], y = a[1], z2 = a[2];
14630
+ out[0] = x2 * m3[0] + y * m3[3] + z2 * m3[6];
14631
+ out[1] = x2 * m3[1] + y * m3[4] + z2 * m3[7];
14632
+ out[2] = x2 * m3[2] + y * m3[5] + z2 * m3[8];
14633
14633
  return out;
14634
14634
  }
14635
14635
  function transformQuat(out, a, q2) {
14636
14636
  var qx = q2[0], qy = q2[1], qz = q2[2], qw = q2[3];
14637
- var x2 = a[0], y = a[1], z = a[2];
14638
- var uvx = qy * z - qz * y, uvy = qz * x2 - qx * z, uvz = qx * y - qy * x2;
14637
+ var x2 = a[0], y = a[1], z2 = a[2];
14638
+ var uvx = qy * z2 - qz * y, uvy = qz * x2 - qx * z2, uvz = qx * y - qy * x2;
14639
14639
  var uuvx = qy * uvz - qz * uvy, uuvy = qz * uvx - qx * uvz, uuvz = qx * uvy - qy * uvx;
14640
14640
  var w2 = qw * 2;
14641
14641
  uvx *= w2;
@@ -14646,7 +14646,7 @@ var require_dcmjs = __commonJS({
14646
14646
  uuvz *= 2;
14647
14647
  out[0] = x2 + uvx + uuvx;
14648
14648
  out[1] = y + uvy + uuvy;
14649
- out[2] = z + uvz + uuvz;
14649
+ out[2] = z2 + uvz + uuvz;
14650
14650
  return out;
14651
14651
  }
14652
14652
  function rotateX(out, a, b2, rad) {
@@ -14718,7 +14718,7 @@ var require_dcmjs = __commonJS({
14718
14718
  var sqrLen = squaredLength;
14719
14719
  var forEach = function() {
14720
14720
  var vec = create();
14721
- return function(a, stride, offset, count, fn2, arg) {
14721
+ return function(a, stride, offset, count, fn, arg) {
14722
14722
  var i2, l3;
14723
14723
  if (!stride) {
14724
14724
  stride = 3;
@@ -14735,7 +14735,7 @@ var require_dcmjs = __commonJS({
14735
14735
  vec[0] = a[i2];
14736
14736
  vec[1] = a[i2 + 1];
14737
14737
  vec[2] = a[i2 + 2];
14738
- fn2(vec, vec, arg);
14738
+ fn(vec, vec, arg);
14739
14739
  a[i2] = vec[0];
14740
14740
  a[i2 + 1] = vec[1];
14741
14741
  a[i2 + 2] = vec[2];
@@ -20861,7 +20861,7 @@ var require_dcmjs = __commonJS({
20861
20861
  __proto__: null,
20862
20862
  Comprehensive3DSR
20863
20863
  });
20864
- var sr = {
20864
+ var sr2 = {
20865
20865
  coding,
20866
20866
  contentItems,
20867
20867
  documents,
@@ -21173,7 +21173,7 @@ var require_dcmjs = __commonJS({
21173
21173
  data: data2,
21174
21174
  derivations,
21175
21175
  normalizers,
21176
- sr,
21176
+ sr: sr2,
21177
21177
  utilities,
21178
21178
  log,
21179
21179
  anonymizer
@@ -21186,7 +21186,7 @@ var require_dcmjs = __commonJS({
21186
21186
  exports3.derivations = derivations;
21187
21187
  exports3.log = log;
21188
21188
  exports3.normalizers = normalizers;
21189
- exports3.sr = sr;
21189
+ exports3.sr = sr2;
21190
21190
  exports3.utilities = utilities;
21191
21191
  Object.defineProperty(exports3, "__esModule", { value: true });
21192
21192
  });
@@ -21211,12 +21211,12 @@ var require_once = __commonJS({
21211
21211
  value: true
21212
21212
  });
21213
21213
  exports2.default = once;
21214
- function once(fn2) {
21214
+ function once(fn) {
21215
21215
  return function() {
21216
- if (fn2 === null)
21216
+ if (fn === null)
21217
21217
  return;
21218
- var callFn = fn2;
21219
- fn2 = null;
21218
+ var callFn = fn;
21219
+ fn = null;
21220
21220
  callFn.apply(this, arguments);
21221
21221
  };
21222
21222
  }
@@ -21757,12 +21757,12 @@ var require_onlyOnce = __commonJS({
21757
21757
  value: true
21758
21758
  });
21759
21759
  exports2.default = onlyOnce;
21760
- function onlyOnce(fn2) {
21760
+ function onlyOnce(fn) {
21761
21761
  return function() {
21762
- if (fn2 === null)
21762
+ if (fn === null)
21763
21763
  throw new Error("Callback was already called.");
21764
- var callFn = fn2;
21765
- fn2 = null;
21764
+ var callFn = fn;
21765
+ fn = null;
21766
21766
  callFn.apply(this, arguments);
21767
21767
  };
21768
21768
  }
@@ -21893,11 +21893,11 @@ var require_initialParams = __commonJS({
21893
21893
  Object.defineProperty(exports2, "__esModule", {
21894
21894
  value: true
21895
21895
  });
21896
- exports2.default = function(fn2) {
21896
+ exports2.default = function(fn) {
21897
21897
  return function() {
21898
21898
  var args = (0, _slice2.default)(arguments);
21899
21899
  var callback = args.pop();
21900
- fn2.call(this, args, callback);
21900
+ fn.call(this, args, callback);
21901
21901
  };
21902
21902
  };
21903
21903
  var _slice = require_slice();
@@ -21926,14 +21926,14 @@ var require_setImmediate = __commonJS({
21926
21926
  }
21927
21927
  var hasSetImmediate = exports2.hasSetImmediate = typeof setImmediate === "function" && setImmediate;
21928
21928
  var hasNextTick = exports2.hasNextTick = typeof process === "object" && typeof process.nextTick === "function";
21929
- function fallback(fn2) {
21930
- setTimeout(fn2, 0);
21929
+ function fallback(fn) {
21930
+ setTimeout(fn, 0);
21931
21931
  }
21932
21932
  function wrap(defer) {
21933
- return function(fn2) {
21933
+ return function(fn) {
21934
21934
  var args = (0, _slice2.default)(arguments, 1);
21935
21935
  defer(function() {
21936
- fn2.apply(null, args);
21936
+ fn.apply(null, args);
21937
21937
  });
21938
21938
  };
21939
21939
  }
@@ -22013,8 +22013,8 @@ var require_wrapAsync = __commonJS({
22013
22013
  return obj && obj.__esModule ? obj : { default: obj };
22014
22014
  }
22015
22015
  var supportsSymbol = typeof Symbol === "function";
22016
- function isAsync(fn2) {
22017
- return supportsSymbol && fn2[Symbol.toStringTag] === "AsyncFunction";
22016
+ function isAsync(fn) {
22017
+ return supportsSymbol && fn[Symbol.toStringTag] === "AsyncFunction";
22018
22018
  }
22019
22019
  function wrapAsync(asyncFn) {
22020
22020
  return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;
@@ -22056,9 +22056,9 @@ var require_doLimit = __commonJS({
22056
22056
  value: true
22057
22057
  });
22058
22058
  exports2.default = doLimit;
22059
- function doLimit(fn2, limit) {
22059
+ function doLimit(fn, limit) {
22060
22060
  return function(iterable, iteratee, callback) {
22061
- return fn2(iterable, limit, iteratee, callback);
22061
+ return fn(iterable, limit, iteratee, callback);
22062
22062
  };
22063
22063
  }
22064
22064
  module2.exports = exports2["default"];
@@ -22110,17 +22110,17 @@ var require_AsyncEventEmitter = __commonJS({
22110
22110
  callback = void 0;
22111
22111
  }
22112
22112
  listeners = Array.isArray(listeners) ? listeners : [listeners];
22113
- eachSeries(listeners.slice(), function(fn2, next) {
22113
+ eachSeries(listeners.slice(), function(fn, next) {
22114
22114
  var err;
22115
- if (fn2.length < 2) {
22115
+ if (fn.length < 2) {
22116
22116
  try {
22117
- fn2.call(self2, data2);
22117
+ fn.call(self2, data2);
22118
22118
  } catch (e) {
22119
22119
  err = e;
22120
22120
  }
22121
22121
  return next(err);
22122
22122
  }
22123
- fn2.call(self2, data2, next);
22123
+ fn.call(self2, data2, next);
22124
22124
  }, callback);
22125
22125
  return self2;
22126
22126
  };
@@ -23642,11 +23642,11 @@ var require_decorator = __commonJS({
23642
23642
  };
23643
23643
  };
23644
23644
  var mergeDecorators = (d1, d22) => {
23645
- var _a, _b, _c, _d, _e2, _f;
23645
+ var _a, _b, _c, _d, _e, _f;
23646
23646
  return {
23647
23647
  class: (0, util_1.unique)([...(_a = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a !== void 0 ? _a : [], ...(_b = d22 === null || d22 === void 0 ? void 0 : d22.class) !== null && _b !== void 0 ? _b : []]),
23648
23648
  static: mergePropertyAndMethodDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.static) !== null && _c !== void 0 ? _c : {}, (_d = d22 === null || d22 === void 0 ? void 0 : d22.static) !== null && _d !== void 0 ? _d : {}),
23649
- instance: mergePropertyAndMethodDecorators((_e2 = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e2 !== void 0 ? _e2 : {}, (_f = d22 === null || d22 === void 0 ? void 0 : d22.instance) !== null && _f !== void 0 ? _f : {})
23649
+ instance: mergePropertyAndMethodDecorators((_e = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e !== void 0 ? _e : {}, (_f = d22 === null || d22 === void 0 ? void 0 : d22.instance) !== null && _f !== void 0 ? _f : {})
23650
23650
  };
23651
23651
  };
23652
23652
  var decorators = /* @__PURE__ */ new Map();
@@ -23944,7 +23944,7 @@ var require_has_flag = __commonJS({
23944
23944
  var require_supports_colors = __commonJS({
23945
23945
  "../../node_modules/logform/node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) {
23946
23946
  "use strict";
23947
- var os2 = require("os");
23947
+ var os = require("os");
23948
23948
  var hasFlag = require_has_flag();
23949
23949
  var env = process.env;
23950
23950
  var forceColor = void 0;
@@ -23982,7 +23982,7 @@ var require_supports_colors = __commonJS({
23982
23982
  }
23983
23983
  var min = forceColor ? 1 : 0;
23984
23984
  if (process.platform === "win32") {
23985
- var osRelease = os2.release().split(".");
23985
+ var osRelease = os.release().split(".");
23986
23986
  if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
23987
23987
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
23988
23988
  }
@@ -27703,11 +27703,11 @@ var require_from = __commonJS({
27703
27703
  Promise.resolve(value).then(_next, _throw);
27704
27704
  }
27705
27705
  }
27706
- function _asyncToGenerator(fn2) {
27706
+ function _asyncToGenerator(fn) {
27707
27707
  return function() {
27708
27708
  var self2 = this, args = arguments;
27709
27709
  return new Promise(function(resolve, reject) {
27710
- var gen = fn2.apply(self2, args);
27710
+ var gen = fn.apply(self2, args);
27711
27711
  function _next(value) {
27712
27712
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
27713
27713
  }
@@ -27855,15 +27855,15 @@ var require_stream_readable = __commonJS({
27855
27855
  require_inherits()(Readable, Stream);
27856
27856
  var errorOrDestroy = destroyImpl.errorOrDestroy;
27857
27857
  var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
27858
- function prependListener(emitter, event, fn2) {
27858
+ function prependListener(emitter, event, fn) {
27859
27859
  if (typeof emitter.prependListener === "function")
27860
- return emitter.prependListener(event, fn2);
27860
+ return emitter.prependListener(event, fn);
27861
27861
  if (!emitter._events || !emitter._events[event])
27862
- emitter.on(event, fn2);
27862
+ emitter.on(event, fn);
27863
27863
  else if (Array.isArray(emitter._events[event]))
27864
- emitter._events[event].unshift(fn2);
27864
+ emitter._events[event].unshift(fn);
27865
27865
  else
27866
- emitter._events[event] = [fn2, emitter._events[event]];
27866
+ emitter._events[event] = [fn, emitter._events[event]];
27867
27867
  }
27868
27868
  function ReadableState(options, stream, isDuplex) {
27869
27869
  Duplex = Duplex || require_stream_duplex();
@@ -28357,8 +28357,8 @@ var require_stream_readable = __commonJS({
28357
28357
  dest.emit("unpipe", this, unpipeInfo);
28358
28358
  return this;
28359
28359
  };
28360
- Readable.prototype.on = function(ev, fn2) {
28361
- var res = Stream.prototype.on.call(this, ev, fn2);
28360
+ Readable.prototype.on = function(ev, fn) {
28361
+ var res = Stream.prototype.on.call(this, ev, fn);
28362
28362
  var state = this._readableState;
28363
28363
  if (ev === "data") {
28364
28364
  state.readableListening = this.listenerCount("readable") > 0;
@@ -28380,8 +28380,8 @@ var require_stream_readable = __commonJS({
28380
28380
  return res;
28381
28381
  };
28382
28382
  Readable.prototype.addListener = Readable.prototype.on;
28383
- Readable.prototype.removeListener = function(ev, fn2) {
28384
- var res = Stream.prototype.removeListener.call(this, ev, fn2);
28383
+ Readable.prototype.removeListener = function(ev, fn) {
28384
+ var res = Stream.prototype.removeListener.call(this, ev, fn);
28385
28385
  if (ev === "readable") {
28386
28386
  process.nextTick(updateReadableListening, this);
28387
28387
  }
@@ -29402,7 +29402,7 @@ var require_winston_transport = __commonJS({
29402
29402
  var require_console = __commonJS({
29403
29403
  "../../node_modules/winston/lib/winston/transports/console.js"(exports2, module2) {
29404
29404
  "use strict";
29405
- var os2 = require("os");
29405
+ var os = require("os");
29406
29406
  var { LEVEL, MESSAGE } = require_triple_beam();
29407
29407
  var TransportStream = require_winston_transport();
29408
29408
  module2.exports = class Console extends TransportStream {
@@ -29416,7 +29416,7 @@ var require_console = __commonJS({
29416
29416
  this.name = options.name || "console";
29417
29417
  this.stderrLevels = this._stringArrayToSet(options.stderrLevels);
29418
29418
  this.consoleWarnLevels = this._stringArrayToSet(options.consoleWarnLevels);
29419
- this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
29419
+ this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
29420
29420
  this.setMaxListeners(30);
29421
29421
  }
29422
29422
  /**
@@ -29506,10 +29506,10 @@ var require_initialParams2 = __commonJS({
29506
29506
  Object.defineProperty(exports2, "__esModule", {
29507
29507
  value: true
29508
29508
  });
29509
- exports2.default = function(fn2) {
29509
+ exports2.default = function(fn) {
29510
29510
  return function(...args) {
29511
29511
  var callback = args.pop();
29512
- return fn2.call(this, args, callback);
29512
+ return fn.call(this, args, callback);
29513
29513
  };
29514
29514
  };
29515
29515
  module2.exports = exports2.default;
@@ -29528,11 +29528,11 @@ var require_setImmediate2 = __commonJS({
29528
29528
  var hasQueueMicrotask = exports2.hasQueueMicrotask = typeof queueMicrotask === "function" && queueMicrotask;
29529
29529
  var hasSetImmediate = exports2.hasSetImmediate = typeof setImmediate === "function" && setImmediate;
29530
29530
  var hasNextTick = exports2.hasNextTick = typeof process === "object" && typeof process.nextTick === "function";
29531
- function fallback(fn2) {
29532
- setTimeout(fn2, 0);
29531
+ function fallback(fn) {
29532
+ setTimeout(fn, 0);
29533
29533
  }
29534
29534
  function wrap(defer) {
29535
- return (fn2, ...args) => defer(() => fn2(...args));
29535
+ return (fn, ...args) => defer(() => fn(...args));
29536
29536
  }
29537
29537
  var _defer;
29538
29538
  if (hasQueueMicrotask) {
@@ -29619,11 +29619,11 @@ var require_wrapAsync2 = __commonJS({
29619
29619
  function _interopRequireDefault(obj) {
29620
29620
  return obj && obj.__esModule ? obj : { default: obj };
29621
29621
  }
29622
- function isAsync(fn2) {
29623
- return fn2[Symbol.toStringTag] === "AsyncFunction";
29622
+ function isAsync(fn) {
29623
+ return fn[Symbol.toStringTag] === "AsyncFunction";
29624
29624
  }
29625
- function isAsyncGenerator(fn2) {
29626
- return fn2[Symbol.toStringTag] === "AsyncGenerator";
29625
+ function isAsyncGenerator(fn) {
29626
+ return fn[Symbol.toStringTag] === "AsyncGenerator";
29627
29627
  }
29628
29628
  function isAsyncIterable(obj) {
29629
29629
  return typeof obj[Symbol.asyncIterator] === "function";
@@ -29712,15 +29712,15 @@ var require_once2 = __commonJS({
29712
29712
  value: true
29713
29713
  });
29714
29714
  exports2.default = once;
29715
- function once(fn2) {
29715
+ function once(fn) {
29716
29716
  function wrapper(...args) {
29717
- if (fn2 === null)
29717
+ if (fn === null)
29718
29718
  return;
29719
- var callFn = fn2;
29720
- fn2 = null;
29719
+ var callFn = fn;
29720
+ fn = null;
29721
29721
  callFn.apply(this, args);
29722
29722
  }
29723
- Object.assign(wrapper, fn2);
29723
+ Object.assign(wrapper, fn);
29724
29724
  return wrapper;
29725
29725
  }
29726
29726
  module2.exports = exports2.default;
@@ -29804,12 +29804,12 @@ var require_onlyOnce2 = __commonJS({
29804
29804
  value: true
29805
29805
  });
29806
29806
  exports2.default = onlyOnce;
29807
- function onlyOnce(fn2) {
29807
+ function onlyOnce(fn) {
29808
29808
  return function(...args) {
29809
- if (fn2 === null)
29809
+ if (fn === null)
29810
29810
  throw new Error("Callback was already called.");
29811
- var callFn = fn2;
29812
- fn2 = null;
29811
+ var callFn = fn;
29812
+ fn = null;
29813
29813
  callFn.apply(this, args);
29814
29814
  };
29815
29815
  }
@@ -31440,11 +31440,11 @@ var require_from2 = __commonJS({
31440
31440
  Promise.resolve(value).then(_next, _throw);
31441
31441
  }
31442
31442
  }
31443
- function _asyncToGenerator(fn2) {
31443
+ function _asyncToGenerator(fn) {
31444
31444
  return function() {
31445
31445
  var self2 = this, args = arguments;
31446
31446
  return new Promise(function(resolve, reject) {
31447
- var gen = fn2.apply(self2, args);
31447
+ var gen = fn.apply(self2, args);
31448
31448
  function _next(value) {
31449
31449
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
31450
31450
  }
@@ -31592,15 +31592,15 @@ var require_stream_readable2 = __commonJS({
31592
31592
  require_inherits()(Readable, Stream);
31593
31593
  var errorOrDestroy = destroyImpl.errorOrDestroy;
31594
31594
  var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
31595
- function prependListener(emitter, event, fn2) {
31595
+ function prependListener(emitter, event, fn) {
31596
31596
  if (typeof emitter.prependListener === "function")
31597
- return emitter.prependListener(event, fn2);
31597
+ return emitter.prependListener(event, fn);
31598
31598
  if (!emitter._events || !emitter._events[event])
31599
- emitter.on(event, fn2);
31599
+ emitter.on(event, fn);
31600
31600
  else if (Array.isArray(emitter._events[event]))
31601
- emitter._events[event].unshift(fn2);
31601
+ emitter._events[event].unshift(fn);
31602
31602
  else
31603
- emitter._events[event] = [fn2, emitter._events[event]];
31603
+ emitter._events[event] = [fn, emitter._events[event]];
31604
31604
  }
31605
31605
  function ReadableState(options, stream, isDuplex) {
31606
31606
  Duplex = Duplex || require_stream_duplex2();
@@ -32094,8 +32094,8 @@ var require_stream_readable2 = __commonJS({
32094
32094
  dest.emit("unpipe", this, unpipeInfo);
32095
32095
  return this;
32096
32096
  };
32097
- Readable.prototype.on = function(ev, fn2) {
32098
- var res = Stream.prototype.on.call(this, ev, fn2);
32097
+ Readable.prototype.on = function(ev, fn) {
32098
+ var res = Stream.prototype.on.call(this, ev, fn);
32099
32099
  var state = this._readableState;
32100
32100
  if (ev === "data") {
32101
32101
  state.readableListening = this.listenerCount("readable") > 0;
@@ -32117,8 +32117,8 @@ var require_stream_readable2 = __commonJS({
32117
32117
  return res;
32118
32118
  };
32119
32119
  Readable.prototype.addListener = Readable.prototype.on;
32120
- Readable.prototype.removeListener = function(ev, fn2) {
32121
- var res = Stream.prototype.removeListener.call(this, ev, fn2);
32120
+ Readable.prototype.removeListener = function(ev, fn) {
32121
+ var res = Stream.prototype.removeListener.call(this, ev, fn);
32122
32122
  if (ev === "readable") {
32123
32123
  process.nextTick(updateReadableListening, this);
32124
32124
  }
@@ -32525,11 +32525,11 @@ var require_pipeline = __commonJS({
32525
32525
  callback(err || new ERR_STREAM_DESTROYED("pipe"));
32526
32526
  };
32527
32527
  }
32528
- function call(fn2) {
32529
- fn2();
32528
+ function call(fn) {
32529
+ fn();
32530
32530
  }
32531
- function pipe(from, to) {
32532
- return from.pipe(to);
32531
+ function pipe(from, to2) {
32532
+ return from.pipe(to2);
32533
32533
  }
32534
32534
  function popCallback(streams) {
32535
32535
  if (!streams.length)
@@ -32623,18 +32623,18 @@ var require_diagnostics = __commonJS({
32623
32623
  return false;
32624
32624
  return new Promise(function pinky(resolve) {
32625
32625
  Promise.all(
32626
- async.map(function prebind(fn2) {
32627
- return fn2(namespace);
32626
+ async.map(function prebind(fn) {
32627
+ return fn(namespace);
32628
32628
  })
32629
32629
  ).then(function resolved(values) {
32630
32630
  resolve(values.some(Boolean));
32631
32631
  });
32632
32632
  });
32633
32633
  }
32634
- function modify(fn2) {
32635
- if (~modifiers.indexOf(fn2))
32634
+ function modify(fn) {
32635
+ if (~modifiers.indexOf(fn))
32636
32636
  return false;
32637
- modifiers.push(fn2);
32637
+ modifiers.push(fn);
32638
32638
  return true;
32639
32639
  }
32640
32640
  function write() {
@@ -32646,14 +32646,14 @@ var require_diagnostics = __commonJS({
32646
32646
  }
32647
32647
  return message;
32648
32648
  }
32649
- function introduce(fn2, options) {
32649
+ function introduce(fn, options) {
32650
32650
  var has = Object.prototype.hasOwnProperty;
32651
32651
  for (var key in options) {
32652
32652
  if (has.call(options, key)) {
32653
- fn2[key] = options[key];
32653
+ fn[key] = options[key];
32654
32654
  }
32655
32655
  }
32656
- return fn2;
32656
+ return fn;
32657
32657
  }
32658
32658
  function nope(options) {
32659
32659
  options.enabled = false;
@@ -32898,9 +32898,9 @@ var require_simple_swizzle = __commonJS({
32898
32898
  }
32899
32899
  return results;
32900
32900
  };
32901
- swizzle.wrap = function(fn2) {
32901
+ swizzle.wrap = function(fn) {
32902
32902
  return function() {
32903
- return fn2(swizzle(arguments));
32903
+ return fn(swizzle(arguments));
32904
32904
  };
32905
32905
  };
32906
32906
  }
@@ -33430,26 +33430,26 @@ var require_conversions = __commonJS({
33430
33430
  b2 = b2 > 0.04045 ? Math.pow((b2 + 0.055) / 1.055, 2.4) : b2 / 12.92;
33431
33431
  var x2 = r4 * 0.4124 + g2 * 0.3576 + b2 * 0.1805;
33432
33432
  var y = r4 * 0.2126 + g2 * 0.7152 + b2 * 0.0722;
33433
- var z = r4 * 0.0193 + g2 * 0.1192 + b2 * 0.9505;
33434
- return [x2 * 100, y * 100, z * 100];
33433
+ var z2 = r4 * 0.0193 + g2 * 0.1192 + b2 * 0.9505;
33434
+ return [x2 * 100, y * 100, z2 * 100];
33435
33435
  };
33436
33436
  convert.rgb.lab = function(rgb) {
33437
33437
  var xyz = convert.rgb.xyz(rgb);
33438
33438
  var x2 = xyz[0];
33439
33439
  var y = xyz[1];
33440
- var z = xyz[2];
33440
+ var z2 = xyz[2];
33441
33441
  var l3;
33442
33442
  var a;
33443
33443
  var b2;
33444
33444
  x2 /= 95.047;
33445
33445
  y /= 100;
33446
- z /= 108.883;
33446
+ z2 /= 108.883;
33447
33447
  x2 = x2 > 8856e-6 ? Math.pow(x2, 1 / 3) : 7.787 * x2 + 16 / 116;
33448
33448
  y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
33449
- z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
33449
+ z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
33450
33450
  l3 = 116 * y - 16;
33451
33451
  a = 500 * (x2 - y);
33452
- b2 = 200 * (y - z);
33452
+ b2 = 200 * (y - z2);
33453
33453
  return [l3, a, b2];
33454
33454
  };
33455
33455
  convert.hsl.rgb = function(hsl) {
@@ -33512,13 +33512,13 @@ var require_conversions = __commonJS({
33512
33512
  var h3 = hsv[0] / 60;
33513
33513
  var s = hsv[1] / 100;
33514
33514
  var v2 = hsv[2] / 100;
33515
- var hi2 = Math.floor(h3) % 6;
33515
+ var hi = Math.floor(h3) % 6;
33516
33516
  var f2 = h3 - Math.floor(h3);
33517
33517
  var p2 = 255 * v2 * (1 - s);
33518
33518
  var q2 = 255 * v2 * (1 - s * f2);
33519
33519
  var t = 255 * v2 * (1 - s * (1 - f2));
33520
33520
  v2 *= 255;
33521
- switch (hi2) {
33521
+ switch (hi) {
33522
33522
  case 0:
33523
33523
  return [v2, t, p2];
33524
33524
  case 1:
@@ -33624,13 +33624,13 @@ var require_conversions = __commonJS({
33624
33624
  convert.xyz.rgb = function(xyz) {
33625
33625
  var x2 = xyz[0] / 100;
33626
33626
  var y = xyz[1] / 100;
33627
- var z = xyz[2] / 100;
33627
+ var z2 = xyz[2] / 100;
33628
33628
  var r4;
33629
33629
  var g2;
33630
33630
  var b2;
33631
- r4 = x2 * 3.2406 + y * -1.5372 + z * -0.4986;
33632
- g2 = x2 * -0.9689 + y * 1.8758 + z * 0.0415;
33633
- b2 = x2 * 0.0557 + y * -0.204 + z * 1.057;
33631
+ r4 = x2 * 3.2406 + y * -1.5372 + z2 * -0.4986;
33632
+ g2 = x2 * -0.9689 + y * 1.8758 + z2 * 0.0415;
33633
+ b2 = x2 * 0.0557 + y * -0.204 + z2 * 1.057;
33634
33634
  r4 = r4 > 31308e-7 ? 1.055 * Math.pow(r4, 1 / 2.4) - 0.055 : r4 * 12.92;
33635
33635
  g2 = g2 > 31308e-7 ? 1.055 * Math.pow(g2, 1 / 2.4) - 0.055 : g2 * 12.92;
33636
33636
  b2 = b2 > 31308e-7 ? 1.055 * Math.pow(b2, 1 / 2.4) - 0.055 : b2 * 12.92;
@@ -33642,19 +33642,19 @@ var require_conversions = __commonJS({
33642
33642
  convert.xyz.lab = function(xyz) {
33643
33643
  var x2 = xyz[0];
33644
33644
  var y = xyz[1];
33645
- var z = xyz[2];
33645
+ var z2 = xyz[2];
33646
33646
  var l3;
33647
33647
  var a;
33648
33648
  var b2;
33649
33649
  x2 /= 95.047;
33650
33650
  y /= 100;
33651
- z /= 108.883;
33651
+ z2 /= 108.883;
33652
33652
  x2 = x2 > 8856e-6 ? Math.pow(x2, 1 / 3) : 7.787 * x2 + 16 / 116;
33653
33653
  y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
33654
- z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
33654
+ z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
33655
33655
  l3 = 116 * y - 16;
33656
33656
  a = 500 * (x2 - y);
33657
- b2 = 200 * (y - z);
33657
+ b2 = 200 * (y - z2);
33658
33658
  return [l3, a, b2];
33659
33659
  };
33660
33660
  convert.lab.xyz = function(lab) {
@@ -33663,30 +33663,30 @@ var require_conversions = __commonJS({
33663
33663
  var b2 = lab[2];
33664
33664
  var x2;
33665
33665
  var y;
33666
- var z;
33666
+ var z2;
33667
33667
  y = (l3 + 16) / 116;
33668
33668
  x2 = a / 500 + y;
33669
- z = y - b2 / 200;
33669
+ z2 = y - b2 / 200;
33670
33670
  var y2 = Math.pow(y, 3);
33671
33671
  var x22 = Math.pow(x2, 3);
33672
- var z2 = Math.pow(z, 3);
33672
+ var z22 = Math.pow(z2, 3);
33673
33673
  y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
33674
33674
  x2 = x22 > 8856e-6 ? x22 : (x2 - 16 / 116) / 7.787;
33675
- z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
33675
+ z2 = z22 > 8856e-6 ? z22 : (z2 - 16 / 116) / 7.787;
33676
33676
  x2 *= 95.047;
33677
33677
  y *= 100;
33678
- z *= 108.883;
33679
- return [x2, y, z];
33678
+ z2 *= 108.883;
33679
+ return [x2, y, z2];
33680
33680
  };
33681
33681
  convert.lab.lch = function(lab) {
33682
33682
  var l3 = lab[0];
33683
33683
  var a = lab[1];
33684
33684
  var b2 = lab[2];
33685
- var hr2;
33685
+ var hr;
33686
33686
  var h3;
33687
33687
  var c2;
33688
- hr2 = Math.atan2(b2, a);
33689
- h3 = hr2 * 360 / 2 / Math.PI;
33688
+ hr = Math.atan2(b2, a);
33689
+ h3 = hr * 360 / 2 / Math.PI;
33690
33690
  if (h3 < 0) {
33691
33691
  h3 += 360;
33692
33692
  }
@@ -33699,10 +33699,10 @@ var require_conversions = __commonJS({
33699
33699
  var h3 = lch[2];
33700
33700
  var a;
33701
33701
  var b2;
33702
- var hr2;
33703
- hr2 = h3 / 360 * 2 * Math.PI;
33704
- a = c2 * Math.cos(hr2);
33705
- b2 = c2 * Math.sin(hr2);
33702
+ var hr;
33703
+ hr = h3 / 360 * 2 * Math.PI;
33704
+ a = c2 * Math.cos(hr);
33705
+ b2 = c2 * Math.sin(hr);
33706
33706
  return [l3, a, b2];
33707
33707
  };
33708
33708
  convert.rgb.ansi16 = function(args) {
@@ -33848,11 +33848,11 @@ var require_conversions = __commonJS({
33848
33848
  return [g2 * 255, g2 * 255, g2 * 255];
33849
33849
  }
33850
33850
  var pure = [0, 0, 0];
33851
- var hi2 = h3 % 1 * 6;
33852
- var v2 = hi2 % 1;
33851
+ var hi = h3 % 1 * 6;
33852
+ var v2 = hi % 1;
33853
33853
  var w2 = 1 - v2;
33854
33854
  var mg = 0;
33855
- switch (Math.floor(hi2)) {
33855
+ switch (Math.floor(hi)) {
33856
33856
  case 0:
33857
33857
  pure[0] = 1;
33858
33858
  pure[1] = v2;
@@ -34000,22 +34000,22 @@ var require_route = __commonJS({
34000
34000
  }
34001
34001
  return graph;
34002
34002
  }
34003
- function link(from, to) {
34003
+ function link(from, to2) {
34004
34004
  return function(args) {
34005
- return to(from(args));
34005
+ return to2(from(args));
34006
34006
  };
34007
34007
  }
34008
34008
  function wrapConversion(toModel, graph) {
34009
34009
  var path = [graph[toModel].parent, toModel];
34010
- var fn2 = conversions[graph[toModel].parent][toModel];
34010
+ var fn = conversions[graph[toModel].parent][toModel];
34011
34011
  var cur = graph[toModel].parent;
34012
34012
  while (graph[cur].parent) {
34013
34013
  path.unshift(graph[cur].parent);
34014
- fn2 = link(conversions[graph[cur].parent][cur], fn2);
34014
+ fn = link(conversions[graph[cur].parent][cur], fn);
34015
34015
  cur = graph[cur].parent;
34016
34016
  }
34017
- fn2.conversion = path;
34018
- return fn2;
34017
+ fn.conversion = path;
34018
+ return fn;
34019
34019
  }
34020
34020
  module2.exports = function(fromModel) {
34021
34021
  var graph = deriveBFS(fromModel);
@@ -34042,7 +34042,7 @@ var require_color_convert = __commonJS({
34042
34042
  var route = require_route();
34043
34043
  var convert = {};
34044
34044
  var models = Object.keys(conversions);
34045
- function wrapRaw(fn2) {
34045
+ function wrapRaw(fn) {
34046
34046
  var wrappedFn = function(args) {
34047
34047
  if (args === void 0 || args === null) {
34048
34048
  return args;
@@ -34050,14 +34050,14 @@ var require_color_convert = __commonJS({
34050
34050
  if (arguments.length > 1) {
34051
34051
  args = Array.prototype.slice.call(arguments);
34052
34052
  }
34053
- return fn2(args);
34053
+ return fn(args);
34054
34054
  };
34055
- if ("conversion" in fn2) {
34056
- wrappedFn.conversion = fn2.conversion;
34055
+ if ("conversion" in fn) {
34056
+ wrappedFn.conversion = fn.conversion;
34057
34057
  }
34058
34058
  return wrappedFn;
34059
34059
  }
34060
- function wrapRounded(fn2) {
34060
+ function wrapRounded(fn) {
34061
34061
  var wrappedFn = function(args) {
34062
34062
  if (args === void 0 || args === null) {
34063
34063
  return args;
@@ -34065,7 +34065,7 @@ var require_color_convert = __commonJS({
34065
34065
  if (arguments.length > 1) {
34066
34066
  args = Array.prototype.slice.call(arguments);
34067
34067
  }
34068
- var result = fn2(args);
34068
+ var result = fn(args);
34069
34069
  if (typeof result === "object") {
34070
34070
  for (var len = result.length, i2 = 0; i2 < len; i2++) {
34071
34071
  result[i2] = Math.round(result[i2]);
@@ -34073,8 +34073,8 @@ var require_color_convert = __commonJS({
34073
34073
  }
34074
34074
  return result;
34075
34075
  };
34076
- if ("conversion" in fn2) {
34077
- wrappedFn.conversion = fn2.conversion;
34076
+ if ("conversion" in fn) {
34077
+ wrappedFn.conversion = fn.conversion;
34078
34078
  }
34079
34079
  return wrappedFn;
34080
34080
  }
@@ -34085,9 +34085,9 @@ var require_color_convert = __commonJS({
34085
34085
  var routes = route(fromModel);
34086
34086
  var routeModels = Object.keys(routes);
34087
34087
  routeModels.forEach(function(toModel) {
34088
- var fn2 = routes[toModel];
34089
- convert[fromModel][toModel] = wrapRounded(fn2);
34090
- convert[fromModel][toModel].raw = wrapRaw(fn2);
34088
+ var fn = routes[toModel];
34089
+ convert[fromModel][toModel] = wrapRounded(fn);
34090
+ convert[fromModel][toModel].raw = wrapRaw(fn);
34091
34091
  });
34092
34092
  });
34093
34093
  module2.exports = convert;
@@ -34602,10 +34602,10 @@ var require_adapters = __commonJS({
34602
34602
  "../../node_modules/@dabh/diagnostics/adapters/index.js"(exports2, module2) {
34603
34603
  "use strict";
34604
34604
  var enabled = require_enabled();
34605
- module2.exports = function create(fn2) {
34605
+ module2.exports = function create(fn) {
34606
34606
  return function adapter(namespace) {
34607
34607
  try {
34608
- return enabled(namespace, fn2());
34608
+ return enabled(namespace, fn());
34609
34609
  } catch (e) {
34610
34610
  }
34611
34611
  return false;
@@ -34781,7 +34781,7 @@ var require_file = __commonJS({
34781
34781
  var { Stream, PassThrough } = require_readable();
34782
34782
  var TransportStream = require_winston_transport();
34783
34783
  var debug = require_node2()("winston:file");
34784
- var os2 = require("os");
34784
+ var os = require("os");
34785
34785
  var tailFile = require_tail_file();
34786
34786
  module2.exports = class File extends TransportStream {
34787
34787
  /**
@@ -34819,7 +34819,7 @@ var require_file = __commonJS({
34819
34819
  this.rotationFormat = options.rotationFormat || false;
34820
34820
  this.zippedArchive = options.zippedArchive || false;
34821
34821
  this.maxFiles = options.maxFiles || null;
34822
- this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
34822
+ this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
34823
34823
  this.tailable = options.tailable || false;
34824
34824
  this.lazy = options.lazy || false;
34825
34825
  this._size = 0;
@@ -35607,7 +35607,7 @@ var require_stream4 = __commonJS({
35607
35607
  "use strict";
35608
35608
  var isStream = require_is_stream();
35609
35609
  var { MESSAGE } = require_triple_beam();
35610
- var os2 = require("os");
35610
+ var os = require("os");
35611
35611
  var TransportStream = require_winston_transport();
35612
35612
  module2.exports = class Stream extends TransportStream {
35613
35613
  /**
@@ -35623,7 +35623,7 @@ var require_stream4 = __commonJS({
35623
35623
  this._stream = options.stream;
35624
35624
  this._stream.setMaxListeners(Infinity);
35625
35625
  this.isObjectMode = options.stream._writableState.objectMode;
35626
- this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
35626
+ this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
35627
35627
  }
35628
35628
  /**
35629
35629
  * Core logging method exposed to Winston.
@@ -35802,15 +35802,15 @@ var require_fn = __commonJS({
35802
35802
  "../../node_modules/fn.name/index.js"(exports2, module2) {
35803
35803
  "use strict";
35804
35804
  var toString = Object.prototype.toString;
35805
- module2.exports = function name(fn2) {
35806
- if ("string" === typeof fn2.displayName && fn2.constructor.name) {
35807
- return fn2.displayName;
35808
- } else if ("string" === typeof fn2.name && fn2.name) {
35809
- return fn2.name;
35810
- }
35811
- if ("object" === typeof fn2 && fn2.constructor && "string" === typeof fn2.constructor.name)
35812
- return fn2.constructor.name;
35813
- var named = fn2.toString(), type = toString.call(fn2).slice(8, -1);
35805
+ module2.exports = function name(fn) {
35806
+ if ("string" === typeof fn.displayName && fn.constructor.name) {
35807
+ return fn.displayName;
35808
+ } else if ("string" === typeof fn.name && fn.name) {
35809
+ return fn.name;
35810
+ }
35811
+ if ("object" === typeof fn && fn.constructor && "string" === typeof fn.constructor.name)
35812
+ return fn.constructor.name;
35813
+ var named = fn.toString(), type = toString.call(fn).slice(8, -1);
35814
35814
  if ("Function" === type) {
35815
35815
  named = named.substring(named.indexOf("(") + 1, named.indexOf(")"));
35816
35816
  } else {
@@ -35826,17 +35826,17 @@ var require_one_time = __commonJS({
35826
35826
  "../../node_modules/one-time/index.js"(exports2, module2) {
35827
35827
  "use strict";
35828
35828
  var name = require_fn();
35829
- module2.exports = function one(fn2) {
35829
+ module2.exports = function one(fn) {
35830
35830
  var called = 0, value;
35831
35831
  function onetime() {
35832
35832
  if (called)
35833
35833
  return value;
35834
35834
  called = 1;
35835
- value = fn2.apply(this, arguments);
35836
- fn2 = null;
35835
+ value = fn.apply(this, arguments);
35836
+ fn = null;
35837
35837
  return value;
35838
35838
  }
35839
- onetime.displayName = name(fn2);
35839
+ onetime.displayName = name(fn);
35840
35840
  return onetime;
35841
35841
  };
35842
35842
  }
@@ -36010,7 +36010,7 @@ var require_exception_stream = __commonJS({
36010
36010
  var require_exception_handler = __commonJS({
36011
36011
  "../../node_modules/winston/lib/winston/exception-handler.js"(exports2, module2) {
36012
36012
  "use strict";
36013
- var os2 = require("os");
36013
+ var os = require("os");
36014
36014
  var asyncForEach = require_forEach();
36015
36015
  var debug = require_node2()("winston:exception");
36016
36016
  var once = require_one_time();
@@ -36105,8 +36105,8 @@ var require_exception_handler = __commonJS({
36105
36105
  */
36106
36106
  getOsInfo() {
36107
36107
  return {
36108
- loadavg: os2.loadavg(),
36109
- uptime: os2.uptime()
36108
+ loadavg: os.loadavg(),
36109
+ uptime: os.uptime()
36110
36110
  };
36111
36111
  }
36112
36112
  /**
@@ -36248,7 +36248,7 @@ var require_rejection_stream = __commonJS({
36248
36248
  var require_rejection_handler = __commonJS({
36249
36249
  "../../node_modules/winston/lib/winston/rejection-handler.js"(exports2, module2) {
36250
36250
  "use strict";
36251
- var os2 = require("os");
36251
+ var os = require("os");
36252
36252
  var asyncForEach = require_forEach();
36253
36253
  var debug = require_node2()("winston:rejection");
36254
36254
  var once = require_one_time();
@@ -36345,8 +36345,8 @@ var require_rejection_handler = __commonJS({
36345
36345
  */
36346
36346
  getOsInfo() {
36347
36347
  return {
36348
- loadavg: os2.loadavg(),
36349
- uptime: os2.uptime()
36348
+ loadavg: os.loadavg(),
36349
+ uptime: os.uptime()
36350
36350
  };
36351
36351
  }
36352
36352
  /**
@@ -38324,8 +38324,8 @@ var require_dcmjs_dimse_min = __commonJS({
38324
38324
  }
38325
38325
  };
38326
38326
  }, 371: (e2, t2, s2) => {
38327
- const { Association: n2 } = s2(570), { AAbort: i3, AAssociateAC: r5, AAssociateRJ: o2, AAssociateRQ: a, AReleaseRP: c2, AReleaseRQ: d3, PDataTF: u2, Pdv: h3, RawPdu: m3 } = s2(942), { CommandFieldType: g2, Status: l3, TranscodableTransferSyntaxes: p2 } = s2(492), { CCancelRequest: R2, CEchoRequest: f2, CEchoResponse: y, CFindRequest: S2, CFindResponse: I2, CGetRequest: C2, CGetResponse: P2, CMoveRequest: v2, CMoveResponse: x2, Command: w2, CStoreRequest: A2, CStoreResponse: U, NActionRequest: q2, NActionResponse: D2, NCreateRequest: E2, NCreateResponse: T, NDeleteRequest: O2, NDeleteResponse: b2, NEventReportRequest: N2, NEventReportResponse: B2, NGetRequest: M2, NGetResponse: L2, NSetRequest: F2, NSetResponse: k2, Response: $ } = s2(940), j2 = s2(825), V2 = s2(139), G2 = s2(906), _2 = s2(547), { SmartBuffer: z } = s2(766), { EOL: Q2 } = s2(857), W2 = s2(733);
38328
- class J extends W2 {
38327
+ const { Association: n2 } = s2(570), { AAbort: i3, AAssociateAC: r5, AAssociateRJ: o2, AAssociateRQ: a, AReleaseRP: c2, AReleaseRQ: d3, PDataTF: u2, Pdv: h3, RawPdu: m3 } = s2(942), { CommandFieldType: g2, Status: l3, TranscodableTransferSyntaxes: p2 } = s2(492), { CCancelRequest: R2, CEchoRequest: f2, CEchoResponse: y, CFindRequest: S2, CFindResponse: I2, CGetRequest: C2, CGetResponse: P2, CMoveRequest: v2, CMoveResponse: x2, Command: w2, CStoreRequest: A2, CStoreResponse: U, NActionRequest: q2, NActionResponse: D2, NCreateRequest: E2, NCreateResponse: T, NDeleteRequest: O2, NDeleteResponse: b2, NEventReportRequest: N2, NEventReportResponse: B2, NGetRequest: M2, NGetResponse: L2, NSetRequest: F2, NSetResponse: k2, Response: $2 } = s2(940), j2 = s2(825), V2 = s2(139), G2 = s2(906), _2 = s2(547), { SmartBuffer: z2 } = s2(766), { EOL: Q2 } = s2(857), W = s2(733);
38328
+ class J extends W {
38329
38329
  constructor() {
38330
38330
  super();
38331
38331
  }
@@ -38338,7 +38338,7 @@ var require_dcmjs_dimse_min = __commonJS({
38338
38338
  if (void 0 === this.receiving) {
38339
38339
  if (this.minimumReceived && (e3 = Buffer.concat([this.minimumReceived, e3], this.minimumReceived.length + e3.length), this.minimumReceived = void 0), e3.length < 6)
38340
38340
  return void (this.minimumReceived = e3);
38341
- const t3 = z.fromBuffer(e3, "ascii");
38341
+ const t3 = z2.fromBuffer(e3, "ascii");
38342
38342
  t3.readUInt8(), t3.readUInt8();
38343
38343
  const s3 = t3.readUInt32BE();
38344
38344
  let n3 = e3.length - 6;
@@ -38362,7 +38362,7 @@ var require_dcmjs_dimse_min = __commonJS({
38362
38362
  }
38363
38363
  }
38364
38364
  }
38365
- e2.exports = class extends W2 {
38365
+ e2.exports = class extends W {
38366
38366
  constructor(e3, t3) {
38367
38367
  super(), this.messageId = 0, this.socket = e3, this.requests = [], this.pending = [], this.dimseBuffer = void 0, this.dimse = void 0, t3 = t3 || {}, this.connectTimeout = t3.connectTimeout || 18e4, this.associationTimeout = t3.associationTimeout || 6e4, this.pduTimeout = t3.pduTimeout || 6e4, this.logCommandDatasets = t3.logCommandDatasets || false, this.logDatasets = t3.logDatasets || false, this.datasetReadOptions = t3.datasetReadOptions || {}, this.datasetWriteOptions = t3.datasetWriteOptions || {}, this.datasetNameMap = t3.datasetNameMap || {}, this.logId = "", this.connected = false, this.connectedTime = void 0, this.lastPduTime = void 0, this.timeoutIntervalId = void 0, this.statistics = new G2(), this._wrapSocket();
38368
38368
  }
@@ -38517,7 +38517,7 @@ var require_dcmjs_dimse_min = __commonJS({
38517
38517
  _processPDataTf(e3) {
38518
38518
  try {
38519
38519
  e3.getPdvs().forEach((e4) => {
38520
- this.dimseBuffer || (this.dimseBuffer = z.fromOptions({ encoding: "ascii" })), this.dimseBuffer.writeBuffer(e4.getValue());
38520
+ this.dimseBuffer || (this.dimseBuffer = z2.fromOptions({ encoding: "ascii" })), this.dimseBuffer.writeBuffer(e4.getValue());
38521
38521
  const t3 = this.association.getPresentationContext(e4.getPresentationContextId());
38522
38522
  if (e4.isLastFragment())
38523
38523
  if (e4.isCommand()) {
@@ -38608,7 +38608,7 @@ var require_dcmjs_dimse_min = __commonJS({
38608
38608
  }
38609
38609
  }
38610
38610
  _performDimse(e3, t3) {
38611
- if (t3 instanceof $) {
38611
+ if (t3 instanceof $2) {
38612
38612
  const e4 = Object.assign(Object.create(Object.getPrototypeOf(t3)), t3), s3 = this.pending.find((e5) => e5.getMessageId() === t3.getMessageIdBeingRespondedTo());
38613
38613
  s3 && (s3.raiseResponseEvent(e4), e4.getStatus() !== l3.Pending && s3.raiseDoneEvent());
38614
38614
  } else
@@ -39265,7 +39265,7 @@ var require_dcmjs_dimse_min = __commonJS({
39265
39265
  }
39266
39266
  };
39267
39267
  }, 237: (e2, t2, s2) => {
39268
- const { Association: n2, PresentationContext: i3 } = s2(570), { Scp: r5, Server: o2 } = s2(538), { CCancelRequest: a, CEchoRequest: c2, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h3, CGetRequest: m3, CGetResponse: g2, CMoveRequest: l3, CMoveResponse: p2, CStoreRequest: R2, CStoreResponse: f2, NActionRequest: y, NActionResponse: S2, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P2, NDeleteResponse: v2, NEventReportRequest: x2, NEventReportResponse: w2, NGetRequest: A2, NGetResponse: U, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: O2, PresentationContextResult: b2, Priority: N2, RejectReason: B2, RejectResult: M2, RejectSource: L2, SopClass: F2, Status: k2, StorageClass: $, TransferSyntax: j2, Uid: V2, UserIdentityType: G2 } = s2(492), _2 = s2(422), z = s2(825), Q2 = s2(139), W2 = s2(906), J = { association: { Association: n2, PresentationContext: i3 }, Client: _2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: O2, PresentationContextResult: b2, Priority: N2, RejectReason: B2, RejectResult: M2, RejectSource: L2, SopClass: F2, Status: k2, StorageClass: $, TransferSyntax: j2, Uid: V2, UserIdentityType: G2 }, Dataset: z, Implementation: Q2, log: s2(547), requests: { CCancelRequest: a, CEchoRequest: c2, CFindRequest: u2, CGetRequest: m3, CMoveRequest: l3, CStoreRequest: R2, NActionRequest: y, NCreateRequest: I2, NDeleteRequest: P2, NEventReportRequest: x2, NGetRequest: A2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h3, CGetResponse: g2, CMoveResponse: p2, CStoreResponse: f2, NActionResponse: S2, NCreateResponse: C2, NDeleteResponse: v2, NEventReportResponse: w2, NGetResponse: U, NSetResponse: D2 }, Scp: r5, Server: o2, Statistics: W2, version: s2(837) };
39268
+ const { Association: n2, PresentationContext: i3 } = s2(570), { Scp: r5, Server: o2 } = s2(538), { CCancelRequest: a, CEchoRequest: c2, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h3, CGetRequest: m3, CGetResponse: g2, CMoveRequest: l3, CMoveResponse: p2, CStoreRequest: R2, CStoreResponse: f2, NActionRequest: y, NActionResponse: S2, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P2, NDeleteResponse: v2, NEventReportRequest: x2, NEventReportResponse: w2, NGetRequest: A2, NGetResponse: U, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: O2, PresentationContextResult: b2, Priority: N2, RejectReason: B2, RejectResult: M2, RejectSource: L2, SopClass: F2, Status: k2, StorageClass: $2, TransferSyntax: j2, Uid: V2, UserIdentityType: G2 } = s2(492), _2 = s2(422), z2 = s2(825), Q2 = s2(139), W = s2(906), J = { association: { Association: n2, PresentationContext: i3 }, Client: _2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: O2, PresentationContextResult: b2, Priority: N2, RejectReason: B2, RejectResult: M2, RejectSource: L2, SopClass: F2, Status: k2, StorageClass: $2, TransferSyntax: j2, Uid: V2, UserIdentityType: G2 }, Dataset: z2, Implementation: Q2, log: s2(547), requests: { CCancelRequest: a, CEchoRequest: c2, CFindRequest: u2, CGetRequest: m3, CMoveRequest: l3, CStoreRequest: R2, NActionRequest: y, NCreateRequest: I2, NDeleteRequest: P2, NEventReportRequest: x2, NGetRequest: A2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h3, CGetResponse: g2, CMoveResponse: p2, CStoreResponse: f2, NActionResponse: S2, NCreateResponse: C2, NDeleteResponse: v2, NEventReportResponse: w2, NGetResponse: U, NSetResponse: D2 }, Scp: r5, Server: o2, Statistics: W, version: s2(837) };
39269
39269
  e2.exports = J;
39270
39270
  }, 547: (e2, t2, s2) => {
39271
39271
  const { createLogger: n2, format: i3, transports: r5 } = s2(688), { combine: o2, printf: a, timestamp: c2 } = i3, d3 = n2({ format: o2(c2(), a(({ level: e3, message: t3, timestamp: s3 }) => `${s3} -- ${e3.toUpperCase()} -- ${t3}`)), transports: [new r5.Console()] });
@@ -39319,7 +39319,7 @@ __export(main_exports, {
39319
39319
  module.exports = __toCommonJS(main_exports);
39320
39320
 
39321
39321
  // ../core/dist/esm/index.mjs
39322
- var Le = class {
39322
+ var Ue = class {
39323
39323
  constructor(e, t) {
39324
39324
  this.operator = e;
39325
39325
  this.child = t;
@@ -39328,7 +39328,7 @@ var Le = class {
39328
39328
  return `${this.operator}(${this.child.toString()})`;
39329
39329
  }
39330
39330
  };
39331
- var G = class {
39331
+ var Q = class {
39332
39332
  constructor(e, t, n) {
39333
39333
  this.operator = e;
39334
39334
  this.left = t;
@@ -39338,7 +39338,7 @@ var G = class {
39338
39338
  return `${this.left.toString()} ${this.operator} ${this.right.toString()}`;
39339
39339
  }
39340
39340
  };
39341
- var Ue = class {
39341
+ var Be = class {
39342
39342
  constructor() {
39343
39343
  this.prefixParselets = {};
39344
39344
  this.infixParselets = {};
@@ -39362,10 +39362,10 @@ var Ue = class {
39362
39362
  }, precedence: t });
39363
39363
  }
39364
39364
  construct(e) {
39365
- return new Vt(e, this.prefixParselets, this.infixParselets);
39365
+ return new Dt(e, this.prefixParselets, this.infixParselets);
39366
39366
  }
39367
39367
  };
39368
- var Vt = class {
39368
+ var Dt = class {
39369
39369
  constructor(e, t, n) {
39370
39370
  this.tokens = e, this.prefixParselets = t, this.infixParselets = n;
39371
39371
  }
@@ -39416,97 +39416,97 @@ var Vt = class {
39416
39416
  return this.infixParselets[e.id === "Symbol" ? e.value : e.id];
39417
39417
  }
39418
39418
  };
39419
- var Dt = "ok";
39420
- var Be = "created";
39421
- var Nt = "not-modified";
39422
- var Ft = "not-found";
39423
- var qe = "accepted";
39424
- var Nr = { resourceType: "OperationOutcome", id: Ft, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
39419
+ var Mt = "ok";
39420
+ var qe = "created";
39421
+ var Ft = "not-modified";
39422
+ var _t = "not-found";
39423
+ var je = "accepted";
39424
+ var _r = { resourceType: "OperationOutcome", id: _t, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
39425
39425
  function R(r4, e) {
39426
39426
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "invalid", details: { text: r4 }, expression: e ? [e] : void 0 }] };
39427
39427
  }
39428
39428
  function m(r4) {
39429
39429
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "structure", details: { text: r4 } }] };
39430
39430
  }
39431
- function Fr(r4) {
39431
+ function Lr(r4) {
39432
39432
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "exception", details: { text: "Internal server error" }, diagnostics: r4.toString() }] };
39433
39433
  }
39434
- function ue(r4) {
39434
+ function le(r4) {
39435
39435
  return typeof r4 == "object" && r4 !== null && r4.resourceType === "OperationOutcome";
39436
39436
  }
39437
- function _t(r4) {
39438
- return r4.id === Dt || r4.id === Be || r4.id === Nt || r4.id === qe;
39437
+ function Lt(r4) {
39438
+ return r4.id === Mt || r4.id === qe || r4.id === Ft || r4.id === je;
39439
39439
  }
39440
39440
  var d = class extends Error {
39441
39441
  constructor(e, t) {
39442
- super(_r(e)), this.outcome = e, this.cause = t;
39442
+ super(Ur(e)), this.outcome = e, this.cause = t;
39443
39443
  }
39444
39444
  };
39445
- function je(r4) {
39446
- return r4 instanceof d ? r4.outcome : ue(r4) ? r4 : R(hi(r4));
39445
+ function $e(r4) {
39446
+ return r4 instanceof d ? r4.outcome : le(r4) ? r4 : R(yi(r4));
39447
39447
  }
39448
- function hi(r4) {
39449
- return r4 ? typeof r4 == "string" ? r4 : r4 instanceof Error ? r4.message : ue(r4) ? _r(r4) : typeof r4 == "object" && "code" in r4 && typeof r4.code == "string" ? r4.code : JSON.stringify(r4) : "Unknown error";
39448
+ function yi(r4) {
39449
+ return r4 ? typeof r4 == "string" ? r4 : r4 instanceof Error ? r4.message : le(r4) ? Ur(r4) : typeof r4 == "object" && "code" in r4 && typeof r4.code == "string" ? r4.code : JSON.stringify(r4) : "Unknown error";
39450
39450
  }
39451
- function _r(r4) {
39452
- let e = r4.issue?.map(yi) ?? [];
39451
+ function Ur(r4) {
39452
+ let e = r4.issue?.map(gi) ?? [];
39453
39453
  return e.length > 0 ? e.join("; ") : "Unknown error";
39454
39454
  }
39455
- function yi(r4) {
39455
+ function gi(r4) {
39456
39456
  let e;
39457
39457
  return r4.details?.text ? r4.diagnostics ? e = `${r4.details.text} (${r4.diagnostics})` : e = r4.details.text : r4.diagnostics ? e = r4.diagnostics : e = "Unknown error", r4.expression?.length && (e += ` (${r4.expression.join(", ")})`), e;
39458
39458
  }
39459
- function xi(r4, e) {
39459
+ function vi(r4, e) {
39460
39460
  let t = e.max && e.max === Number.MAX_SAFE_INTEGER ? Number.POSITIVE_INFINITY : e.max;
39461
39461
  return { path: r4, description: "", type: e.type ?? [], min: e.min ?? 0, max: t ?? 1, isArray: !!t && t > 1, constraints: [] };
39462
39462
  }
39463
- function Br(r4) {
39463
+ function jr(r4) {
39464
39464
  let e = /* @__PURE__ */ Object.create(null);
39465
39465
  for (let [t, n] of Object.entries(r4))
39466
- e[t] = { name: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i2, o]) => [i2, xi(i2, o)])), constraints: [], innerTypes: [] };
39466
+ e[t] = { name: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i2, o]) => [i2, vi(i2, o)])), constraints: [], innerTypes: [] };
39467
39467
  return e;
39468
39468
  }
39469
- var qr = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, MetadataResource: { elements: { id: { type: [{ code: "string" }] }, meta: { type: [{ code: "Meta" }] }, implicitRules: { type: [{ code: "uri" }] }, language: { type: [{ code: "code" }] }, text: { type: [{ code: "Narrative" }] }, contained: { max: 9007199254740991, type: [{ code: "Resource" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, name: { type: [{ code: "string" }] }, title: { type: [{ code: "string" }] }, status: { min: 1, type: [{ code: "code" }] }, experimental: { type: [{ code: "boolean" }] }, date: { type: [{ code: "dateTime" }] }, publisher: { type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] }, description: { type: [{ code: "markdown" }] }, useContext: { max: 9007199254740991, type: [{ code: "UsageContext" }] }, jurisdiction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
39470
- function jt(r4) {
39471
- return new Bt(r4).parse();
39469
+ var $r = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, MetadataResource: { elements: { id: { type: [{ code: "string" }] }, meta: { type: [{ code: "Meta" }] }, implicitRules: { type: [{ code: "uri" }] }, language: { type: [{ code: "code" }] }, text: { type: [{ code: "Narrative" }] }, contained: { max: 9007199254740991, type: [{ code: "Resource" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, name: { type: [{ code: "string" }] }, title: { type: [{ code: "string" }] }, status: { min: 1, type: [{ code: "code" }] }, experimental: { type: [{ code: "boolean" }] }, date: { type: [{ code: "dateTime" }] }, publisher: { type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] }, description: { type: [{ code: "markdown" }] }, useContext: { max: 9007199254740991, type: [{ code: "UsageContext" }] }, jurisdiction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
39470
+ function $t(r4) {
39471
+ return new qt(r4).parse();
39472
39472
  }
39473
- var Re = Br(qr);
39474
- var $t = /* @__PURE__ */ Object.create(null);
39475
- var jr = /* @__PURE__ */ Object.create(null);
39476
- function Ut(r4) {
39473
+ var Pe = jr($r);
39474
+ var Wt = /* @__PURE__ */ Object.create(null);
39475
+ var Wr = /* @__PURE__ */ Object.create(null);
39476
+ function Bt(r4) {
39477
39477
  let e;
39478
- return r4 ? (e = jr[r4], e || (e = jr[r4] = /* @__PURE__ */ Object.create(null))) : e = Re, e;
39478
+ return r4 ? (e = Wr[r4], e || (e = Wr[r4] = /* @__PURE__ */ Object.create(null))) : e = Pe, e;
39479
39479
  }
39480
- function Wt(r4, e) {
39480
+ function Ht(r4, e) {
39481
39481
  let t = Array.isArray(r4) ? r4 : r4.entry?.map((n) => n.resource) ?? [];
39482
39482
  for (let n of t)
39483
- Ht(n, e);
39483
+ Gt(n, e);
39484
39484
  }
39485
- function Ht(r4, e) {
39485
+ function Gt(r4, e) {
39486
39486
  if (!r4?.name)
39487
39487
  throw new Error("Failed loading StructureDefinition from bundle");
39488
39488
  if (r4.resourceType !== "StructureDefinition")
39489
39489
  return;
39490
- let t = jt(r4), n = Ut(e);
39491
- n[r4.name] = t, e && r4.url === e && ($t[e] = t);
39490
+ let t = $t(r4), n = Bt(e);
39491
+ n[r4.name] = t, e && r4.url === e && (Wt[e] = t);
39492
39492
  for (let i2 of t.innerTypes)
39493
39493
  i2.parentType = t, n[i2.name] = i2;
39494
39494
  }
39495
- function Qr(r4) {
39496
- return !!Re[r4];
39495
+ function zr(r4) {
39496
+ return !!Pe[r4];
39497
39497
  }
39498
- function Pe(r4, e) {
39499
- let t = Ut(e)[r4];
39500
- return !t && e && (t = Ut()[r4]), t;
39498
+ function Ce(r4, e) {
39499
+ let t = Bt(e)[r4];
39500
+ return !t && e && (t = Bt()[r4]), t;
39501
39501
  }
39502
- function zr(r4) {
39503
- return !!$t[r4];
39502
+ function Yr(r4) {
39503
+ return !!Wt[r4];
39504
39504
  }
39505
- var Bt = class {
39505
+ var qt = class {
39506
39506
  constructor(e) {
39507
39507
  if (!e.snapshot?.element || e.snapshot.element.length === 0)
39508
39508
  throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
39509
- this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, title: e.title, type: e.type, url: e.url, kind: e.kind, description: bi(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
39509
+ this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, title: e.title, type: e.type, url: e.url, kind: e.kind, description: Ri(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
39510
39510
  }
39511
39511
  parse() {
39512
39512
  let e = this.next();
@@ -39515,7 +39515,7 @@ var Bt = class {
39515
39515
  this.parseSliceStart(e);
39516
39516
  else if (e.id?.includes(":")) {
39517
39517
  if (this.slicingContext?.current) {
39518
- let t = Lt(e, this.slicingContext.path);
39518
+ let t = Ut(e, this.slicingContext.path);
39519
39519
  this.slicingContext.current.elements[t] = this.parseElementDefinition(e);
39520
39520
  }
39521
39521
  } else {
@@ -39524,13 +39524,13 @@ var Bt = class {
39524
39524
  let n = this.backboneContext;
39525
39525
  for (; n; ) {
39526
39526
  if (e.path?.startsWith(n.path + ".")) {
39527
- n.type.elements[Lt(e, n.path)] = t;
39527
+ n.type.elements[Ut(e, n.path)] = t;
39528
39528
  break;
39529
39529
  }
39530
39530
  n = n.parent;
39531
39531
  }
39532
39532
  if (!n) {
39533
- let i2 = Lt(e, this.root.path);
39533
+ let i2 = Ut(e, this.root.path);
39534
39534
  e.isSummary && this.resourceSchema.summaryProperties?.add(i2.replace("[x]", "")), t.min > 0 && this.resourceSchema.mandatoryProperties?.add(i2.replace("[x]", "")), this.resourceSchema.elements[i2] = t;
39535
39535
  }
39536
39536
  this.checkFieldExit(e);
@@ -39543,26 +39543,26 @@ var Bt = class {
39543
39543
  this.isInnerType(e) && this.enterInnerType(e), e.slicing && !this.slicingContext && this.enterSlice(e, t);
39544
39544
  }
39545
39545
  enterInnerType(e) {
39546
- for (; this.backboneContext && !pe(this.backboneContext?.path, e.path); )
39546
+ for (; this.backboneContext && !de(this.backboneContext?.path, e.path); )
39547
39547
  this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
39548
- this.backboneContext = { type: { name: qt(e), title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path ?? "", parent: pe(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
39548
+ this.backboneContext = { type: { name: jt(e), title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path ?? "", parent: de(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
39549
39549
  }
39550
39550
  enterSlice(e, t) {
39551
- Ei(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
39551
+ bi(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
39552
39552
  if (n.type !== "value" && n.type !== "pattern" && n.type !== "type")
39553
39553
  throw new Error(`Unsupported slicing discriminator type: ${n.type}`);
39554
39554
  return { path: n.path, type: n.type };
39555
39555
  }), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
39556
39556
  }
39557
39557
  checkFieldExit(e = void 0) {
39558
- if (this.backboneContext && !pe(this.backboneContext.path, e?.path))
39558
+ if (this.backboneContext && !de(this.backboneContext.path, e?.path))
39559
39559
  if (this.backboneContext.parent)
39560
39560
  do
39561
39561
  this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
39562
- while (this.backboneContext && !pe(this.backboneContext.path, e?.path));
39562
+ while (this.backboneContext && !de(this.backboneContext.path, e?.path));
39563
39563
  else
39564
39564
  this.innerTypes.push(this.backboneContext.type), this.backboneContext = void 0;
39565
- this.slicingContext && !pe(this.slicingContext.path, e?.path) && (this.slicingContext?.current && this.slicingContext.field.slices.push(this.slicingContext.current), this.slicingContext = void 0);
39565
+ this.slicingContext && !de(this.slicingContext.path, e?.path) && (this.slicingContext?.current && this.slicingContext.field.slices.push(this.slicingContext.current), this.slicingContext = void 0);
39566
39566
  }
39567
39567
  next() {
39568
39568
  let e = this.peek();
@@ -39574,14 +39574,14 @@ var Bt = class {
39574
39574
  if (e) {
39575
39575
  if (this.elementIndex[e.path ?? ""] = e, e.contentReference) {
39576
39576
  let t = e.contentReference.slice(e.contentReference.indexOf("#") + 1), n = this.elementIndex[t];
39577
- return n ? { ...n, id: e.id, path: e.path, min: e.min ?? n.min, max: e.max ?? n.max, base: n.base ?? { path: t, min: n.min, max: n.max }, contentReference: e.contentReference, definition: e.definition } : void 0;
39577
+ return n ? { ...n, id: e.id, path: e.path, min: e.min ?? n.min, max: e.max ?? n.max, base: { path: n.base?.path ?? t, min: e.base?.min ?? n.base?.min ?? n.min, max: e.base?.max ?? n.base?.max ?? n.max }, contentReference: e.contentReference, definition: e.definition } : void 0;
39578
39578
  }
39579
39579
  return e;
39580
39580
  }
39581
39581
  }
39582
39582
  isInnerType(e) {
39583
39583
  let t = this.peek();
39584
- return !!(pe(e?.path, t?.path) && e.type?.some((n) => ["BackboneElement", "Element"].includes(n.code)));
39584
+ return !!(de(e?.path, t?.path) && e.type?.some((n) => ["BackboneElement", "Element"].includes(n.code)));
39585
39585
  }
39586
39586
  parseSliceStart(e) {
39587
39587
  if (!this.slicingContext)
@@ -39591,38 +39591,38 @@ var Bt = class {
39591
39591
  parseElementDefinitionType(e) {
39592
39592
  return (e.type ?? []).map((t) => {
39593
39593
  let n;
39594
- return (t.code === "BackboneElement" || t.code === "Element") && (n = qt(e)), n || (n = Gt(t, "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl), n || (n = t.code ?? ""), { code: n, targetProfile: t.targetProfile, profile: t.profile };
39594
+ return (t.code === "BackboneElement" || t.code === "Element") && (n = jt(e)), n || (n = Qt(t, "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl), n || (n = t.code ?? ""), { code: n, targetProfile: t.targetProfile, profile: t.profile };
39595
39595
  });
39596
39596
  }
39597
39597
  parseElementDefinition(e) {
39598
- let t = Wr(e.max), n = e.base?.max ? Wr(e.base.max) : t, i2 = { type: "ElementDefinition", value: e };
39599
- return { description: e.definition || "", path: e.path || e.base?.path || "", min: e.min ?? 0, max: t, isArray: n > 1, constraints: (e.constraint ?? []).map((o) => ({ key: o.key ?? "", severity: o.severity ?? "error", expression: o.expression ?? "", description: o.human ?? "" })), type: this.parseElementDefinitionType(e), fixed: Hr(A(i2, "fixed[x]")), pattern: Hr(A(i2, "pattern[x]")), binding: e.binding };
39598
+ let t = Gr(e.max), n = e.base?.max ? Gr(e.base.max) : t, i2 = { type: "ElementDefinition", value: e };
39599
+ return { description: e.definition || "", path: e.path || e.base?.path || "", min: e.min ?? 0, max: t, isArray: n > 1, constraints: (e.constraint ?? []).map((o) => ({ key: o.key ?? "", severity: o.severity ?? "error", expression: o.expression ?? "", description: o.human ?? "" })), type: this.parseElementDefinitionType(e), fixed: Qr(A(i2, "fixed[x]")), pattern: Qr(A(i2, "pattern[x]")), binding: e.binding };
39600
39600
  }
39601
39601
  };
39602
- function Wr(r4) {
39602
+ function Gr(r4) {
39603
39603
  return r4 === "*" ? Number.POSITIVE_INFINITY : Number.parseInt(r4, 10);
39604
39604
  }
39605
- function Lt(r4, e = "") {
39606
- return Si(r4.path, e);
39605
+ function Ut(r4, e = "") {
39606
+ return Ei(r4.path, e);
39607
39607
  }
39608
- function Si(r4, e) {
39608
+ function Ei(r4, e) {
39609
39609
  return r4 ? e && r4.startsWith(e) ? r4.substring(e.length + 1) : r4 : "";
39610
39610
  }
39611
- function pe(r4, e) {
39611
+ function de(r4, e) {
39612
39612
  return !r4 || !e ? false : e.startsWith(r4 + ".") || e === r4;
39613
39613
  }
39614
- function Hr(r4) {
39614
+ function Qr(r4) {
39615
39615
  return Array.isArray(r4) && r4.length > 0 ? r4[0] : S(r4) ? void 0 : r4;
39616
39616
  }
39617
- function Ei(r4) {
39617
+ function bi(r4) {
39618
39618
  let e = r4.slicing?.discriminator;
39619
39619
  return !!(r4.type?.some((t) => t.code === "Extension") && e?.length === 1 && e[0].type === "value" && e[0].path === "url");
39620
39620
  }
39621
- function bi(r4) {
39621
+ function Ri(r4) {
39622
39622
  let e = r4.description;
39623
39623
  return e?.startsWith(`Base StructureDefinition for ${r4.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r4.name} Type: `.length)), e;
39624
39624
  }
39625
- var He = { base64Binary: /^([A-Za-z\d+/]{4})*([A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=)?$/, canonical: /^\S*$/, code: /^[^\s]+( [^\s]+)*$/, date: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/, dateTime: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/, id: /^[A-Za-z0-9\-.]{1,64}$/, instant: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\d|3[0-1])T([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00))$/, markdown: /^[\s\S]+$/, oid: /^urn:oid:[0-2](\.(0|[1-9]\d*))+$/, string: /^[\s\S]+$/, time: /^([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?$/, uri: /^\S*$/, url: /^\S*$/, uuid: /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, xhtml: /.*/ };
39625
+ var Ge = { base64Binary: /^([A-Za-z\d+/]{4})*([A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=)?$/, canonical: /^\S*$/, code: /^[^\s]+( [^\s]+)*$/, date: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/, dateTime: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/, id: /^[A-Za-z0-9\-.]{1,64}$/, instant: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\d|3[0-1])T([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00))$/, markdown: /^[\s\S]+$/, oid: /^urn:oid:[0-2](\.(0|[1-9]\d*))+$/, string: /^[\s\S]+$/, time: /^([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?$/, uri: /^\S*$/, url: /^\S*$/, uuid: /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, xhtml: /.*/ };
39626
39626
  function f(r4) {
39627
39627
  return [{ type: l.boolean, value: r4 }];
39628
39628
  }
@@ -39642,10 +39642,10 @@ function L(r4, e) {
39642
39642
  function A(r4, e, t) {
39643
39643
  if (!r4.value)
39644
39644
  return;
39645
- let n = Ye(r4.type, e, t?.profileUrl);
39646
- return n ? ki(r4, e, n) : Vi(r4, e);
39645
+ let n = Ze(r4.type, e, t?.profileUrl);
39646
+ return n ? Vi(r4, e, n) : Di(r4, e);
39647
39647
  }
39648
- function ki(r4, e, t) {
39648
+ function Vi(r4, e, t) {
39649
39649
  let n = r4.value, i2 = t.type;
39650
39650
  if (!i2 || i2.length === 0)
39651
39651
  return;
@@ -39665,16 +39665,16 @@ function ki(r4, e, t) {
39665
39665
  if (Array.isArray(o)) {
39666
39666
  o = o.slice();
39667
39667
  for (let c2 = 0; c2 < Math.max(o.length, a.length); c2++)
39668
- o[c2] = nn(o[c2], a[c2]);
39668
+ o[c2] = sn(o[c2], a[c2]);
39669
39669
  } else
39670
- o = nn(o, a);
39670
+ o = sn(o, a);
39671
39671
  if (!S(o))
39672
- return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((c2) => Xr(c2, s)) : Xr(o, s);
39672
+ return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((c2) => tn(c2, s)) : tn(o, s);
39673
39673
  }
39674
- function Xr(r4, e) {
39674
+ function tn(r4, e) {
39675
39675
  return e === "Resource" && _(r4) && (e = r4.resourceType), { type: e, value: r4 };
39676
39676
  }
39677
- function Vi(r4, e) {
39677
+ function Di(r4, e) {
39678
39678
  let t = r4.value;
39679
39679
  if (!t || typeof t != "object")
39680
39680
  return;
@@ -39692,12 +39692,12 @@ function Vi(r4, e) {
39692
39692
  if (!S(n))
39693
39693
  return Array.isArray(n) ? n.map(x) : x(n);
39694
39694
  }
39695
- function ze(r4) {
39695
+ function Je(r4) {
39696
39696
  let e = [];
39697
39697
  for (let t of r4) {
39698
39698
  let n = false;
39699
39699
  for (let i2 of e)
39700
- if (F(on(t, i2))) {
39700
+ if (F(an(t, i2))) {
39701
39701
  n = true;
39702
39702
  break;
39703
39703
  }
@@ -39705,28 +39705,28 @@ function ze(r4) {
39705
39705
  }
39706
39706
  return e;
39707
39707
  }
39708
- function Xt(r4) {
39708
+ function er(r4) {
39709
39709
  return f(!F(r4));
39710
39710
  }
39711
- function er(r4, e) {
39712
- return r4.length === 0 || e.length === 0 ? [] : r4.length !== e.length ? f(false) : f(r4.every((t, n) => F(on(t, e[n]))));
39711
+ function tr(r4, e) {
39712
+ return r4.length === 0 || e.length === 0 ? [] : r4.length !== e.length ? f(false) : f(r4.every((t, n) => F(an(t, e[n]))));
39713
39713
  }
39714
- function on(r4, e) {
39714
+ function an(r4, e) {
39715
39715
  let t = r4.value?.valueOf(), n = e.value?.valueOf();
39716
- return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : O(t) && O(n) ? f(cn(t, n)) : f(typeof t == "object" && typeof n == "object" ? rr(r4, e) : t === n);
39716
+ return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : O(t) && O(n) ? f(ln(t, n)) : f(typeof t == "object" && typeof n == "object" ? nr(r4, e) : t === n);
39717
39717
  }
39718
- function tr(r4, e) {
39719
- return r4.length === 0 && e.length === 0 ? f(true) : r4.length !== e.length ? f(false) : (r4.sort(en), e.sort(en), f(r4.every((t, n) => F(Di(t, e[n])))));
39718
+ function rr(r4, e) {
39719
+ return r4.length === 0 && e.length === 0 ? f(true) : r4.length !== e.length ? f(false) : (r4.sort(rn), e.sort(rn), f(r4.every((t, n) => F(Mi(t, e[n])))));
39720
39720
  }
39721
- function Di(r4, e) {
39721
+ function Mi(r4, e) {
39722
39722
  let { type: t, value: n } = r4, { type: i2, value: o } = e, s = n?.valueOf(), a = o?.valueOf();
39723
- return typeof s == "number" && typeof a == "number" ? f(Math.abs(s - a) < 0.01) : O(s) && O(a) ? f(cn(s, a)) : f(t === "Coding" && i2 === "Coding" ? typeof s != "object" || typeof a != "object" ? false : s.code === a.code && s.system === a.system : typeof s == "object" && typeof a == "object" ? rr({ ...s, id: void 0 }, { ...a, id: void 0 }) : typeof s == "string" && typeof a == "string" ? s.toLowerCase() === a.toLowerCase() : s === a);
39723
+ return typeof s == "number" && typeof a == "number" ? f(Math.abs(s - a) < 0.01) : O(s) && O(a) ? f(ln(s, a)) : f(t === "Coding" && i2 === "Coding" ? typeof s != "object" || typeof a != "object" ? false : s.code === a.code && s.system === a.system : typeof s == "object" && typeof a == "object" ? nr({ ...s, id: void 0 }, { ...a, id: void 0 }) : typeof s == "string" && typeof a == "string" ? s.toLowerCase() === a.toLowerCase() : s === a);
39724
39724
  }
39725
- function en(r4, e) {
39725
+ function rn(r4, e) {
39726
39726
  let t = r4.value?.valueOf(), n = e.value?.valueOf();
39727
39727
  return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
39728
39728
  }
39729
- function Je(r4, e) {
39729
+ function Ye(r4, e) {
39730
39730
  let { value: t } = r4;
39731
39731
  if (t == null)
39732
39732
  return false;
@@ -39737,91 +39737,91 @@ function Je(r4, e) {
39737
39737
  case "Integer":
39738
39738
  return typeof t == "number";
39739
39739
  case "Date":
39740
- return sn(t);
39740
+ return cn(t);
39741
39741
  case "DateTime":
39742
- return Ke(t);
39742
+ return ze(t);
39743
39743
  case "Time":
39744
39744
  return typeof t == "string" && !!/^T\d/.exec(t);
39745
39745
  case "Period":
39746
- return an(t);
39746
+ return un(t);
39747
39747
  case "Quantity":
39748
39748
  return O(t);
39749
39749
  default:
39750
39750
  return typeof t == "object" && t?.resourceType === e;
39751
39751
  }
39752
39752
  }
39753
- function sn(r4) {
39754
- return typeof r4 == "string" && !!He.date.exec(r4);
39753
+ function cn(r4) {
39754
+ return typeof r4 == "string" && !!Ge.date.exec(r4);
39755
39755
  }
39756
- function Ke(r4) {
39757
- return typeof r4 == "string" && !!He.dateTime.exec(r4);
39756
+ function ze(r4) {
39757
+ return typeof r4 == "string" && !!Ge.dateTime.exec(r4);
39758
39758
  }
39759
- function an(r4) {
39760
- return !!(r4 && typeof r4 == "object" && ("start" in r4 && Ke(r4.start) || "end" in r4 && Ke(r4.end)));
39759
+ function un(r4) {
39760
+ return !!(r4 && typeof r4 == "object" && ("start" in r4 && ze(r4.start) || "end" in r4 && ze(r4.end)));
39761
39761
  }
39762
39762
  function O(r4) {
39763
39763
  return !!(r4 && typeof r4 == "object" && "value" in r4 && typeof r4.value == "number");
39764
39764
  }
39765
- function cn(r4, e) {
39765
+ function ln(r4, e) {
39766
39766
  return Math.abs(r4.value - e.value) < 0.01 && (r4.unit === e.unit || r4.code === e.code || r4.unit === e.code || r4.code === e.unit);
39767
39767
  }
39768
- function rr(r4, e) {
39768
+ function nr(r4, e) {
39769
39769
  let t = Object.keys(r4), n = Object.keys(e);
39770
39770
  if (t.length !== n.length)
39771
39771
  return false;
39772
39772
  for (let i2 of t) {
39773
39773
  let o = r4[i2], s = e[i2];
39774
- if (rn(o) && rn(s)) {
39775
- if (!rr(o, s))
39774
+ if (on(o) && on(s)) {
39775
+ if (!nr(o, s))
39776
39776
  return false;
39777
39777
  } else if (o !== s)
39778
39778
  return false;
39779
39779
  }
39780
39780
  return true;
39781
39781
  }
39782
- function rn(r4) {
39782
+ function on(r4) {
39783
39783
  return r4 !== null && typeof r4 == "object";
39784
39784
  }
39785
- function nn(r4, e) {
39785
+ function sn(r4, e) {
39786
39786
  if (e) {
39787
39787
  if (typeof e != "object")
39788
39788
  throw new Error("Primitive extension must be an object");
39789
- return Mi(r4 ?? {}, e);
39789
+ return Ni(r4 ?? {}, e);
39790
39790
  }
39791
39791
  return r4;
39792
39792
  }
39793
- function Mi(r4, e) {
39793
+ function Ni(r4, e) {
39794
39794
  return delete e.__proto__, delete e.constructor, Object.assign(r4, e);
39795
39795
  }
39796
- function Q(r4) {
39797
- let e = X(r4), t = Fi(r4);
39796
+ function K(r4) {
39797
+ let e = ee(r4), t = _i(r4);
39798
39798
  return t === e ? { reference: e } : { reference: e, display: t };
39799
39799
  }
39800
- function X(r4) {
39801
- return Z(r4) ? r4.reference : `${r4.resourceType}/${r4.id}`;
39800
+ function ee(r4) {
39801
+ return X(r4) ? r4.reference : `${r4.resourceType}/${r4.id}`;
39802
39802
  }
39803
- function Xe(r4) {
39803
+ function et(r4) {
39804
39804
  if (r4)
39805
- return Z(r4) ? r4.reference.split("/")[1] : r4.id;
39805
+ return X(r4) ? r4.reference.split("/")[1] : r4.id;
39806
39806
  }
39807
- function Ni(r4) {
39807
+ function Fi(r4) {
39808
39808
  return r4.resourceType === "Patient" || r4.resourceType === "Practitioner" || r4.resourceType === "RelatedPerson";
39809
39809
  }
39810
- function Fi(r4) {
39811
- if (Ni(r4)) {
39812
- let e = _i(r4);
39810
+ function _i(r4) {
39811
+ if (Fi(r4)) {
39812
+ let e = Li(r4);
39813
39813
  if (e)
39814
39814
  return e;
39815
39815
  }
39816
39816
  if (r4.resourceType === "Device") {
39817
- let e = Li(r4);
39817
+ let e = Ui(r4);
39818
39818
  if (e)
39819
39819
  return e;
39820
39820
  }
39821
39821
  if (r4.resourceType === "MedicationRequest") {
39822
39822
  let e = r4.medicationCodeableConcept;
39823
39823
  if (e)
39824
- return Ze(e);
39824
+ return Xe(e);
39825
39825
  }
39826
39826
  if (r4.resourceType === "User" && r4.email)
39827
39827
  return r4.email;
@@ -39829,24 +39829,24 @@ function Fi(r4) {
39829
39829
  return r4.name;
39830
39830
  if ("code" in r4 && r4.code) {
39831
39831
  let e = r4.code;
39832
- if (Array.isArray(e) && (e = e[0]), Qi(e))
39833
- return Ze(e);
39834
- if (Ki(e))
39832
+ if (Array.isArray(e) && (e = e[0]), Ki(e))
39833
+ return Xe(e);
39834
+ if (zi(e))
39835
39835
  return e.text;
39836
39836
  }
39837
- return X(r4);
39837
+ return ee(r4);
39838
39838
  }
39839
- function _i(r4) {
39839
+ function Li(r4) {
39840
39840
  let e = r4.name;
39841
39841
  if (e && e.length > 0)
39842
- return tt(e[0]);
39842
+ return nt(e[0]);
39843
39843
  }
39844
- function Li(r4) {
39844
+ function Ui(r4) {
39845
39845
  let e = r4.deviceName;
39846
39846
  if (e && e.length > 0)
39847
39847
  return e[0].name;
39848
39848
  }
39849
- function et(r4, e) {
39849
+ function tt(r4, e) {
39850
39850
  let t = new Date(r4);
39851
39851
  t.setUTCHours(0, 0, 0, 0);
39852
39852
  let n = e ? new Date(e) : /* @__PURE__ */ new Date();
@@ -39858,28 +39858,28 @@ function et(r4, e) {
39858
39858
  let g2 = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60 * 60 * 24));
39859
39859
  return { years: p2, months: y, days: g2 };
39860
39860
  }
39861
- function Gt(r4, ...e) {
39861
+ function Qt(r4, ...e) {
39862
39862
  let t = r4;
39863
39863
  for (let n = 0; n < e.length && t; n++)
39864
39864
  t = t?.extension?.find((i2) => i2.url === e[n]);
39865
39865
  return t;
39866
39866
  }
39867
- function dn(r4, e) {
39868
- return JSON.stringify(r4, Ui, e ? 2 : void 0);
39867
+ function mn(r4, e) {
39868
+ return JSON.stringify(r4, Bi, e ? 2 : void 0);
39869
39869
  }
39870
- function Ui(r4, e) {
39871
- return !Bi(r4) && S(e) ? void 0 : e;
39870
+ function Bi(r4, e) {
39871
+ return !qi(r4) && S(e) ? void 0 : e;
39872
39872
  }
39873
- function Bi(r4) {
39873
+ function qi(r4) {
39874
39874
  return !!/\d+$/.exec(r4);
39875
39875
  }
39876
39876
  function S(r4) {
39877
39877
  if (r4 == null)
39878
39878
  return true;
39879
39879
  let e = typeof r4;
39880
- return e === "string" || e === "object" ? !W(r4) : false;
39880
+ return e === "string" || e === "object" ? !H(r4) : false;
39881
39881
  }
39882
- function W(r4) {
39882
+ function H(r4) {
39883
39883
  if (r4 == null)
39884
39884
  return false;
39885
39885
  let e = typeof r4;
@@ -39888,31 +39888,31 @@ function W(r4) {
39888
39888
  function b(r4) {
39889
39889
  return r4 !== null && typeof r4 == "object";
39890
39890
  }
39891
- function fn(r4) {
39892
- return r4.every(Hi);
39893
- }
39894
- function Hi(r4) {
39895
- return typeof r4 == "string";
39891
+ function hn(r4) {
39892
+ return r4.every(Gi);
39896
39893
  }
39897
39894
  function Gi(r4) {
39898
- return b(r4) && "code" in r4 && typeof r4.code == "string";
39895
+ return typeof r4 == "string";
39899
39896
  }
39900
39897
  function Qi(r4) {
39901
- return b(r4) && "coding" in r4 && Array.isArray(r4.coding) && r4.coding.every(Gi);
39898
+ return b(r4) && "code" in r4 && typeof r4.code == "string";
39902
39899
  }
39903
39900
  function Ki(r4) {
39901
+ return b(r4) && "coding" in r4 && Array.isArray(r4.coding) && r4.coding.every(Qi);
39902
+ }
39903
+ function zi(r4) {
39904
39904
  return b(r4) && "text" in r4 && typeof r4.text == "string";
39905
39905
  }
39906
- var mn = [];
39906
+ var yn = [];
39907
39907
  for (let r4 = 0; r4 < 256; r4++)
39908
- mn.push(r4.toString(16).padStart(2, "0"));
39909
- function hn(r4) {
39908
+ yn.push(r4.toString(16).padStart(2, "0"));
39909
+ function gn(r4) {
39910
39910
  let e = new Uint8Array(r4), t = new Array(e.length);
39911
39911
  for (let n = 0; n < e.length; n++)
39912
- t[n] = mn[e[n]];
39912
+ t[n] = yn[e[n]];
39913
39913
  return t.join("");
39914
39914
  }
39915
- function yn(r4) {
39915
+ function xn(r4) {
39916
39916
  let e = new Uint8Array(r4), t = [];
39917
39917
  for (let n = 0; n < e.length; n++)
39918
39918
  t[n] = String.fromCharCode(e[n]);
@@ -39921,53 +39921,65 @@ function yn(r4) {
39921
39921
  function C(r4) {
39922
39922
  return r4 ? r4.charAt(0).toUpperCase() + r4.substring(1) : "";
39923
39923
  }
39924
- var or = (r4) => new Promise((e) => {
39924
+ var sr = (r4) => new Promise((e) => {
39925
39925
  setTimeout(e, r4);
39926
39926
  });
39927
- function Tn(r4, e) {
39928
- return new URL(r4, e).toString().replace("http://", "ws://").replace("https://", "wss://");
39927
+ function rt(r4) {
39928
+ return r4.sort((e, t) => e.localeCompare(t));
39929
39929
  }
39930
- function tt(r4, e) {
39930
+ function ar(r4) {
39931
+ return r4.endsWith("/") ? r4 : r4 + "/";
39932
+ }
39933
+ function to(r4) {
39934
+ return r4.startsWith("/") ? r4.slice(1) : r4;
39935
+ }
39936
+ function B(r4, e) {
39937
+ return new URL(to(e), ar(r4.toString())).toString();
39938
+ }
39939
+ function En(r4, e) {
39940
+ return B(r4, e).toString().replace("http://", "ws://").replace("https://", "wss://");
39941
+ }
39942
+ function nt(r4, e) {
39931
39943
  let t = [];
39932
39944
  if (r4.prefix && e?.prefix !== false && t.push(...r4.prefix), r4.given && t.push(...r4.given), r4.family && t.push(r4.family), r4.suffix && e?.suffix !== false && t.push(...r4.suffix), r4.use && (e?.all || e?.use) && t.push("[" + r4.use + "]"), t.length === 0) {
39933
- let n = he(r4.text);
39945
+ let n = ye(r4.text);
39934
39946
  if (n)
39935
39947
  return n;
39936
39948
  }
39937
39949
  return t.join(" ").trim();
39938
39950
  }
39939
- function Ze(r4) {
39951
+ function Xe(r4) {
39940
39952
  if (!r4)
39941
39953
  return "";
39942
- let e = he(r4.text);
39943
- return e || (r4.coding ? r4.coding.map((t) => oo(t)).join(", ") : "");
39954
+ let e = ye(r4.text);
39955
+ return e || (r4.coding ? r4.coding.map((t) => ao(t)).join(", ") : "");
39944
39956
  }
39945
- function oo(r4) {
39946
- return he(r4?.display) ?? he(r4?.code) ?? "";
39957
+ function ao(r4) {
39958
+ return ye(r4?.display) ?? ye(r4?.code) ?? "";
39947
39959
  }
39948
- function he(r4) {
39960
+ function ye(r4) {
39949
39961
  return typeof r4 == "string" ? r4 : void 0;
39950
39962
  }
39951
39963
  var l = { Address: "Address", Age: "Age", Annotation: "Annotation", Attachment: "Attachment", BackboneElement: "BackboneElement", CodeableConcept: "CodeableConcept", Coding: "Coding", ContactDetail: "ContactDetail", ContactPoint: "ContactPoint", Contributor: "Contributor", Count: "Count", DataRequirement: "DataRequirement", Distance: "Distance", Dosage: "Dosage", Duration: "Duration", Expression: "Expression", Extension: "Extension", HumanName: "HumanName", Identifier: "Identifier", MarketingStatus: "MarketingStatus", Meta: "Meta", Money: "Money", Narrative: "Narrative", ParameterDefinition: "ParameterDefinition", Period: "Period", Population: "Population", ProdCharacteristic: "ProdCharacteristic", ProductShelfLife: "ProductShelfLife", Quantity: "Quantity", Range: "Range", Ratio: "Ratio", Reference: "Reference", RelatedArtifact: "RelatedArtifact", SampledData: "SampledData", Signature: "Signature", SubstanceAmount: "SubstanceAmount", SystemString: "http://hl7.org/fhirpath/System.String", Timing: "Timing", TriggerDefinition: "TriggerDefinition", UsageContext: "UsageContext", base64Binary: "base64Binary", boolean: "boolean", canonical: "canonical", code: "code", date: "date", dateTime: "dateTime", decimal: "decimal", id: "id", instant: "instant", integer: "integer", markdown: "markdown", oid: "oid", positiveInt: "positiveInt", string: "string", time: "time", unsignedInt: "unsignedInt", uri: "uri", url: "url", uuid: "uuid" };
39952
- function cr(r4) {
39964
+ function lr(r4) {
39953
39965
  for (let e of r4.base ?? []) {
39954
39966
  let t = V.types[e];
39955
39967
  t || (t = { searchParamsDetails: {} }, V.types[e] = t), t.searchParams || (t.searchParams = { _id: { base: [e], code: "_id", type: "token", expression: e + ".id" }, _lastUpdated: { base: [e], code: "_lastUpdated", type: "date", expression: e + ".meta.lastUpdated" }, _compartment: { base: [e], code: "_compartment", type: "reference", expression: e + ".meta.compartment" }, _profile: { base: [e], code: "_profile", type: "uri", expression: e + ".meta.profile" }, _security: { base: [e], code: "_security", type: "token", expression: e + ".meta.security" }, _source: { base: [e], code: "_source", type: "uri", expression: e + ".meta.source" }, _tag: { base: [e], code: "_tag", type: "token", expression: e + ".meta.tag" } }), t.searchParams[r4.code] = r4;
39956
39968
  }
39957
39969
  }
39958
- function qt(r4) {
39970
+ function jt(r4) {
39959
39971
  let e = r4.type?.[0]?.code;
39960
- return e === "BackboneElement" || e === "Element" ? uo((r4.base?.path ?? r4.path)?.split(".")) : e;
39972
+ return e === "BackboneElement" || e === "Element" ? po((r4.base?.path ?? r4.path)?.split(".")) : e;
39961
39973
  }
39962
- function uo(r4) {
39974
+ function po(r4) {
39963
39975
  return r4.length === 1 ? r4[0] : r4.map(C).join("");
39964
39976
  }
39965
- function Ye(r4, e, t) {
39966
- let n = Pe(r4, t);
39977
+ function Ze(r4, e, t) {
39978
+ let n = Ce(r4, t);
39967
39979
  if (n)
39968
- return mo(n.elements, e);
39980
+ return yo(n.elements, e);
39969
39981
  }
39970
- function mo(r4, e) {
39982
+ function yo(r4, e) {
39971
39983
  let t = r4[e] ?? r4[e + "[x]"];
39972
39984
  if (t)
39973
39985
  return t;
@@ -39983,11 +39995,11 @@ function mo(r4, e) {
39983
39995
  function _(r4) {
39984
39996
  return !!(r4 && typeof r4 == "object" && "resourceType" in r4);
39985
39997
  }
39986
- function Z(r4) {
39998
+ function X(r4) {
39987
39999
  return !!(r4 && typeof r4 == "object" && "reference" in r4 && typeof r4.reference == "string");
39988
40000
  }
39989
40001
  var V = { types: {} };
39990
- function ye(r4) {
40002
+ function ge(r4) {
39991
40003
  if (r4.startsWith("T"))
39992
40004
  return r4 + "T00:00:00.000Z".substring(r4.length);
39993
40005
  if (r4.length <= 10)
@@ -39998,7 +40010,7 @@ function ye(r4) {
39998
40010
  return r4;
39999
40011
  }
40000
40012
  }
40001
- var we = () => [];
40013
+ var Ae = () => [];
40002
40014
  var w = { empty: (r4, e) => f(e.length === 0 || e.every((t) => S(t.value))), hasValue: (r4, e) => f(e.length !== 0), exists: (r4, e, t) => t ? f(e.filter((n) => F(t.eval(r4, [n]))).length > 0) : f(e.length > 0 && e.every((n) => !S(n.value))), all: (r4, e, t) => f(e.every((n) => F(t.eval(r4, [n])))), allTrue: (r4, e) => {
40003
40015
  for (let t of e)
40004
40016
  if (!t.value)
@@ -40019,12 +40031,12 @@ var w = { empty: (r4, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
40019
40031
  if (!t.value)
40020
40032
  return f(true);
40021
40033
  return f(false);
40022
- }, subsetOf: we, supersetOf: we, count: (r4, e) => [{ type: l.integer, value: e.length }], distinct: (r4, e) => {
40034
+ }, subsetOf: Ae, supersetOf: Ae, count: (r4, e) => [{ type: l.integer, value: e.length }], distinct: (r4, e) => {
40023
40035
  let t = [];
40024
40036
  for (let n of e)
40025
40037
  t.some((i2) => i2.value === n.value) || t.push(n);
40026
40038
  return t;
40027
- }, isDistinct: (r4, e) => f(e.length === w.distinct(r4, e).length), where: (r4, e, t) => e.filter((n) => F(t.eval({ parent: r4, variables: { $this: n } }, [n]))), select: (r4, e, t) => e.map((n) => t.eval(r4, [n])).flat(), repeat: we, ofType: (r4, e, t) => e.filter((n) => n.type === t.name), single: (r4, e) => {
40039
+ }, isDistinct: (r4, e) => f(e.length === w.distinct(r4, e).length), where: (r4, e, t) => e.filter((n) => F(t.eval({ parent: r4, variables: { $this: n } }, [n]))), select: (r4, e, t) => e.map((n) => t.eval(r4, [n])).flat(), repeat: Ae, ofType: (r4, e, t) => e.filter((n) => n.type === t.name), single: (r4, e) => {
40028
40040
  if (e.length > 1)
40029
40041
  throw new Error("Expected input length one for single()");
40030
40042
  return e.length === 0 ? [] : e.slice(0, 1);
@@ -40056,7 +40068,7 @@ var w = { empty: (r4, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
40056
40068
  if (!t)
40057
40069
  return e;
40058
40070
  let n = t.eval(r4, e);
40059
- return ze([...e, ...n]);
40071
+ return Je([...e, ...n]);
40060
40072
  }, combine: (r4, e, t) => {
40061
40073
  if (!t)
40062
40074
  return e;
@@ -40070,7 +40082,7 @@ var w = { empty: (r4, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
40070
40082
  }, toBoolean: (r4, e) => {
40071
40083
  if (e.length === 0)
40072
40084
  return [];
40073
- let [{ value: t }] = q(e, 1);
40085
+ let [{ value: t }] = j(e, 1);
40074
40086
  if (typeof t == "boolean")
40075
40087
  return [{ type: l.boolean, value: t }];
40076
40088
  if (typeof t == "number" && (t === 0 || t === 1))
@@ -40086,47 +40098,47 @@ var w = { empty: (r4, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
40086
40098
  }, convertsToBoolean: (r4, e) => e.length === 0 ? [] : f(w.toBoolean(r4, e).length === 1), toInteger: (r4, e) => {
40087
40099
  if (e.length === 0)
40088
40100
  return [];
40089
- let [{ value: t }] = q(e, 1);
40101
+ let [{ value: t }] = j(e, 1);
40090
40102
  return typeof t == "number" ? [{ type: l.integer, value: t }] : typeof t == "string" && /^[+-]?\d+$/.exec(t) ? [{ type: l.integer, value: parseInt(t, 10) }] : typeof t == "boolean" ? [{ type: l.integer, value: t ? 1 : 0 }] : [];
40091
40103
  }, convertsToInteger: (r4, e) => e.length === 0 ? [] : f(w.toInteger(r4, e).length === 1), toDate: (r4, e) => {
40092
40104
  if (e.length === 0)
40093
40105
  return [];
40094
- let [{ value: t }] = q(e, 1);
40095
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.date, value: ye(t) }] : [];
40106
+ let [{ value: t }] = j(e, 1);
40107
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.date, value: ge(t) }] : [];
40096
40108
  }, convertsToDate: (r4, e) => e.length === 0 ? [] : f(w.toDate(r4, e).length === 1), toDateTime: (r4, e) => {
40097
40109
  if (e.length === 0)
40098
40110
  return [];
40099
- let [{ value: t }] = q(e, 1);
40100
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.dateTime, value: ye(t) }] : [];
40111
+ let [{ value: t }] = j(e, 1);
40112
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.dateTime, value: ge(t) }] : [];
40101
40113
  }, convertsToDateTime: (r4, e) => e.length === 0 ? [] : f(w.toDateTime(r4, e).length === 1), toDecimal: (r4, e) => {
40102
40114
  if (e.length === 0)
40103
40115
  return [];
40104
- let [{ value: t }] = q(e, 1);
40116
+ let [{ value: t }] = j(e, 1);
40105
40117
  return typeof t == "number" ? [{ type: l.decimal, value: t }] : typeof t == "string" && /^-?\d{1,9}(\.\d{1,9})?$/.exec(t) ? [{ type: l.decimal, value: parseFloat(t) }] : typeof t == "boolean" ? [{ type: l.decimal, value: t ? 1 : 0 }] : [];
40106
40118
  }, convertsToDecimal: (r4, e) => e.length === 0 ? [] : f(w.toDecimal(r4, e).length === 1), toQuantity: (r4, e) => {
40107
40119
  if (e.length === 0)
40108
40120
  return [];
40109
- let [{ value: t }] = q(e, 1);
40121
+ let [{ value: t }] = j(e, 1);
40110
40122
  return O(t) ? [{ type: l.Quantity, value: t }] : typeof t == "number" ? [{ type: l.Quantity, value: { value: t, unit: "1" } }] : typeof t == "string" && /^-?\d{1,9}(\.\d{1,9})?/.exec(t) ? [{ type: l.Quantity, value: { value: parseFloat(t), unit: "1" } }] : typeof t == "boolean" ? [{ type: l.Quantity, value: { value: t ? 1 : 0, unit: "1" } }] : [];
40111
40123
  }, convertsToQuantity: (r4, e) => e.length === 0 ? [] : f(w.toQuantity(r4, e).length === 1), toString: (r4, e) => {
40112
40124
  if (e.length === 0)
40113
40125
  return [];
40114
- let [{ value: t }] = q(e, 1);
40126
+ let [{ value: t }] = j(e, 1);
40115
40127
  return t == null ? [] : O(t) ? [{ type: l.string, value: `${t.value} '${t.unit}'` }] : [{ type: l.string, value: t.toString() }];
40116
40128
  }, convertsToString: (r4, e) => e.length === 0 ? [] : f(w.toString(r4, e).length === 1), toTime: (r4, e) => {
40117
40129
  if (e.length === 0)
40118
40130
  return [];
40119
- let [{ value: t }] = q(e, 1);
40131
+ let [{ value: t }] = j(e, 1);
40120
40132
  if (typeof t == "string") {
40121
40133
  let n = /^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(t);
40122
40134
  if (n)
40123
- return [{ type: l.time, value: ye("T" + n[1]) }];
40135
+ return [{ type: l.time, value: ge("T" + n[1]) }];
40124
40136
  }
40125
40137
  return [];
40126
40138
  }, convertsToTime: (r4, e) => e.length === 0 ? [] : f(w.toTime(r4, e).length === 1), indexOf: (r4, e, t) => D((n, i2) => n.indexOf(i2), r4, e, t), substring: (r4, e, t, n) => D((i2, o, s) => {
40127
40139
  let a = o, c2 = s ? a + s : i2.length;
40128
40140
  return a < 0 || a >= i2.length ? void 0 : i2.substring(a, c2);
40129
- }, r4, e, t, n), startsWith: (r4, e, t) => D((n, i2) => n.startsWith(i2), r4, e, t), endsWith: (r4, e, t) => D((n, i2) => n.endsWith(i2), r4, e, t), contains: (r4, e, t) => D((n, i2) => n.includes(i2), r4, e, t), upper: (r4, e) => D((t) => t.toUpperCase(), r4, e), lower: (r4, e) => D((t) => t.toLowerCase(), r4, e), replace: (r4, e, t, n) => D((i2, o, s) => i2.replaceAll(o, s), r4, e, t, n), matches: (r4, e, t) => D((n, i2) => !!new RegExp(i2).exec(n), r4, e, t), replaceMatches: (r4, e, t, n) => D((i2, o, s) => i2.replaceAll(o, s), r4, e, t, n), length: (r4, e) => D((t) => t.length, r4, e), toChars: (r4, e) => D((t) => t ? t.split("") : void 0, r4, e), abs: (r4, e) => B(Math.abs, r4, e), ceiling: (r4, e) => B(Math.ceil, r4, e), exp: (r4, e) => B(Math.exp, r4, e), floor: (r4, e) => B(Math.floor, r4, e), ln: (r4, e) => B(Math.log, r4, e), log: (r4, e, t) => B((n, i2) => Math.log(n) / Math.log(i2), r4, e, t), power: (r4, e, t) => B(Math.pow, r4, e, t), round: (r4, e) => B(Math.round, r4, e), sqrt: (r4, e) => B(Math.sqrt, r4, e), truncate: (r4, e) => B((t) => t | 0, r4, e), children: we, descendants: we, trace: (r4, e, t) => e, now: () => [{ type: l.dateTime, value: (/* @__PURE__ */ new Date()).toISOString() }], timeOfDay: () => [{ type: l.time, value: (/* @__PURE__ */ new Date()).toISOString().substring(11) }], today: () => [{ type: l.date, value: (/* @__PURE__ */ new Date()).toISOString().substring(0, 10) }], between: (r4, e, t, n, i2) => {
40141
+ }, r4, e, t, n), startsWith: (r4, e, t) => D((n, i2) => n.startsWith(i2), r4, e, t), endsWith: (r4, e, t) => D((n, i2) => n.endsWith(i2), r4, e, t), contains: (r4, e, t) => D((n, i2) => n.includes(i2), r4, e, t), upper: (r4, e) => D((t) => t.toUpperCase(), r4, e), lower: (r4, e) => D((t) => t.toLowerCase(), r4, e), replace: (r4, e, t, n) => D((i2, o, s) => i2.replaceAll(o, s), r4, e, t, n), matches: (r4, e, t) => D((n, i2) => !!new RegExp(i2).exec(n), r4, e, t), replaceMatches: (r4, e, t, n) => D((i2, o, s) => i2.replaceAll(o, s), r4, e, t, n), length: (r4, e) => D((t) => t.length, r4, e), toChars: (r4, e) => D((t) => t ? t.split("") : void 0, r4, e), abs: (r4, e) => q(Math.abs, r4, e), ceiling: (r4, e) => q(Math.ceil, r4, e), exp: (r4, e) => q(Math.exp, r4, e), floor: (r4, e) => q(Math.floor, r4, e), ln: (r4, e) => q(Math.log, r4, e), log: (r4, e, t) => q((n, i2) => Math.log(n) / Math.log(i2), r4, e, t), power: (r4, e, t) => q(Math.pow, r4, e, t), round: (r4, e) => q(Math.round, r4, e), sqrt: (r4, e) => q(Math.sqrt, r4, e), truncate: (r4, e) => q((t) => t | 0, r4, e), children: Ae, descendants: Ae, trace: (r4, e, t) => e, now: () => [{ type: l.dateTime, value: (/* @__PURE__ */ new Date()).toISOString() }], timeOfDay: () => [{ type: l.time, value: (/* @__PURE__ */ new Date()).toISOString().substring(11) }], today: () => [{ type: l.date, value: (/* @__PURE__ */ new Date()).toISOString().substring(0, 10) }], between: (r4, e, t, n, i2) => {
40130
40142
  let o = w.toDateTime(r4, t.eval(r4, e));
40131
40143
  if (o.length === 0)
40132
40144
  throw new Error("Invalid start date");
@@ -40136,11 +40148,11 @@ var w = { empty: (r4, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
40136
40148
  let a = i2.eval(r4, e)[0]?.value;
40137
40149
  if (a !== "years" && a !== "months" && a !== "days")
40138
40150
  throw new Error("Invalid units");
40139
- let c2 = et(o[0].value, s[0].value);
40151
+ let c2 = tt(o[0].value, s[0].value);
40140
40152
  return [{ type: l.Quantity, value: { value: c2[a], unit: a } }];
40141
40153
  }, is: (r4, e, t) => {
40142
40154
  let n = "";
40143
- return t instanceof j ? n = t.name : t instanceof K && (n = t.left.name + "." + t.right.name), n ? e.map((i2) => ({ type: l.boolean, value: Je(i2, n) })) : [];
40155
+ return t instanceof $ ? n = t.name : t instanceof z && (n = t.left.name + "." + t.right.name), n ? e.map((i2) => ({ type: l.boolean, value: Ye(i2, n) })) : [];
40144
40156
  }, not: (r4, e) => w.toBoolean(r4, e).map((t) => ({ type: l.boolean, value: !t.value })), resolve: (r4, e) => e.map((t) => {
40145
40157
  let n = t.value, i2;
40146
40158
  if (typeof n == "string")
@@ -40170,22 +40182,22 @@ var w = { empty: (r4, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
40170
40182
  function D(r4, e, t, ...n) {
40171
40183
  if (t.length === 0)
40172
40184
  return [];
40173
- let [{ value: i2 }] = q(t, 1);
40185
+ let [{ value: i2 }] = j(t, 1);
40174
40186
  if (typeof i2 != "string")
40175
40187
  throw new Error("String function cannot be called with non-string");
40176
40188
  let o = r4(i2, ...n.map((s) => s?.eval(e, t)[0]?.value));
40177
40189
  return o === void 0 ? [] : Array.isArray(o) ? o.map(x) : [x(o)];
40178
40190
  }
40179
- function B(r4, e, t, ...n) {
40191
+ function q(r4, e, t, ...n) {
40180
40192
  if (t.length === 0)
40181
40193
  return [];
40182
- let [{ value: i2 }] = q(t, 1), o = O(i2), s = o ? i2.value : i2;
40194
+ let [{ value: i2 }] = j(t, 1), o = O(i2), s = o ? i2.value : i2;
40183
40195
  if (typeof s != "number")
40184
40196
  throw new Error("Math function cannot be called with non-number");
40185
40197
  let a = r4(s, ...n.map((p2) => p2.eval(e, t)[0]?.value)), c2 = o ? l.Quantity : t[0].type, u2 = o ? { ...i2, value: a } : a;
40186
40198
  return [{ type: c2, value: u2 }];
40187
40199
  }
40188
- function q(r4, e) {
40200
+ function j(r4, e) {
40189
40201
  if (r4.length !== e)
40190
40202
  throw new Error(`Expected ${e} arguments`);
40191
40203
  for (let t of r4)
@@ -40205,7 +40217,7 @@ var M = class {
40205
40217
  return typeof e == "string" ? `'${e}'` : e.toString();
40206
40218
  }
40207
40219
  };
40208
- var j = class {
40220
+ var $ = class {
40209
40221
  constructor(e) {
40210
40222
  this.name = e;
40211
40223
  }
@@ -40233,7 +40245,7 @@ var j = class {
40233
40245
  return this.name;
40234
40246
  }
40235
40247
  };
40236
- var nt = class {
40248
+ var ot = class {
40237
40249
  eval() {
40238
40250
  return [];
40239
40251
  }
@@ -40241,7 +40253,7 @@ var nt = class {
40241
40253
  return "{}";
40242
40254
  }
40243
40255
  };
40244
- var it = class extends Le {
40256
+ var st = class extends Ue {
40245
40257
  constructor(t, n, i2) {
40246
40258
  super(t, n);
40247
40259
  this.impl = i2;
@@ -40253,7 +40265,7 @@ var it = class extends Le {
40253
40265
  return this.operator + this.child.toString();
40254
40266
  }
40255
40267
  };
40256
- var re = class extends G {
40268
+ var ne = class extends Q {
40257
40269
  constructor(e, t) {
40258
40270
  super("as", e, t);
40259
40271
  }
@@ -40261,7 +40273,7 @@ var re = class extends G {
40261
40273
  return w.ofType(e, this.left.eval(e, t), this.right);
40262
40274
  }
40263
40275
  };
40264
- var P = class extends G {
40276
+ var P = class extends Q {
40265
40277
  };
40266
40278
  var I = class extends P {
40267
40279
  constructor(t, n, i2, o) {
@@ -40279,7 +40291,7 @@ var I = class extends P {
40279
40291
  return typeof p2 == "boolean" ? f(p2) : O(s) ? [{ type: l.Quantity, value: { ...s, value: p2 } }] : [x(p2)];
40280
40292
  }
40281
40293
  };
40282
- var ot = class extends G {
40294
+ var at = class extends Q {
40283
40295
  constructor(e, t) {
40284
40296
  super("&", e, t);
40285
40297
  }
@@ -40288,7 +40300,7 @@ var ot = class extends G {
40288
40300
  return o.length > 0 && o.every((s) => typeof s.value == "string") ? [{ type: l.string, value: o.map((s) => s.value).join("") }] : o;
40289
40301
  }
40290
40302
  };
40291
- var st = class extends P {
40303
+ var ct = class extends P {
40292
40304
  constructor(e, t) {
40293
40305
  super("contains", e, t);
40294
40306
  }
@@ -40297,7 +40309,7 @@ var st = class extends P {
40297
40309
  return f(n.some((o) => o.value === i2[0].value));
40298
40310
  }
40299
40311
  };
40300
- var at = class extends P {
40312
+ var ut = class extends P {
40301
40313
  constructor(e, t) {
40302
40314
  super("in", e, t);
40303
40315
  }
@@ -40306,7 +40318,7 @@ var at = class extends P {
40306
40318
  return n ? f(i2.some((o) => o.value === n.value)) : [];
40307
40319
  }
40308
40320
  };
40309
- var K = class extends G {
40321
+ var z = class extends Q {
40310
40322
  constructor(e, t) {
40311
40323
  super(".", e, t);
40312
40324
  }
@@ -40317,52 +40329,52 @@ var K = class extends G {
40317
40329
  return `${this.left.toString()}.${this.right.toString()}`;
40318
40330
  }
40319
40331
  };
40320
- var ge = class extends G {
40332
+ var xe = class extends Q {
40321
40333
  constructor(e, t) {
40322
40334
  super("|", e, t);
40323
40335
  }
40324
40336
  eval(e, t) {
40325
40337
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
40326
- return ze([...n, ...i2]);
40338
+ return Je([...n, ...i2]);
40327
40339
  }
40328
40340
  };
40329
- var ct = class extends P {
40341
+ var lt = class extends P {
40330
40342
  constructor(e, t) {
40331
40343
  super("=", e, t);
40332
40344
  }
40333
40345
  eval(e, t) {
40334
40346
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
40335
- return er(n, i2);
40347
+ return tr(n, i2);
40336
40348
  }
40337
40349
  };
40338
- var ut = class extends P {
40350
+ var pt = class extends P {
40339
40351
  constructor(e, t) {
40340
40352
  super("!=", e, t);
40341
40353
  }
40342
40354
  eval(e, t) {
40343
40355
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
40344
- return Xt(er(n, i2));
40356
+ return er(tr(n, i2));
40345
40357
  }
40346
40358
  };
40347
- var lt = class extends P {
40359
+ var dt = class extends P {
40348
40360
  constructor(e, t) {
40349
40361
  super("~", e, t);
40350
40362
  }
40351
40363
  eval(e, t) {
40352
40364
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
40353
- return tr(n, i2);
40365
+ return rr(n, i2);
40354
40366
  }
40355
40367
  };
40356
- var pt = class extends P {
40368
+ var ft = class extends P {
40357
40369
  constructor(e, t) {
40358
40370
  super("!~", e, t);
40359
40371
  }
40360
40372
  eval(e, t) {
40361
40373
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
40362
- return Xt(tr(n, i2));
40374
+ return er(rr(n, i2));
40363
40375
  }
40364
40376
  };
40365
- var ne = class extends P {
40377
+ var ie = class extends P {
40366
40378
  constructor(e, t) {
40367
40379
  super("is", e, t);
40368
40380
  }
@@ -40371,10 +40383,10 @@ var ne = class extends P {
40371
40383
  if (n.length !== 1)
40372
40384
  return [];
40373
40385
  let i2 = this.right.name;
40374
- return f(Je(n[0], i2));
40386
+ return f(Ye(n[0], i2));
40375
40387
  }
40376
40388
  };
40377
- var dt = class extends P {
40389
+ var mt = class extends P {
40378
40390
  constructor(e, t) {
40379
40391
  super("and", e, t);
40380
40392
  }
@@ -40383,7 +40395,7 @@ var dt = class extends P {
40383
40395
  return n?.value === true && i2?.value === true ? f(true) : n?.value === false || i2?.value === false ? f(false) : [];
40384
40396
  }
40385
40397
  };
40386
- var ft = class extends P {
40398
+ var ht = class extends P {
40387
40399
  constructor(e, t) {
40388
40400
  super("or", e, t);
40389
40401
  }
@@ -40392,7 +40404,7 @@ var ft = class extends P {
40392
40404
  return n?.value === false && i2?.value === false ? f(false) : n?.value || i2?.value ? f(true) : [];
40393
40405
  }
40394
40406
  };
40395
- var mt = class extends P {
40407
+ var yt = class extends P {
40396
40408
  constructor(e, t) {
40397
40409
  super("xor", e, t);
40398
40410
  }
@@ -40401,7 +40413,7 @@ var mt = class extends P {
40401
40413
  return !n || !i2 ? [] : f(n.value !== i2.value);
40402
40414
  }
40403
40415
  };
40404
- var ht = class extends P {
40416
+ var gt = class extends P {
40405
40417
  constructor(e, t) {
40406
40418
  super("implies", e, t);
40407
40419
  }
@@ -40410,7 +40422,7 @@ var ht = class extends P {
40410
40422
  return i2?.value === true || n?.value === false ? f(true) : !n || !i2 ? [] : f(false);
40411
40423
  }
40412
40424
  };
40413
- var H = class {
40425
+ var G = class {
40414
40426
  constructor(e, t) {
40415
40427
  this.name = e;
40416
40428
  this.args = t;
@@ -40425,7 +40437,7 @@ var H = class {
40425
40437
  return `${this.name}(${this.args.map((e) => e.toString()).join(", ")})`;
40426
40438
  }
40427
40439
  };
40428
- var ie = class {
40440
+ var oe = class {
40429
40441
  constructor(e, t) {
40430
40442
  this.left = e;
40431
40443
  this.expr = t;
@@ -40444,67 +40456,67 @@ var ie = class {
40444
40456
  return `${this.left.toString()}[${this.expr.toString()}]`;
40445
40457
  }
40446
40458
  };
40447
- var Oe = ["!=", "!~", "<=", ">=", "{}", "->"];
40459
+ var Ie = ["!=", "!~", "<=", ">=", "{}", "->"];
40448
40460
  var h = { FunctionCall: 0, Dot: 1, Indexer: 2, UnaryAdd: 3, UnarySubtract: 3, Multiply: 4, Divide: 4, IntegerDivide: 4, Modulo: 4, Add: 5, Subtract: 5, Ampersand: 5, Is: 6, As: 6, Union: 7, GreaterThan: 8, GreaterThanOrEquals: 8, LessThan: 8, LessThanOrEquals: 8, Equals: 9, Equivalent: 9, NotEquals: 9, NotEquivalent: 9, In: 10, Contains: 10, And: 11, Xor: 12, Or: 12, Implies: 13, Arrow: 100, Semicolon: 200 };
40449
- var go = { parse(r4) {
40461
+ var vo = { parse(r4) {
40450
40462
  let e = r4.consumeAndParse();
40451
40463
  if (!r4.match(")"))
40452
40464
  throw new Error("Parse error: expected `)` got `" + r4.peek()?.value + "`");
40453
40465
  return e;
40454
40466
  } };
40455
- var xo = { parse(r4, e) {
40467
+ var To = { parse(r4, e) {
40456
40468
  let t = r4.consumeAndParse();
40457
40469
  if (!r4.match("]"))
40458
40470
  throw new Error("Parse error: expected `]`");
40459
- return new ie(e, t);
40471
+ return new oe(e, t);
40460
40472
  }, precedence: h.Indexer };
40461
- var vo = { parse(r4, e) {
40462
- if (!(e instanceof j))
40473
+ var So = { parse(r4, e) {
40474
+ if (!(e instanceof $))
40463
40475
  throw new Error("Unexpected parentheses");
40464
40476
  let t = [];
40465
40477
  for (; !r4.match(")"); )
40466
40478
  t.push(r4.consumeAndParse()), r4.match(",");
40467
- return new H(e.name, t);
40479
+ return new G(e.name, t);
40468
40480
  }, precedence: h.FunctionCall };
40469
- function To(r4) {
40481
+ function Eo(r4) {
40470
40482
  let e = r4.split(" "), t = parseFloat(e[0]), n = e[1];
40471
40483
  return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
40472
40484
  }
40473
- function Ie() {
40474
- return new Ue().registerPrefix("String", { parse: (r4, e) => new M({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r4, e) => new M({ type: l.dateTime, value: ye(e.value) }) }).registerPrefix("Quantity", { parse: (r4, e) => new M({ type: l.Quantity, value: To(e.value) }) }).registerPrefix("Number", { parse: (r4, e) => new M({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new M({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new M({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r4, e) => new j(e.value) }).registerPrefix("{}", { parse: () => new nt() }).registerPrefix("(", go).registerInfix("[", xo).registerInfix("(", vo).prefix("+", h.UnaryAdd, (r4, e) => new it("+", e, (t) => t)).prefix("-", h.UnarySubtract, (r4, e) => new I("-", e, e, (t, n) => -n)).infixLeft(".", h.Dot, (r4, e, t) => new K(r4, t)).infixLeft("/", h.Divide, (r4, e, t) => new I("/", r4, t, (n, i2) => n / i2)).infixLeft("*", h.Multiply, (r4, e, t) => new I("*", r4, t, (n, i2) => n * i2)).infixLeft("+", h.Add, (r4, e, t) => new I("+", r4, t, (n, i2) => n + i2)).infixLeft("-", h.Subtract, (r4, e, t) => new I("-", r4, t, (n, i2) => n - i2)).infixLeft("|", h.Union, (r4, e, t) => new ge(r4, t)).infixLeft("=", h.Equals, (r4, e, t) => new ct(r4, t)).infixLeft("!=", h.NotEquals, (r4, e, t) => new ut(r4, t)).infixLeft("~", h.Equivalent, (r4, e, t) => new lt(r4, t)).infixLeft("!~", h.NotEquivalent, (r4, e, t) => new pt(r4, t)).infixLeft("<", h.LessThan, (r4, e, t) => new I("<", r4, t, (n, i2) => n < i2)).infixLeft("<=", h.LessThanOrEquals, (r4, e, t) => new I("<=", r4, t, (n, i2) => n <= i2)).infixLeft(">", h.GreaterThan, (r4, e, t) => new I(">", r4, t, (n, i2) => n > i2)).infixLeft(">=", h.GreaterThanOrEquals, (r4, e, t) => new I(">=", r4, t, (n, i2) => n >= i2)).infixLeft("&", h.Ampersand, (r4, e, t) => new ot(r4, t)).infixLeft("and", h.And, (r4, e, t) => new dt(r4, t)).infixLeft("as", h.As, (r4, e, t) => new re(r4, t)).infixLeft("contains", h.Contains, (r4, e, t) => new st(r4, t)).infixLeft("div", h.Divide, (r4, e, t) => new I("div", r4, t, (n, i2) => n / i2 | 0)).infixLeft("in", h.In, (r4, e, t) => new at(r4, t)).infixLeft("is", h.Is, (r4, e, t) => new ne(r4, t)).infixLeft("mod", h.Modulo, (r4, e, t) => new I("mod", r4, t, (n, i2) => n % i2)).infixLeft("or", h.Or, (r4, e, t) => new ft(r4, t)).infixLeft("xor", h.Xor, (r4, e, t) => new mt(r4, t)).infixLeft("implies", h.Implies, (r4, e, t) => new ht(r4, t));
40485
+ function ke() {
40486
+ return new Be().registerPrefix("String", { parse: (r4, e) => new M({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r4, e) => new M({ type: l.dateTime, value: ge(e.value) }) }).registerPrefix("Quantity", { parse: (r4, e) => new M({ type: l.Quantity, value: Eo(e.value) }) }).registerPrefix("Number", { parse: (r4, e) => new M({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new M({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new M({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r4, e) => new $(e.value) }).registerPrefix("{}", { parse: () => new ot() }).registerPrefix("(", vo).registerInfix("[", To).registerInfix("(", So).prefix("+", h.UnaryAdd, (r4, e) => new st("+", e, (t) => t)).prefix("-", h.UnarySubtract, (r4, e) => new I("-", e, e, (t, n) => -n)).infixLeft(".", h.Dot, (r4, e, t) => new z(r4, t)).infixLeft("/", h.Divide, (r4, e, t) => new I("/", r4, t, (n, i2) => n / i2)).infixLeft("*", h.Multiply, (r4, e, t) => new I("*", r4, t, (n, i2) => n * i2)).infixLeft("+", h.Add, (r4, e, t) => new I("+", r4, t, (n, i2) => n + i2)).infixLeft("-", h.Subtract, (r4, e, t) => new I("-", r4, t, (n, i2) => n - i2)).infixLeft("|", h.Union, (r4, e, t) => new xe(r4, t)).infixLeft("=", h.Equals, (r4, e, t) => new lt(r4, t)).infixLeft("!=", h.NotEquals, (r4, e, t) => new pt(r4, t)).infixLeft("~", h.Equivalent, (r4, e, t) => new dt(r4, t)).infixLeft("!~", h.NotEquivalent, (r4, e, t) => new ft(r4, t)).infixLeft("<", h.LessThan, (r4, e, t) => new I("<", r4, t, (n, i2) => n < i2)).infixLeft("<=", h.LessThanOrEquals, (r4, e, t) => new I("<=", r4, t, (n, i2) => n <= i2)).infixLeft(">", h.GreaterThan, (r4, e, t) => new I(">", r4, t, (n, i2) => n > i2)).infixLeft(">=", h.GreaterThanOrEquals, (r4, e, t) => new I(">=", r4, t, (n, i2) => n >= i2)).infixLeft("&", h.Ampersand, (r4, e, t) => new at(r4, t)).infixLeft("and", h.And, (r4, e, t) => new mt(r4, t)).infixLeft("as", h.As, (r4, e, t) => new ne(r4, t)).infixLeft("contains", h.Contains, (r4, e, t) => new ct(r4, t)).infixLeft("div", h.Divide, (r4, e, t) => new I("div", r4, t, (n, i2) => n / i2 | 0)).infixLeft("in", h.In, (r4, e, t) => new ut(r4, t)).infixLeft("is", h.Is, (r4, e, t) => new ie(r4, t)).infixLeft("mod", h.Modulo, (r4, e, t) => new I("mod", r4, t, (n, i2) => n % i2)).infixLeft("or", h.Or, (r4, e, t) => new ht(r4, t)).infixLeft("xor", h.Xor, (r4, e, t) => new yt(r4, t)).infixLeft("implies", h.Implies, (r4, e, t) => new gt(r4, t));
40475
40487
  }
40476
- var So = Ie();
40477
- var Pn = ((p2) => (p2.BOOLEAN = "BOOLEAN", p2.NUMBER = "NUMBER", p2.QUANTITY = "QUANTITY", p2.TEXT = "TEXT", p2.REFERENCE = "REFERENCE", p2.CANONICAL = "CANONICAL", p2.DATE = "DATE", p2.DATETIME = "DATETIME", p2.PERIOD = "PERIOD", p2.UUID = "UUID", p2))(Pn || {});
40478
- var Ao = ((T) => (T.EQUALS = "eq", T.NOT_EQUALS = "ne", T.GREATER_THAN = "gt", T.LESS_THAN = "lt", T.GREATER_THAN_OR_EQUALS = "ge", T.LESS_THAN_OR_EQUALS = "le", T.STARTS_AFTER = "sa", T.ENDS_BEFORE = "eb", T.APPROXIMATELY = "ap", T.CONTAINS = "contains", T.EXACT = "exact", T.TEXT = "text", T.NOT = "not", T.ABOVE = "above", T.BELOW = "below", T.IN = "in", T.NOT_IN = "not-in", T.OF_TYPE = "of-type", T.MISSING = "missing", T.IDENTIFIER = "identifier", T.ITERATE = "iterate", T))(Ao || {});
40479
- var Jo = ((E2) => (E2.READ = "read", E2.VREAD = "vread", E2.UPDATE = "update", E2.PATCH = "patch", E2.DELETE = "delete", E2.HISTORY = "history", E2.HISTORY_INSTANCE = "history-instance", E2.HISTORY_TYPE = "history-type", E2.HISTORY_SYSTEM = "history-system", E2.CREATE = "create", E2.SEARCH = "search", E2.SEARCH_TYPE = "search-type", E2.SEARCH_SYSTEM = "search-system", E2.SEARCH_COMPARTMENT = "search-compartment", E2.CAPABILITIES = "capabilities", E2.TRANSACTION = "transaction", E2.BATCH = "batch", E2.OPERATION = "operation", E2))(Jo || {});
40480
- function Nn(r4) {
40488
+ var bo = ke();
40489
+ var wn = ((p2) => (p2.BOOLEAN = "BOOLEAN", p2.NUMBER = "NUMBER", p2.QUANTITY = "QUANTITY", p2.TEXT = "TEXT", p2.REFERENCE = "REFERENCE", p2.CANONICAL = "CANONICAL", p2.DATE = "DATE", p2.DATETIME = "DATETIME", p2.PERIOD = "PERIOD", p2.UUID = "UUID", p2))(wn || {});
40490
+ var Io = ((T) => (T.EQUALS = "eq", T.NOT_EQUALS = "ne", T.GREATER_THAN = "gt", T.LESS_THAN = "lt", T.GREATER_THAN_OR_EQUALS = "ge", T.LESS_THAN_OR_EQUALS = "le", T.STARTS_AFTER = "sa", T.ENDS_BEFORE = "eb", T.APPROXIMATELY = "ap", T.CONTAINS = "contains", T.EXACT = "exact", T.TEXT = "text", T.NOT = "not", T.ABOVE = "above", T.BELOW = "below", T.IN = "in", T.NOT_IN = "not-in", T.OF_TYPE = "of-type", T.MISSING = "missing", T.IDENTIFIER = "identifier", T.ITERATE = "iterate", T))(Io || {});
40491
+ var Zo = ((E2) => (E2.READ = "read", E2.VREAD = "vread", E2.UPDATE = "update", E2.PATCH = "patch", E2.DELETE = "delete", E2.HISTORY = "history", E2.HISTORY_INSTANCE = "history-instance", E2.HISTORY_TYPE = "history-type", E2.HISTORY_SYSTEM = "history-system", E2.CREATE = "create", E2.SEARCH = "search", E2.SEARCH_TYPE = "search-type", E2.SEARCH_SYSTEM = "search-system", E2.SEARCH_COMPARTMENT = "search-compartment", E2.CAPABILITIES = "capabilities", E2.TRANSACTION = "transaction", E2.BATCH = "batch", E2.OPERATION = "operation", E2))(Zo || {});
40492
+ function _n(r4) {
40481
40493
  if (typeof window < "u")
40482
40494
  return window.atob(r4);
40483
40495
  if (typeof Buffer < "u")
40484
40496
  return Buffer.from(r4, "base64").toString("binary");
40485
40497
  throw new Error("Unable to decode base64");
40486
40498
  }
40487
- function Fn(r4) {
40499
+ function Ln(r4) {
40488
40500
  if (typeof window < "u")
40489
40501
  return window.btoa(r4);
40490
40502
  if (typeof Buffer < "u")
40491
40503
  return Buffer.from(r4, "binary").toString("base64");
40492
40504
  throw new Error("Unable to encode base64");
40493
40505
  }
40494
- function mr() {
40506
+ function yr() {
40495
40507
  let r4 = new Uint32Array(28);
40496
- return crypto.getRandomValues(r4), hn(r4.buffer);
40508
+ return crypto.getRandomValues(r4), gn(r4.buffer);
40497
40509
  }
40498
- async function _n(r4) {
40510
+ async function Un(r4) {
40499
40511
  return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r4));
40500
40512
  }
40501
- function oe() {
40513
+ function se() {
40502
40514
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r4) => {
40503
40515
  let e = Math.random() * 16 | 0;
40504
40516
  return (r4 === "x" ? e : e & 3 | 8).toString(16);
40505
40517
  });
40506
40518
  }
40507
- var gt = class {
40519
+ var vt = class {
40508
40520
  constructor(e = 10) {
40509
40521
  this.max = e, this.cache = /* @__PURE__ */ new Map();
40510
40522
  }
@@ -40529,7 +40541,7 @@ var gt = class {
40529
40541
  }
40530
40542
  };
40531
40543
  var N = { CSS: "text/css", DICOM: "application/dicom", FAVICON: "image/vnd.microsoft.icon", FHIR_JSON: "application/fhir+json", FORM_URL_ENCODED: "application/x-www-form-urlencoded", HL7_V2: "x-application/hl7-v2+er7", HTML: "text/html", JAVASCRIPT: "text/javascript", JSON: "application/json", JSON_PATCH: "application/json-patch+json", PNG: "image/png", SCIM_JSON: "application/scim+json", SVG: "image/svg+xml", TEXT: "text/plain", TYPESCRIPT: "text/typescript", PING: "x-application/ping" };
40532
- var Ve = class {
40544
+ var De = class {
40533
40545
  constructor() {
40534
40546
  this.listeners = {};
40535
40547
  }
@@ -40557,9 +40569,9 @@ var Ve = class {
40557
40569
  this.listeners = {};
40558
40570
  }
40559
40571
  };
40560
- var se = class {
40572
+ var ae = class {
40561
40573
  constructor() {
40562
- this.emitter = new Ve();
40574
+ this.emitter = new De();
40563
40575
  }
40564
40576
  dispatchEvent(e) {
40565
40577
  this.emitter.dispatchEvent(e);
@@ -40574,41 +40586,41 @@ var se = class {
40574
40586
  this.emitter.removeAllListeners();
40575
40587
  }
40576
40588
  };
40577
- var hr = { "Patient-open": "Patient-open", "Patient-close": "Patient-close", "ImagingStudy-open": "ImagingStudy-open", "ImagingStudy-close": "ImagingStudy-close", "Encounter-open": "Encounter-open", "Encounter-close": "Encounter-close", "DiagnosticReport-open": "DiagnosticReport-open", "DiagnosticReport-close": "DiagnosticReport-close", "DiagnosticReport-select": "DiagnosticReport-select", "DiagnosticReport-update": "DiagnosticReport-update", syncerror: "syncerror" };
40578
- var os = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
40579
- var yr = ["DiagnosticReport-update"];
40580
- function Bn(r4) {
40581
- return yr.includes(r4);
40589
+ var gr = { "Patient-open": "Patient-open", "Patient-close": "Patient-close", "ImagingStudy-open": "ImagingStudy-open", "ImagingStudy-close": "ImagingStudy-close", "Encounter-open": "Encounter-open", "Encounter-close": "Encounter-close", "DiagnosticReport-open": "DiagnosticReport-open", "DiagnosticReport-close": "DiagnosticReport-close", "DiagnosticReport-select": "DiagnosticReport-select", "DiagnosticReport-update": "DiagnosticReport-update", syncerror: "syncerror" };
40590
+ var as = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
40591
+ var xr = ["DiagnosticReport-update"];
40592
+ function jn(r4) {
40593
+ return xr.includes(r4);
40582
40594
  }
40583
- function qn(r4) {
40584
- if (yr.includes(r4))
40595
+ function $n(r4) {
40596
+ if (xr.includes(r4))
40585
40597
  throw new d(m(`'context.version' is required for '${r4}'.`));
40586
40598
  }
40587
- var ss = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport" }, select: { resourceType: "*", isArray: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport" }, patient: { resourceType: "Patient", optional: true }, study: { resourceType: "ImagingStudy", optional: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
40588
- function as(r4) {
40589
- return os.includes(r4);
40599
+ var cs = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport" }, select: { resourceType: "*", isArray: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport" }, patient: { resourceType: "Patient", optional: true }, study: { resourceType: "ImagingStudy", optional: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
40600
+ function us(r4) {
40601
+ return as.includes(r4);
40590
40602
  }
40591
- function jn(r4) {
40603
+ function Wn(r4) {
40592
40604
  return !!r4.endpoint;
40593
40605
  }
40594
- function gr(r4) {
40595
- if (!vt(r4))
40606
+ function vr(r4) {
40607
+ if (!St(r4))
40596
40608
  throw new d(m("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
40597
40609
  let { channelType: e, mode: t, topic: n, events: i2 } = r4, o = { "hub.channel.type": e, "hub.mode": t, "hub.topic": n, "hub.events": i2.join(",") };
40598
- return jn(r4) && (o.endpoint = r4.endpoint), new URLSearchParams(o).toString();
40610
+ return Wn(r4) && (o.endpoint = r4.endpoint), new URLSearchParams(o).toString();
40599
40611
  }
40600
- function vt(r4) {
40612
+ function St(r4) {
40601
40613
  if (typeof r4 != "object")
40602
40614
  return false;
40603
40615
  let { channelType: e, mode: t, topic: n, events: i2 } = r4;
40604
40616
  if (!(e && t && n && i2) || typeof n != "string" || typeof i2 != "object" || !Array.isArray(i2) || i2.length < 1 || e !== "websocket" || t !== "subscribe" && t !== "unsubscribe")
40605
40617
  return false;
40606
40618
  for (let o of i2)
40607
- if (!hr[o])
40619
+ if (!gr[o])
40608
40620
  return false;
40609
- return !(jn(r4) && !(typeof r4.endpoint == "string" && r4.endpoint.startsWith("ws")));
40621
+ return !(Wn(r4) && !(typeof r4.endpoint == "string" && r4.endpoint.startsWith("ws")));
40610
40622
  }
40611
- function Un(r4, e, t, n) {
40623
+ function qn(r4, e, t, n) {
40612
40624
  if (typeof e != "object")
40613
40625
  throw new d(m(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
40614
40626
  if (!(e.id && typeof e.id == "string"))
@@ -40617,30 +40629,30 @@ function Un(r4, e, t, n) {
40617
40629
  throw new d(m(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
40618
40630
  let i2 = n.resourceType;
40619
40631
  if (i2 !== "*") {
40620
- if (!as(e.resourceType))
40632
+ if (!us(e.resourceType))
40621
40633
  throw new d(m(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
40622
40634
  if (i2 && e.resourceType !== i2)
40623
40635
  throw new d(m(`context[${t}] is invalid. context[${t}] for the '${r4}' event should contain resource of type ${i2}.`));
40624
40636
  }
40625
40637
  }
40626
- function cs(r4, e, t, n, i2) {
40638
+ function ls(r4, e, t, n, i2) {
40627
40639
  if (i2.set(e.key, (i2.get(e.key) ?? 0) + 1), !n.isArray)
40628
- Un(r4, e.resource, t, n);
40640
+ qn(r4, e.resource, t, n);
40629
40641
  else {
40630
40642
  let { resources: o } = e;
40631
40643
  if (!o)
40632
40644
  throw new d(m(`context[${t}] is invalid. context[${t}] for the '${r4}' with key '${String(e.key)}' should contain an array of resources on the key 'resources'.`));
40633
40645
  for (let s of o)
40634
- Un(r4, s, t, n);
40646
+ qn(r4, s, t, n);
40635
40647
  }
40636
40648
  }
40637
- function us(r4, e) {
40638
- let t = /* @__PURE__ */ new Map(), n = ss[r4];
40649
+ function ps(r4, e) {
40650
+ let t = /* @__PURE__ */ new Map(), n = cs[r4];
40639
40651
  for (let i2 = 0; i2 < e.length; i2++) {
40640
40652
  let o = e[i2].key;
40641
40653
  if (!n[o])
40642
40654
  throw new d(m(`Key '${o}' not found for event '${r4}'. Make sure to add only valid keys.`));
40643
- cs(r4, e[i2], i2, n[o], t);
40655
+ ls(r4, e[i2], i2, n[o], t);
40644
40656
  }
40645
40657
  for (let [i2, o] of Object.entries(n)) {
40646
40658
  if (!(o.optional || t.has(i2)))
@@ -40649,23 +40661,23 @@ function us(r4, e) {
40649
40661
  throw new d(m(`${t.get(i2)} context entries with key '${i2}' found for the '${r4}' event when schema only allows for 1.`));
40650
40662
  }
40651
40663
  }
40652
- function xr(r4, e, t, n) {
40664
+ function Tr(r4, e, t, n) {
40653
40665
  if (!(r4 && typeof r4 == "string"))
40654
40666
  throw new d(m("Must provide a topic."));
40655
- if (!hr[e])
40656
- throw new d(m(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(hr).join(", ")}`));
40667
+ if (!gr[e])
40668
+ throw new d(m(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(gr).join(", ")}`));
40657
40669
  if (typeof t != "object")
40658
40670
  throw new d(m("context must be a context object or array of context objects."));
40659
- if (yr.includes(e) && !n)
40671
+ if (xr.includes(e) && !n)
40660
40672
  throw new d(m(`The '${e}' event must contain a 'context.versionId'.`));
40661
40673
  let i2 = Array.isArray(t) ? t : [t];
40662
- return us(e, i2), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: oe(), event: { "hub.topic": r4, "hub.event": e, context: i2, ...n ? { "context.versionId": n } : {} } };
40674
+ return ps(e, i2), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: se(), event: { "hub.topic": r4, "hub.event": e, context: i2, ...n ? { "context.versionId": n } : {} } };
40663
40675
  }
40664
- var xt = class extends se {
40676
+ var Tt = class extends ae {
40665
40677
  constructor(e) {
40666
40678
  if (super(), this.subRequest = e, !e.endpoint)
40667
40679
  throw new d(m("Subscription request should contain an endpoint."));
40668
- if (!vt(e))
40680
+ if (!St(e))
40669
40681
  throw new d(m("Subscription request failed validation."));
40670
40682
  let t = new WebSocket(e.endpoint);
40671
40683
  t.addEventListener("open", () => {
@@ -40684,36 +40696,36 @@ var xt = class extends se {
40684
40696
  this.websocket.close();
40685
40697
  }
40686
40698
  };
40687
- function ls(r4) {
40688
- let e = r4.replace(/-/g, "+").replace(/_/g, "/"), t = Nn(e), n = Array.from(t).reduce((o, s) => {
40699
+ function ds(r4) {
40700
+ let e = r4.replace(/-/g, "+").replace(/_/g, "/"), t = _n(e), n = Array.from(t).reduce((o, s) => {
40689
40701
  let a = ("00" + s.charCodeAt(0).toString(16)).slice(-2);
40690
40702
  return `${o}%${a}`;
40691
40703
  }, ""), i2 = decodeURIComponent(n);
40692
40704
  return JSON.parse(i2);
40693
40705
  }
40694
- function $n(r4) {
40706
+ function Hn(r4) {
40695
40707
  return r4.split(".").length === 3;
40696
40708
  }
40697
- function Tt(r4) {
40709
+ function Et(r4) {
40698
40710
  let [e, t, n] = r4.split(".");
40699
- return ls(t);
40711
+ return ds(t);
40700
40712
  }
40701
- function Wn(r4) {
40713
+ function Gn(r4) {
40702
40714
  try {
40703
- return typeof Tt(r4).login_id == "string";
40715
+ return typeof Et(r4).login_id == "string";
40704
40716
  } catch {
40705
40717
  return false;
40706
40718
  }
40707
40719
  }
40708
- function Hn(r4) {
40720
+ function Qn(r4) {
40709
40721
  try {
40710
- let t = Tt(r4).exp;
40722
+ let t = Et(r4).exp;
40711
40723
  return typeof t == "number" ? t * 1e3 : void 0;
40712
40724
  } catch {
40713
40725
  return;
40714
40726
  }
40715
40727
  }
40716
- var St = class {
40728
+ var bt = class {
40717
40729
  constructor(e) {
40718
40730
  this.medplum = e;
40719
40731
  }
@@ -40727,10 +40739,10 @@ var St = class {
40727
40739
  await this.medplum.delete(`keyvalue/v1/${e}`);
40728
40740
  }
40729
40741
  };
40730
- var ps;
40742
+ var fs;
40731
40743
  var k = class {
40732
40744
  constructor(e) {
40733
- this[ps] = "ReadablePromise";
40745
+ this[fs] = "ReadablePromise";
40734
40746
  this.status = "pending";
40735
40747
  this.suspender = e.then((t) => (this.status = "success", this.response = t, t), (t) => {
40736
40748
  throw this.status = "error", this.error = t, t;
@@ -40762,10 +40774,10 @@ var k = class {
40762
40774
  return this.suspender.finally(e);
40763
40775
  }
40764
40776
  };
40765
- ps = Symbol.toStringTag;
40766
- var De = class {
40777
+ fs = Symbol.toStringTag;
40778
+ var Me = class {
40767
40779
  constructor(e) {
40768
- this.storage = e ?? (typeof localStorage < "u" ? localStorage : new vr());
40780
+ this.storage = e ?? (typeof localStorage < "u" ? localStorage : new Sr());
40769
40781
  }
40770
40782
  clear() {
40771
40783
  this.storage.clear();
@@ -40781,10 +40793,10 @@ var De = class {
40781
40793
  return t ? JSON.parse(t) : void 0;
40782
40794
  }
40783
40795
  setObject(e, t) {
40784
- this.setString(e, t ? dn(t) : void 0);
40796
+ this.setString(e, t ? mn(t) : void 0);
40785
40797
  }
40786
40798
  };
40787
- var vr = class {
40799
+ var Sr = class {
40788
40800
  constructor() {
40789
40801
  this.data = /* @__PURE__ */ new Map();
40790
40802
  }
@@ -40807,7 +40819,7 @@ var vr = class {
40807
40819
  return Array.from(this.data.keys())[e];
40808
40820
  }
40809
40821
  };
40810
- var Tr = class extends se {
40822
+ var Er = class extends ae {
40811
40823
  constructor(t) {
40812
40824
  super();
40813
40825
  this.bufferedAmount = -1 / 0;
@@ -40847,7 +40859,7 @@ var Tr = class extends se {
40847
40859
  }
40848
40860
  }
40849
40861
  };
40850
- var Me = class extends se {
40862
+ var Ne = class extends ae {
40851
40863
  constructor(...e) {
40852
40864
  super(), this.criteria = new Set(e);
40853
40865
  }
@@ -40861,14 +40873,14 @@ var Me = class extends se {
40861
40873
  this.criteria.delete(e);
40862
40874
  }
40863
40875
  };
40864
- var Sr = class {
40876
+ var br = class {
40865
40877
  constructor(e) {
40866
- this.criteria = e, this.emitter = new Me(e), this.refCount = 1;
40878
+ this.criteria = e, this.emitter = new Ne(e), this.refCount = 1;
40867
40879
  }
40868
40880
  };
40869
- var Et = class {
40881
+ var Rt = class {
40870
40882
  constructor(e, t, n) {
40871
- if (!(e instanceof bt))
40883
+ if (!(e instanceof Pt))
40872
40884
  throw new d(m("First arg of constructor should be a `MedplumClient`"));
40873
40885
  let i2;
40874
40886
  try {
@@ -40876,8 +40888,8 @@ var Et = class {
40876
40888
  } catch {
40877
40889
  throw new d(m("Not a valid URL"));
40878
40890
  }
40879
- let o = n?.RobustWebSocket ? new n.RobustWebSocket(i2) : new Tr(i2);
40880
- this.medplum = e, this.ws = o, this.masterSubEmitter = new Me(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.setupWebSocketListeners();
40891
+ let o = n?.RobustWebSocket ? new n.RobustWebSocket(i2) : new Er(i2);
40892
+ this.medplum = e, this.ws = o, this.masterSubEmitter = new Ne(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.setupWebSocketListeners();
40881
40893
  }
40882
40894
  setupWebSocketListeners() {
40883
40895
  let e = this.ws;
@@ -40889,7 +40901,7 @@ var Et = class {
40889
40901
  return;
40890
40902
  }
40891
40903
  this.masterSubEmitter?.dispatchEvent({ type: "message", payload: n });
40892
- let o = this.criteriaEntriesBySubscriptionId.get(Xe(i2.subscription));
40904
+ let o = this.criteriaEntriesBySubscriptionId.get(et(i2.subscription));
40893
40905
  if (!o) {
40894
40906
  console.warn("Received notification for criteria the SubscriptionManager is not listening for");
40895
40907
  return;
@@ -40903,7 +40915,7 @@ var Et = class {
40903
40915
  o.dispatchEvent(i2);
40904
40916
  }
40905
40917
  }), e.addEventListener("error", () => {
40906
- let t = { type: "error", payload: new d(Fr(new Error("WebSocket error"))) };
40918
+ let t = { type: "error", payload: new d(Lr(new Error("WebSocket error"))) };
40907
40919
  this.masterSubEmitter?.dispatchEvent(t);
40908
40920
  for (let { emitter: n } of this.criteriaEntries.values())
40909
40921
  n.dispatchEvent(t);
@@ -40926,8 +40938,8 @@ var Et = class {
40926
40938
  }
40927
40939
  async getTokenForCriteria(e) {
40928
40940
  let t = e?.subscriptionId;
40929
- t || (t = (await this.medplum.createResource({ resourceType: "Subscription", status: "active", reason: `WebSocket subscription for ${X(this.medplum.getProfile())}`, criteria: e.criteria, channel: { type: "websocket" } })).id);
40930
- let { parameter: n } = await this.medplum.get(`/fhir/R4/Subscription/${t}/$get-ws-binding-token`), i2 = n?.find((s) => s.name === "token")?.valueString, o = n?.find((s) => s.name === "websocket-url")?.valueUrl;
40941
+ t || (t = (await this.medplum.createResource({ resourceType: "Subscription", status: "active", reason: `WebSocket subscription for ${ee(this.medplum.getProfile())}`, criteria: e.criteria, channel: { type: "websocket" } })).id);
40942
+ let { parameter: n } = await this.medplum.get(`fhir/R4/Subscription/${t}/$get-ws-binding-token`), i2 = n?.find((s) => s.name === "token")?.valueString, o = n?.find((s) => s.name === "websocket-url")?.valueUrl;
40931
40943
  if (!i2)
40932
40944
  throw new d(m("Failed to get token"));
40933
40945
  if (!o)
@@ -40939,7 +40951,7 @@ var Et = class {
40939
40951
  let t = this.criteriaEntries.get(e);
40940
40952
  if (t)
40941
40953
  return t.refCount += 1, t.emitter;
40942
- let n = new Sr(e);
40954
+ let n = new br(e);
40943
40955
  return this.criteriaEntries.set(e, n), this.getTokenForCriteria(n).then(([i2, o]) => {
40944
40956
  n.subscriptionId = i2, this.criteriaEntriesBySubscriptionId.set(i2, n), this.emitConnect(i2), this.ws.send(JSON.stringify({ type: "bind-with-token", payload: { token: o } }));
40945
40957
  }).catch((i2) => {
@@ -40964,27 +40976,27 @@ var Et = class {
40964
40976
  return this.criteriaEntries.size;
40965
40977
  }
40966
40978
  getMasterEmitter() {
40967
- return this.masterSubEmitter || (this.masterSubEmitter = new Me(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
40979
+ return this.masterSubEmitter || (this.masterSubEmitter = new Ne(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
40968
40980
  }
40969
40981
  };
40970
- var ds = N.FHIR_JSON + ", */*; q=0.1";
40971
- var fs = "https://api.medplum.com/";
40972
- var ms = 1e3;
40973
- var hs = 6e4;
40974
- var ys = 0;
40975
- var gs = "Binary/";
40976
- var Qn = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
40977
- var xs = ((o) => (o.ClientCredentials = "client_credentials", o.AuthorizationCode = "authorization_code", o.RefreshToken = "refresh_token", o.JwtBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer", o.TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange", o))(xs || {});
40978
- var vs = ((o) => (o.AccessToken = "urn:ietf:params:oauth:token-type:access_token", o.RefreshToken = "urn:ietf:params:oauth:token-type:refresh_token", o.IdToken = "urn:ietf:params:oauth:token-type:id_token", o.Saml1Token = "urn:ietf:params:oauth:token-type:saml1", o.Saml2Token = "urn:ietf:params:oauth:token-type:saml2", o))(vs || {});
40979
- var Ts = ((o) => (o.ClientSecretBasic = "client_secret_basic", o.ClientSecretPost = "client_secret_post", o.ClientSecretJwt = "client_secret_jwt", o.PrivateKeyJwt = "private_key_jwt", o.None = "none", o))(Ts || {});
40980
- var Ss = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(Ss || {});
40981
- var bt = class extends Ve {
40982
+ var ms = N.FHIR_JSON + ", */*; q=0.1";
40983
+ var hs = "https://api.medplum.com/";
40984
+ var ys = 1e3;
40985
+ var gs = 6e4;
40986
+ var xs = 0;
40987
+ var vs = "Binary/";
40988
+ var zn = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
40989
+ var Ts = ((o) => (o.ClientCredentials = "client_credentials", o.AuthorizationCode = "authorization_code", o.RefreshToken = "refresh_token", o.JwtBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer", o.TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange", o))(Ts || {});
40990
+ var Ss = ((o) => (o.AccessToken = "urn:ietf:params:oauth:token-type:access_token", o.RefreshToken = "urn:ietf:params:oauth:token-type:refresh_token", o.IdToken = "urn:ietf:params:oauth:token-type:id_token", o.Saml1Token = "urn:ietf:params:oauth:token-type:saml1", o.Saml2Token = "urn:ietf:params:oauth:token-type:saml2", o))(Ss || {});
40991
+ var Es = ((o) => (o.ClientSecretBasic = "client_secret_basic", o.ClientSecretPost = "client_secret_post", o.ClientSecretJwt = "client_secret_jwt", o.PrivateKeyJwt = "private_key_jwt", o.None = "none", o))(Es || {});
40992
+ var bs = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(bs || {});
40993
+ var Pt = class extends De {
40982
40994
  constructor(t) {
40983
40995
  super();
40984
40996
  this.initComplete = true;
40985
40997
  if (t?.baseUrl && !t.baseUrl.startsWith("http"))
40986
40998
  throw new Error("Base URL must start with http or https");
40987
- this.options = t ?? {}, this.fetch = t?.fetch ?? Es(), this.storage = t?.storage ?? new De(), this.createPdfImpl = t?.createPdf, this.baseUrl = zn(t?.baseUrl ?? fs), this.fhirBaseUrl = zn(Rt(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4/")), this.authorizeUrl = Rt(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = Rt(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = Rt(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.onUnauthenticated = t?.onUnauthenticated, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? ys : hs), this.cacheTime > 0 ? this.requestCache = new gt(t?.resourceCacheSize ?? ms) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0), t?.accessToken && this.setAccessToken(t.accessToken), this.storage.getInitPromise === void 0 ? (t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initPromise = Promise.resolve()) : (this.initComplete = false, this.initPromise = this.storage.getInitPromise(), this.initPromise.then(() => {
40999
+ this.options = t ?? {}, this.fetch = t?.fetch ?? Rs(), this.storage = t?.storage ?? new Me(), this.createPdfImpl = t?.createPdf, this.baseUrl = ar(t?.baseUrl ?? hs), this.fhirBaseUrl = B(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = B(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = B(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = B(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.onUnauthenticated = t?.onUnauthenticated, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? xs : gs), this.cacheTime > 0 ? this.requestCache = new vt(t?.resourceCacheSize ?? ys) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0), t?.accessToken && this.setAccessToken(t.accessToken), this.storage.getInitPromise === void 0 ? (t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initPromise = Promise.resolve()) : (this.initComplete = false, this.initPromise = this.storage.getInitPromise(), this.initPromise.then(() => {
40988
41000
  t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true;
40989
41001
  }).catch(console.error)), this.setupStorageListener();
40990
41002
  }
@@ -41023,7 +41035,7 @@ var bt = class extends Ve {
41023
41035
  this.requestCache?.clear();
41024
41036
  }
41025
41037
  invalidateSearches(t) {
41026
- let n = this.fhirBaseUrl + t;
41038
+ let n = B(this.fhirBaseUrl, t);
41027
41039
  if (this.requestCache)
41028
41040
  for (let i2 of this.requestCache.keys())
41029
41041
  (i2.endsWith(n) || i2.includes(n + "?")) && this.requestCache.delete(i2);
@@ -41108,7 +41120,7 @@ var bt = class extends Ve {
41108
41120
  return a.toString();
41109
41121
  }
41110
41122
  fhirUrl(...t) {
41111
- return new URL(t.join("/"), this.fhirBaseUrl);
41123
+ return new URL(B(this.fhirBaseUrl, t.join("/")));
41112
41124
  }
41113
41125
  fhirSearchUrl(t, n) {
41114
41126
  let i2 = this.fhirUrl(t);
@@ -41140,7 +41152,7 @@ var bt = class extends Ve {
41140
41152
  let s = "searchResources-" + this.fhirSearchUrl(t, n).toString(), a = this.getCacheEntry(s, i2);
41141
41153
  if (a)
41142
41154
  return a.value;
41143
- let c2 = new k(this.search(t, n, i2).then(Er));
41155
+ let c2 = new k(this.search(t, n, i2).then(Rr));
41144
41156
  return this.setCacheEntry(s, c2), c2;
41145
41157
  }
41146
41158
  async *searchResourcePages(t, n, i2) {
@@ -41149,7 +41161,7 @@ var bt = class extends Ve {
41149
41161
  let s = new URL(o).searchParams, a = await this.search(t, s, i2), c2 = a.link?.find((u2) => u2.relation === "next");
41150
41162
  if (!a.entry?.length && !c2)
41151
41163
  break;
41152
- yield Er(a), o = c2?.url ? new URL(c2.url) : void 0;
41164
+ yield Rr(a), o = c2?.url ? new URL(c2.url) : void 0;
41153
41165
  }
41154
41166
  }
41155
41167
  searchValueSet(t, n, i2) {
@@ -41168,7 +41180,7 @@ var bt = class extends Ve {
41168
41180
  if (!n)
41169
41181
  return;
41170
41182
  if (n === "system")
41171
- return Qn;
41183
+ return zn;
41172
41184
  let [i2, o] = n.split("/");
41173
41185
  if (!(!i2 || !o))
41174
41186
  return this.getCached(i2, o);
@@ -41181,12 +41193,12 @@ var bt = class extends Ve {
41181
41193
  if (!i2)
41182
41194
  return new k(Promise.reject(new Error("Missing reference")));
41183
41195
  if (i2 === "system")
41184
- return new k(Promise.resolve(Qn));
41196
+ return new k(Promise.resolve(zn));
41185
41197
  let [o, s] = i2.split("/");
41186
41198
  return !o || !s ? new k(Promise.reject(new Error("Invalid reference"))) : this.readResource(o, s, n);
41187
41199
  }
41188
41200
  requestSchema(t) {
41189
- if (Qr(t))
41201
+ if (zr(t))
41190
41202
  return Promise.resolve();
41191
41203
  let n = t + "-requestSchema", i2 = this.getCacheEntry(n, void 0);
41192
41204
  if (i2)
@@ -41232,14 +41244,14 @@ var bt = class extends Ve {
41232
41244
  target
41233
41245
  }
41234
41246
  }`.replace(/\s+/g, " "), a = await this.graphql(s);
41235
- Wt(a.data.StructureDefinitionList);
41247
+ Ht(a.data.StructureDefinitionList);
41236
41248
  for (let c2 of a.data.SearchParameterList)
41237
- cr(c2);
41249
+ lr(c2);
41238
41250
  })());
41239
41251
  return this.setCacheEntry(n, o), o;
41240
41252
  }
41241
41253
  requestProfileSchema(t, n) {
41242
- if (!n?.expandProfile && zr(t))
41254
+ if (!n?.expandProfile && Yr(t))
41243
41255
  return Promise.resolve([t]);
41244
41256
  let i2 = t + "-requestSchema" + (n?.expandProfile ? "-nested" : ""), o = this.getCacheEntry(i2, void 0);
41245
41257
  if (o)
@@ -41249,10 +41261,10 @@ var bt = class extends Ve {
41249
41261
  let a = this.fhirUrl("StructureDefinition", "$expand-profile");
41250
41262
  a.search = new URLSearchParams({ url: t }).toString();
41251
41263
  let c2 = await this.post(a.toString(), {});
41252
- return Er(c2).map((u2) => (Ht(u2, u2.url), u2.url));
41264
+ return Rr(c2).map((u2) => (Gt(u2, u2.url), u2.url));
41253
41265
  } else {
41254
41266
  let a = await this.searchOne("StructureDefinition", { url: t, _sort: "-_lastUpdated" });
41255
- return a ? (Wt([a], t), [t]) : (console.warn(`No StructureDefinition found for ${t}!`), []);
41267
+ return a ? (Ht([a], t), [t]) : (console.warn(`No StructureDefinition found for ${t}!`), []);
41256
41268
  }
41257
41269
  })());
41258
41270
  return this.setCacheEntry(i2, s), s;
@@ -41275,12 +41287,12 @@ var bt = class extends Ve {
41275
41287
  return await this.searchOne(t.resourceType, n, i2) ?? this.createResource(t, i2);
41276
41288
  }
41277
41289
  async createAttachment(t, n, i2, o, s) {
41278
- let a = Yn(t, n, i2, o), c2 = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a, c2);
41290
+ let a = Zn(t, n, i2, o), c2 = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a, c2);
41279
41291
  return { contentType: a.contentType, url: u2.url, title: a.filename };
41280
41292
  }
41281
41293
  createBinary(t, n, i2, o, s) {
41282
- let a = Yn(t, n, i2, o), c2 = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: p2, filename: y, securityContext: g2, onProgress: ce } = a, be = this.fhirUrl("Binary");
41283
- return y && be.searchParams.set("_filename", y), g2?.reference && this.setRequestHeader(c2, "X-Security-Context", g2.reference), ce ? this.uploadwithProgress(be, u2, p2, ce, c2) : this.post(be, u2, p2, c2);
41294
+ let a = Zn(t, n, i2, o), c2 = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: p2, filename: y, securityContext: g2, onProgress: ue } = a, Re = this.fhirUrl("Binary");
41295
+ return y && Re.searchParams.set("_filename", y), g2?.reference && this.setRequestHeader(c2, "X-Security-Context", g2.reference), ue ? this.uploadwithProgress(Re, u2, p2, ue, c2) : this.post(Re, u2, p2, c2);
41284
41296
  }
41285
41297
  uploadwithProgress(t, n, i2, o, s) {
41286
41298
  return new Promise((a, c2) => {
@@ -41290,11 +41302,11 @@ var bt = class extends Ve {
41290
41302
  s?.signal?.removeEventListener("abort", p2), g2 instanceof Error ? c2(g2) : a(g2);
41291
41303
  };
41292
41304
  if (u2.responseType = "json", u2.onabort = () => y(new Error("Request aborted")), u2.onerror = () => y(new Error("Request error")), o && (u2.upload.onprogress = (g2) => o(g2), u2.upload.onload = (g2) => o(g2)), u2.onload = () => {
41293
- u2.status >= 200 && u2.status < 300 ? y(u2.response) : y(new d(je(u2.response || u2.statusText)));
41305
+ u2.status >= 200 && u2.status < 300 ? y(u2.response) : y(new d($e(u2.response || u2.statusText)));
41294
41306
  }, u2.open("POST", t), u2.withCredentials = true, u2.setRequestHeader("Authorization", "Bearer " + this.accessToken), u2.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0"), u2.setRequestHeader("Content-Type", i2), u2.setRequestHeader("X-Medplum", "extended"), s?.headers) {
41295
41307
  let g2 = s.headers;
41296
- for (let [ce, be] of Object.entries(g2))
41297
- u2.setRequestHeader(ce, be);
41308
+ for (let [ue, Re] of Object.entries(g2))
41309
+ u2.setRequestHeader(ue, Re);
41298
41310
  }
41299
41311
  u2.send(n);
41300
41312
  });
@@ -41302,12 +41314,12 @@ var bt = class extends Ve {
41302
41314
  async createPdf(t, n, i2, o) {
41303
41315
  if (!this.createPdfImpl)
41304
41316
  throw new Error("PDF creation not enabled");
41305
- let s = Ps(t, n, i2, o), a = typeof n == "object" ? n : {}, { docDefinition: c2, tableLayouts: u2, fonts: p2, ...y } = s, g2 = await this.createPdfImpl(c2, u2, p2), ce = { ...y, data: g2, contentType: "application/pdf" };
41306
- return this.createBinary(ce, a);
41317
+ let s = ws(t, n, i2, o), a = typeof n == "object" ? n : {}, { docDefinition: c2, tableLayouts: u2, fonts: p2, ...y } = s, g2 = await this.createPdfImpl(c2, u2, p2), ue = { ...y, data: g2, contentType: "application/pdf" };
41318
+ return this.createBinary(ue, a);
41307
41319
  }
41308
41320
  createComment(t, n, i2) {
41309
41321
  let o = this.getProfile(), s, a;
41310
- return t.resourceType === "Encounter" && (s = Q(t), a = t.subject), t.resourceType === "ServiceRequest" && (s = t.encounter, a = t.subject), t.resourceType === "Patient" && (a = Q(t)), this.createResource({ resourceType: "Communication", status: "completed", basedOn: [Q(t)], encounter: s, subject: a, sender: o ? Q(o) : void 0, sent: (/* @__PURE__ */ new Date()).toISOString(), payload: [{ contentString: n }] }, i2);
41322
+ return t.resourceType === "Encounter" && (s = K(t), a = t.subject), t.resourceType === "ServiceRequest" && (s = t.encounter, a = t.subject), t.resourceType === "Patient" && (a = K(t)), this.createResource({ resourceType: "Communication", status: "completed", basedOn: [K(t)], encounter: s, subject: a, sender: o ? K(o) : void 0, sent: (/* @__PURE__ */ new Date()).toISOString(), payload: [{ contentString: n }] }, i2);
41311
41323
  }
41312
41324
  async updateResource(t, n) {
41313
41325
  if (!t.resourceType)
@@ -41338,7 +41350,7 @@ var bt = class extends Ve {
41338
41350
  return this.post(s, n, i2, o);
41339
41351
  }
41340
41352
  executeBatch(t, n) {
41341
- return this.post(this.fhirBaseUrl.slice(0, -1), t, void 0, n);
41353
+ return this.post(this.fhirBaseUrl, t, void 0, n);
41342
41354
  }
41343
41355
  sendEmail(t, n) {
41344
41356
  return this.post("email/v1/send", t, N.JSON, n);
@@ -41350,19 +41362,19 @@ var bt = class extends Ve {
41350
41362
  return this.get(`${this.fhirUrl(t, n)}/$graph?graph=${i2}`, o);
41351
41363
  }
41352
41364
  pushToAgent(t, n, i2, o, s, a) {
41353
- return this.post(this.fhirUrl("Agent", Xe(t), "$push"), { destination: typeof n == "string" ? n : X(n), body: i2, contentType: o, waitForResponse: s }, N.FHIR_JSON, a);
41365
+ return this.post(this.fhirUrl("Agent", et(t), "$push"), { destination: typeof n == "string" ? n : ee(n), body: i2, contentType: o, waitForResponse: s }, N.FHIR_JSON, a);
41354
41366
  }
41355
41367
  getActiveLogin() {
41356
41368
  return this.storage.getObject("activeLogin");
41357
41369
  }
41358
41370
  async setActiveLogin(t) {
41359
- (!this.sessionDetails?.profile || X(this.sessionDetails.profile) !== t.profile?.reference) && this.clearActiveLogin(), this.setAccessToken(t.accessToken, t.refreshToken), this.storage.setObject("activeLogin", t), this.addLogin(t), this.refreshPromise = void 0, await this.refreshProfile();
41371
+ (!this.sessionDetails?.profile || ee(this.sessionDetails.profile) !== t.profile?.reference) && this.clearActiveLogin(), this.setAccessToken(t.accessToken, t.refreshToken), this.storage.setObject("activeLogin", t), this.addLogin(t), this.refreshPromise = void 0, await this.refreshProfile();
41360
41372
  }
41361
41373
  getAccessToken() {
41362
41374
  return this.accessToken;
41363
41375
  }
41364
41376
  setAccessToken(t, n) {
41365
- this.accessToken = t, this.refreshToken = n, this.sessionDetails = void 0, this.accessTokenExpires = Hn(t), this.medplumServer = Wn(t);
41377
+ this.accessToken = t, this.refreshToken = n, this.sessionDetails = void 0, this.accessTokenExpires = Qn(t), this.medplumServer = Gn(t);
41366
41378
  }
41367
41379
  getLogins() {
41368
41380
  return this.storage.getObject("logins") ?? [];
@@ -41410,13 +41422,13 @@ var bt = class extends Ve {
41410
41422
  async download(t, n = {}) {
41411
41423
  this.refreshPromise && await this.refreshPromise;
41412
41424
  let i2 = t.toString();
41413
- i2.startsWith(gs) && (t = this.fhirUrl(i2));
41425
+ i2.startsWith(vs) && (t = this.fhirUrl(i2));
41414
41426
  let o = n.headers;
41415
41427
  return o || (o = {}, n.headers = o), o.Accept || (o.Accept = "*/*"), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
41416
41428
  }
41417
41429
  async createMedia(t, n) {
41418
41430
  let { additionalFields: i2, ...o } = t, s = await this.createResource({ resourceType: "Media", status: "preparation", content: { contentType: t.contentType }, ...i2 });
41419
- o.securityContext || (o.securityContext = Q(s));
41431
+ o.securityContext || (o.securityContext = K(s));
41420
41432
  let a = await this.createAttachment(o, n);
41421
41433
  return this.updateResource({ ...s, status: "completed", content: a });
41422
41434
  }
@@ -41433,7 +41445,7 @@ var bt = class extends Ve {
41433
41445
  return i2.Prefer = "respond-async", this.request("POST", t, n);
41434
41446
  }
41435
41447
  get keyValue() {
41436
- return this.keyValueClient || (this.keyValueClient = new St(this)), this.keyValueClient;
41448
+ return this.keyValueClient || (this.keyValueClient = new bt(this)), this.keyValueClient;
41437
41449
  }
41438
41450
  getCacheEntry(t, n) {
41439
41451
  if (!this.requestCache || n?.cache === "no-cache" || n?.cache === "reload")
@@ -41460,20 +41472,20 @@ var bt = class extends Ve {
41460
41472
  return;
41461
41473
  let c2 = s.headers.get("content-type")?.includes("json");
41462
41474
  if (s.status === 404 && !c2)
41463
- throw new d(Nr);
41475
+ throw new d(_r);
41464
41476
  let u2 = await this.parseBody(s, c2);
41465
41477
  if (s.status === 200 && i2.followRedirectOnOk || s.status === 201 && i2.followRedirectOnCreated) {
41466
- let p2 = await Jn(s, u2);
41478
+ let p2 = await Yn(s, u2);
41467
41479
  if (p2)
41468
41480
  return this.request("GET", p2, { ...i2, body: void 0 });
41469
41481
  }
41470
41482
  if (s.status === 202 && i2.pollStatusOnAccepted) {
41471
- let y = await Jn(s, u2) ?? o.statusUrl;
41483
+ let y = await Yn(s, u2) ?? o.statusUrl;
41472
41484
  if (y)
41473
41485
  return this.pollStatus(y, i2, o);
41474
41486
  }
41475
41487
  if (s.status >= 400)
41476
- throw new d(je(u2));
41488
+ throw new d($e(u2));
41477
41489
  return u2;
41478
41490
  }
41479
41491
  async parseBody(t, n) {
@@ -41489,7 +41501,7 @@ var bt = class extends Ve {
41489
41501
  return i2;
41490
41502
  }
41491
41503
  async fetchWithRetry(t, n) {
41492
- t.startsWith("http") || (t = new URL(t, this.baseUrl).href);
41504
+ t.startsWith("http") || (t = B(this.baseUrl, t));
41493
41505
  let i2 = 3, o = 200, s;
41494
41506
  for (let a = 0; a < i2; a++) {
41495
41507
  try {
@@ -41498,15 +41510,15 @@ var bt = class extends Ve {
41498
41510
  } catch (c2) {
41499
41511
  this.retryCatch(a, i2, c2);
41500
41512
  }
41501
- await or(o);
41513
+ await sr(o);
41502
41514
  }
41503
41515
  return s;
41504
41516
  }
41505
41517
  logRequest(t, n) {
41506
41518
  if (console.log(`> ${n.method} ${t}`), n.headers) {
41507
- let i2 = n.headers, o = Object.entries(i2).sort((s, a) => s[0].localeCompare(a[0]));
41508
- for (let [s, a] of o)
41509
- console.log(`> ${s}: ${a}`);
41519
+ let i2 = n.headers;
41520
+ for (let o of rt(Object.keys(i2)))
41521
+ console.log(`> ${o}: ${i2[o]}`);
41510
41522
  }
41511
41523
  }
41512
41524
  logResponse(t) {
@@ -41518,7 +41530,7 @@ var bt = class extends Ve {
41518
41530
  n.headers && typeof n.headers == "object" && "Prefer" in n.headers && (o.headers = { ...n.headers }, delete o.headers.Prefer), i2.statusUrl = t, i2.pollCount = 1;
41519
41531
  else {
41520
41532
  let s = n.pollStatusPeriod ?? 1e3;
41521
- await or(s), i2.pollCount++;
41533
+ await sr(s), i2.pollCount++;
41522
41534
  }
41523
41535
  return this.request("GET", t, o, i2);
41524
41536
  }
@@ -41527,20 +41539,20 @@ var bt = class extends Ve {
41527
41539
  if (this.autoBatchQueue.length = 0, this.autoBatchTimerId = void 0, t.length === 1) {
41528
41540
  let o = t[0];
41529
41541
  try {
41530
- o.resolve(await this.request(o.method, this.fhirBaseUrl + o.url, o.options));
41542
+ o.resolve(await this.request(o.method, B(this.fhirBaseUrl, o.url), o.options));
41531
41543
  } catch (s) {
41532
- o.reject(new d(je(s)));
41544
+ o.reject(new d($e(s)));
41533
41545
  }
41534
41546
  return;
41535
41547
  }
41536
- let n = { resourceType: "Bundle", type: "batch", entry: t.map((o) => ({ request: { method: o.method, url: o.url }, resource: o.options.body ? JSON.parse(o.options.body) : void 0 })) }, i2 = await this.post(this.fhirBaseUrl.slice(0, -1), n);
41548
+ let n = { resourceType: "Bundle", type: "batch", entry: t.map((o) => ({ request: { method: o.method, url: o.url }, resource: o.options.body ? JSON.parse(o.options.body) : void 0 })) }, i2 = await this.post(this.fhirBaseUrl, n);
41537
41549
  for (let o = 0; o < t.length; o++) {
41538
41550
  let s = t[o], a = i2.entry?.[o];
41539
- a?.response?.outcome && !_t(a.response.outcome) ? s.reject(new d(a.response.outcome)) : s.resolve(a?.resource);
41551
+ a?.response?.outcome && !Lt(a.response.outcome) ? s.reject(new d(a.response.outcome)) : s.resolve(a?.resource);
41540
41552
  }
41541
41553
  }
41542
41554
  addFetchOptionsDefaults(t) {
41543
- this.setRequestHeader(t, "X-Medplum", "extended"), this.setRequestHeader(t, "Accept", ds, true), t.body && this.setRequestHeader(t, "Content-Type", N.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
41555
+ this.setRequestHeader(t, "X-Medplum", "extended"), this.setRequestHeader(t, "Accept", ms, true), t.body && this.setRequestHeader(t, "Content-Type", N.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
41544
41556
  }
41545
41557
  setRequestContentType(t, n) {
41546
41558
  this.setRequestHeader(t, "Content-Type", n);
@@ -41557,20 +41569,20 @@ var bt = class extends Ve {
41557
41569
  return this.refresh() ? this.request(t, n, i2) : (this.clearActiveLogin(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new Error("Unauthenticated")));
41558
41570
  }
41559
41571
  async startPkce() {
41560
- let t = mr();
41572
+ let t = yr();
41561
41573
  sessionStorage.setItem("pkceState", t);
41562
- let n = mr();
41574
+ let n = yr();
41563
41575
  sessionStorage.setItem("codeVerifier", n);
41564
- let i2 = await _n(n), o = yn(i2).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
41576
+ let i2 = await Un(n), o = xn(i2).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
41565
41577
  return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
41566
41578
  }
41567
41579
  async requestAuthorization(t) {
41568
41580
  let n = await this.ensureCodeChallenge(t ?? {}), i2 = new URL(this.authorizeUrl);
41569
- i2.searchParams.set("response_type", "code"), i2.searchParams.set("state", sessionStorage.getItem("pkceState")), i2.searchParams.set("client_id", n.clientId ?? this.clientId), i2.searchParams.set("redirect_uri", n.redirectUri ?? Kn()), i2.searchParams.set("code_challenge_method", n.codeChallengeMethod), i2.searchParams.set("code_challenge", n.codeChallenge), i2.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i2.toString());
41581
+ i2.searchParams.set("response_type", "code"), i2.searchParams.set("state", sessionStorage.getItem("pkceState")), i2.searchParams.set("client_id", n.clientId ?? this.clientId), i2.searchParams.set("redirect_uri", n.redirectUri ?? Jn()), i2.searchParams.set("code_challenge_method", n.codeChallengeMethod), i2.searchParams.set("code_challenge", n.codeChallenge), i2.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i2.toString());
41570
41582
  }
41571
41583
  processCode(t, n) {
41572
41584
  let i2 = new URLSearchParams();
41573
- if (i2.set("grant_type", "authorization_code"), i2.set("code", t), i2.set("client_id", n?.clientId ?? this.clientId), i2.set("redirect_uri", n?.redirectUri ?? Kn()), typeof sessionStorage < "u") {
41585
+ if (i2.set("grant_type", "authorization_code"), i2.set("code", t), i2.set("client_id", n?.clientId ?? this.clientId), i2.set("redirect_uri", n?.redirectUri ?? Jn()), typeof sessionStorage < "u") {
41574
41586
  let o = sessionStorage.getItem("codeVerifier");
41575
41587
  o && i2.set("code_verifier", o);
41576
41588
  }
@@ -41604,30 +41616,30 @@ var bt = class extends Ve {
41604
41616
  return n.append("grant_type", "client_credentials"), n.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.append("client_assertion", t), this.fetchTokens(n);
41605
41617
  }
41606
41618
  setBasicAuth(t, n) {
41607
- this.clientId = t, this.clientSecret = n, this.basicAuth = Fn(t + ":" + n);
41619
+ this.clientId = t, this.clientSecret = n, this.basicAuth = Ln(t + ":" + n);
41608
41620
  }
41609
41621
  async fhircastSubscribe(t, n) {
41610
41622
  if (!(typeof t == "string" && t !== ""))
41611
41623
  throw new d(m("Invalid topic provided. Topic must be a valid string."));
41612
41624
  if (!(typeof n == "object" && Array.isArray(n) && n.length > 0))
41613
41625
  throw new d(m("Invalid events provided. Events must be an array of event names containing at least one event."));
41614
- let i2 = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post("/fhircast/STU3", gr(i2), N.FORM_URL_ENCODED))["hub.channel.endpoint"];
41626
+ let i2 = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post("/fhircast/STU3", vr(i2), N.FORM_URL_ENCODED))["hub.channel.endpoint"];
41615
41627
  if (!s)
41616
41628
  throw new Error("Invalid response!");
41617
41629
  return i2.endpoint = s, i2;
41618
41630
  }
41619
41631
  async fhircastUnsubscribe(t) {
41620
- if (!vt(t))
41632
+ if (!St(t))
41621
41633
  throw new d(m("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
41622
41634
  if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws")))
41623
41635
  throw new d(m("Provided subscription request must have an endpoint in order to unsubscribe."));
41624
- t.mode = "unsubscribe", await this.post("/fhircast/STU3", gr(t), N.FORM_URL_ENCODED);
41636
+ t.mode = "unsubscribe", await this.post("/fhircast/STU3", vr(t), N.FORM_URL_ENCODED);
41625
41637
  }
41626
41638
  fhircastConnect(t) {
41627
- return new xt(t);
41639
+ return new Tt(t);
41628
41640
  }
41629
41641
  async fhircastPublish(t, n, i2, o) {
41630
- return Bn(n) ? this.post(`/fhircast/STU3/${t}`, xr(t, n, i2, o), N.JSON) : (qn(n), this.post(`/fhircast/STU3/${t}`, xr(t, n, i2), N.JSON));
41642
+ return jn(n) ? this.post(`/fhircast/STU3/${t}`, Tr(t, n, i2, o), N.JSON) : ($n(n), this.post(`/fhircast/STU3/${t}`, Tr(t, n, i2), N.JSON));
41631
41643
  }
41632
41644
  async fhircastGetContext(t) {
41633
41645
  return this.get(`/fhircast/STU3/${t}`);
@@ -41658,8 +41670,8 @@ var bt = class extends Ve {
41658
41670
  }
41659
41671
  async verifyTokens(t) {
41660
41672
  let n = t.access_token;
41661
- if ($n(n)) {
41662
- let i2 = Tt(n);
41673
+ if (Hn(n)) {
41674
+ let i2 = Et(n);
41663
41675
  if (Date.now() >= i2.exp * 1e3)
41664
41676
  throw this.clearActiveLogin(), new Error("Token expired");
41665
41677
  if (i2.cid) {
@@ -41683,7 +41695,7 @@ var bt = class extends Ve {
41683
41695
  throw i2;
41684
41696
  }
41685
41697
  getSubscriptionManager() {
41686
- return this.subscriptionManager || (this.subscriptionManager = new Et(this, Tn("/ws/subscriptions-r4", this.baseUrl))), this.subscriptionManager;
41698
+ return this.subscriptionManager || (this.subscriptionManager = new Rt(this, En(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
41687
41699
  }
41688
41700
  subscribeToCriteria(t) {
41689
41701
  return this.getSubscriptionManager().addCriteria(t);
@@ -41695,51 +41707,45 @@ var bt = class extends Ve {
41695
41707
  return this.getSubscriptionManager().getMasterEmitter();
41696
41708
  }
41697
41709
  };
41698
- function Es() {
41710
+ function Rs() {
41699
41711
  if (!globalThis.fetch)
41700
41712
  throw new Error("Fetch not available in this environment");
41701
41713
  return globalThis.fetch.bind(globalThis);
41702
41714
  }
41703
- function Kn() {
41715
+ function Jn() {
41704
41716
  return typeof window > "u" ? "" : window.location.protocol + "//" + window.location.host + "/";
41705
41717
  }
41706
- function zn(r4) {
41707
- return r4.endsWith("/") ? r4 : r4 + "/";
41708
- }
41709
- function Rt(r4, e) {
41710
- return new URL(e, r4).toString();
41711
- }
41712
- async function Jn(r4, e) {
41718
+ async function Yn(r4, e) {
41713
41719
  let t = r4.headers.get("content-location");
41714
41720
  if (t)
41715
41721
  return t;
41716
41722
  let n = r4.headers.get("location");
41717
41723
  if (n)
41718
41724
  return n;
41719
- if (ue(e) && e.issue?.[0]?.diagnostics)
41725
+ if (le(e) && e.issue?.[0]?.diagnostics)
41720
41726
  return e.issue[0].diagnostics;
41721
41727
  }
41722
- function Er(r4) {
41728
+ function Rr(r4) {
41723
41729
  let e = r4.entry?.map((t) => t.resource) ?? [];
41724
41730
  return Object.assign(e, { bundle: r4 });
41725
41731
  }
41726
- function bs(r4) {
41732
+ function Ps(r4) {
41727
41733
  return b(r4) && "data" in r4 && "contentType" in r4;
41728
41734
  }
41729
- function Yn(r4, e, t, n) {
41730
- return bs(r4) ? r4 : { data: r4, filename: e, contentType: t, onProgress: n };
41735
+ function Zn(r4, e, t, n) {
41736
+ return Ps(r4) ? r4 : { data: r4, filename: e, contentType: t, onProgress: n };
41731
41737
  }
41732
- function Rs(r4) {
41738
+ function Cs(r4) {
41733
41739
  return b(r4) && "docDefinition" in r4;
41734
41740
  }
41735
- function Ps(r4, e, t, n) {
41736
- return Rs(r4) ? r4 : { docDefinition: r4, filename: e, tableLayouts: t, fonts: n };
41741
+ function ws(r4, e, t, n) {
41742
+ return Cs(r4) ? r4 : { docDefinition: r4, filename: e, tableLayouts: t, fonts: n };
41737
41743
  }
41738
- var Ns = [...Oe, "->", "<<", ">>", "=="];
41739
- var Ls = Ie().registerInfix("->", { precedence: h.Arrow }).registerInfix(";", { precedence: h.Semicolon });
41740
- var ea = [...Oe, "eq", "ne", "co"];
41741
- var na = Ie();
41742
- var Y = class {
41744
+ var _s = [...Ie, "->", "<<", ">>", "=="];
41745
+ var Bs = ke().registerInfix("->", { precedence: h.Arrow }).registerInfix(";", { precedence: h.Semicolon });
41746
+ var ra = [...Ie, "eq", "ne", "co"];
41747
+ var oa = ke();
41748
+ var Z = class {
41743
41749
  constructor(e = "\r", t = "|", n = "^", i2 = "~", o = "\\", s = "&") {
41744
41750
  this.segmentSeparator = e;
41745
41751
  this.fieldSeparator = t;
@@ -41755,8 +41761,8 @@ var Y = class {
41755
41761
  return this.componentSeparator + this.repetitionSeparator + this.escapeCharacter + this.subcomponentSeparator;
41756
41762
  }
41757
41763
  };
41758
- var di = class r {
41759
- constructor(e, t = new Y()) {
41764
+ var fi = class r {
41765
+ constructor(e, t = new Z()) {
41760
41766
  this.context = t, this.segments = e;
41761
41767
  }
41762
41768
  get header() {
@@ -41779,7 +41785,7 @@ var di = class r {
41779
41785
  }
41780
41786
  buildAck() {
41781
41787
  let e = /* @__PURE__ */ new Date(), t = this.getSegment("MSH"), n = t?.getField(3)?.toString() ?? "", i2 = t?.getField(4)?.toString() ?? "", o = t?.getField(5)?.toString() ?? "", s = t?.getField(6)?.toString() ?? "", a = t?.getField(10)?.toString() ?? "", c2 = t?.getField(12)?.toString() ?? "2.5.1";
41782
- return new r([new _e(["MSH", this.context.getMsh2(), o, s, n, i2, oa(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c2], this.context), new _e(["MSA", "AA", a, "OK"], this.context)]);
41788
+ return new r([new Le(["MSH", this.context.getMsh2(), o, s, n, i2, aa(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c2], this.context), new Le(["MSA", "AA", a, "OK"], this.context)]);
41783
41789
  }
41784
41790
  buildAckMessageType(e) {
41785
41791
  let t = e?.getField(9), n = t?.getComponent(2), i2 = t?.getComponent(3), o = "ACK";
@@ -41790,13 +41796,13 @@ var di = class r {
41790
41796
  let n = new Error("Invalid HL7 message");
41791
41797
  throw n.type = "entity.parse.failed", n;
41792
41798
  }
41793
- let t = new Y("\r", e.charAt(3), e.charAt(4), e.charAt(5), e.charAt(6), e.charAt(7));
41794
- return new r(e.split(/[\r\n]+/).map((n) => _e.parse(n, t)), t);
41799
+ let t = new Z("\r", e.charAt(3), e.charAt(4), e.charAt(5), e.charAt(6), e.charAt(7));
41800
+ return new r(e.split(/[\r\n]+/).map((n) => Le.parse(n, t)), t);
41795
41801
  }
41796
41802
  };
41797
- var _e = class r2 {
41798
- constructor(e, t = new Y()) {
41799
- this.context = t, fn(e) ? this.fields = e.map((n) => Ee.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
41803
+ var Le = class r2 {
41804
+ constructor(e, t = new Z()) {
41805
+ this.context = t, hn(e) ? this.fields = e.map((n) => be.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
41800
41806
  }
41801
41807
  get(e) {
41802
41808
  return this.fields[e];
@@ -41804,9 +41810,9 @@ var _e = class r2 {
41804
41810
  getField(e) {
41805
41811
  if (this.name === "MSH") {
41806
41812
  if (e === 1)
41807
- return new Ee([[this.context.getMsh1()]], this.context);
41813
+ return new be([[this.context.getMsh1()]], this.context);
41808
41814
  if (e === 2)
41809
- return new Ee([[this.context.getMsh2()]], this.context);
41815
+ return new be([[this.context.getMsh2()]], this.context);
41810
41816
  if (e > 2)
41811
41817
  return this.fields[e - 1];
41812
41818
  }
@@ -41818,12 +41824,12 @@ var _e = class r2 {
41818
41824
  toString() {
41819
41825
  return this.fields.map((e) => e.toString()).join(this.context.fieldSeparator);
41820
41826
  }
41821
- static parse(e, t = new Y()) {
41822
- return new r2(e.split(t.fieldSeparator).map((n) => Ee.parse(n, t)), t);
41827
+ static parse(e, t = new Z()) {
41828
+ return new r2(e.split(t.fieldSeparator).map((n) => be.parse(n, t)), t);
41823
41829
  }
41824
41830
  };
41825
- var Ee = class r3 {
41826
- constructor(e, t = new Y()) {
41831
+ var be = class r3 {
41832
+ constructor(e, t = new Z()) {
41827
41833
  this.context = t, this.components = e;
41828
41834
  }
41829
41835
  get(e, t, n = 0) {
@@ -41836,16 +41842,16 @@ var Ee = class r3 {
41836
41842
  toString() {
41837
41843
  return this.components.map((e) => e.join(this.context.componentSeparator)).join(this.context.repetitionSeparator);
41838
41844
  }
41839
- static parse(e, t = new Y()) {
41845
+ static parse(e, t = new Z()) {
41840
41846
  return new r3(e.split(t.repetitionSeparator).map((n) => n.split(t.componentSeparator)), t);
41841
41847
  }
41842
41848
  };
41843
- function oa(r4) {
41849
+ function aa(r4) {
41844
41850
  let e = r4 instanceof Date ? r4 : new Date(r4), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i2 = e.getUTCMilliseconds();
41845
41851
  return i2 > 0 && (n += "." + i2.toString()), n;
41846
41852
  }
41847
- var wr = ((o) => (o[o.NONE = 0] = "NONE", o[o.ERROR = 1] = "ERROR", o[o.WARN = 2] = "WARN", o[o.INFO = 3] = "INFO", o[o.DEBUG = 4] = "DEBUG", o))(wr || {});
41848
- var fi = class {
41853
+ var Or = ((o) => (o[o.NONE = 0] = "NONE", o[o.ERROR = 1] = "ERROR", o[o.WARN = 2] = "WARN", o[o.INFO = 3] = "INFO", o[o.DEBUG = 4] = "DEBUG", o))(Or || {});
41854
+ var mi = class {
41849
41855
  constructor(e, t = {}, n = 3) {
41850
41856
  this.write = e;
41851
41857
  this.metadata = t;
@@ -41865,11 +41871,11 @@ var fi = class {
41865
41871
  }
41866
41872
  log(e, t, n) {
41867
41873
  e > this.level || (n instanceof Error && (n = { error: n.toString(), stack: n.stack?.split(`
41868
- `) }), this.write(JSON.stringify({ level: wr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: t, ...n, ...this.metadata })));
41874
+ `) }), this.write(JSON.stringify({ level: Or[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: t, ...n, ...this.metadata })));
41869
41875
  }
41870
41876
  };
41871
- function kd(r4) {
41872
- let e = wr[r4.toUpperCase()];
41877
+ function Dd(r4) {
41878
+ let e = Or[r4.toUpperCase()];
41873
41879
  if (e === void 0)
41874
41880
  throw new Error(`Invalid log level: ${r4}`);
41875
41881
  return e;
@@ -41914,7 +41920,7 @@ var c = class extends i {
41914
41920
  t.on("data", (s) => {
41915
41921
  try {
41916
41922
  if (o += s.toString(), o.endsWith(p + v)) {
41917
- let r4 = di.parse(o.substring(1, o.length - 2));
41923
+ let r4 = fi.parse(o.substring(1, o.length - 2));
41918
41924
  this.dispatchEvent(new d2(this, r4)), o = "";
41919
41925
  }
41920
41926
  } catch (r4) {
@@ -42089,7 +42095,7 @@ var DcmjsDimseScp = class extends dimse.Scp {
42089
42095
  calledAeTitle: this.association?.getCalledAeTitle()
42090
42096
  },
42091
42097
  dataset: dicomJson,
42092
- binary: binary ? Q(binary) : void 0
42098
+ binary: binary ? K(binary) : void 0
42093
42099
  };
42094
42100
  App.instance.addToWebSocketQueue({
42095
42101
  type: "agent:transmit:request",
@@ -42101,7 +42107,7 @@ var DcmjsDimseScp = class extends dimse.Scp {
42101
42107
  });
42102
42108
  response.setStatus(dimse.constants.Status.Success);
42103
42109
  } catch (err) {
42104
- App.instance.log.error(`DICOM error: ${hi(err)}`);
42110
+ App.instance.log.error(`DICOM error: ${yi(err)}`);
42105
42111
  response.setStatus(dimse.constants.Status.ProcessingFailure);
42106
42112
  }
42107
42113
  return response;
@@ -42132,7 +42138,7 @@ var AgentHl7Channel = class {
42132
42138
  sendToRemote(msg) {
42133
42139
  const connection = this.connections.get(msg.remote);
42134
42140
  if (connection) {
42135
- connection.hl7Connection.send(di.parse(msg.body));
42141
+ connection.hl7Connection.send(fi.parse(msg.body));
42136
42142
  }
42137
42143
  }
42138
42144
  handleNewConnection(connection) {
@@ -42161,7 +42167,7 @@ var AgentHl7ChannelConnection = class {
42161
42167
  body: event.message.toString()
42162
42168
  });
42163
42169
  } catch (err) {
42164
- this.channel.app.log.error(`HL7 error: ${hi(err)}`);
42170
+ this.channel.app.log.error(`HL7 error: ${yi(err)}`);
42165
42171
  }
42166
42172
  }
42167
42173
  close() {
@@ -42183,7 +42189,7 @@ var App = class _App {
42183
42189
  this.live = false;
42184
42190
  this.shutdown = false;
42185
42191
  _App.instance = this;
42186
- this.log = new fi((msg) => console.log(msg), void 0, logLevel);
42192
+ this.log = new mi((msg) => console.log(msg), void 0, logLevel);
42187
42193
  }
42188
42194
  async start() {
42189
42195
  this.log.info("Medplum service starting...");
@@ -42225,7 +42231,7 @@ var App = class _App {
42225
42231
  this.webSocket.binaryType = "nodebuffer";
42226
42232
  this.webSocket.addEventListener("error", (err) => {
42227
42233
  if (!this.shutdown) {
42228
- this.log.error(hi(err.error));
42234
+ this.log.error(yi(err.error));
42229
42235
  }
42230
42236
  });
42231
42237
  this.webSocket.addEventListener("open", async () => {
@@ -42279,7 +42285,7 @@ var App = class _App {
42279
42285
  this.log.error(`Unknown message type: ${command.type}`);
42280
42286
  }
42281
42287
  } catch (err) {
42282
- this.log.error(`WebSocket error: ${hi(err)}`);
42288
+ this.log.error(`WebSocket error: ${yi(err)}`);
42283
42289
  }
42284
42290
  });
42285
42291
  }
@@ -42345,7 +42351,7 @@ var App = class _App {
42345
42351
  try {
42346
42352
  await this.sendToWebSocket(msg);
42347
42353
  } catch (err) {
42348
- this.log.error(`WebSocket error: ${hi(err)}`);
42354
+ this.log.error(`WebSocket error: ${yi(err)}`);
42349
42355
  this.webSocketQueue.unshift(msg);
42350
42356
  throw err;
42351
42357
  }
@@ -42402,7 +42408,7 @@ ${result}`);
42402
42408
  body: result
42403
42409
  });
42404
42410
  } catch (err) {
42405
- this.log.error(`Error during ping attempt to ${message.remote ?? "NO_IP_GIVEN"}: ${hi(err)}`);
42411
+ this.log.error(`Error during ping attempt to ${message.remote ?? "NO_IP_GIVEN"}: ${yi(err)}`);
42406
42412
  this.addToWebSocketQueue({
42407
42413
  type: "agent:error",
42408
42414
  body: err.message
@@ -42429,7 +42435,7 @@ ${result}`);
42429
42435
  host: address.hostname,
42430
42436
  port: parseInt(address.port, 10)
42431
42437
  });
42432
- client.sendAndWait(di.parse(message.body)).then((response) => {
42438
+ client.sendAndWait(fi.parse(message.body)).then((response) => {
42433
42439
  this.log.info(`Response: ${response.toString().replaceAll("\r", "\n")}`);
42434
42440
  this.addToWebSocketQueue({
42435
42441
  type: "agent:transmit:response",
@@ -42440,7 +42446,7 @@ ${result}`);
42440
42446
  body: response.toString()
42441
42447
  });
42442
42448
  }).catch((err) => {
42443
- this.log.error(`HL7 error: ${hi(err)}`);
42449
+ this.log.error(`HL7 error: ${yi(err)}`);
42444
42450
  }).finally(() => {
42445
42451
  client.close();
42446
42452
  });
@@ -42473,9 +42479,9 @@ async function main(argv) {
42473
42479
  process.exit(1);
42474
42480
  }
42475
42481
  const { baseUrl, clientId, clientSecret, agentId } = args;
42476
- const medplum = new bt({ baseUrl, clientId });
42482
+ const medplum = new Pt({ baseUrl, clientId });
42477
42483
  await medplum.startClientLogin(clientId, clientSecret);
42478
- const app = new App(medplum, agentId, kd(args.logLevel ?? "INFO"));
42484
+ const app = new App(medplum, agentId, Dd(args.logLevel ?? "INFO"));
42479
42485
  await app.start();
42480
42486
  process.on("SIGINT", () => {
42481
42487
  console.log("Gracefully shutting down from SIGINT (Crtl-C)");