@nsshunt/stsfhirclient 1.0.30 → 1.0.32

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.
@@ -11,34 +11,32 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
11
11
  var _options, _DUMMY_USER, _invokeMethods, _maxRetries, _sleepDuration, _NoRetryStatusCodes, _stsfhirapiroot, _LogDebugMessage, _LogErrorMessage, _HandleError, _InvokeResourceAPI, _TestMode, ___InvokeResourceAPI;
12
12
  import axios from "axios";
13
13
  import { Sleep, STSAxiosConfig } from "@nsshunt/stsutils";
14
- var byteToHex = [];
15
- for (var i = 0; i < 256; ++i) {
14
+ const byteToHex = [];
15
+ for (let i = 0; i < 256; ++i) {
16
16
  byteToHex.push((i + 256).toString(16).slice(1));
17
17
  }
18
18
  function unsafeStringify(arr, offset = 0) {
19
19
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
20
20
  }
21
- var getRandomValues;
22
- var rnds8 = new Uint8Array(16);
21
+ let getRandomValues;
22
+ const rnds8 = new Uint8Array(16);
23
23
  function rng() {
24
24
  if (!getRandomValues) {
25
- getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
26
- if (!getRandomValues) {
25
+ if (typeof crypto === "undefined" || !crypto.getRandomValues) {
27
26
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
28
27
  }
28
+ getRandomValues = crypto.getRandomValues.bind(crypto);
29
29
  }
30
30
  return getRandomValues(rnds8);
31
31
  }
32
- var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
33
- const native = {
34
- randomUUID
35
- };
32
+ const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
33
+ const native = { randomUUID };
36
34
  function v4(options, buf, offset) {
37
35
  if (native.randomUUID && !buf && !options) {
38
36
  return native.randomUUID();
39
37
  }
40
38
  options = options || {};
41
- var rnds = options.random || (options.rng || rng)();
39
+ const rnds = options.random || (options.rng || rng)();
42
40
  rnds[6] = rnds[6] & 15 | 64;
43
41
  rnds[8] = rnds[8] & 63 | 128;
44
42
  return unsafeStringify(rnds);
@@ -47,7 +45,7 @@ const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? p
47
45
  function getDefaultExportFromCjs(x) {
48
46
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
49
47
  }
50
- var ansiStyles$1 = { exports: {} };
48
+ var ansiStyles = { exports: {} };
51
49
  var colorName;
52
50
  var hasRequiredColorName;
53
51
  function requireColorName() {
@@ -1010,181 +1008,200 @@ function requireColorConvert() {
1010
1008
  colorConvert = convert;
1011
1009
  return colorConvert;
1012
1010
  }
1013
- ansiStyles$1.exports;
1014
- (function(module) {
1015
- const wrapAnsi16 = (fn, offset) => (...args) => {
1016
- const code = fn(...args);
1017
- return `\x1B[${code + offset}m`;
1018
- };
1019
- const wrapAnsi256 = (fn, offset) => (...args) => {
1020
- const code = fn(...args);
1021
- return `\x1B[${38 + offset};5;${code}m`;
1022
- };
1023
- const wrapAnsi16m = (fn, offset) => (...args) => {
1024
- const rgb = fn(...args);
1025
- return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
1026
- };
1027
- const ansi2ansi = (n) => n;
1028
- const rgb2rgb = (r, g, b) => [r, g, b];
1029
- const setLazyProperty = (object, property, get) => {
1030
- Object.defineProperty(object, property, {
1031
- get: () => {
1032
- const value = get();
1033
- Object.defineProperty(object, property, {
1034
- value,
1035
- enumerable: true,
1036
- configurable: true
1037
- });
1038
- return value;
1039
- },
1040
- enumerable: true,
1041
- configurable: true
1042
- });
1043
- };
1044
- let colorConvert2;
1045
- const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
1046
- if (colorConvert2 === void 0) {
1047
- colorConvert2 = requireColorConvert();
1048
- }
1049
- const offset = isBackground ? 10 : 0;
1050
- const styles2 = {};
1051
- for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
1052
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
1053
- if (sourceSpace === targetSpace) {
1054
- styles2[name] = wrap(identity, offset);
1055
- } else if (typeof suite === "object") {
1056
- styles2[name] = wrap(suite[targetSpace], offset);
1011
+ ansiStyles.exports;
1012
+ var hasRequiredAnsiStyles;
1013
+ function requireAnsiStyles() {
1014
+ if (hasRequiredAnsiStyles) return ansiStyles.exports;
1015
+ hasRequiredAnsiStyles = 1;
1016
+ (function(module) {
1017
+ const wrapAnsi16 = (fn, offset) => (...args) => {
1018
+ const code = fn(...args);
1019
+ return `\x1B[${code + offset}m`;
1020
+ };
1021
+ const wrapAnsi256 = (fn, offset) => (...args) => {
1022
+ const code = fn(...args);
1023
+ return `\x1B[${38 + offset};5;${code}m`;
1024
+ };
1025
+ const wrapAnsi16m = (fn, offset) => (...args) => {
1026
+ const rgb = fn(...args);
1027
+ return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
1028
+ };
1029
+ const ansi2ansi = (n) => n;
1030
+ const rgb2rgb = (r, g, b) => [r, g, b];
1031
+ const setLazyProperty = (object, property, get) => {
1032
+ Object.defineProperty(object, property, {
1033
+ get: () => {
1034
+ const value = get();
1035
+ Object.defineProperty(object, property, {
1036
+ value,
1037
+ enumerable: true,
1038
+ configurable: true
1039
+ });
1040
+ return value;
1041
+ },
1042
+ enumerable: true,
1043
+ configurable: true
1044
+ });
1045
+ };
1046
+ let colorConvert2;
1047
+ const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
1048
+ if (colorConvert2 === void 0) {
1049
+ colorConvert2 = requireColorConvert();
1057
1050
  }
1058
- }
1059
- return styles2;
1060
- };
1061
- function assembleStyles() {
1062
- const codes = /* @__PURE__ */ new Map();
1063
- const styles2 = {
1064
- modifier: {
1065
- reset: [0, 0],
1066
- // 21 isn't widely supported and 22 does the same thing
1067
- bold: [1, 22],
1068
- dim: [2, 22],
1069
- italic: [3, 23],
1070
- underline: [4, 24],
1071
- inverse: [7, 27],
1072
- hidden: [8, 28],
1073
- strikethrough: [9, 29]
1074
- },
1075
- color: {
1076
- black: [30, 39],
1077
- red: [31, 39],
1078
- green: [32, 39],
1079
- yellow: [33, 39],
1080
- blue: [34, 39],
1081
- magenta: [35, 39],
1082
- cyan: [36, 39],
1083
- white: [37, 39],
1084
- // Bright color
1085
- blackBright: [90, 39],
1086
- redBright: [91, 39],
1087
- greenBright: [92, 39],
1088
- yellowBright: [93, 39],
1089
- blueBright: [94, 39],
1090
- magentaBright: [95, 39],
1091
- cyanBright: [96, 39],
1092
- whiteBright: [97, 39]
1093
- },
1094
- bgColor: {
1095
- bgBlack: [40, 49],
1096
- bgRed: [41, 49],
1097
- bgGreen: [42, 49],
1098
- bgYellow: [43, 49],
1099
- bgBlue: [44, 49],
1100
- bgMagenta: [45, 49],
1101
- bgCyan: [46, 49],
1102
- bgWhite: [47, 49],
1103
- // Bright color
1104
- bgBlackBright: [100, 49],
1105
- bgRedBright: [101, 49],
1106
- bgGreenBright: [102, 49],
1107
- bgYellowBright: [103, 49],
1108
- bgBlueBright: [104, 49],
1109
- bgMagentaBright: [105, 49],
1110
- bgCyanBright: [106, 49],
1111
- bgWhiteBright: [107, 49]
1051
+ const offset = isBackground ? 10 : 0;
1052
+ const styles = {};
1053
+ for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
1054
+ const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
1055
+ if (sourceSpace === targetSpace) {
1056
+ styles[name] = wrap(identity, offset);
1057
+ } else if (typeof suite === "object") {
1058
+ styles[name] = wrap(suite[targetSpace], offset);
1059
+ }
1112
1060
  }
1061
+ return styles;
1113
1062
  };
1114
- styles2.color.gray = styles2.color.blackBright;
1115
- styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
1116
- styles2.color.grey = styles2.color.blackBright;
1117
- styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
1118
- for (const [groupName, group] of Object.entries(styles2)) {
1119
- for (const [styleName, style] of Object.entries(group)) {
1120
- styles2[styleName] = {
1121
- open: `\x1B[${style[0]}m`,
1122
- close: `\x1B[${style[1]}m`
1123
- };
1124
- group[styleName] = styles2[styleName];
1125
- codes.set(style[0], style[1]);
1063
+ function assembleStyles() {
1064
+ const codes = /* @__PURE__ */ new Map();
1065
+ const styles = {
1066
+ modifier: {
1067
+ reset: [0, 0],
1068
+ // 21 isn't widely supported and 22 does the same thing
1069
+ bold: [1, 22],
1070
+ dim: [2, 22],
1071
+ italic: [3, 23],
1072
+ underline: [4, 24],
1073
+ inverse: [7, 27],
1074
+ hidden: [8, 28],
1075
+ strikethrough: [9, 29]
1076
+ },
1077
+ color: {
1078
+ black: [30, 39],
1079
+ red: [31, 39],
1080
+ green: [32, 39],
1081
+ yellow: [33, 39],
1082
+ blue: [34, 39],
1083
+ magenta: [35, 39],
1084
+ cyan: [36, 39],
1085
+ white: [37, 39],
1086
+ // Bright color
1087
+ blackBright: [90, 39],
1088
+ redBright: [91, 39],
1089
+ greenBright: [92, 39],
1090
+ yellowBright: [93, 39],
1091
+ blueBright: [94, 39],
1092
+ magentaBright: [95, 39],
1093
+ cyanBright: [96, 39],
1094
+ whiteBright: [97, 39]
1095
+ },
1096
+ bgColor: {
1097
+ bgBlack: [40, 49],
1098
+ bgRed: [41, 49],
1099
+ bgGreen: [42, 49],
1100
+ bgYellow: [43, 49],
1101
+ bgBlue: [44, 49],
1102
+ bgMagenta: [45, 49],
1103
+ bgCyan: [46, 49],
1104
+ bgWhite: [47, 49],
1105
+ // Bright color
1106
+ bgBlackBright: [100, 49],
1107
+ bgRedBright: [101, 49],
1108
+ bgGreenBright: [102, 49],
1109
+ bgYellowBright: [103, 49],
1110
+ bgBlueBright: [104, 49],
1111
+ bgMagentaBright: [105, 49],
1112
+ bgCyanBright: [106, 49],
1113
+ bgWhiteBright: [107, 49]
1114
+ }
1115
+ };
1116
+ styles.color.gray = styles.color.blackBright;
1117
+ styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
1118
+ styles.color.grey = styles.color.blackBright;
1119
+ styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
1120
+ for (const [groupName, group] of Object.entries(styles)) {
1121
+ for (const [styleName, style] of Object.entries(group)) {
1122
+ styles[styleName] = {
1123
+ open: `\x1B[${style[0]}m`,
1124
+ close: `\x1B[${style[1]}m`
1125
+ };
1126
+ group[styleName] = styles[styleName];
1127
+ codes.set(style[0], style[1]);
1128
+ }
1129
+ Object.defineProperty(styles, groupName, {
1130
+ value: group,
1131
+ enumerable: false
1132
+ });
1126
1133
  }
1127
- Object.defineProperty(styles2, groupName, {
1128
- value: group,
1134
+ Object.defineProperty(styles, "codes", {
1135
+ value: codes,
1129
1136
  enumerable: false
1130
1137
  });
1138
+ styles.color.close = "\x1B[39m";
1139
+ styles.bgColor.close = "\x1B[49m";
1140
+ setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
1141
+ setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
1142
+ setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
1143
+ setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
1144
+ setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
1145
+ setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
1146
+ return styles;
1131
1147
  }
1132
- Object.defineProperty(styles2, "codes", {
1133
- value: codes,
1134
- enumerable: false
1148
+ Object.defineProperty(module, "exports", {
1149
+ enumerable: true,
1150
+ get: assembleStyles
1135
1151
  });
1136
- styles2.color.close = "\x1B[39m";
1137
- styles2.bgColor.close = "\x1B[49m";
1138
- setLazyProperty(styles2.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
1139
- setLazyProperty(styles2.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
1140
- setLazyProperty(styles2.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
1141
- setLazyProperty(styles2.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
1142
- setLazyProperty(styles2.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
1143
- setLazyProperty(styles2.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
1144
- return styles2;
1145
- }
1146
- Object.defineProperty(module, "exports", {
1147
- enumerable: true,
1148
- get: assembleStyles
1149
- });
1150
- })(ansiStyles$1);
1151
- var ansiStylesExports = ansiStyles$1.exports;
1152
- var browser = {
1153
- stdout: false,
1154
- stderr: false
1155
- };
1156
- const stringReplaceAll$1 = (string, substring, replacer) => {
1157
- let index = string.indexOf(substring);
1158
- if (index === -1) {
1159
- return string;
1160
- }
1161
- const substringLength = substring.length;
1162
- let endIndex = 0;
1163
- let returnValue = "";
1164
- do {
1165
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
1166
- endIndex = index + substringLength;
1167
- index = string.indexOf(substring, endIndex);
1168
- } while (index !== -1);
1169
- returnValue += string.substr(endIndex);
1170
- return returnValue;
1171
- };
1172
- const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
1173
- let endIndex = 0;
1174
- let returnValue = "";
1175
- do {
1176
- const gotCR = string[index - 1] === "\r";
1177
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
1178
- endIndex = index + 1;
1179
- index = string.indexOf("\n", endIndex);
1180
- } while (index !== -1);
1181
- returnValue += string.substr(endIndex);
1182
- return returnValue;
1183
- };
1184
- var util = {
1185
- stringReplaceAll: stringReplaceAll$1,
1186
- stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
1187
- };
1152
+ })(ansiStyles);
1153
+ return ansiStyles.exports;
1154
+ }
1155
+ var browser;
1156
+ var hasRequiredBrowser;
1157
+ function requireBrowser() {
1158
+ if (hasRequiredBrowser) return browser;
1159
+ hasRequiredBrowser = 1;
1160
+ browser = {
1161
+ stdout: false,
1162
+ stderr: false
1163
+ };
1164
+ return browser;
1165
+ }
1166
+ var util;
1167
+ var hasRequiredUtil;
1168
+ function requireUtil() {
1169
+ if (hasRequiredUtil) return util;
1170
+ hasRequiredUtil = 1;
1171
+ const stringReplaceAll = (string, substring, replacer) => {
1172
+ let index = string.indexOf(substring);
1173
+ if (index === -1) {
1174
+ return string;
1175
+ }
1176
+ const substringLength = substring.length;
1177
+ let endIndex = 0;
1178
+ let returnValue = "";
1179
+ do {
1180
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
1181
+ endIndex = index + substringLength;
1182
+ index = string.indexOf(substring, endIndex);
1183
+ } while (index !== -1);
1184
+ returnValue += string.substr(endIndex);
1185
+ return returnValue;
1186
+ };
1187
+ const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
1188
+ let endIndex = 0;
1189
+ let returnValue = "";
1190
+ do {
1191
+ const gotCR = string[index - 1] === "\r";
1192
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
1193
+ endIndex = index + 1;
1194
+ index = string.indexOf("\n", endIndex);
1195
+ } while (index !== -1);
1196
+ returnValue += string.substr(endIndex);
1197
+ return returnValue;
1198
+ };
1199
+ util = {
1200
+ stringReplaceAll,
1201
+ stringEncaseCRLFWithFirstIndex
1202
+ };
1203
+ return util;
1204
+ }
1188
1205
  var templates;
1189
1206
  var hasRequiredTemplates;
1190
1207
  function requireTemplates() {
@@ -1248,27 +1265,27 @@ function requireTemplates() {
1248
1265
  }
1249
1266
  return results;
1250
1267
  }
1251
- function buildStyle(chalk2, styles2) {
1268
+ function buildStyle(chalk2, styles) {
1252
1269
  const enabled = {};
1253
- for (const layer of styles2) {
1270
+ for (const layer of styles) {
1254
1271
  for (const style of layer.styles) {
1255
1272
  enabled[style[0]] = layer.inverse ? null : style.slice(1);
1256
1273
  }
1257
1274
  }
1258
1275
  let current = chalk2;
1259
- for (const [styleName, styles3] of Object.entries(enabled)) {
1260
- if (!Array.isArray(styles3)) {
1276
+ for (const [styleName, styles2] of Object.entries(enabled)) {
1277
+ if (!Array.isArray(styles2)) {
1261
1278
  continue;
1262
1279
  }
1263
1280
  if (!(styleName in current)) {
1264
1281
  throw new Error(`Unknown Chalk style: ${styleName}`);
1265
1282
  }
1266
- current = styles3.length > 0 ? current[styleName](...styles3) : current[styleName];
1283
+ current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
1267
1284
  }
1268
1285
  return current;
1269
1286
  }
1270
1287
  templates = (chalk2, temporary) => {
1271
- const styles2 = [];
1288
+ const styles = [];
1272
1289
  const chunks = [];
1273
1290
  let chunk = [];
1274
1291
  temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
@@ -1277,200 +1294,208 @@ function requireTemplates() {
1277
1294
  } else if (style) {
1278
1295
  const string = chunk.join("");
1279
1296
  chunk = [];
1280
- chunks.push(styles2.length === 0 ? string : buildStyle(chalk2, styles2)(string));
1281
- styles2.push({ inverse, styles: parseStyle(style) });
1297
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
1298
+ styles.push({ inverse, styles: parseStyle(style) });
1282
1299
  } else if (close) {
1283
- if (styles2.length === 0) {
1300
+ if (styles.length === 0) {
1284
1301
  throw new Error("Found extraneous } in Chalk template literal");
1285
1302
  }
1286
- chunks.push(buildStyle(chalk2, styles2)(chunk.join("")));
1303
+ chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
1287
1304
  chunk = [];
1288
- styles2.pop();
1305
+ styles.pop();
1289
1306
  } else {
1290
1307
  chunk.push(character);
1291
1308
  }
1292
1309
  });
1293
1310
  chunks.push(chunk.join(""));
1294
- if (styles2.length > 0) {
1295
- const errMessage = `Chalk template literal is missing ${styles2.length} closing bracket${styles2.length === 1 ? "" : "s"} (\`}\`)`;
1311
+ if (styles.length > 0) {
1312
+ const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
1296
1313
  throw new Error(errMessage);
1297
1314
  }
1298
1315
  return chunks.join("");
1299
1316
  };
1300
1317
  return templates;
1301
1318
  }
1302
- const ansiStyles = ansiStylesExports;
1303
- const { stdout: stdoutColor, stderr: stderrColor } = browser;
1304
- const {
1305
- stringReplaceAll,
1306
- stringEncaseCRLFWithFirstIndex
1307
- } = util;
1308
- const { isArray } = Array;
1309
- const levelMapping = [
1310
- "ansi",
1311
- "ansi",
1312
- "ansi256",
1313
- "ansi16m"
1314
- ];
1315
- const styles = /* @__PURE__ */ Object.create(null);
1316
- const applyOptions = (object, options = {}) => {
1317
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
1318
- throw new Error("The `level` option should be an integer from 0 to 3");
1319
+ var source;
1320
+ var hasRequiredSource;
1321
+ function requireSource() {
1322
+ if (hasRequiredSource) return source;
1323
+ hasRequiredSource = 1;
1324
+ const ansiStyles2 = requireAnsiStyles();
1325
+ const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
1326
+ const {
1327
+ stringReplaceAll,
1328
+ stringEncaseCRLFWithFirstIndex
1329
+ } = requireUtil();
1330
+ const { isArray } = Array;
1331
+ const levelMapping = [
1332
+ "ansi",
1333
+ "ansi",
1334
+ "ansi256",
1335
+ "ansi16m"
1336
+ ];
1337
+ const styles = /* @__PURE__ */ Object.create(null);
1338
+ const applyOptions = (object, options = {}) => {
1339
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
1340
+ throw new Error("The `level` option should be an integer from 0 to 3");
1341
+ }
1342
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
1343
+ object.level = options.level === void 0 ? colorLevel : options.level;
1344
+ };
1345
+ class ChalkClass {
1346
+ constructor(options) {
1347
+ return chalkFactory(options);
1348
+ }
1319
1349
  }
1320
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
1321
- object.level = options.level === void 0 ? colorLevel : options.level;
1322
- };
1323
- class ChalkClass {
1324
- constructor(options) {
1350
+ const chalkFactory = (options) => {
1351
+ const chalk3 = {};
1352
+ applyOptions(chalk3, options);
1353
+ chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
1354
+ Object.setPrototypeOf(chalk3, Chalk.prototype);
1355
+ Object.setPrototypeOf(chalk3.template, chalk3);
1356
+ chalk3.template.constructor = () => {
1357
+ throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
1358
+ };
1359
+ chalk3.template.Instance = ChalkClass;
1360
+ return chalk3.template;
1361
+ };
1362
+ function Chalk(options) {
1325
1363
  return chalkFactory(options);
1326
1364
  }
1327
- }
1328
- const chalkFactory = (options) => {
1329
- const chalk2 = {};
1330
- applyOptions(chalk2, options);
1331
- chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
1332
- Object.setPrototypeOf(chalk2, Chalk.prototype);
1333
- Object.setPrototypeOf(chalk2.template, chalk2);
1334
- chalk2.template.constructor = () => {
1335
- throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
1336
- };
1337
- chalk2.template.Instance = ChalkClass;
1338
- return chalk2.template;
1339
- };
1340
- function Chalk(options) {
1341
- return chalkFactory(options);
1342
- }
1343
- for (const [styleName, style] of Object.entries(ansiStyles)) {
1344
- styles[styleName] = {
1365
+ for (const [styleName, style] of Object.entries(ansiStyles2)) {
1366
+ styles[styleName] = {
1367
+ get() {
1368
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
1369
+ Object.defineProperty(this, styleName, { value: builder });
1370
+ return builder;
1371
+ }
1372
+ };
1373
+ }
1374
+ styles.visible = {
1345
1375
  get() {
1346
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
1347
- Object.defineProperty(this, styleName, { value: builder });
1376
+ const builder = createBuilder(this, this._styler, true);
1377
+ Object.defineProperty(this, "visible", { value: builder });
1348
1378
  return builder;
1349
1379
  }
1350
1380
  };
1351
- }
1352
- styles.visible = {
1353
- get() {
1354
- const builder = createBuilder(this, this._styler, true);
1355
- Object.defineProperty(this, "visible", { value: builder });
1356
- return builder;
1381
+ const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
1382
+ for (const model of usedModels) {
1383
+ styles[model] = {
1384
+ get() {
1385
+ const { level } = this;
1386
+ return function(...arguments_) {
1387
+ const styler = createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
1388
+ return createBuilder(this, styler, this._isEmpty);
1389
+ };
1390
+ }
1391
+ };
1357
1392
  }
1358
- };
1359
- const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
1360
- for (const model of usedModels) {
1361
- styles[model] = {
1362
- get() {
1363
- const { level } = this;
1364
- return function(...arguments_) {
1365
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
1366
- return createBuilder(this, styler, this._isEmpty);
1367
- };
1393
+ for (const model of usedModels) {
1394
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
1395
+ styles[bgModel] = {
1396
+ get() {
1397
+ const { level } = this;
1398
+ return function(...arguments_) {
1399
+ const styler = createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
1400
+ return createBuilder(this, styler, this._isEmpty);
1401
+ };
1402
+ }
1403
+ };
1404
+ }
1405
+ const proto = Object.defineProperties(() => {
1406
+ }, {
1407
+ ...styles,
1408
+ level: {
1409
+ enumerable: true,
1410
+ get() {
1411
+ return this._generator.level;
1412
+ },
1413
+ set(level) {
1414
+ this._generator.level = level;
1415
+ }
1368
1416
  }
1369
- };
1370
- }
1371
- for (const model of usedModels) {
1372
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
1373
- styles[bgModel] = {
1374
- get() {
1375
- const { level } = this;
1376
- return function(...arguments_) {
1377
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
1378
- return createBuilder(this, styler, this._isEmpty);
1379
- };
1417
+ });
1418
+ const createStyler = (open, close, parent) => {
1419
+ let openAll;
1420
+ let closeAll;
1421
+ if (parent === void 0) {
1422
+ openAll = open;
1423
+ closeAll = close;
1424
+ } else {
1425
+ openAll = parent.openAll + open;
1426
+ closeAll = close + parent.closeAll;
1380
1427
  }
1428
+ return {
1429
+ open,
1430
+ close,
1431
+ openAll,
1432
+ closeAll,
1433
+ parent
1434
+ };
1381
1435
  };
1382
- }
1383
- const proto = Object.defineProperties(() => {
1384
- }, {
1385
- ...styles,
1386
- level: {
1387
- enumerable: true,
1388
- get() {
1389
- return this._generator.level;
1390
- },
1391
- set(level) {
1392
- this._generator.level = level;
1393
- }
1394
- }
1395
- });
1396
- const createStyler = (open, close, parent) => {
1397
- let openAll;
1398
- let closeAll;
1399
- if (parent === void 0) {
1400
- openAll = open;
1401
- closeAll = close;
1402
- } else {
1403
- openAll = parent.openAll + open;
1404
- closeAll = close + parent.closeAll;
1405
- }
1406
- return {
1407
- open,
1408
- close,
1409
- openAll,
1410
- closeAll,
1411
- parent
1436
+ const createBuilder = (self, _styler, _isEmpty) => {
1437
+ const builder = (...arguments_) => {
1438
+ if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
1439
+ return applyStyle(builder, chalkTag(builder, ...arguments_));
1440
+ }
1441
+ return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
1442
+ };
1443
+ Object.setPrototypeOf(builder, proto);
1444
+ builder._generator = self;
1445
+ builder._styler = _styler;
1446
+ builder._isEmpty = _isEmpty;
1447
+ return builder;
1412
1448
  };
1413
- };
1414
- const createBuilder = (self, _styler, _isEmpty) => {
1415
- const builder = (...arguments_) => {
1416
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
1417
- return applyStyle(builder, chalkTag(builder, ...arguments_));
1449
+ const applyStyle = (self, string) => {
1450
+ if (self.level <= 0 || !string) {
1451
+ return self._isEmpty ? "" : string;
1452
+ }
1453
+ let styler = self._styler;
1454
+ if (styler === void 0) {
1455
+ return string;
1456
+ }
1457
+ const { openAll, closeAll } = styler;
1458
+ if (string.indexOf("\x1B") !== -1) {
1459
+ while (styler !== void 0) {
1460
+ string = stringReplaceAll(string, styler.close, styler.open);
1461
+ styler = styler.parent;
1462
+ }
1463
+ }
1464
+ const lfIndex = string.indexOf("\n");
1465
+ if (lfIndex !== -1) {
1466
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
1418
1467
  }
1419
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
1468
+ return openAll + string + closeAll;
1420
1469
  };
1421
- Object.setPrototypeOf(builder, proto);
1422
- builder._generator = self;
1423
- builder._styler = _styler;
1424
- builder._isEmpty = _isEmpty;
1425
- return builder;
1426
- };
1427
- const applyStyle = (self, string) => {
1428
- if (self.level <= 0 || !string) {
1429
- return self._isEmpty ? "" : string;
1430
- }
1431
- let styler = self._styler;
1432
- if (styler === void 0) {
1433
- return string;
1434
- }
1435
- const { openAll, closeAll } = styler;
1436
- if (string.indexOf("\x1B") !== -1) {
1437
- while (styler !== void 0) {
1438
- string = stringReplaceAll(string, styler.close, styler.open);
1439
- styler = styler.parent;
1470
+ let template;
1471
+ const chalkTag = (chalk3, ...strings) => {
1472
+ const [firstString] = strings;
1473
+ if (!isArray(firstString) || !isArray(firstString.raw)) {
1474
+ return strings.join(" ");
1440
1475
  }
1441
- }
1442
- const lfIndex = string.indexOf("\n");
1443
- if (lfIndex !== -1) {
1444
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
1445
- }
1446
- return openAll + string + closeAll;
1447
- };
1448
- let template;
1449
- const chalkTag = (chalk2, ...strings) => {
1450
- const [firstString] = strings;
1451
- if (!isArray(firstString) || !isArray(firstString.raw)) {
1452
- return strings.join(" ");
1453
- }
1454
- const arguments_ = strings.slice(1);
1455
- const parts = [firstString.raw[0]];
1456
- for (let i = 1; i < firstString.length; i++) {
1457
- parts.push(
1458
- String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
1459
- String(firstString.raw[i])
1460
- );
1461
- }
1462
- if (template === void 0) {
1463
- template = requireTemplates();
1464
- }
1465
- return template(chalk2, parts.join(""));
1466
- };
1467
- Object.defineProperties(Chalk.prototype, styles);
1468
- const chalk = Chalk();
1469
- chalk.supportsColor = stdoutColor;
1470
- chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
1471
- chalk.stderr.supportsColor = stderrColor;
1472
- var source = chalk;
1473
- const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
1476
+ const arguments_ = strings.slice(1);
1477
+ const parts = [firstString.raw[0]];
1478
+ for (let i = 1; i < firstString.length; i++) {
1479
+ parts.push(
1480
+ String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
1481
+ String(firstString.raw[i])
1482
+ );
1483
+ }
1484
+ if (template === void 0) {
1485
+ template = requireTemplates();
1486
+ }
1487
+ return template(chalk3, parts.join(""));
1488
+ };
1489
+ Object.defineProperties(Chalk.prototype, styles);
1490
+ const chalk2 = Chalk();
1491
+ chalk2.supportsColor = stdoutColor;
1492
+ chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
1493
+ chalk2.stderr.supportsColor = stderrColor;
1494
+ source = chalk2;
1495
+ return source;
1496
+ }
1497
+ var sourceExports = requireSource();
1498
+ const chalk = /* @__PURE__ */ getDefaultExportFromCjs(sourceExports);
1474
1499
  var StatusCodes;
1475
1500
  (function(StatusCodes2) {
1476
1501
  StatusCodes2[StatusCodes2["CONTINUE"] = 100] = "CONTINUE";
@@ -1556,28 +1581,28 @@ class FhirClient {
1556
1581
  });
1557
1582
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1558
1583
  __privateAdd(this, _HandleError, (error) => {
1559
- __privateGet(this, _LogDebugMessage).call(this, chalk$1.red(`HandleError(): Error: [${error}]`));
1584
+ __privateGet(this, _LogDebugMessage).call(this, chalk.red(`HandleError(): Error: [${error}]`));
1560
1585
  let responseCode = 500;
1561
1586
  if (axios.isAxiosError(error)) {
1562
1587
  const axiosError = error;
1563
1588
  if (axiosError.response) {
1564
1589
  responseCode = axiosError.response.status;
1565
- __privateGet(this, _LogDebugMessage).call(this, chalk$1.red(`AXIOS Error Response.Status = [${axiosError.response.status}]`));
1590
+ __privateGet(this, _LogDebugMessage).call(this, chalk.red(`AXIOS Error Response.Status = [${axiosError.response.status}]`));
1566
1591
  if (axiosError.response.headers) {
1567
- __privateGet(this, _LogErrorMessage).call(this, chalk$1.red(` headers: [${JSON.stringify(axiosError.response.headers)}]`));
1592
+ __privateGet(this, _LogErrorMessage).call(this, chalk.red(` headers: [${JSON.stringify(axiosError.response.headers)}]`));
1568
1593
  }
1569
1594
  if (axiosError.response.data) {
1570
- __privateGet(this, _LogErrorMessage).call(this, chalk$1.red(` data: [${JSON.stringify(axiosError.response.data)}]`));
1595
+ __privateGet(this, _LogErrorMessage).call(this, chalk.red(` data: [${JSON.stringify(axiosError.response.data)}]`));
1571
1596
  }
1572
1597
  try {
1573
1598
  if (axiosError.response.config) {
1574
- __privateGet(this, _LogErrorMessage).call(this, chalk$1.red(` config: [${JSON.stringify(axiosError.response.config)}]`));
1599
+ __privateGet(this, _LogErrorMessage).call(this, chalk.red(` config: [${JSON.stringify(axiosError.response.config)}]`));
1575
1600
  }
1576
1601
  } catch (innererror) {
1577
- __privateGet(this, _LogErrorMessage).call(this, chalk$1.red(` could not get response config, error: [${innererror}]`));
1602
+ __privateGet(this, _LogErrorMessage).call(this, chalk.red(` could not get response config, error: [${innererror}]`));
1578
1603
  }
1579
1604
  } else {
1580
- __privateGet(this, _LogDebugMessage).call(this, chalk$1.red(`AXIOS Error = [${axiosError}]`));
1605
+ __privateGet(this, _LogDebugMessage).call(this, chalk.red(`AXIOS Error = [${axiosError}]`));
1581
1606
  }
1582
1607
  }
1583
1608
  return responseCode;
@@ -1598,18 +1623,18 @@ class FhirClient {
1598
1623
  const metadataRecord = __privateGet(this, _invokeMethods)[id2];
1599
1624
  let performRetry = false;
1600
1625
  const returnData = await __privateGet(this, ___InvokeResourceAPI).call(this, metadataRecord, (statusCode, error) => {
1601
- console.error(chalk$1.red(`#InvokeResourceAPI(): Error: [${error}], Attempt: [${metadataRecord.retries + 1}]`));
1626
+ console.error(chalk.red(`#InvokeResourceAPI(): Error: [${error}], Attempt: [${metadataRecord.retries + 1}]`));
1602
1627
  const noRetryIndex = __privateGet(this, _NoRetryStatusCodes).indexOf(statusCode);
1603
1628
  if (noRetryIndex === -1) {
1604
1629
  if (statusCode === StatusCodes.UNAUTHORIZED) {
1605
- console.error(chalk$1.red(`#InvokeResourceAPI(): Authentication error, resetting access_token (to null).`));
1630
+ console.error(chalk.red(`#InvokeResourceAPI(): Authentication error, resetting access_token (to null).`));
1606
1631
  __privateGet(this, _options).ResetAccessToken();
1607
1632
  if (__privateGet(this, _options).clientTelemetryEvents) {
1608
1633
  __privateGet(this, _options).clientTelemetryEvents.AuthenticationErrorInc();
1609
1634
  }
1610
1635
  }
1611
1636
  if (isNode && __privateGet(this, _options).agentManager) {
1612
- console.error(chalk$1.red(`#InvokeResourceAPI(): Resetting https agent (to null).`));
1637
+ console.error(chalk.red(`#InvokeResourceAPI(): Resetting https agent (to null).`));
1613
1638
  __privateGet(this, _options).agentManager.ResetAgent();
1614
1639
  }
1615
1640
  performRetry = true;