nolo-cli 0.97.0-alpha.1 → 0.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-JIG7MRXQ.js → _executeModel-DYHTQJZC.js} +68 -63
  3. package/{action-YVYQEAAV.js → action-GI44T4DR.js} +10 -10
  4. package/{addContentAction-O7R66HEX.js → addContentAction-B2DRF7P6.js} +9 -9
  5. package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-T3I7IXPK.js} +15 -17
  6. package/{agentDeleteCommand-THAZ5GQS.js → agentDeleteCommand-LLNNP3AM.js} +47 -43
  7. package/{agentEmailCommands-A7T7AJA4.js → agentEmailCommands-EO3H2LDW.js} +90 -82
  8. package/agentListCommands-J3MWAZWO.js +741 -0
  9. package/{agentMachineCommands-DM4N5PK3.js → agentMachineCommands-V65VOQNK.js} +42 -38
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-EMZCM6VA.js} +1 -1
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-HF4A42D4.js} +1 -1
  12. package/agentRecordCommands-VY35OMX3.js +136 -0
  13. package/{agentRunCommand-JVSTGVG2.js → agentRunCommand-CSEX4QIH.js} +90 -80
  14. package/{agentRunControl-WCTKX5VL.js → agentRunControl-5T64LM2M.js} +2 -2
  15. package/{agentRuntimeLocal-73CVIWBB.js → agentRuntimeLocal-AY6YNUAL.js} +44 -36
  16. package/{agentSlice-6X4JL2E3.js → agentSlice-FOZUXW7X.js} +11 -11
  17. package/{appDeleteCommands-S7CK4OYL.js → appDeleteCommands-QTTL3QF3.js} +42 -38
  18. package/{appDeployCommands-U6TMS5GO.js → appDeployCommands-43LJECGV.js} +42 -38
  19. package/{appDeployStatusCommands-DTNQJ3LJ.js → appDeployStatusCommands-L5BKOLYW.js} +42 -38
  20. package/{appGetCommands-3SHZEQD5.js → appGetCommands-HOFZKOPC.js} +42 -38
  21. package/{appListCommands-E2ZMIUB6.js → appListCommands-I7C3SJCE.js} +42 -38
  22. package/{authCommand-F4EFRRX6.js → authCommand-2YPMMIJN.js} +117 -23
  23. package/{authCommands-RGOGCPP6.js → authCommands-FFDS4FVX.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-CALVIJTX.js} +6 -5
  25. package/{chatQueueReduxAdapter-LAQEZQKE.js → chatQueueReduxAdapter-NMEZRYC2.js} +30 -29
  26. package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
  27. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
  28. package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
  29. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  30. package/{chunk-YQTQQX2H.js → chunk-2UV22D2F.js} +1 -1
  31. package/{chunk-R2B3MIZA.js → chunk-3BFMH6GE.js} +6 -7
  32. package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
  33. package/{chunk-QIAVMDHY.js → chunk-3LX6YE3P.js} +4 -4
  34. package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
  35. package/chunk-4LCOCOR5.js +50 -0
  36. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  37. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  38. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  39. package/chunk-5J3PYNUP.js +255 -0
  40. package/chunk-5MMAK75Q.js +15 -0
  41. package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
  42. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  43. package/{chunk-6YTOJY35.js → chunk-6D2JFXLY.js} +35 -0
  44. package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
  45. package/{chunk-IIVGDG4I.js → chunk-6PHKBY2Q.js} +10 -4
  46. package/{chunk-WADCY6G6.js → chunk-6ZWMH6TJ.js} +111 -41
  47. package/{chunk-ABQYVJBJ.js → chunk-7CHC4W22.js} +1 -1
  48. package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
  49. package/{chunk-ZWUOR654.js → chunk-7WCQEMPB.js} +971 -1093
  50. package/{chunk-BLJWCTRL.js → chunk-AOPCEXTB.js} +1 -1
  51. package/{chunk-LXF6XQDT.js → chunk-AQ3I6DZE.js} +865 -207
  52. package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
  53. package/{chunk-RG6JBBX5.js → chunk-AWF3WO5R.js} +166 -13
  54. package/{chunk-GPCZ7UXG.js → chunk-AZRHIN5B.js} +1 -1
  55. package/chunk-BMQ2MJUK.js +153 -0
  56. package/{chunk-HWIZU4OL.js → chunk-C3VLSD4K.js} +236 -36
  57. package/{chunk-3IIEFNGY.js → chunk-C53ZG23R.js} +2 -2
  58. package/chunk-CHOZJMJS.js +78 -0
  59. package/{chunk-HJUYAD4A.js → chunk-CPUFH46E.js} +8 -8
  60. package/{chunk-LS2ZANRJ.js → chunk-CTUQJVQM.js} +1 -1
  61. package/{chunk-BP4XNZRM.js → chunk-CU3QB4HW.js} +3 -3
  62. package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
  63. package/{chunk-KQ4ONNQD.js → chunk-DAWDCRIG.js} +82 -8
  64. package/{chunk-VLTIYV3X.js → chunk-DCLMZ5TX.js} +4 -4
  65. package/{chunk-UKZDAFYT.js → chunk-DSSTTEKI.js} +6 -10
  66. package/{chunk-LZIWMYX4.js → chunk-EKS2APRJ.js} +21 -5
  67. package/{chunk-HVURBGF3.js → chunk-ESRMFY7G.js} +2 -2
  68. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  69. package/chunk-FD5K6MPI.js +7808 -0
  70. package/chunk-GMZLP5DV.js +82 -0
  71. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  72. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  73. package/{chunk-JCIHVIVG.js → chunk-HKTIX4ZE.js} +23 -76
  74. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  75. package/{chunk-H62HCIUP.js → chunk-HYZIYH2H.js} +11 -10
  76. package/{chunk-3VNWWVKB.js → chunk-I3QNET24.js} +30 -17
  77. package/{chunk-WV42OMV7.js → chunk-IAESIMK7.js} +4 -4
  78. package/{chunk-6FVRQBRR.js → chunk-JJ7P5CIY.js} +56 -34
  79. package/{chunk-3WD6RUUJ.js → chunk-JZ5II5UV.js} +15 -20
  80. package/{chunk-JRQFUXY7.js → chunk-KCDUTE5V.js} +96 -19
  81. package/{chunk-Y5HW6GM2.js → chunk-KHVJXNRY.js} +100 -100
  82. package/{chunk-7S4YWN7P.js → chunk-MX574M24.js} +1 -1
  83. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  84. package/{chunk-53HEEOTT.js → chunk-O26PCYLS.js} +80 -13
  85. package/{chunk-3DII57IT.js → chunk-O2OWEFII.js} +1 -1
  86. package/{chunk-TDRTS7QW.js → chunk-O6JPWEEK.js} +77 -17
  87. package/chunk-OCZKATRC.js +129 -0
  88. package/{chunk-6D6VBVEW.js → chunk-OTEMQQZI.js} +80 -14
  89. package/{chunk-7OLPQSMQ.js → chunk-OYOWA3CP.js} +24 -5
  90. package/chunk-P6GMCCAT.js +870 -0
  91. package/{chunk-ESWUWEFS.js → chunk-PQTSOHBT.js} +13 -13
  92. package/{chunk-WGR3J4Q6.js → chunk-Q4GP72HX.js} +9 -3
  93. package/{chunk-DHDMC6FO.js → chunk-QKUMVP3O.js} +11 -6
  94. package/{chunk-TZJJ77KQ.js → chunk-RMAWULCS.js} +498 -480
  95. package/{chunk-V4MJDUSR.js → chunk-RSEEDUMS.js} +2 -2
  96. package/{chunk-UZGQNTVW.js → chunk-S5XGT6GB.js} +5 -3
  97. package/{chunk-76WEAXJB.js → chunk-SACTCJAC.js} +18 -15
  98. package/{chunk-AFUORTY4.js → chunk-SONWNI3L.js} +21 -21
  99. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  100. package/{chunk-OF7AQZUG.js → chunk-TU5NE4U3.js} +9 -84
  101. package/chunk-TY3TIUJK.js +89 -0
  102. package/chunk-UEGYKNHO.js +13349 -0
  103. package/chunk-UNYJU5L6.js +780 -0
  104. package/{chunk-J4MOO56S.js → chunk-UQNS32WZ.js} +10 -2
  105. package/chunk-VIWDGTDA.js +8 -0
  106. package/chunk-VJVNU77E.js +83 -0
  107. package/{chunk-54ADB4W7.js → chunk-VYN7O3OY.js} +1 -1
  108. package/{chunk-JAXOVNM4.js → chunk-WILHZY7K.js} +45 -45
  109. package/{chunk-UKWGR5SS.js → chunk-WIWM4FE3.js} +187 -398
  110. package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
  111. package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
  112. package/{chunk-SNPMM7H3.js → chunk-Y6AZRODX.js} +13 -13
  113. package/{chunk-SQQVLHMH.js → chunk-YJKDTJ2X.js} +7 -7
  114. package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
  115. package/{chunk-TOP2VXOR.js → chunk-Z4CSIXYP.js} +2 -2
  116. package/{chunk-2F7RJC6L.js → chunk-ZOVKKMF6.js} +1 -1
  117. package/chunk-ZRAU6T47.js +56 -0
  118. package/{chunk-Z77CRGTW.js → chunk-ZYWQNCBN.js} +1 -1
  119. package/commandRegistry-MRPLKSWP.js +833 -0
  120. package/{contentThunks-ATLWNC2D.js → contentThunks-TD5YOAQM.js} +32 -30
  121. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  122. package/{createAgentAutomationAction-QYYWTVUR.js → createAgentAutomationAction-XUG62ANM.js} +32 -30
  123. package/{createDialogAction-7I5VGWCR.js → createDialogAction-L3CMZKNL.js} +36 -33
  124. package/{createPageAction-WNURYCWU.js → createPageAction-WJ3MX6JS.js} +38 -36
  125. package/{chunk-YVIV7WT4.js → cursorProvider-YGGNMVWX.js} +2496 -9890
  126. package/{dbSlice-XVWBAGYN.js → dbSlice-DQ32LYTJ.js} +8 -8
  127. package/{deleteFile-YG6QMJLU.js → deleteFile-NX6QHCWZ.js} +3 -3
  128. package/{dialogCommands-RILHDRQ5.js → dialogCommands-VM3I4HBW.js} +45 -41
  129. package/{dialogSlice-W5BYELVR.js → dialogSlice-DSHG3YUE.js} +36 -29
  130. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  131. package/{docCreateCommands-GSTPU7SG.js → docCreateCommands-TYUJPCOP.js} +44 -40
  132. package/{docDeleteCommands-2FC3LSUT.js → docDeleteCommands-5XEG2LXO.js} +44 -40
  133. package/{docReadCommands-27POBA34.js → docReadCommands-M6RO6QHV.js} +43 -39
  134. package/{docStore-7LAHBFP2.js → docStore-RYOGMPEF.js} +11 -10
  135. package/{docUpdateCommands-U4II6VCO.js → docUpdateCommands-DKOFTZRX.js} +44 -40
  136. package/{fetchMessages-EIU7UFFK.js → fetchMessages-67MEFPZR.js} +2 -2
  137. package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +3 -3
  138. package/{handleSendMessageAction-SKMJMVRU.js → handleSendMessageAction-XH742B27.js} +91 -83
  139. package/index.js +87 -884
  140. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-EBRS242U.js} +2 -2
  141. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-5W6IJRAD.js} +6 -6
  142. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-3LRMNLCM.js} +1 -1
  143. package/{machineCommands-S2RNYKVJ.js → machineCommands-BKYVMMEG.js} +85 -77
  144. package/{machineWsRunDispatch-JC44LBLP.js → machineWsRunDispatch-QOBSQQ72.js} +82 -74
  145. package/{memberThunks-QGFLFVCI.js → memberThunks-5ZXPR63F.js} +9 -9
  146. package/{models-T3SG6MJ5.js → models-ZPU5EDF4.js} +2 -2
  147. package/oauthTokenStore-ITEB663N.js +23 -0
  148. package/package.json +1 -1
  149. package/pdf-U6KSUEZZ.js +26435 -0
  150. package/processSpawn-SOAV3FEV.js +11 -0
  151. package/profileConfig-ZGOFORWV.js +43 -0
  152. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-76AVU3HD.js} +7 -7
  153. package/{providerRegistry-757OWH3O.js → providerRegistry-Z62NC45X.js} +11 -7
  154. package/{read-COE3ZYR6.js → read-EPTJRAEF.js} +5 -5
  155. package/{readDocTool-5USN4A6V.js → readDocTool-W4NDXNEX.js} +5 -3
  156. package/{readlineWorkspace-VZSBXUH4.js → readlineWorkspace-7P7IORIT.js} +2450 -2022
  157. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-BVAWQKXE.js} +17 -19
  158. package/{runAgentClientLoop-ZYENU7GH.js → runAgentClientLoop-7WXN6I7L.js} +62 -58
  159. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-3USD722U.js} +3 -3
  160. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  161. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-LYY45IAD.js} +12 -11
  162. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-73IL7DLU.js} +18 -20
  163. package/{settingSlice-ZQZVUPKK.js → settingSlice-Q6EKL7EQ.js} +9 -9
  164. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  165. package/{spaceCommands-QB3NNEMN.js → spaceCommands-QFP4ZXKG.js} +44 -40
  166. package/{streamAgentChatTurn-43GPPQSN.js → streamAgentChatTurn-B4PXPJJS.js} +184 -91
  167. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-UUXDSQ6X.js} +15 -17
  168. package/{tableCommands-O6NWHFKV.js → tableCommands-G7RV3RU3.js} +4 -4
  169. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-INIQCPGY.js} +3 -3
  170. package/{tools-SX6Y4STZ.js → tools-QFS2L7BU.js} +55 -51
  171. package/{tuiSummaryLlmCaller-T2SHYMDZ.js → tuiSummaryLlmCaller-74NRRLVW.js} +18 -16
  172. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  173. package/{updateDialogTitleAction-VAKA4ZNY.js → updateDialogTitleAction-HTDYCNNZ.js} +81 -43
  174. package/agentListCommands-BRZFEJQM.js +0 -406
  175. package/agentRecordCommands-TTAEMNHB.js +0 -128
  176. package/chunk-K4YGZD3P.js +0 -18881
  177. package/chunk-M76ECQRD.js +0 -13658
  178. package/chunk-Q5FJJ6XI.js +0 -103
  179. package/chunk-S7Z2HMCN.js +0 -25
  180. package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
  181. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  182. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -941,7 +941,7 @@ var objectTraps = {
941
941
  const currentState = current2?.[DRAFT_STATE];
942
942
  if (currentState && currentState.base_ === value) {
943
943
  state.copy_[prop] = value;
944
- state.assigned_.set(prop, false);
944
+ state.assigned_.delete(prop);
945
945
  return true;
946
946
  }
947
947
  if (is(value, current2) && (value !== void 0 || has(state.base_, prop, state.type_)))
@@ -1268,9 +1268,7 @@ var createDraftSafeSelectorCreator = (...args) => {
1268
1268
  const wrappedSelector = (value, ...rest) => selector(isDraft(value) ? current(value) : value, ...rest);
1269
1269
  Object.assign(wrappedSelector, selector);
1270
1270
  return wrappedSelector;
1271
- }, {
1272
- withTypes: () => createDraftSafeSelector2
1273
- });
1271
+ }, { withTypes: () => createDraftSafeSelector2 });
1274
1272
  return createDraftSafeSelector2;
1275
1273
  };
1276
1274
  var createDraftSafeSelector = /* @__PURE__ */ createDraftSafeSelectorCreator(weakMapMemoize);
@@ -1279,11 +1277,7 @@ var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOO
1279
1277
  if (typeof arguments[0] === "object") return compose;
1280
1278
  return compose.apply(null, arguments);
1281
1279
  };
1282
- var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() {
1283
- return function(noop3) {
1284
- return noop3;
1285
- };
1286
- };
1280
+ typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__;
1287
1281
  var hasMatchFunction = (v) => {
1288
1282
  return v && typeof v.match === "function";
1289
1283
  };
@@ -1291,18 +1285,12 @@ function createAction(type, prepareAction) {
1291
1285
  function actionCreator(...args) {
1292
1286
  if (prepareAction) {
1293
1287
  let prepared = prepareAction(...args);
1294
- if (!prepared) {
1295
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(0) : "prepareAction did not return an object");
1296
- }
1288
+ if (!prepared) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(0) : "prepareAction did not return an object");
1297
1289
  return {
1298
1290
  type,
1299
1291
  payload: prepared.payload,
1300
- ..."meta" in prepared && {
1301
- meta: prepared.meta
1302
- },
1303
- ..."error" in prepared && {
1304
- error: prepared.error
1305
- }
1292
+ ..."meta" in prepared && { meta: prepared.meta },
1293
+ ..."error" in prepared && { error: prepared.error }
1306
1294
  };
1307
1295
  }
1308
1296
  return {
@@ -1319,7 +1307,12 @@ function isFSA(action) {
1319
1307
  return isAction(action) && Object.keys(action).every(isValidKey);
1320
1308
  }
1321
1309
  function isValidKey(key) {
1322
- return ["type", "payload", "error", "meta"].indexOf(key) > -1;
1310
+ return [
1311
+ "type",
1312
+ "payload",
1313
+ "error",
1314
+ "meta"
1315
+ ].indexOf(key) > -1;
1323
1316
  }
1324
1317
  function freezeDraftable(val) {
1325
1318
  return isDraftable(val) ? produce(val, () => {
@@ -1336,28 +1329,18 @@ function executeReducerBuilderCallback(builderCallback) {
1336
1329
  const builder = {
1337
1330
  addCase(typeOrActionCreator, reducer) {
1338
1331
  if (process.env.NODE_ENV !== "production") {
1339
- if (actionMatchers.length > 0) {
1340
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(26) : "`builder.addCase` should only be called before calling `builder.addMatcher`");
1341
- }
1342
- if (defaultCaseReducer) {
1343
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(27) : "`builder.addCase` should only be called before calling `builder.addDefaultCase`");
1344
- }
1332
+ if (actionMatchers.length > 0) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(26) : "`builder.addCase` should only be called before calling `builder.addMatcher`");
1333
+ if (defaultCaseReducer) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(27) : "`builder.addCase` should only be called before calling `builder.addDefaultCase`");
1345
1334
  }
1346
1335
  const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
1347
- if (!type) {
1348
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(28) : "`builder.addCase` cannot be called with an empty action type");
1349
- }
1350
- if (type in actionsMap) {
1351
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(29) : `\`builder.addCase\` cannot be called with two reducers for the same action type '${type}'`);
1352
- }
1336
+ if (!type) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(28) : "`builder.addCase` cannot be called with an empty action type");
1337
+ if (type in actionsMap) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(29) : `\`builder.addCase\` cannot be called with two reducers for the same action type '${type}'`);
1353
1338
  actionsMap[type] = reducer;
1354
1339
  return builder;
1355
1340
  },
1356
1341
  addAsyncThunk(asyncThunk, reducers) {
1357
1342
  if (process.env.NODE_ENV !== "production") {
1358
- if (defaultCaseReducer) {
1359
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(43) : "`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");
1360
- }
1343
+ if (defaultCaseReducer) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(43) : "`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");
1361
1344
  }
1362
1345
  if (reducers.pending) actionsMap[asyncThunk.pending.type] = reducers.pending;
1363
1346
  if (reducers.rejected) actionsMap[asyncThunk.rejected.type] = reducers.rejected;
@@ -1370,9 +1353,7 @@ function executeReducerBuilderCallback(builderCallback) {
1370
1353
  },
1371
1354
  addMatcher(matcher, reducer) {
1372
1355
  if (process.env.NODE_ENV !== "production") {
1373
- if (defaultCaseReducer) {
1374
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(30) : "`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
1375
- }
1356
+ if (defaultCaseReducer) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(30) : "`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
1376
1357
  }
1377
1358
  actionMatchers.push({
1378
1359
  matcher,
@@ -1382,66 +1363,52 @@ function executeReducerBuilderCallback(builderCallback) {
1382
1363
  },
1383
1364
  addDefaultCase(reducer) {
1384
1365
  if (process.env.NODE_ENV !== "production") {
1385
- if (defaultCaseReducer) {
1386
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(31) : "`builder.addDefaultCase` can only be called once");
1387
- }
1366
+ if (defaultCaseReducer) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(31) : "`builder.addDefaultCase` can only be called once");
1388
1367
  }
1389
1368
  defaultCaseReducer = reducer;
1390
1369
  return builder;
1391
1370
  }
1392
1371
  };
1393
1372
  builderCallback(builder);
1394
- return [actionsMap, actionMatchers, defaultCaseReducer];
1373
+ return [
1374
+ actionsMap,
1375
+ actionMatchers,
1376
+ defaultCaseReducer
1377
+ ];
1395
1378
  }
1396
1379
  function isStateFunction(x) {
1397
1380
  return typeof x === "function";
1398
1381
  }
1399
1382
  function createReducer(initialState, mapOrBuilderCallback) {
1400
1383
  if (process.env.NODE_ENV !== "production") {
1401
- if (typeof mapOrBuilderCallback === "object") {
1402
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(8) : "The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
1403
- }
1384
+ if (typeof mapOrBuilderCallback === "object") throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(8) : "The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
1404
1385
  }
1405
1386
  let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback);
1406
1387
  let getInitialState;
1407
- if (isStateFunction(initialState)) {
1408
- getInitialState = () => freezeDraftable(initialState());
1409
- } else {
1388
+ if (isStateFunction(initialState)) getInitialState = () => freezeDraftable(initialState());
1389
+ else {
1410
1390
  const frozenInitialState = freezeDraftable(initialState);
1411
1391
  getInitialState = () => frozenInitialState;
1412
1392
  }
1413
1393
  function reducer(state = getInitialState(), action) {
1414
- let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({
1415
- matcher
1416
- }) => matcher(action)).map(({
1417
- reducer: reducer2
1418
- }) => reducer2)];
1419
- if (caseReducers.filter((cr) => !!cr).length === 0) {
1420
- caseReducers = [finalDefaultCaseReducer];
1421
- }
1394
+ let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({ matcher }) => matcher(action)).map(({ reducer: reducer2 }) => reducer2)];
1395
+ if (caseReducers.filter((cr) => !!cr).length === 0) caseReducers = [finalDefaultCaseReducer];
1422
1396
  return caseReducers.reduce((previousState, caseReducer) => {
1423
1397
  if (caseReducer) {
1424
1398
  if (isDraft(previousState)) {
1425
- const draft = previousState;
1426
- const result = caseReducer(draft, action);
1427
- if (result === void 0) {
1428
- return previousState;
1429
- }
1399
+ const result = caseReducer(previousState, action);
1400
+ if (result === void 0) return previousState;
1430
1401
  return result;
1431
1402
  } else if (!isDraftable(previousState)) {
1432
1403
  const result = caseReducer(previousState, action);
1433
1404
  if (result === void 0) {
1434
- if (previousState === null) {
1435
- return previousState;
1436
- }
1437
- throw Error("A case reducer on a non-draftable value must not return undefined");
1405
+ if (previousState === null) return previousState;
1406
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(9) : "A case reducer on a non-draftable value must not return undefined");
1438
1407
  }
1439
1408
  return result;
1440
- } else {
1441
- return produce(previousState, (draft) => {
1442
- return caseReducer(draft, action);
1443
- });
1444
- }
1409
+ } else return produce(previousState, (draft) => {
1410
+ return caseReducer(draft, action);
1411
+ });
1445
1412
  }
1446
1413
  return previousState;
1447
1414
  }, state);
@@ -1450,11 +1417,8 @@ function createReducer(initialState, mapOrBuilderCallback) {
1450
1417
  return reducer;
1451
1418
  }
1452
1419
  var matches = (matcher, action) => {
1453
- if (hasMatchFunction(matcher)) {
1454
- return matcher.match(action);
1455
- } else {
1456
- return matcher(action);
1457
- }
1420
+ if (hasMatchFunction(matcher)) return matcher.match(action);
1421
+ else return matcher(action);
1458
1422
  };
1459
1423
  function isAnyOf(...matchers) {
1460
1424
  return (action) => {
@@ -1465,51 +1429,40 @@ var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXI
1465
1429
  var nanoid = (size = 21) => {
1466
1430
  let id = "";
1467
1431
  let i = size;
1468
- while (i--) {
1469
- id += urlAlphabet[Math.random() * 64 | 0];
1470
- }
1432
+ while (i--) id += urlAlphabet[Math.random() * 64 | 0];
1471
1433
  return id;
1472
1434
  };
1473
- var commonProperties = ["name", "message", "stack", "code"];
1435
+ var commonProperties = [
1436
+ "name",
1437
+ "message",
1438
+ "stack",
1439
+ "code"
1440
+ ];
1474
1441
  var RejectWithValue = class {
1442
+ payload;
1443
+ meta;
1444
+ _type;
1475
1445
  constructor(payload, meta) {
1476
1446
  this.payload = payload;
1477
1447
  this.meta = meta;
1478
1448
  }
1449
+ };
1450
+ var FulfillWithMeta = class {
1479
1451
  payload;
1480
1452
  meta;
1481
- /*
1482
- type-only property to distinguish between RejectWithValue and FulfillWithMeta
1483
- does not exist at runtime
1484
- */
1485
1453
  _type;
1486
- };
1487
- var FulfillWithMeta = class {
1488
1454
  constructor(payload, meta) {
1489
1455
  this.payload = payload;
1490
1456
  this.meta = meta;
1491
1457
  }
1492
- payload;
1493
- meta;
1494
- /*
1495
- type-only property to distinguish between RejectWithValue and FulfillWithMeta
1496
- does not exist at runtime
1497
- */
1498
- _type;
1499
1458
  };
1500
1459
  var miniSerializeError = (value) => {
1501
1460
  if (typeof value === "object" && value !== null) {
1502
1461
  const simpleError = {};
1503
- for (const property of commonProperties) {
1504
- if (typeof value[property] === "string") {
1505
- simpleError[property] = value[property];
1506
- }
1507
- }
1462
+ for (const property of commonProperties) if (typeof value[property] === "string") simpleError[property] = value[property];
1508
1463
  return simpleError;
1509
1464
  }
1510
- return {
1511
- message: String(value)
1512
- };
1465
+ return { message: String(value) };
1513
1466
  };
1514
1467
  var externalAbortMessage = "External signal was aborted";
1515
1468
  var createAsyncThunk = /* @__PURE__ */ (() => {
@@ -1539,15 +1492,13 @@ var createAsyncThunk = /* @__PURE__ */ (() => {
1539
1492
  ...meta || {},
1540
1493
  arg,
1541
1494
  requestId,
1542
- rejectedWithValue: !!payload,
1495
+ rejectedWithValue: payload !== void 0,
1543
1496
  requestStatus: "rejected",
1544
1497
  aborted: error?.name === "AbortError",
1545
1498
  condition: error?.name === "ConditionError"
1546
1499
  }
1547
1500
  }));
1548
- function actionCreator(arg, {
1549
- signal
1550
- } = {}) {
1501
+ function actionCreator(arg, { signal } = {}) {
1551
1502
  return (dispatch, getState, extra) => {
1552
1503
  const requestId = options?.idGenerator ? options.idGenerator(arg) : nanoid();
1553
1504
  const abortController = new AbortController();
@@ -1558,13 +1509,8 @@ var createAsyncThunk = /* @__PURE__ */ (() => {
1558
1509
  abortController.abort();
1559
1510
  }
1560
1511
  if (signal) {
1561
- if (signal.aborted) {
1562
- abort(externalAbortMessage);
1563
- } else {
1564
- signal.addEventListener("abort", () => abort(externalAbortMessage), {
1565
- once: true
1566
- });
1567
- }
1512
+ if (signal.aborted) abort(externalAbortMessage);
1513
+ else signal.addEventListener("abort", () => abort(externalAbortMessage), { once: true });
1568
1514
  }
1569
1515
  const promise = async function() {
1570
1516
  let finalAction;
@@ -1573,15 +1519,15 @@ var createAsyncThunk = /* @__PURE__ */ (() => {
1573
1519
  getState,
1574
1520
  extra
1575
1521
  });
1576
- if (isThenable(conditionResult)) {
1577
- conditionResult = await conditionResult;
1578
- }
1579
- if (conditionResult === false || abortController.signal.aborted) {
1580
- throw {
1581
- name: "ConditionError",
1582
- message: "Aborted due to condition callback returning false."
1583
- };
1584
- }
1522
+ if (isThenable(conditionResult)) conditionResult = await conditionResult;
1523
+ if (conditionResult === false) throw {
1524
+ name: "ConditionError",
1525
+ message: "Aborted due to condition callback returning false."
1526
+ };
1527
+ if (abortController.signal.aborted) throw {
1528
+ name: "AbortError",
1529
+ message: abortReason || "Aborted"
1530
+ };
1585
1531
  const abortedPromise = new Promise((_, reject) => {
1586
1532
  abortHandler = () => {
1587
1533
  reject({
@@ -1589,9 +1535,7 @@ var createAsyncThunk = /* @__PURE__ */ (() => {
1589
1535
  message: abortReason || "Aborted"
1590
1536
  });
1591
1537
  };
1592
- abortController.signal.addEventListener("abort", abortHandler, {
1593
- once: true
1594
- });
1538
+ abortController.signal.addEventListener("abort", abortHandler, { once: true });
1595
1539
  });
1596
1540
  dispatch(pending(requestId, arg, options?.getPendingMeta?.({
1597
1541
  requestId,
@@ -1614,25 +1558,16 @@ var createAsyncThunk = /* @__PURE__ */ (() => {
1614
1558
  return new FulfillWithMeta(value, meta);
1615
1559
  }
1616
1560
  })).then((result) => {
1617
- if (result instanceof RejectWithValue) {
1618
- throw result;
1619
- }
1620
- if (result instanceof FulfillWithMeta) {
1621
- return fulfilled(result.payload, requestId, arg, result.meta);
1622
- }
1561
+ if (result instanceof RejectWithValue) throw result;
1562
+ if (result instanceof FulfillWithMeta) return fulfilled(result.payload, requestId, arg, result.meta);
1623
1563
  return fulfilled(result, requestId, arg);
1624
1564
  })]);
1625
1565
  } catch (err) {
1626
1566
  finalAction = err instanceof RejectWithValue ? rejected(null, requestId, arg, err.payload, err.meta) : rejected(err, requestId, arg);
1627
1567
  } finally {
1628
- if (abortHandler) {
1629
- abortController.signal.removeEventListener("abort", abortHandler);
1630
- }
1631
- }
1632
- const skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
1633
- if (!skipDispatch) {
1634
- dispatch(finalAction);
1568
+ if (abortHandler) abortController.signal.removeEventListener("abort", abortHandler);
1635
1569
  }
1570
+ if (!(options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition)) dispatch(finalAction);
1636
1571
  return finalAction;
1637
1572
  }();
1638
1573
  return Object.assign(promise, {
@@ -1657,40 +1592,25 @@ var createAsyncThunk = /* @__PURE__ */ (() => {
1657
1592
  return createAsyncThunk2;
1658
1593
  })();
1659
1594
  function unwrapResult(action) {
1660
- if (action.meta && action.meta.rejectedWithValue) {
1661
- throw action.payload;
1662
- }
1663
- if (action.error) {
1664
- throw action.error;
1665
- }
1595
+ if (action.meta && action.meta.rejectedWithValue) throw action.payload;
1596
+ if (action.error) throw action.error;
1666
1597
  return action.payload;
1667
1598
  }
1668
1599
  function isThenable(value) {
1669
1600
  return value !== null && typeof value === "object" && typeof value.then === "function";
1670
1601
  }
1671
1602
  var asyncThunkSymbol = /* @__PURE__ */ Symbol.for("rtk-slice-createasyncthunk");
1672
- var asyncThunkCreator = {
1673
- [asyncThunkSymbol]: createAsyncThunk
1674
- };
1603
+ var asyncThunkCreator = { [asyncThunkSymbol]: createAsyncThunk };
1675
1604
  function getType(slice, actionKey) {
1676
1605
  return `${slice}/${actionKey}`;
1677
1606
  }
1678
- function buildCreateSlice({
1679
- creators
1680
- } = {}) {
1607
+ function buildCreateSlice({ creators } = {}) {
1681
1608
  const cAT = creators?.asyncThunk?.[asyncThunkSymbol];
1682
- return function createSlice2(options) {
1683
- const {
1684
- name,
1685
- reducerPath = name
1686
- } = options;
1687
- if (!name) {
1688
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(11) : "`name` is a required option for createSlice");
1689
- }
1609
+ return function createSlice(options) {
1610
+ const { name, reducerPath = name } = options;
1611
+ if (!name) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(11) : "`name` is a required option for createSlice");
1690
1612
  if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
1691
- if (options.initialState === void 0) {
1692
- console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
1693
- }
1613
+ if (options.initialState === void 0) console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
1694
1614
  }
1695
1615
  const reducers = (typeof options.reducers === "function" ? options.reducers(buildReducerCreators()) : options.reducers) || {};
1696
1616
  const reducerNames = Object.keys(reducers);
@@ -1703,12 +1623,8 @@ function buildCreateSlice({
1703
1623
  const contextMethods = {
1704
1624
  addCase(typeOrActionCreator, reducer2) {
1705
1625
  const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
1706
- if (!type) {
1707
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : "`context.addCase` cannot be called with an empty action type");
1708
- }
1709
- if (type in context.sliceCaseReducersByType) {
1710
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : "`context.addCase` cannot be called with two reducers for the same action type: " + type);
1711
- }
1626
+ if (!type) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : "`context.addCase` cannot be called with an empty action type");
1627
+ if (type in context.sliceCaseReducersByType) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : "`context.addCase` cannot be called with two reducers for the same action type: " + type);
1712
1628
  context.sliceCaseReducersByType[type] = reducer2;
1713
1629
  return contextMethods;
1714
1630
  },
@@ -1735,17 +1651,12 @@ function buildCreateSlice({
1735
1651
  type: getType(name, reducerName),
1736
1652
  createNotation: typeof options.reducers === "function"
1737
1653
  };
1738
- if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) {
1739
- handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT);
1740
- } else {
1741
- handleNormalReducerDefinition(reducerDetails, reducerDefinition, contextMethods);
1742
- }
1654
+ if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT);
1655
+ else handleNormalReducerDefinition(reducerDetails, reducerDefinition, contextMethods);
1743
1656
  });
1744
1657
  function buildReducer() {
1745
1658
  if (process.env.NODE_ENV !== "production") {
1746
- if (typeof options.extraReducers === "object") {
1747
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : "The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
1748
- }
1659
+ if (typeof options.extraReducers === "object") throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : "The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
1749
1660
  }
1750
1661
  const [extraReducers = {}, actionMatchers = [], defaultCaseReducer = void 0] = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers];
1751
1662
  const finalCaseReducers = {
@@ -1753,18 +1664,10 @@ function buildCreateSlice({
1753
1664
  ...context.sliceCaseReducersByType
1754
1665
  };
1755
1666
  return createReducer(options.initialState, (builder) => {
1756
- for (let key in finalCaseReducers) {
1757
- builder.addCase(key, finalCaseReducers[key]);
1758
- }
1759
- for (let sM of context.sliceMatchers) {
1760
- builder.addMatcher(sM.matcher, sM.reducer);
1761
- }
1762
- for (let m of actionMatchers) {
1763
- builder.addMatcher(m.matcher, m.reducer);
1764
- }
1765
- if (defaultCaseReducer) {
1766
- builder.addDefaultCase(defaultCaseReducer);
1767
- }
1667
+ for (let key in finalCaseReducers) builder.addCase(key, finalCaseReducers[key]);
1668
+ for (let sM of context.sliceMatchers) builder.addMatcher(sM.matcher, sM.reducer);
1669
+ for (let m of actionMatchers) builder.addMatcher(m.matcher, m.reducer);
1670
+ if (defaultCaseReducer) builder.addDefaultCase(defaultCaseReducer);
1768
1671
  });
1769
1672
  }
1770
1673
  const selectSelf = (state) => state;
@@ -1783,21 +1686,15 @@ function buildCreateSlice({
1783
1686
  function selectSlice(state) {
1784
1687
  let sliceState = state[reducerPath2];
1785
1688
  if (typeof sliceState === "undefined") {
1786
- if (injected) {
1787
- sliceState = getOrInsertComputed(injectedStateCache, selectSlice, getInitialState);
1788
- } else if (process.env.NODE_ENV !== "production") {
1789
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(15) : "selectSlice returned undefined for an uninjected slice reducer");
1790
- }
1689
+ if (injected) sliceState = getOrInsertComputed(injectedStateCache, selectSlice, getInitialState);
1690
+ else if (process.env.NODE_ENV !== "production") throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(15) : "selectSlice returned undefined for an uninjected slice reducer");
1791
1691
  }
1792
1692
  return sliceState;
1793
1693
  }
1794
1694
  function getSelectors(selectState = selectSelf) {
1795
- const selectorCache = getOrInsertComputed(injectedSelectorCache, injected, () => /* @__PURE__ */ new WeakMap());
1796
- return getOrInsertComputed(selectorCache, selectState, () => {
1695
+ return getOrInsertComputed(getOrInsertComputed(injectedSelectorCache, injected, () => /* @__PURE__ */ new WeakMap()), selectState, () => {
1797
1696
  const map = {};
1798
- for (const [name2, selector] of Object.entries(options.selectors ?? {})) {
1799
- map[name2] = wrapSelector(selector, selectState, () => getOrInsertComputed(injectedStateCache, selectState, getInitialState), injected);
1800
- }
1697
+ for (const [name2, selector] of Object.entries(options.selectors ?? {})) map[name2] = wrapSelector(selector, selectState, () => getOrInsertComputed(injectedStateCache, selectState, getInitialState), injected);
1801
1698
  return map;
1802
1699
  });
1803
1700
  }
@@ -1817,10 +1714,7 @@ function buildCreateSlice({
1817
1714
  caseReducers: context.sliceCaseReducersByName,
1818
1715
  getInitialState,
1819
1716
  ...makeSelectorProps(reducerPath),
1820
- injectInto(injectable, {
1821
- reducerPath: pathOpt,
1822
- ...config
1823
- } = {}) {
1717
+ injectInto(injectable, { reducerPath: pathOpt, ...config } = {}) {
1824
1718
  const newReducerPath = pathOpt ?? reducerPath;
1825
1719
  injectable.inject({
1826
1720
  reducerPath: newReducerPath,
@@ -1839,11 +1733,8 @@ function wrapSelector(selector, selectState, getInitialState, injected) {
1839
1733
  function wrapper(rootState, ...args) {
1840
1734
  let sliceState = selectState(rootState);
1841
1735
  if (typeof sliceState === "undefined") {
1842
- if (injected) {
1843
- sliceState = getInitialState();
1844
- } else if (process.env.NODE_ENV !== "production") {
1845
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(16) : "selectState returned undefined for an uninjected slice reducer");
1846
- }
1736
+ if (injected) sliceState = getInitialState();
1737
+ else if (process.env.NODE_ENV !== "production") throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(16) : "selectState returned undefined for an uninjected slice reducer");
1847
1738
  }
1848
1739
  return selector(sliceState, ...args);
1849
1740
  }
@@ -1861,16 +1752,9 @@ function buildReducerCreators() {
1861
1752
  asyncThunk.withTypes = () => asyncThunk;
1862
1753
  return {
1863
1754
  reducer(caseReducer) {
1864
- return Object.assign({
1865
- // hack so the wrapping function has the same name as the original
1866
- // we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original
1867
- [caseReducer.name](...args) {
1868
- return caseReducer(...args);
1869
- }
1870
- }[caseReducer.name], {
1871
- _reducerDefinitionType: "reducer"
1872
- /* reducer */
1873
- });
1755
+ return Object.assign({ [caseReducer.name](...args) {
1756
+ return caseReducer(...args);
1757
+ } }[caseReducer.name], { _reducerDefinitionType: "reducer" });
1874
1758
  },
1875
1759
  preparedReducer(prepare, reducer) {
1876
1760
  return {
@@ -1882,22 +1766,14 @@ function buildReducerCreators() {
1882
1766
  asyncThunk
1883
1767
  };
1884
1768
  }
1885
- function handleNormalReducerDefinition({
1886
- type,
1887
- reducerName,
1888
- createNotation
1889
- }, maybeReducerWithPrepare, context) {
1769
+ function handleNormalReducerDefinition({ type, reducerName, createNotation }, maybeReducerWithPrepare, context) {
1890
1770
  let caseReducer;
1891
1771
  let prepareCallback;
1892
1772
  if ("reducer" in maybeReducerWithPrepare) {
1893
- if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) {
1894
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(17) : "Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");
1895
- }
1773
+ if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(17) : "Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");
1896
1774
  caseReducer = maybeReducerWithPrepare.reducer;
1897
1775
  prepareCallback = maybeReducerWithPrepare.prepare;
1898
- } else {
1899
- caseReducer = maybeReducerWithPrepare;
1900
- }
1776
+ } else caseReducer = maybeReducerWithPrepare;
1901
1777
  context.addCase(type, caseReducer).exposeCaseReducer(reducerName, caseReducer).exposeAction(reducerName, prepareCallback ? createAction(type, prepareCallback) : createAction(type));
1902
1778
  }
1903
1779
  function isAsyncThunkSliceReducerDefinition(reducerDefinition) {
@@ -1906,43 +1782,23 @@ function isAsyncThunkSliceReducerDefinition(reducerDefinition) {
1906
1782
  function isCaseReducerWithPrepareDefinition(reducerDefinition) {
1907
1783
  return reducerDefinition._reducerDefinitionType === "reducerWithPrepare";
1908
1784
  }
1909
- function handleThunkCaseReducerDefinition({
1910
- type,
1911
- reducerName
1912
- }, reducerDefinition, context, cAT) {
1913
- if (!cAT) {
1914
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(18) : "Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");
1915
- }
1916
- const {
1917
- payloadCreator,
1918
- fulfilled,
1919
- pending,
1920
- rejected,
1921
- settled,
1922
- options
1923
- } = reducerDefinition;
1785
+ function handleThunkCaseReducerDefinition({ type, reducerName }, reducerDefinition, context, cAT) {
1786
+ if (!cAT) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(18) : "Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");
1787
+ const { payloadCreator, fulfilled, pending, rejected, settled, options } = reducerDefinition;
1924
1788
  const thunk = cAT(type, payloadCreator, options);
1925
1789
  context.exposeAction(reducerName, thunk);
1926
- if (fulfilled) {
1927
- context.addCase(thunk.fulfilled, fulfilled);
1928
- }
1929
- if (pending) {
1930
- context.addCase(thunk.pending, pending);
1931
- }
1932
- if (rejected) {
1933
- context.addCase(thunk.rejected, rejected);
1934
- }
1935
- if (settled) {
1936
- context.addMatcher(thunk.settled, settled);
1937
- }
1790
+ if (fulfilled) context.addCase(thunk.fulfilled, fulfilled);
1791
+ if (pending) context.addCase(thunk.pending, pending);
1792
+ if (rejected) context.addCase(thunk.rejected, rejected);
1793
+ if (settled) context.addMatcher(thunk.settled, settled);
1938
1794
  context.exposeCaseReducer(reducerName, {
1939
- fulfilled: fulfilled || noop,
1940
- pending: pending || noop,
1941
- rejected: rejected || noop,
1942
- settled: settled || noop
1795
+ fulfilled: fulfilled || noop$1,
1796
+ pending: pending || noop$1,
1797
+ rejected: rejected || noop$1,
1798
+ settled: settled || noop$1
1943
1799
  });
1944
1800
  }
1945
- function noop() {
1801
+ function noop$1() {
1946
1802
  }
1947
1803
  function getInitialEntityState() {
1948
1804
  return {
@@ -1955,30 +1811,24 @@ function createInitialStateFactory(stateAdapter) {
1955
1811
  const state = Object.assign(getInitialEntityState(), additionalState);
1956
1812
  return entities ? stateAdapter.setAll(state, entities) : state;
1957
1813
  }
1958
- return {
1959
- getInitialState
1960
- };
1814
+ return { getInitialState };
1961
1815
  }
1962
1816
  function createSelectorsFactory() {
1963
1817
  function getSelectors(selectState, options = {}) {
1964
- const {
1965
- createSelector: createSelector2 = createDraftSafeSelector
1966
- } = options;
1818
+ const { createSelector: createSelector2 = createDraftSafeSelector } = options;
1967
1819
  const selectIds = (state) => state.ids;
1968
1820
  const selectEntities = (state) => state.entities;
1969
1821
  const selectAll = createSelector2(selectIds, selectEntities, (ids, entities) => ids.map((id) => entities[id]));
1970
1822
  const selectId = (_, id) => id;
1971
1823
  const selectById = (entities, id) => entities[id];
1972
1824
  const selectTotal = createSelector2(selectIds, (ids) => ids.length);
1973
- if (!selectState) {
1974
- return {
1975
- selectIds,
1976
- selectEntities,
1977
- selectAll,
1978
- selectTotal,
1979
- selectById: createSelector2(selectEntities, selectId, selectById)
1980
- };
1981
- }
1825
+ if (!selectState) return {
1826
+ selectIds,
1827
+ selectEntities,
1828
+ selectAll,
1829
+ selectTotal,
1830
+ selectById: createSelector2(selectEntities, selectId, selectById)
1831
+ };
1982
1832
  const selectGlobalizedEntities = createSelector2(selectState, selectEntities);
1983
1833
  return {
1984
1834
  selectIds: createSelector2(selectState, selectIds),
@@ -1988,9 +1838,7 @@ function createSelectorsFactory() {
1988
1838
  selectById: createSelector2(selectGlobalizedEntities, selectId, selectById)
1989
1839
  };
1990
1840
  }
1991
- return {
1992
- getSelectors
1993
- };
1841
+ return { getSelectors };
1994
1842
  }
1995
1843
  var isDraftTyped = isDraft;
1996
1844
  function createSingleArgumentStateOperator(mutator) {
@@ -2005,11 +1853,8 @@ function createStateOperator(mutator) {
2005
1853
  return isFSA(arg2);
2006
1854
  }
2007
1855
  const runMutator = (draft) => {
2008
- if (isPayloadActionArgument(arg)) {
2009
- mutator(arg.payload, draft);
2010
- } else {
2011
- mutator(arg, draft);
2012
- }
1856
+ if (isPayloadActionArgument(arg)) mutator(arg.payload, draft);
1857
+ else mutator(arg, draft);
2013
1858
  };
2014
1859
  if (isDraftTyped(state)) {
2015
1860
  runMutator(state);
@@ -2020,15 +1865,11 @@ function createStateOperator(mutator) {
2020
1865
  }
2021
1866
  function selectIdValue(entity, selectId) {
2022
1867
  const key = selectId(entity);
2023
- if (process.env.NODE_ENV !== "production" && key === void 0) {
2024
- console.warn("The entity passed to the `selectId` implementation returned undefined.", "You should probably provide your own `selectId` implementation.", "The entity that was passed:", entity, "The `selectId` implementation:", selectId.toString());
2025
- }
1868
+ if (process.env.NODE_ENV !== "production" && key === void 0) console.warn("The entity passed to the `selectId` implementation returned undefined.", "You should probably provide your own `selectId` implementation.", "The entity that was passed:", entity, "The `selectId` implementation:", selectId.toString());
2026
1869
  return key;
2027
1870
  }
2028
1871
  function ensureEntitiesArray(entities) {
2029
- if (!Array.isArray(entities)) {
2030
- entities = Object.values(entities);
2031
- }
1872
+ if (!Array.isArray(entities)) entities = Object.values(entities);
2032
1873
  return entities;
2033
1874
  }
2034
1875
  function getCurrent(value) {
@@ -2043,52 +1884,46 @@ function splitAddedUpdatedEntities(newEntities, selectId, state) {
2043
1884
  const updated = [];
2044
1885
  for (const entity of newEntities) {
2045
1886
  const id = selectIdValue(entity, selectId);
2046
- if (existingIds.has(id) || addedIds.has(id)) {
2047
- updated.push({
2048
- id,
2049
- changes: entity
2050
- });
2051
- } else {
1887
+ if (existingIds.has(id) || addedIds.has(id)) updated.push({
1888
+ id,
1889
+ changes: entity
1890
+ });
1891
+ else {
2052
1892
  addedIds.add(id);
2053
1893
  added.push(entity);
2054
1894
  }
2055
1895
  }
2056
- return [added, updated, existingIdsArray];
1896
+ return [
1897
+ added,
1898
+ updated,
1899
+ existingIdsArray
1900
+ ];
2057
1901
  }
2058
1902
  function createUnsortedStateAdapter(selectId) {
2059
1903
  function addOneMutably(entity, state) {
2060
1904
  const key = selectIdValue(entity, selectId);
2061
- if (key in state.entities) {
2062
- return;
2063
- }
1905
+ if (key in state.entities) return;
2064
1906
  state.ids.push(key);
2065
1907
  state.entities[key] = entity;
2066
1908
  }
2067
1909
  function addManyMutably(newEntities, state) {
2068
1910
  newEntities = ensureEntitiesArray(newEntities);
2069
- for (const entity of newEntities) {
2070
- addOneMutably(entity, state);
2071
- }
1911
+ for (const entity of newEntities) addOneMutably(entity, state);
2072
1912
  }
2073
1913
  function setOneMutably(entity, state) {
2074
1914
  const key = selectIdValue(entity, selectId);
2075
- if (!(key in state.entities)) {
2076
- state.ids.push(key);
2077
- }
2078
- ;
1915
+ if (!(key in state.entities)) state.ids.push(key);
2079
1916
  state.entities[key] = entity;
2080
1917
  }
2081
1918
  function setManyMutably(newEntities, state) {
2082
1919
  newEntities = ensureEntitiesArray(newEntities);
2083
- for (const entity of newEntities) {
2084
- setOneMutably(entity, state);
2085
- }
1920
+ for (const entity of newEntities) setOneMutably(entity, state);
2086
1921
  }
2087
1922
  function setAllMutably(newEntities, state) {
2088
1923
  newEntities = ensureEntitiesArray(newEntities);
2089
1924
  state.ids = [];
2090
1925
  state.entities = {};
2091
- addManyMutably(newEntities, state);
1926
+ setManyMutably(newEntities, state);
2092
1927
  }
2093
1928
  function removeOneMutably(key, state) {
2094
1929
  return removeManyMutably([key], state);
@@ -2101,9 +1936,7 @@ function createUnsortedStateAdapter(selectId) {
2101
1936
  didMutate = true;
2102
1937
  }
2103
1938
  });
2104
- if (didMutate) {
2105
- state.ids = state.ids.filter((id) => id in state.entities);
2106
- }
1939
+ if (didMutate) state.ids = state.ids.filter((id) => id in state.entities);
2107
1940
  }
2108
1941
  function removeAllMutably(state) {
2109
1942
  Object.assign(state, {
@@ -2112,18 +1945,15 @@ function createUnsortedStateAdapter(selectId) {
2112
1945
  });
2113
1946
  }
2114
1947
  function takeNewKey(keys, update, state) {
2115
- const original3 = state.entities[update.id];
2116
- if (original3 === void 0) {
2117
- return false;
2118
- }
2119
- const updated = Object.assign({}, original3, update.changes);
1948
+ const original2 = state.entities[update.id];
1949
+ if (original2 === void 0) return false;
1950
+ const updated = Object.assign({}, original2, update.changes);
2120
1951
  const newKey = selectIdValue(updated, selectId);
2121
1952
  const hasNewKey = newKey !== update.id;
2122
1953
  if (hasNewKey) {
2123
1954
  keys[update.id] = newKey;
2124
1955
  delete state.entities[update.id];
2125
1956
  }
2126
- ;
2127
1957
  state.entities[newKey] = updated;
2128
1958
  return hasNewKey;
2129
1959
  }
@@ -2134,25 +1964,17 @@ function createUnsortedStateAdapter(selectId) {
2134
1964
  const newKeys = {};
2135
1965
  const updatesPerEntity = {};
2136
1966
  updates.forEach((update) => {
2137
- if (update.id in state.entities) {
2138
- updatesPerEntity[update.id] = {
2139
- id: update.id,
2140
- // Spreads ignore falsy values, so this works even if there isn't
2141
- // an existing update already at this key
2142
- changes: {
2143
- ...updatesPerEntity[update.id]?.changes,
2144
- ...update.changes
2145
- }
2146
- };
2147
- }
1967
+ if (update.id in state.entities) updatesPerEntity[update.id] = {
1968
+ id: update.id,
1969
+ changes: {
1970
+ ...updatesPerEntity[update.id]?.changes,
1971
+ ...update.changes
1972
+ }
1973
+ };
2148
1974
  });
2149
1975
  updates = Object.values(updatesPerEntity);
2150
- const didMutateEntities = updates.length > 0;
2151
- if (didMutateEntities) {
2152
- const didMutateIds = updates.filter((update) => takeNewKey(newKeys, update, state)).length > 0;
2153
- if (didMutateIds) {
2154
- state.ids = Object.values(state.entities).map((e) => selectIdValue(e, selectId));
2155
- }
1976
+ if (updates.length > 0) {
1977
+ if (updates.filter((update) => takeNewKey(newKeys, update, state)).length > 0) state.ids = Object.values(state.entities).map((e) => selectIdValue(e, selectId));
2156
1978
  }
2157
1979
  }
2158
1980
  function upsertOneMutably(entity, state) {
@@ -2184,12 +2006,8 @@ function findInsertIndex(sortedItems, item, comparisonFunction) {
2184
2006
  while (lowIndex < highIndex) {
2185
2007
  let middleIndex = lowIndex + highIndex >>> 1;
2186
2008
  const currentItem = sortedItems[middleIndex];
2187
- const res = comparisonFunction(item, currentItem);
2188
- if (res >= 0) {
2189
- lowIndex = middleIndex + 1;
2190
- } else {
2191
- highIndex = middleIndex;
2192
- }
2009
+ if (comparisonFunction(item, currentItem) >= 0) lowIndex = middleIndex + 1;
2010
+ else highIndex = middleIndex;
2193
2011
  }
2194
2012
  return lowIndex;
2195
2013
  }
@@ -2199,11 +2017,7 @@ function insert(sortedItems, item, comparisonFunction) {
2199
2017
  return sortedItems;
2200
2018
  }
2201
2019
  function createSortedStateAdapter(selectId, comparer) {
2202
- const {
2203
- removeOne,
2204
- removeMany,
2205
- removeAll
2206
- } = createUnsortedStateAdapter(selectId);
2020
+ const { removeOne, removeMany, removeAll } = createUnsortedStateAdapter(selectId);
2207
2021
  function addOneMutably(entity, state) {
2208
2022
  return addManyMutably([entity], state);
2209
2023
  }
@@ -2217,9 +2031,7 @@ function createSortedStateAdapter(selectId, comparer) {
2217
2031
  if (notAdded) addedKeys.add(modelId);
2218
2032
  return !existingKeys.has(modelId) && notAdded;
2219
2033
  });
2220
- if (models.length !== 0) {
2221
- mergeFunction(state, models);
2222
- }
2034
+ if (models.length !== 0) mergeFunction(state, models);
2223
2035
  }
2224
2036
  function setOneMutably(entity, state) {
2225
2037
  return setManyMutably([entity], state);
@@ -2241,7 +2053,7 @@ function createSortedStateAdapter(selectId, comparer) {
2241
2053
  newEntities = ensureEntitiesArray(newEntities);
2242
2054
  state.entities = {};
2243
2055
  state.ids = [];
2244
- addManyMutably(newEntities, state, []);
2056
+ setManyMutably(newEntities, state);
2245
2057
  }
2246
2058
  function updateOneMutably(update, state) {
2247
2059
  return updateManyMutably([update], state);
@@ -2249,11 +2061,17 @@ function createSortedStateAdapter(selectId, comparer) {
2249
2061
  function updateManyMutably(updates, state) {
2250
2062
  let appliedUpdates = false;
2251
2063
  let replacedIds = false;
2252
- for (let update of updates) {
2253
- const entity = state.entities[update.id];
2254
- if (!entity) {
2255
- continue;
2064
+ const updatesPerEntity = {};
2065
+ for (const update of updates) if (update.id in state.entities) updatesPerEntity[update.id] = {
2066
+ id: update.id,
2067
+ changes: {
2068
+ ...updatesPerEntity[update.id]?.changes,
2069
+ ...update.changes
2256
2070
  }
2071
+ };
2072
+ for (const update of Object.values(updatesPerEntity)) {
2073
+ const entity = state.entities[update.id];
2074
+ if (!entity) continue;
2257
2075
  appliedUpdates = true;
2258
2076
  Object.assign(entity, update.changes);
2259
2077
  const newId = selectId(entity);
@@ -2265,66 +2083,45 @@ function createSortedStateAdapter(selectId, comparer) {
2265
2083
  state.entities[newId] = entity;
2266
2084
  }
2267
2085
  }
2268
- if (appliedUpdates) {
2269
- mergeFunction(state, [], appliedUpdates, replacedIds);
2270
- }
2086
+ if (appliedUpdates) mergeFunction(state, [], appliedUpdates, replacedIds);
2271
2087
  }
2272
2088
  function upsertOneMutably(entity, state) {
2273
2089
  return upsertManyMutably([entity], state);
2274
2090
  }
2275
2091
  function upsertManyMutably(newEntities, state) {
2276
2092
  const [added, updated, existingIdsArray] = splitAddedUpdatedEntities(newEntities, selectId, state);
2277
- if (added.length) {
2278
- addManyMutably(added, state, existingIdsArray);
2279
- }
2280
- if (updated.length) {
2281
- updateManyMutably(updated, state);
2282
- }
2093
+ if (added.length) addManyMutably(added, state, existingIdsArray);
2094
+ if (updated.length) updateManyMutably(updated, state);
2283
2095
  }
2284
2096
  function areArraysEqual(a, b) {
2285
- if (a.length !== b.length) {
2286
- return false;
2287
- }
2097
+ if (a.length !== b.length) return false;
2288
2098
  for (let i = 0; i < a.length; i++) {
2289
- if (a[i] === b[i]) {
2290
- continue;
2291
- }
2099
+ if (a[i] === b[i]) continue;
2292
2100
  return false;
2293
2101
  }
2294
2102
  return true;
2295
2103
  }
2296
- const mergeFunction = (state, addedItems, appliedUpdates, replacedIds) => {
2104
+ function mergeFunction(state, addedItems, appliedUpdates, replacedIds) {
2297
2105
  const currentEntities = getCurrent(state.entities);
2298
2106
  const currentIds = getCurrent(state.ids);
2299
2107
  const stateEntities = state.entities;
2300
2108
  let ids = currentIds;
2301
- if (replacedIds) {
2302
- ids = new Set(currentIds);
2303
- }
2109
+ if (replacedIds) ids = new Set(currentIds);
2304
2110
  let sortedEntities = [];
2305
2111
  for (const id of ids) {
2306
2112
  const entity = currentEntities[id];
2307
- if (entity) {
2308
- sortedEntities.push(entity);
2309
- }
2113
+ if (entity) sortedEntities.push(entity);
2310
2114
  }
2311
2115
  const wasPreviouslyEmpty = sortedEntities.length === 0;
2312
2116
  for (const item of addedItems) {
2313
2117
  stateEntities[selectId(item)] = item;
2314
- if (!wasPreviouslyEmpty) {
2315
- insert(sortedEntities, item, comparer);
2316
- }
2317
- }
2318
- if (wasPreviouslyEmpty) {
2319
- sortedEntities = addedItems.slice().sort(comparer);
2320
- } else if (appliedUpdates) {
2321
- sortedEntities.sort(comparer);
2118
+ if (!wasPreviouslyEmpty) insert(sortedEntities, item, comparer);
2322
2119
  }
2120
+ if (wasPreviouslyEmpty) sortedEntities = addedItems.slice().sort(comparer);
2121
+ else if (appliedUpdates) sortedEntities.sort(comparer);
2323
2122
  const newSortedIds = sortedEntities.map(selectId);
2324
- if (!areArraysEqual(currentIds, newSortedIds)) {
2325
- state.ids = newSortedIds;
2326
- }
2327
- };
2123
+ if (!areArraysEqual(currentIds, newSortedIds)) state.ids = newSortedIds;
2124
+ }
2328
2125
  return {
2329
2126
  removeOne,
2330
2127
  removeMany,
@@ -2341,10 +2138,7 @@ function createSortedStateAdapter(selectId, comparer) {
2341
2138
  };
2342
2139
  }
2343
2140
  function createEntityAdapter(options = {}) {
2344
- const {
2345
- selectId,
2346
- sortComparer
2347
- } = {
2141
+ const { selectId, sortComparer } = {
2348
2142
  sortComparer: false,
2349
2143
  selectId: (instance) => instance.id,
2350
2144
  ...options
@@ -2367,17 +2161,12 @@ var taskCancelled = `task-${cancelled}`;
2367
2161
  var taskCompleted = `task-${completed}`;
2368
2162
  var listenerCancelled = `${listener}-${cancelled}`;
2369
2163
  var listenerCompleted = `${listener}-${completed}`;
2370
- var {
2371
- assign
2372
- } = Object;
2164
+ var { assign } = Object;
2373
2165
  var alm = "listenerMiddleware";
2374
- var addListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/add`), {
2375
- withTypes: () => addListener
2376
- });
2166
+ var addListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/add`), { withTypes: () => addListener });
2377
2167
  var clearAllListeners = /* @__PURE__ */ createAction(`${alm}/removeAll`);
2378
- var removeListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/remove`), {
2379
- withTypes: () => removeListener
2380
- });
2168
+ var removeListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/remove`), { withTypes: () => removeListener });
2169
+ var ORIGINAL_STATE = Symbol.for("rtk-state-proxy-original");
2381
2170
  function formatProdErrorMessage(code) {
2382
2171
  return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
2383
2172
  }