@learncard/learn-cloud-plugin 2.0.4 → 2.0.5

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.
@@ -807,7 +807,7 @@ var require_lodash = __commonJS({
807
807
  }
808
808
  __name(object, "object");
809
809
  return function(proto) {
810
- if (!isObject2(proto)) {
810
+ if (!isObject3(proto)) {
811
811
  return {};
812
812
  }
813
813
  if (objectCreate) {
@@ -1215,7 +1215,7 @@ var require_lodash = __commonJS({
1215
1215
  if (result2 !== undefined2) {
1216
1216
  return result2;
1217
1217
  }
1218
- if (!isObject2(value)) {
1218
+ if (!isObject3(value)) {
1219
1219
  return value;
1220
1220
  }
1221
1221
  var isArr = isArray(value);
@@ -1592,7 +1592,7 @@ var require_lodash = __commonJS({
1592
1592
  }
1593
1593
  __name(baseIsMatch, "baseIsMatch");
1594
1594
  function baseIsNative(value) {
1595
- if (!isObject2(value) || isMasked(value)) {
1595
+ if (!isObject3(value) || isMasked(value)) {
1596
1596
  return false;
1597
1597
  }
1598
1598
  var pattern = isFunction2(value) ? reIsNative : reIsHostCtor;
@@ -1638,7 +1638,7 @@ var require_lodash = __commonJS({
1638
1638
  }
1639
1639
  __name(baseKeys, "baseKeys");
1640
1640
  function baseKeysIn(object) {
1641
- if (!isObject2(object)) {
1641
+ if (!isObject3(object)) {
1642
1642
  return nativeKeysIn(object);
1643
1643
  }
1644
1644
  var isProto = isPrototype(object), result2 = [];
@@ -1688,7 +1688,7 @@ var require_lodash = __commonJS({
1688
1688
  }
1689
1689
  baseFor(source, function(srcValue, key) {
1690
1690
  stack || (stack = new Stack());
1691
- if (isObject2(srcValue)) {
1691
+ if (isObject3(srcValue)) {
1692
1692
  baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
1693
1693
  } else {
1694
1694
  var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined2;
@@ -1729,7 +1729,7 @@ var require_lodash = __commonJS({
1729
1729
  newValue = objValue;
1730
1730
  if (isArguments(objValue)) {
1731
1731
  newValue = toPlainObject(objValue);
1732
- } else if (!isObject2(objValue) || isFunction2(objValue)) {
1732
+ } else if (!isObject3(objValue) || isFunction2(objValue)) {
1733
1733
  newValue = initCloneObject(srcValue);
1734
1734
  }
1735
1735
  } else {
@@ -1882,7 +1882,7 @@ var require_lodash = __commonJS({
1882
1882
  }
1883
1883
  __name(baseSampleSize, "baseSampleSize");
1884
1884
  function baseSet(object, path, value, customizer) {
1885
- if (!isObject2(object)) {
1885
+ if (!isObject3(object)) {
1886
1886
  return object;
1887
1887
  }
1888
1888
  path = castPath(path, object);
@@ -1896,7 +1896,7 @@ var require_lodash = __commonJS({
1896
1896
  var objValue = nested[key];
1897
1897
  newValue = customizer ? customizer(objValue, key, nested) : undefined2;
1898
1898
  if (newValue === undefined2) {
1899
- newValue = isObject2(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
1899
+ newValue = isObject3(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
1900
1900
  }
1901
1901
  }
1902
1902
  assignValue(nested, key, newValue);
@@ -2388,7 +2388,7 @@ var require_lodash = __commonJS({
2388
2388
  return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
2389
2389
  }
2390
2390
  var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
2391
- return isObject2(result2) ? result2 : thisBinding;
2391
+ return isObject3(result2) ? result2 : thisBinding;
2392
2392
  };
2393
2393
  }
2394
2394
  __name(createCtor, "createCtor");
@@ -2722,7 +2722,7 @@ var require_lodash = __commonJS({
2722
2722
  }
2723
2723
  __name(customDefaultsAssignIn, "customDefaultsAssignIn");
2724
2724
  function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
2725
- if (isObject2(objValue) && isObject2(srcValue)) {
2725
+ if (isObject3(objValue) && isObject3(srcValue)) {
2726
2726
  stack.set(srcValue, objValue);
2727
2727
  baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack);
2728
2728
  stack["delete"](srcValue);
@@ -3094,7 +3094,7 @@ var require_lodash = __commonJS({
3094
3094
  }
3095
3095
  __name(isIndex, "isIndex");
3096
3096
  function isIterateeCall(value, index, object) {
3097
- if (!isObject2(object)) {
3097
+ if (!isObject3(object)) {
3098
3098
  return false;
3099
3099
  }
3100
3100
  var type = typeof index;
@@ -3143,7 +3143,7 @@ var require_lodash = __commonJS({
3143
3143
  }
3144
3144
  __name(isPrototype, "isPrototype");
3145
3145
  function isStrictComparable(value) {
3146
- return value === value && !isObject2(value);
3146
+ return value === value && !isObject3(value);
3147
3147
  }
3148
3148
  __name(isStrictComparable, "isStrictComparable");
3149
3149
  function matchesStrictComparable(key, srcValue) {
@@ -4122,7 +4122,7 @@ var require_lodash = __commonJS({
4122
4122
  throw new TypeError2(FUNC_ERROR_TEXT);
4123
4123
  }
4124
4124
  wait = toNumber(wait) || 0;
4125
- if (isObject2(options)) {
4125
+ if (isObject3(options)) {
4126
4126
  leading = !!options.leading;
4127
4127
  maxing = "maxWait" in options;
4128
4128
  maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
@@ -4308,7 +4308,7 @@ var require_lodash = __commonJS({
4308
4308
  if (typeof func != "function") {
4309
4309
  throw new TypeError2(FUNC_ERROR_TEXT);
4310
4310
  }
4311
- if (isObject2(options)) {
4311
+ if (isObject3(options)) {
4312
4312
  leading = "leading" in options ? !!options.leading : leading;
4313
4313
  trailing = "trailing" in options ? !!options.trailing : trailing;
4314
4314
  }
@@ -4435,7 +4435,7 @@ var require_lodash = __commonJS({
4435
4435
  }
4436
4436
  __name(isFinite2, "isFinite");
4437
4437
  function isFunction2(value) {
4438
- if (!isObject2(value)) {
4438
+ if (!isObject3(value)) {
4439
4439
  return false;
4440
4440
  }
4441
4441
  var tag = baseGetTag(value);
@@ -4450,11 +4450,11 @@ var require_lodash = __commonJS({
4450
4450
  return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
4451
4451
  }
4452
4452
  __name(isLength, "isLength");
4453
- function isObject2(value) {
4453
+ function isObject3(value) {
4454
4454
  var type = typeof value;
4455
4455
  return value != null && (type == "object" || type == "function");
4456
4456
  }
4457
- __name(isObject2, "isObject");
4457
+ __name(isObject3, "isObject");
4458
4458
  function isObjectLike(value) {
4459
4459
  return value != null && typeof value == "object";
4460
4460
  }
@@ -4577,9 +4577,9 @@ var require_lodash = __commonJS({
4577
4577
  if (isSymbol(value)) {
4578
4578
  return NAN;
4579
4579
  }
4580
- if (isObject2(value)) {
4580
+ if (isObject3(value)) {
4581
4581
  var other = typeof value.valueOf == "function" ? value.valueOf() : value;
4582
- value = isObject2(other) ? other + "" : other;
4582
+ value = isObject3(other) ? other + "" : other;
4583
4583
  }
4584
4584
  if (typeof value != "string") {
4585
4585
  return value === 0 ? value : +value;
@@ -4699,7 +4699,7 @@ var require_lodash = __commonJS({
4699
4699
  return object != null && hasPath(object, path, baseHasIn);
4700
4700
  }
4701
4701
  __name(hasIn, "hasIn");
4702
- var invert = createInverter(function(result2, value, key) {
4702
+ var invert2 = createInverter(function(result2, value, key) {
4703
4703
  if (value != null && typeof value.toString != "function") {
4704
4704
  value = nativeObjectToString.call(value);
4705
4705
  }
@@ -4825,7 +4825,7 @@ var require_lodash = __commonJS({
4825
4825
  var Ctor = object && object.constructor;
4826
4826
  if (isArrLike) {
4827
4827
  accumulator = isArr ? new Ctor() : [];
4828
- } else if (isObject2(object)) {
4828
+ } else if (isObject3(object)) {
4829
4829
  accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object)) : {};
4830
4830
  } else {
4831
4831
  accumulator = {};
@@ -5135,7 +5135,7 @@ var require_lodash = __commonJS({
5135
5135
  __name(trimStart, "trimStart");
5136
5136
  function truncate(string, options) {
5137
5137
  var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
5138
- if (isObject2(options)) {
5138
+ if (isObject3(options)) {
5139
5139
  var separator = "separator" in options ? options.separator : separator;
5140
5140
  length = "length" in options ? toInteger(options.length) : length;
5141
5141
  omission = "omission" in options ? baseToString(options.omission) : omission;
@@ -5276,13 +5276,13 @@ var require_lodash = __commonJS({
5276
5276
  });
5277
5277
  function mixin(object, source, options) {
5278
5278
  var props = keys(source), methodNames = baseFunctions(source, props);
5279
- if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) {
5279
+ if (options == null && !(isObject3(source) && (methodNames.length || !props.length))) {
5280
5280
  options = source;
5281
5281
  source = object;
5282
5282
  object = this;
5283
5283
  methodNames = baseFunctions(source, keys(source));
5284
5284
  }
5285
- var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction2(object);
5285
+ var chain2 = !(isObject3(options) && "chain" in options) || !!options.chain, isFunc = isFunction2(object);
5286
5286
  arrayEach(methodNames, function(methodName) {
5287
5287
  var func = source[methodName];
5288
5288
  object[methodName] = func;
@@ -5482,7 +5482,7 @@ var require_lodash = __commonJS({
5482
5482
  lodash.intersection = intersection;
5483
5483
  lodash.intersectionBy = intersectionBy;
5484
5484
  lodash.intersectionWith = intersectionWith;
5485
- lodash.invert = invert;
5485
+ lodash.invert = invert2;
5486
5486
  lodash.invertBy = invertBy;
5487
5487
  lodash.invokeMap = invokeMap;
5488
5488
  lodash.iteratee = iteratee;
@@ -5650,7 +5650,7 @@ var require_lodash = __commonJS({
5650
5650
  lodash.isNil = isNil;
5651
5651
  lodash.isNull = isNull;
5652
5652
  lodash.isNumber = isNumber;
5653
- lodash.isObject = isObject2;
5653
+ lodash.isObject = isObject3;
5654
5654
  lodash.isObjectLike = isObjectLike;
5655
5655
  lodash.isPlainObject = isPlainObject;
5656
5656
  lodash.isRegExp = isRegExp;
@@ -5954,7 +5954,7 @@ var require_lib = __commonJS({
5954
5954
  var DEFAULTS = require_defaults();
5955
5955
  var isFunction2 = require_util().isFunction;
5956
5956
  var isBoolean = require_util().isBoolean;
5957
- var isObject2 = require_util().isObject;
5957
+ var isObject3 = require_util().isObject;
5958
5958
  var isArray = require_util().isArray;
5959
5959
  var isRegex = require_util().isRegex;
5960
5960
  var assign = require_util().assign;
@@ -5994,7 +5994,7 @@ var require_lib = __commonJS({
5994
5994
  node = replacer.call(parent, key, node);
5995
5995
  if (node === void 0)
5996
5996
  return;
5997
- if (!isObject2(node) || node === null)
5997
+ if (!isObject3(node) || node === null)
5998
5998
  return stringify2(node);
5999
5999
  if (isArray(node)) {
6000
6000
  const out = [];
@@ -6034,7 +6034,7 @@ var require_lib = __commonJS({
6034
6034
  // src/plugin.ts
6035
6035
  var import_lodash = __toESM(require_lodash());
6036
6036
 
6037
- // ../../../node_modules/.pnpm/@trpc+server@10.17.0/node_modules/@trpc/server/dist/observable-ade1bad8.mjs
6037
+ // ../../../node_modules/.pnpm/@trpc+server@10.45.2/node_modules/@trpc/server/dist/observable-ade1bad8.mjs
6038
6038
  function identity(x) {
6039
6039
  return x;
6040
6040
  }
@@ -6113,7 +6113,7 @@ function observable(subscribe) {
6113
6113
  }
6114
6114
  __name(observable, "observable");
6115
6115
 
6116
- // ../../../node_modules/.pnpm/@trpc+server@10.17.0/node_modules/@trpc/server/dist/observable/index.mjs
6116
+ // ../../../node_modules/.pnpm/@trpc+server@10.45.2/node_modules/@trpc/server/dist/observable/index.mjs
6117
6117
  function share(_opts) {
6118
6118
  return (originalObserver) => {
6119
6119
  let refCount = 0;
@@ -6216,85 +6216,7 @@ function observableToPromise(observable2) {
6216
6216
  }
6217
6217
  __name(observableToPromise, "observableToPromise");
6218
6218
 
6219
- // ../../../node_modules/.pnpm/@trpc+client@10.17.0_@trpc+server@10.17.0/node_modules/@trpc/client/dist/transformResult-6fb67924.mjs
6220
- var TRPCClientError = class extends Error {
6221
- static from(cause, opts = {}) {
6222
- if (!(cause instanceof Error)) {
6223
- return new TRPCClientError(cause.error.message ?? "", {
6224
- ...opts,
6225
- cause: void 0,
6226
- result: cause
6227
- });
6228
- }
6229
- if (cause.name === "TRPCClientError") {
6230
- return cause;
6231
- }
6232
- return new TRPCClientError(cause.message, {
6233
- ...opts,
6234
- cause,
6235
- result: null
6236
- });
6237
- }
6238
- constructor(message, opts) {
6239
- const cause = opts?.cause;
6240
- super(message, {
6241
- cause
6242
- });
6243
- this.meta = opts?.meta;
6244
- this.cause = cause;
6245
- this.shape = opts?.result?.error;
6246
- this.data = opts?.result?.error.data;
6247
- this.name = "TRPCClientError";
6248
- Object.setPrototypeOf(this, TRPCClientError.prototype);
6249
- }
6250
- };
6251
- __name(TRPCClientError, "TRPCClientError");
6252
- function transformResultInner(response, runtime) {
6253
- if ("error" in response) {
6254
- const error = runtime.transformer.deserialize(response.error);
6255
- return {
6256
- ok: false,
6257
- error: {
6258
- ...response,
6259
- error
6260
- }
6261
- };
6262
- }
6263
- const result = {
6264
- ...response.result,
6265
- ...(!response.result.type || response.result.type === "data") && {
6266
- type: "data",
6267
- data: runtime.transformer.deserialize(response.result.data)
6268
- }
6269
- };
6270
- return {
6271
- ok: true,
6272
- result
6273
- };
6274
- }
6275
- __name(transformResultInner, "transformResultInner");
6276
- function isObject(value) {
6277
- return !!value && !Array.isArray(value) && typeof value === "object";
6278
- }
6279
- __name(isObject, "isObject");
6280
- function transformResult(response, runtime) {
6281
- let result;
6282
- try {
6283
- result = transformResultInner(response, runtime);
6284
- } catch (err) {
6285
- throw new TRPCClientError("Unable to transform response from server");
6286
- }
6287
- if (!result.ok && (!isObject(result.error.error) || typeof result.error.error.code !== "number")) {
6288
- throw new TRPCClientError("Badly formatted response from server");
6289
- }
6290
- if (result.ok && !isObject(result.result)) {
6291
- throw new TRPCClientError("Badly formatted response from server");
6292
- }
6293
- return result;
6294
- }
6295
- __name(transformResult, "transformResult");
6296
-
6297
- // ../../../node_modules/.pnpm/@trpc+client@10.17.0_@trpc+server@10.17.0/node_modules/@trpc/client/dist/splitLink-4c75f7be.mjs
6219
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/splitLink-4c75f7be.mjs
6298
6220
  function createChain(opts) {
6299
6221
  return observable((observer) => {
6300
6222
  function execute(index = 0, op = opts.op) {
@@ -6318,7 +6240,37 @@ function createChain(opts) {
6318
6240
  }
6319
6241
  __name(createChain, "createChain");
6320
6242
 
6321
- // ../../../node_modules/.pnpm/@trpc+server@10.17.0/node_modules/@trpc/server/dist/index-972002da.mjs
6243
+ // ../../../node_modules/.pnpm/@trpc+server@10.45.2/node_modules/@trpc/server/dist/codes-c924c3db.mjs
6244
+ function invert(obj) {
6245
+ const newObj = /* @__PURE__ */ Object.create(null);
6246
+ for (const key in obj) {
6247
+ const v = obj[key];
6248
+ newObj[v] = key;
6249
+ }
6250
+ return newObj;
6251
+ }
6252
+ __name(invert, "invert");
6253
+ var TRPC_ERROR_CODES_BY_KEY = {
6254
+ PARSE_ERROR: -32700,
6255
+ BAD_REQUEST: -32600,
6256
+ INTERNAL_SERVER_ERROR: -32603,
6257
+ NOT_IMPLEMENTED: -32603,
6258
+ UNAUTHORIZED: -32001,
6259
+ FORBIDDEN: -32003,
6260
+ NOT_FOUND: -32004,
6261
+ METHOD_NOT_SUPPORTED: -32005,
6262
+ TIMEOUT: -32008,
6263
+ CONFLICT: -32009,
6264
+ PRECONDITION_FAILED: -32012,
6265
+ PAYLOAD_TOO_LARGE: -32013,
6266
+ UNPROCESSABLE_CONTENT: -32022,
6267
+ TOO_MANY_REQUESTS: -32029,
6268
+ CLIENT_CLOSED_REQUEST: -32099
6269
+ };
6270
+ var TRPC_ERROR_CODES_BY_NUMBER = invert(TRPC_ERROR_CODES_BY_KEY);
6271
+
6272
+ // ../../../node_modules/.pnpm/@trpc+server@10.45.2/node_modules/@trpc/server/dist/index-f91d720c.mjs
6273
+ var TRPC_ERROR_CODES_BY_NUMBER2 = invert(TRPC_ERROR_CODES_BY_KEY);
6322
6274
  var noop = /* @__PURE__ */ __name(() => {
6323
6275
  }, "noop");
6324
6276
  function createInnerProxy(callback, path) {
@@ -6333,9 +6285,10 @@ function createInnerProxy(callback, path) {
6333
6285
  ]);
6334
6286
  },
6335
6287
  apply(_1, _2, args) {
6288
+ const isApply = path[path.length - 1] === "apply";
6336
6289
  return callback({
6337
- args,
6338
- path
6290
+ args: isApply ? args.length >= 2 ? args[1] : [] : args,
6291
+ path: isApply ? path.slice(0, -1) : path
6339
6292
  });
6340
6293
  }
6341
6294
  });
@@ -6354,21 +6307,152 @@ var createFlatProxy = /* @__PURE__ */ __name((callback) => {
6354
6307
  });
6355
6308
  }, "createFlatProxy");
6356
6309
 
6357
- // ../../../node_modules/.pnpm/@trpc+client@10.17.0_@trpc+server@10.17.0/node_modules/@trpc/client/dist/httpUtils-9b676ab4.mjs
6358
- var isFunction = /* @__PURE__ */ __name((fn) => typeof fn === "function", "isFunction");
6359
- function _bind(fn, thisArg) {
6360
- return isFunction(fn.bind) ? fn.bind(thisArg) : fn;
6310
+ // ../../../node_modules/.pnpm/@trpc+server@10.45.2/node_modules/@trpc/server/dist/getCauseFromUnknown-2d66414a.mjs
6311
+ function isObject(value) {
6312
+ return !!value && !Array.isArray(value) && typeof value === "object";
6361
6313
  }
6362
- __name(_bind, "_bind");
6314
+ __name(isObject, "isObject");
6315
+ var UnknownCauseError = class extends Error {
6316
+ };
6317
+ __name(UnknownCauseError, "UnknownCauseError");
6318
+ function getCauseFromUnknown(cause) {
6319
+ if (cause instanceof Error) {
6320
+ return cause;
6321
+ }
6322
+ const type = typeof cause;
6323
+ if (type === "undefined" || type === "function" || cause === null) {
6324
+ return void 0;
6325
+ }
6326
+ if (type !== "object") {
6327
+ return new Error(String(cause));
6328
+ }
6329
+ if (isObject(cause)) {
6330
+ const err = new UnknownCauseError();
6331
+ for (const key in cause) {
6332
+ err[key] = cause[key];
6333
+ }
6334
+ return err;
6335
+ }
6336
+ return void 0;
6337
+ }
6338
+ __name(getCauseFromUnknown, "getCauseFromUnknown");
6339
+
6340
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/transformResult-ace864b8.mjs
6341
+ function isObject2(value) {
6342
+ return !!value && !Array.isArray(value) && typeof value === "object";
6343
+ }
6344
+ __name(isObject2, "isObject");
6345
+ function transformResultInner(response, runtime) {
6346
+ if ("error" in response) {
6347
+ const error = runtime.transformer.deserialize(response.error);
6348
+ return {
6349
+ ok: false,
6350
+ error: {
6351
+ ...response,
6352
+ error
6353
+ }
6354
+ };
6355
+ }
6356
+ const result = {
6357
+ ...response.result,
6358
+ ...(!response.result.type || response.result.type === "data") && {
6359
+ type: "data",
6360
+ data: runtime.transformer.deserialize(response.result.data)
6361
+ }
6362
+ };
6363
+ return {
6364
+ ok: true,
6365
+ result
6366
+ };
6367
+ }
6368
+ __name(transformResultInner, "transformResultInner");
6369
+ var TransformResultError = class extends Error {
6370
+ constructor() {
6371
+ super("Unable to transform response from server");
6372
+ }
6373
+ };
6374
+ __name(TransformResultError, "TransformResultError");
6375
+ function transformResult(response, runtime) {
6376
+ let result;
6377
+ try {
6378
+ result = transformResultInner(response, runtime);
6379
+ } catch (err) {
6380
+ throw new TransformResultError();
6381
+ }
6382
+ if (!result.ok && (!isObject2(result.error.error) || typeof result.error.error.code !== "number")) {
6383
+ throw new TransformResultError();
6384
+ }
6385
+ if (result.ok && !isObject2(result.result)) {
6386
+ throw new TransformResultError();
6387
+ }
6388
+ return result;
6389
+ }
6390
+ __name(transformResult, "transformResult");
6391
+
6392
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/TRPCClientError-38f9a32a.mjs
6393
+ function isTRPCClientError(cause) {
6394
+ return cause instanceof TRPCClientError || cause instanceof Error && cause.name === "TRPCClientError";
6395
+ }
6396
+ __name(isTRPCClientError, "isTRPCClientError");
6397
+ function isTRPCErrorResponse(obj) {
6398
+ return isObject2(obj) && isObject2(obj.error) && typeof obj.error.code === "number" && typeof obj.error.message === "string";
6399
+ }
6400
+ __name(isTRPCErrorResponse, "isTRPCErrorResponse");
6401
+ var TRPCClientError = class extends Error {
6402
+ static from(_cause, opts = {}) {
6403
+ const cause = _cause;
6404
+ if (isTRPCClientError(cause)) {
6405
+ if (opts.meta) {
6406
+ cause.meta = {
6407
+ ...cause.meta,
6408
+ ...opts.meta
6409
+ };
6410
+ }
6411
+ return cause;
6412
+ }
6413
+ if (isTRPCErrorResponse(cause)) {
6414
+ return new TRPCClientError(cause.error.message, {
6415
+ ...opts,
6416
+ result: cause
6417
+ });
6418
+ }
6419
+ if (!(cause instanceof Error)) {
6420
+ return new TRPCClientError("Unknown error", {
6421
+ ...opts,
6422
+ cause
6423
+ });
6424
+ }
6425
+ return new TRPCClientError(cause.message, {
6426
+ ...opts,
6427
+ cause: getCauseFromUnknown(cause)
6428
+ });
6429
+ }
6430
+ constructor(message, opts) {
6431
+ const cause = opts?.cause;
6432
+ super(message, {
6433
+ cause
6434
+ });
6435
+ this.meta = opts?.meta;
6436
+ this.cause = cause;
6437
+ this.shape = opts?.result?.error;
6438
+ this.data = opts?.result?.error.data;
6439
+ this.name = "TRPCClientError";
6440
+ Object.setPrototypeOf(this, TRPCClientError.prototype);
6441
+ }
6442
+ };
6443
+ __name(TRPCClientError, "TRPCClientError");
6444
+
6445
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/httpUtils-b9d0cb48.mjs
6446
+ var isFunction = /* @__PURE__ */ __name((fn) => typeof fn === "function", "isFunction");
6363
6447
  function getFetch(customFetchImpl) {
6364
6448
  if (customFetchImpl) {
6365
6449
  return customFetchImpl;
6366
6450
  }
6367
6451
  if (typeof window !== "undefined" && isFunction(window.fetch)) {
6368
- return _bind(window.fetch, window);
6452
+ return window.fetch;
6369
6453
  }
6370
6454
  if (typeof globalThis !== "undefined" && isFunction(globalThis.fetch)) {
6371
- return _bind(globalThis.fetch, globalThis);
6455
+ return globalThis.fetch;
6372
6456
  }
6373
6457
  throw new Error("No fetch implementation found");
6374
6458
  }
@@ -6387,12 +6471,10 @@ function getAbortController(customAbortControllerImpl) {
6387
6471
  }
6388
6472
  __name(getAbortController, "getAbortController");
6389
6473
  function resolveHTTPLinkOptions(opts) {
6390
- const headers = opts.headers || (() => ({}));
6391
6474
  return {
6392
- url: opts.url,
6393
- fetch: getFetch(opts.fetch),
6394
- AbortController: getAbortController(opts.AbortController),
6395
- headers: typeof headers === "function" ? headers : () => headers
6475
+ url: opts.url.toString().replace(/\/$/, ""),
6476
+ fetch: opts.fetch,
6477
+ AbortController: getAbortController(opts.AbortController)
6396
6478
  };
6397
6479
  }
6398
6480
  __name(resolveHTTPLinkOptions, "resolveHTTPLinkOptions");
@@ -6413,7 +6495,7 @@ function getInput(opts) {
6413
6495
  return "input" in opts ? opts.runtime.transformer.serialize(opts.input) : arrayToDict(opts.inputs.map((_input) => opts.runtime.transformer.serialize(_input)));
6414
6496
  }
6415
6497
  __name(getInput, "getInput");
6416
- function getUrl(opts) {
6498
+ var getUrl = /* @__PURE__ */ __name((opts) => {
6417
6499
  let url = opts.url + "/" + opts.path;
6418
6500
  const queryParts = [];
6419
6501
  if ("inputs" in opts) {
@@ -6429,48 +6511,73 @@ function getUrl(opts) {
6429
6511
  url += "?" + queryParts.join("&");
6430
6512
  }
6431
6513
  return url;
6432
- }
6433
- __name(getUrl, "getUrl");
6434
- function getBody(opts) {
6514
+ }, "getUrl");
6515
+ var getBody = /* @__PURE__ */ __name((opts) => {
6435
6516
  if (opts.type === "query") {
6436
6517
  return void 0;
6437
6518
  }
6438
6519
  const input = getInput(opts);
6439
6520
  return input !== void 0 ? JSON.stringify(input) : void 0;
6521
+ }, "getBody");
6522
+ var jsonHttpRequester = /* @__PURE__ */ __name((opts) => {
6523
+ return httpRequest({
6524
+ ...opts,
6525
+ contentTypeHeader: "application/json",
6526
+ getUrl,
6527
+ getBody
6528
+ });
6529
+ }, "jsonHttpRequester");
6530
+ async function fetchHTTPResponse(opts, ac) {
6531
+ const url = opts.getUrl(opts);
6532
+ const body = opts.getBody(opts);
6533
+ const { type } = opts;
6534
+ const resolvedHeaders = await opts.headers();
6535
+ if (type === "subscription") {
6536
+ throw new Error("Subscriptions should use wsLink");
6537
+ }
6538
+ const headers = {
6539
+ ...opts.contentTypeHeader ? {
6540
+ "content-type": opts.contentTypeHeader
6541
+ } : {},
6542
+ ...opts.batchModeHeader ? {
6543
+ "trpc-batch-mode": opts.batchModeHeader
6544
+ } : {},
6545
+ ...resolvedHeaders
6546
+ };
6547
+ return getFetch(opts.fetch)(url, {
6548
+ method: METHOD[type],
6549
+ signal: ac?.signal,
6550
+ body,
6551
+ headers
6552
+ });
6440
6553
  }
6441
- __name(getBody, "getBody");
6554
+ __name(fetchHTTPResponse, "fetchHTTPResponse");
6442
6555
  function httpRequest(opts) {
6443
- const { type } = opts;
6444
6556
  const ac = opts.AbortController ? new opts.AbortController() : null;
6557
+ const meta = {};
6558
+ let done = false;
6445
6559
  const promise = new Promise((resolve, reject) => {
6446
- const url = getUrl(opts);
6447
- const body = getBody(opts);
6448
- const meta = {};
6449
- Promise.resolve(opts.headers()).then((headers) => {
6450
- if (type === "subscription") {
6451
- throw new Error("Subscriptions should use wsLink");
6452
- }
6453
- return opts.fetch(url, {
6454
- method: METHOD[type],
6455
- signal: ac?.signal,
6456
- body,
6457
- headers: {
6458
- "content-type": "application/json",
6459
- ...headers
6460
- }
6461
- });
6462
- }).then((_res) => {
6560
+ fetchHTTPResponse(opts, ac).then((_res) => {
6463
6561
  meta.response = _res;
6562
+ done = true;
6464
6563
  return _res.json();
6465
6564
  }).then((json) => {
6565
+ meta.responseJSON = json;
6466
6566
  resolve({
6467
6567
  json,
6468
6568
  meta
6469
6569
  });
6470
- }).catch(reject);
6570
+ }).catch((err) => {
6571
+ done = true;
6572
+ reject(TRPCClientError.from(err, {
6573
+ meta
6574
+ }));
6575
+ });
6471
6576
  });
6472
6577
  const cancel = /* @__PURE__ */ __name(() => {
6473
- ac?.abort();
6578
+ if (!done) {
6579
+ ac?.abort();
6580
+ }
6474
6581
  }, "cancel");
6475
6582
  return {
6476
6583
  promise,
@@ -6479,7 +6586,7 @@ function httpRequest(opts) {
6479
6586
  }
6480
6587
  __name(httpRequest, "httpRequest");
6481
6588
 
6482
- // ../../../node_modules/.pnpm/@trpc+client@10.17.0_@trpc+server@10.17.0/node_modules/@trpc/client/dist/links/httpBatchLink.mjs
6589
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/httpBatchLink-d0f9eac9.mjs
6483
6590
  var throwFatalError = /* @__PURE__ */ __name(() => {
6484
6591
  throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
6485
6592
  }, "throwFatalError");
@@ -6503,7 +6610,7 @@ function dataLoader(batchLoader) {
6503
6610
  }
6504
6611
  const lastGroup = groupedItems[groupedItems.length - 1];
6505
6612
  if (item.aborted) {
6506
- item.reject(new Error("Aborted"));
6613
+ item.reject?.(new Error("Aborted"));
6507
6614
  index++;
6508
6615
  continue;
6509
6616
  }
@@ -6514,7 +6621,7 @@ function dataLoader(batchLoader) {
6514
6621
  continue;
6515
6622
  }
6516
6623
  if (lastGroup.length === 0) {
6517
- item.reject(new Error("Input is too big for a single dispatch"));
6624
+ item.reject?.(new Error("Input is too big for a single dispatch"));
6518
6625
  index++;
6519
6626
  continue;
6520
6627
  }
@@ -6537,18 +6644,27 @@ function dataLoader(batchLoader) {
6537
6644
  for (const item of items) {
6538
6645
  item.batch = batch;
6539
6646
  }
6540
- const { promise, cancel } = batchLoader.fetch(batch.items.map((_item) => _item.key));
6647
+ const unitResolver = /* @__PURE__ */ __name((index, value) => {
6648
+ const item = batch.items[index];
6649
+ item.resolve?.(value);
6650
+ item.batch = null;
6651
+ item.reject = null;
6652
+ item.resolve = null;
6653
+ }, "unitResolver");
6654
+ const { promise, cancel } = batchLoader.fetch(batch.items.map((_item) => _item.key), unitResolver);
6541
6655
  batch.cancel = cancel;
6542
6656
  promise.then((result) => {
6543
6657
  for (let i = 0; i < result.length; i++) {
6544
6658
  const value = result[i];
6545
- const item = batch.items[i];
6546
- item.resolve(value);
6659
+ unitResolver(i, value);
6660
+ }
6661
+ for (const item of batch.items) {
6662
+ item.reject?.(new Error("Missing result"));
6547
6663
  item.batch = null;
6548
6664
  }
6549
6665
  }).catch((cause) => {
6550
6666
  for (const item of batch.items) {
6551
- item.reject(cause);
6667
+ item.reject?.(cause);
6552
6668
  item.batch = null;
6553
6669
  }
6554
6670
  });
@@ -6592,89 +6708,170 @@ function dataLoader(batchLoader) {
6592
6708
  };
6593
6709
  }
6594
6710
  __name(dataLoader, "dataLoader");
6595
- function httpBatchLink(opts) {
6596
- const resolvedOpts = resolveHTTPLinkOptions(opts);
6597
- return (runtime) => {
6598
- const maxURLLength = opts.maxURLLength || Infinity;
6599
- const batchLoader = /* @__PURE__ */ __name((type) => {
6600
- const validate = /* @__PURE__ */ __name((batchOps) => {
6601
- if (maxURLLength === Infinity) {
6602
- return true;
6603
- }
6604
- const path = batchOps.map((op) => op.path).join(",");
6605
- const inputs = batchOps.map((op) => op.input);
6606
- const url = getUrl({
6607
- ...resolvedOpts,
6608
- runtime,
6609
- type,
6610
- path,
6611
- inputs
6612
- });
6613
- return url.length <= maxURLLength;
6614
- }, "validate");
6615
- const fetch = /* @__PURE__ */ __name((batchOps) => {
6616
- const path = batchOps.map((op) => op.path).join(",");
6617
- const inputs = batchOps.map((op) => op.input);
6618
- const { promise, cancel } = httpRequest({
6711
+ function createHTTPBatchLink(requester) {
6712
+ return /* @__PURE__ */ __name(function httpBatchLink2(opts) {
6713
+ const resolvedOpts = resolveHTTPLinkOptions(opts);
6714
+ const maxURLLength = opts.maxURLLength ?? Infinity;
6715
+ return (runtime) => {
6716
+ const batchLoader = /* @__PURE__ */ __name((type) => {
6717
+ const validate = /* @__PURE__ */ __name((batchOps) => {
6718
+ if (maxURLLength === Infinity) {
6719
+ return true;
6720
+ }
6721
+ const path = batchOps.map((op) => op.path).join(",");
6722
+ const inputs = batchOps.map((op) => op.input);
6723
+ const url = getUrl({
6724
+ ...resolvedOpts,
6725
+ runtime,
6726
+ type,
6727
+ path,
6728
+ inputs
6729
+ });
6730
+ return url.length <= maxURLLength;
6731
+ }, "validate");
6732
+ const fetch = requester({
6619
6733
  ...resolvedOpts,
6620
6734
  runtime,
6621
6735
  type,
6622
- path,
6623
- inputs
6736
+ opts
6624
6737
  });
6625
6738
  return {
6626
- promise: promise.then((res) => {
6627
- const resJSON = Array.isArray(res.json) ? res.json : batchOps.map(() => res.json);
6628
- const result = resJSON.map((item) => ({
6629
- meta: res.meta,
6630
- json: item
6631
- }));
6632
- return result;
6633
- }),
6634
- cancel
6739
+ validate,
6740
+ fetch
6635
6741
  };
6636
- }, "fetch");
6637
- return {
6638
- validate,
6639
- fetch
6742
+ }, "batchLoader");
6743
+ const query = dataLoader(batchLoader("query"));
6744
+ const mutation = dataLoader(batchLoader("mutation"));
6745
+ const subscription = dataLoader(batchLoader("subscription"));
6746
+ const loaders = {
6747
+ query,
6748
+ subscription,
6749
+ mutation
6640
6750
  };
6641
- }, "batchLoader");
6642
- const query = dataLoader(batchLoader("query"));
6643
- const mutation = dataLoader(batchLoader("mutation"));
6644
- const subscription = dataLoader(batchLoader("subscription"));
6645
- const loaders = {
6646
- query,
6647
- subscription,
6648
- mutation
6649
- };
6650
- return ({ op }) => {
6651
- return observable((observer) => {
6652
- const loader = loaders[op.type];
6653
- const { promise, cancel } = loader.load(op);
6654
- promise.then((res) => {
6655
- const transformed = transformResult(res.json, runtime);
6656
- if (!transformed.ok) {
6657
- observer.error(TRPCClientError.from(transformed.error, {
6658
- meta: res.meta
6751
+ return ({ op }) => {
6752
+ return observable((observer) => {
6753
+ const loader = loaders[op.type];
6754
+ const { promise, cancel } = loader.load(op);
6755
+ let _res = void 0;
6756
+ promise.then((res) => {
6757
+ _res = res;
6758
+ const transformed = transformResult(res.json, runtime);
6759
+ if (!transformed.ok) {
6760
+ observer.error(TRPCClientError.from(transformed.error, {
6761
+ meta: res.meta
6762
+ }));
6763
+ return;
6764
+ }
6765
+ observer.next({
6766
+ context: res.meta,
6767
+ result: transformed.result
6768
+ });
6769
+ observer.complete();
6770
+ }).catch((err) => {
6771
+ observer.error(TRPCClientError.from(err, {
6772
+ meta: _res?.meta
6659
6773
  }));
6660
- return;
6661
- }
6662
- observer.next({
6663
- context: res.meta,
6664
- result: transformed.result
6665
6774
  });
6666
- observer.complete();
6667
- }).catch((err) => observer.error(TRPCClientError.from(err)));
6668
- return () => {
6669
- cancel();
6670
- };
6671
- });
6775
+ return () => {
6776
+ cancel();
6777
+ };
6778
+ });
6779
+ };
6780
+ };
6781
+ }, "httpBatchLink");
6782
+ }
6783
+ __name(createHTTPBatchLink, "createHTTPBatchLink");
6784
+ var batchRequester = /* @__PURE__ */ __name((requesterOpts) => {
6785
+ return (batchOps) => {
6786
+ const path = batchOps.map((op) => op.path).join(",");
6787
+ const inputs = batchOps.map((op) => op.input);
6788
+ const { promise, cancel } = jsonHttpRequester({
6789
+ ...requesterOpts,
6790
+ path,
6791
+ inputs,
6792
+ headers() {
6793
+ if (!requesterOpts.opts.headers) {
6794
+ return {};
6795
+ }
6796
+ if (typeof requesterOpts.opts.headers === "function") {
6797
+ return requesterOpts.opts.headers({
6798
+ opList: batchOps
6799
+ });
6800
+ }
6801
+ return requesterOpts.opts.headers;
6802
+ }
6803
+ });
6804
+ return {
6805
+ promise: promise.then((res) => {
6806
+ const resJSON = Array.isArray(res.json) ? res.json : batchOps.map(() => res.json);
6807
+ const result = resJSON.map((item) => ({
6808
+ meta: res.meta,
6809
+ json: item
6810
+ }));
6811
+ return result;
6812
+ }),
6813
+ cancel
6672
6814
  };
6673
6815
  };
6816
+ }, "batchRequester");
6817
+ var httpBatchLink = createHTTPBatchLink(batchRequester);
6818
+
6819
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/links/httpLink.mjs
6820
+ function httpLinkFactory(factoryOpts) {
6821
+ return (opts) => {
6822
+ const resolvedOpts = resolveHTTPLinkOptions(opts);
6823
+ return (runtime) => ({ op }) => observable((observer) => {
6824
+ const { path, input, type } = op;
6825
+ const { promise, cancel } = factoryOpts.requester({
6826
+ ...resolvedOpts,
6827
+ runtime,
6828
+ type,
6829
+ path,
6830
+ input,
6831
+ headers() {
6832
+ if (!opts.headers) {
6833
+ return {};
6834
+ }
6835
+ if (typeof opts.headers === "function") {
6836
+ return opts.headers({
6837
+ op
6838
+ });
6839
+ }
6840
+ return opts.headers;
6841
+ }
6842
+ });
6843
+ let meta = void 0;
6844
+ promise.then((res) => {
6845
+ meta = res.meta;
6846
+ const transformed = transformResult(res.json, runtime);
6847
+ if (!transformed.ok) {
6848
+ observer.error(TRPCClientError.from(transformed.error, {
6849
+ meta
6850
+ }));
6851
+ return;
6852
+ }
6853
+ observer.next({
6854
+ context: res.meta,
6855
+ result: transformed.result
6856
+ });
6857
+ observer.complete();
6858
+ }).catch((cause) => {
6859
+ observer.error(TRPCClientError.from(cause, {
6860
+ meta
6861
+ }));
6862
+ });
6863
+ return () => {
6864
+ cancel();
6865
+ };
6866
+ });
6867
+ };
6674
6868
  }
6675
- __name(httpBatchLink, "httpBatchLink");
6869
+ __name(httpLinkFactory, "httpLinkFactory");
6870
+ var httpLink = httpLinkFactory({
6871
+ requester: jsonHttpRequester
6872
+ });
6676
6873
 
6677
- // ../../../node_modules/.pnpm/@trpc+client@10.17.0_@trpc+server@10.17.0/node_modules/@trpc/client/dist/index.mjs
6874
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/index.mjs
6678
6875
  var TRPCUntypedClient = class {
6679
6876
  $request({ type, input, path, context = {} }) {
6680
6877
  const chain$ = createChain({
@@ -6747,23 +6944,34 @@ var TRPCUntypedClient = class {
6747
6944
  }
6748
6945
  constructor(opts) {
6749
6946
  this.requestId = 0;
6750
- function getTransformer() {
6947
+ const combinedTransformer = (() => {
6751
6948
  const transformer = opts.transformer;
6752
- if (!transformer)
6753
- return {
6754
- serialize: (data) => data,
6755
- deserialize: (data) => data
6756
- };
6757
- if ("input" in transformer)
6949
+ if (!transformer) {
6758
6950
  return {
6759
- serialize: transformer.input.serialize,
6760
- deserialize: transformer.output.deserialize
6951
+ input: {
6952
+ serialize: (data) => data,
6953
+ deserialize: (data) => data
6954
+ },
6955
+ output: {
6956
+ serialize: (data) => data,
6957
+ deserialize: (data) => data
6958
+ }
6761
6959
  };
6762
- return transformer;
6763
- }
6764
- __name(getTransformer, "getTransformer");
6960
+ }
6961
+ if ("input" in transformer) {
6962
+ return opts.transformer;
6963
+ }
6964
+ return {
6965
+ input: transformer,
6966
+ output: transformer
6967
+ };
6968
+ })();
6765
6969
  this.runtime = {
6766
- transformer: getTransformer()
6970
+ transformer: {
6971
+ serialize: (data) => combinedTransformer.input.serialize(data),
6972
+ deserialize: (data) => combinedTransformer.output.deserialize(data)
6973
+ },
6974
+ combinedTransformer
6767
6975
  };
6768
6976
  this.links = opts.links.map((link) => link(this.runtime));
6769
6977
  }
@@ -6774,18 +6982,23 @@ var clientCallTypeMap = {
6774
6982
  mutate: "mutation",
6775
6983
  subscribe: "subscription"
6776
6984
  };
6985
+ var clientCallTypeToProcedureType = /* @__PURE__ */ __name((clientCallType) => {
6986
+ return clientCallTypeMap[clientCallType];
6987
+ }, "clientCallTypeToProcedureType");
6777
6988
  function createTRPCClientProxy(client) {
6778
6989
  return createFlatProxy((key) => {
6779
6990
  if (client.hasOwnProperty(key)) {
6780
6991
  return client[key];
6781
6992
  }
6993
+ if (key === "__untypedClient") {
6994
+ return client;
6995
+ }
6782
6996
  return createRecursiveProxy(({ path, args }) => {
6783
6997
  const pathCopy = [
6784
6998
  key,
6785
6999
  ...path
6786
7000
  ];
6787
- const clientCallType = pathCopy.pop();
6788
- const procedureType = clientCallTypeMap[clientCallType];
7001
+ const procedureType = clientCallTypeToProcedureType(pathCopy.pop());
6789
7002
  const fullPath = pathCopy.join(".");
6790
7003
  return client[procedureType](fullPath, ...args);
6791
7004
  });
@@ -6798,6 +7011,161 @@ function createTRPCProxyClient(opts) {
6798
7011
  return proxy;
6799
7012
  }
6800
7013
  __name(createTRPCProxyClient, "createTRPCProxyClient");
7014
+ function getTextDecoder(customTextDecoder) {
7015
+ if (customTextDecoder) {
7016
+ return customTextDecoder;
7017
+ }
7018
+ if (typeof window !== "undefined" && window.TextDecoder) {
7019
+ return new window.TextDecoder();
7020
+ }
7021
+ if (typeof globalThis !== "undefined" && globalThis.TextDecoder) {
7022
+ return new globalThis.TextDecoder();
7023
+ }
7024
+ throw new Error("No TextDecoder implementation found");
7025
+ }
7026
+ __name(getTextDecoder, "getTextDecoder");
7027
+ async function parseJSONStream(opts) {
7028
+ const parse = opts.parse ?? JSON.parse;
7029
+ const onLine = /* @__PURE__ */ __name((line) => {
7030
+ if (opts.signal?.aborted)
7031
+ return;
7032
+ if (!line || line === "}") {
7033
+ return;
7034
+ }
7035
+ const indexOfColon = line.indexOf(":");
7036
+ const indexAsStr = line.substring(2, indexOfColon - 1);
7037
+ const text = line.substring(indexOfColon + 1);
7038
+ opts.onSingle(Number(indexAsStr), parse(text));
7039
+ }, "onLine");
7040
+ await readLines(opts.readableStream, onLine, opts.textDecoder);
7041
+ }
7042
+ __name(parseJSONStream, "parseJSONStream");
7043
+ async function readLines(readableStream, onLine, textDecoder) {
7044
+ let partOfLine = "";
7045
+ const onChunk = /* @__PURE__ */ __name((chunk2) => {
7046
+ const chunkText = textDecoder.decode(chunk2);
7047
+ const chunkLines = chunkText.split("\n");
7048
+ if (chunkLines.length === 1) {
7049
+ partOfLine += chunkLines[0];
7050
+ } else if (chunkLines.length > 1) {
7051
+ onLine(partOfLine + chunkLines[0]);
7052
+ for (let i = 1; i < chunkLines.length - 1; i++) {
7053
+ onLine(chunkLines[i]);
7054
+ }
7055
+ partOfLine = chunkLines[chunkLines.length - 1];
7056
+ }
7057
+ }, "onChunk");
7058
+ if ("getReader" in readableStream) {
7059
+ await readStandardChunks(readableStream, onChunk);
7060
+ } else {
7061
+ await readNodeChunks(readableStream, onChunk);
7062
+ }
7063
+ onLine(partOfLine);
7064
+ }
7065
+ __name(readLines, "readLines");
7066
+ function readNodeChunks(stream, onChunk) {
7067
+ return new Promise((resolve) => {
7068
+ stream.on("data", onChunk);
7069
+ stream.on("end", resolve);
7070
+ });
7071
+ }
7072
+ __name(readNodeChunks, "readNodeChunks");
7073
+ async function readStandardChunks(stream, onChunk) {
7074
+ const reader = stream.getReader();
7075
+ let readResult = await reader.read();
7076
+ while (!readResult.done) {
7077
+ onChunk(readResult.value);
7078
+ readResult = await reader.read();
7079
+ }
7080
+ }
7081
+ __name(readStandardChunks, "readStandardChunks");
7082
+ var streamingJsonHttpRequester = /* @__PURE__ */ __name((opts, onSingle) => {
7083
+ const ac = opts.AbortController ? new opts.AbortController() : null;
7084
+ const responsePromise = fetchHTTPResponse({
7085
+ ...opts,
7086
+ contentTypeHeader: "application/json",
7087
+ batchModeHeader: "stream",
7088
+ getUrl,
7089
+ getBody
7090
+ }, ac);
7091
+ const cancel = /* @__PURE__ */ __name(() => ac?.abort(), "cancel");
7092
+ const promise = responsePromise.then(async (res) => {
7093
+ if (!res.body)
7094
+ throw new Error("Received response without body");
7095
+ const meta = {
7096
+ response: res
7097
+ };
7098
+ return parseJSONStream({
7099
+ readableStream: res.body,
7100
+ onSingle,
7101
+ parse: (string) => ({
7102
+ json: JSON.parse(string),
7103
+ meta
7104
+ }),
7105
+ signal: ac?.signal,
7106
+ textDecoder: opts.textDecoder
7107
+ });
7108
+ });
7109
+ return {
7110
+ cancel,
7111
+ promise
7112
+ };
7113
+ }, "streamingJsonHttpRequester");
7114
+ var streamRequester = /* @__PURE__ */ __name((requesterOpts) => {
7115
+ const textDecoder = getTextDecoder(requesterOpts.opts.textDecoder);
7116
+ return (batchOps, unitResolver) => {
7117
+ const path = batchOps.map((op) => op.path).join(",");
7118
+ const inputs = batchOps.map((op) => op.input);
7119
+ const { cancel, promise } = streamingJsonHttpRequester({
7120
+ ...requesterOpts,
7121
+ textDecoder,
7122
+ path,
7123
+ inputs,
7124
+ headers() {
7125
+ if (!requesterOpts.opts.headers) {
7126
+ return {};
7127
+ }
7128
+ if (typeof requesterOpts.opts.headers === "function") {
7129
+ return requesterOpts.opts.headers({
7130
+ opList: batchOps
7131
+ });
7132
+ }
7133
+ return requesterOpts.opts.headers;
7134
+ }
7135
+ }, (index, res) => {
7136
+ unitResolver(index, res);
7137
+ });
7138
+ return {
7139
+ promise: promise.then(() => []),
7140
+ cancel
7141
+ };
7142
+ };
7143
+ }, "streamRequester");
7144
+ var unstable_httpBatchStreamLink = createHTTPBatchLink(streamRequester);
7145
+ var getBody2 = /* @__PURE__ */ __name((opts) => {
7146
+ if (!("input" in opts)) {
7147
+ return void 0;
7148
+ }
7149
+ if (!(opts.input instanceof FormData)) {
7150
+ throw new Error("Input is not FormData");
7151
+ }
7152
+ return opts.input;
7153
+ }, "getBody");
7154
+ var formDataRequester = /* @__PURE__ */ __name((opts) => {
7155
+ if (opts.type !== "mutation") {
7156
+ throw new Error("We only handle mutations with formdata");
7157
+ }
7158
+ return httpRequest({
7159
+ ...opts,
7160
+ getUrl() {
7161
+ return `${opts.url}/${opts.path}`;
7162
+ },
7163
+ getBody: getBody2
7164
+ });
7165
+ }, "formDataRequester");
7166
+ var experimental_formDataLink = httpLinkFactory({
7167
+ requester: formDataRequester
7168
+ });
6801
7169
 
6802
7170
  // ../../learn-card-network/cloud-client/dist/learn-cloud-client.esm.js
6803
7171
  var __defProp2 = Object.defineProperty;
@@ -6840,7 +7208,11 @@ var getClient = /* @__PURE__ */ __name2(async (url, didAuthFunction) => {
6840
7208
  let challenges = [];
6841
7209
  const challengeRequester = createTRPCProxyClient({
6842
7210
  links: [
6843
- httpBatchLink({ url, headers: { Authorization: `Bearer ${await didAuthFunction()}` } })
7211
+ httpBatchLink({
7212
+ url,
7213
+ maxURLLength: 2048,
7214
+ headers: { Authorization: `Bearer ${await didAuthFunction()}` }
7215
+ })
6844
7216
  ]
6845
7217
  });
6846
7218
  const getChallenges = /* @__PURE__ */ __name2(async (amount = 95 + Math.round((Math.random() - 0.5) * 5)) => {
@@ -6854,6 +7226,7 @@ var getClient = /* @__PURE__ */ __name2(async (url, didAuthFunction) => {
6854
7226
  }),
6855
7227
  httpBatchLink({
6856
7228
  url,
7229
+ maxURLLength: 2048,
6857
7230
  headers: async () => {
6858
7231
  if (challenges.length === 0)
6859
7232
  challenges.push(...await getChallenges());
@@ -6964,6 +7337,8 @@ var require_types_cjs_development = __commonJS2({
6964
7337
  LCNProfileValidator: () => LCNProfileValidator2,
6965
7338
  LCNSigningAuthorityForUserValidator: () => LCNSigningAuthorityForUserValidator2,
6966
7339
  LCNSigningAuthorityValidator: () => LCNSigningAuthorityValidator2,
7340
+ PaginatedBoostRecipientsValidator: () => PaginatedBoostRecipientsValidator2,
7341
+ PaginatedBoostsValidator: () => PaginatedBoostsValidator2,
6967
7342
  PaginatedConsentFlowContractsValidator: () => PaginatedConsentFlowContractsValidator2,
6968
7343
  PaginatedConsentFlowDataValidator: () => PaginatedConsentFlowDataValidator2,
6969
7344
  PaginatedConsentFlowTermsValidator: () => PaginatedConsentFlowTermsValidator2,
@@ -10775,11 +11150,17 @@ var require_types_cjs_development = __commonJS2({
10775
11150
  status: LCNBoostStatus2.optional(),
10776
11151
  autoConnectRecipients: mod2.boolean().optional()
10777
11152
  });
11153
+ var PaginatedBoostsValidator2 = PaginationResponseValidator2.extend({
11154
+ records: BoostValidator2.array()
11155
+ });
10778
11156
  var BoostRecipientValidator2 = mod2.object({
10779
11157
  to: LCNProfileValidator2,
10780
11158
  from: mod2.string(),
10781
11159
  received: mod2.string().optional()
10782
11160
  });
11161
+ var PaginatedBoostRecipientsValidator2 = PaginationResponseValidator2.extend({
11162
+ records: BoostRecipientValidator2.array()
11163
+ });
10783
11164
  var LCNBoostClaimLinkSigningAuthorityValidator2 = mod2.object({
10784
11165
  endpoint: mod2.string(),
10785
11166
  name: mod2.string(),
@@ -14725,11 +15106,17 @@ var BoostValidator = mod.object({
14725
15106
  status: LCNBoostStatus.optional(),
14726
15107
  autoConnectRecipients: mod.boolean().optional()
14727
15108
  });
15109
+ var PaginatedBoostsValidator = PaginationResponseValidator.extend({
15110
+ records: BoostValidator.array()
15111
+ });
14728
15112
  var BoostRecipientValidator = mod.object({
14729
15113
  to: LCNProfileValidator,
14730
15114
  from: mod.string(),
14731
15115
  received: mod.string().optional()
14732
15116
  });
15117
+ var PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({
15118
+ records: BoostRecipientValidator.array()
15119
+ });
14733
15120
  var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
14734
15121
  endpoint: mod.string(),
14735
15122
  name: mod.string(),