@arpproject/recrate 0.1.30 → 0.1.32-test

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.
@@ -7936,9 +7936,9 @@ var CheckCircleFilled = function CheckCircleFilled2(props, ref) {
7936
7936
  icon: CheckCircleFilled$1
7937
7937
  }));
7938
7938
  };
7939
- var RefIcon$B = /* @__PURE__ */ React.forwardRef(CheckCircleFilled);
7939
+ var RefIcon$C = /* @__PURE__ */ React.forwardRef(CheckCircleFilled);
7940
7940
  if (process.env.NODE_ENV !== "production") {
7941
- RefIcon$B.displayName = "CheckCircleFilled";
7941
+ RefIcon$C.displayName = "CheckCircleFilled";
7942
7942
  }
7943
7943
  var CloseCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, "name": "close-circle", "theme": "filled" };
7944
7944
  var CloseCircleFilled = function CloseCircleFilled2(props, ref) {
@@ -7947,9 +7947,9 @@ var CloseCircleFilled = function CloseCircleFilled2(props, ref) {
7947
7947
  icon: CloseCircleFilled$1
7948
7948
  }));
7949
7949
  };
7950
- var RefIcon$A = /* @__PURE__ */ React.forwardRef(CloseCircleFilled);
7950
+ var RefIcon$B = /* @__PURE__ */ React.forwardRef(CloseCircleFilled);
7951
7951
  if (process.env.NODE_ENV !== "production") {
7952
- RefIcon$A.displayName = "CloseCircleFilled";
7952
+ RefIcon$B.displayName = "CloseCircleFilled";
7953
7953
  }
7954
7954
  var CloseOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" };
7955
7955
  var CloseOutlined = function CloseOutlined2(props, ref) {
@@ -7958,9 +7958,9 @@ var CloseOutlined = function CloseOutlined2(props, ref) {
7958
7958
  icon: CloseOutlined$1
7959
7959
  }));
7960
7960
  };
7961
- var RefIcon$z = /* @__PURE__ */ React.forwardRef(CloseOutlined);
7961
+ var RefIcon$A = /* @__PURE__ */ React.forwardRef(CloseOutlined);
7962
7962
  if (process.env.NODE_ENV !== "production") {
7963
- RefIcon$z.displayName = "CloseOutlined";
7963
+ RefIcon$A.displayName = "CloseOutlined";
7964
7964
  }
7965
7965
  var ExclamationCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" };
7966
7966
  var ExclamationCircleFilled = function ExclamationCircleFilled2(props, ref) {
@@ -7969,9 +7969,9 @@ var ExclamationCircleFilled = function ExclamationCircleFilled2(props, ref) {
7969
7969
  icon: ExclamationCircleFilled$1
7970
7970
  }));
7971
7971
  };
7972
- var RefIcon$y = /* @__PURE__ */ React.forwardRef(ExclamationCircleFilled);
7972
+ var RefIcon$z = /* @__PURE__ */ React.forwardRef(ExclamationCircleFilled);
7973
7973
  if (process.env.NODE_ENV !== "production") {
7974
- RefIcon$y.displayName = "ExclamationCircleFilled";
7974
+ RefIcon$z.displayName = "ExclamationCircleFilled";
7975
7975
  }
7976
7976
  var InfoCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" };
7977
7977
  var InfoCircleFilled = function InfoCircleFilled2(props, ref) {
@@ -7980,9 +7980,9 @@ var InfoCircleFilled = function InfoCircleFilled2(props, ref) {
7980
7980
  icon: InfoCircleFilled$1
7981
7981
  }));
7982
7982
  };
7983
- var RefIcon$x = /* @__PURE__ */ React.forwardRef(InfoCircleFilled);
7983
+ var RefIcon$y = /* @__PURE__ */ React.forwardRef(InfoCircleFilled);
7984
7984
  if (process.env.NODE_ENV !== "production") {
7985
- RefIcon$x.displayName = "InfoCircleFilled";
7985
+ RefIcon$y.displayName = "InfoCircleFilled";
7986
7986
  }
7987
7987
  var attributes = "accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap";
7988
7988
  var eventsName = "onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError";
@@ -8723,9 +8723,9 @@ var LoadingOutlined = function LoadingOutlined2(props, ref) {
8723
8723
  icon: LoadingOutlined$1
8724
8724
  }));
8725
8725
  };
8726
- var RefIcon$w = /* @__PURE__ */ React.forwardRef(LoadingOutlined);
8726
+ var RefIcon$x = /* @__PURE__ */ React.forwardRef(LoadingOutlined);
8727
8727
  if (process.env.NODE_ENV !== "production") {
8728
- RefIcon$w.displayName = "LoadingOutlined";
8728
+ RefIcon$x.displayName = "LoadingOutlined";
8729
8729
  }
8730
8730
  function mergeProps$1(...items) {
8731
8731
  const ret = {};
@@ -8784,7 +8784,7 @@ const useClosable = (propCloseCollection, contextCloseCollection, fallbackCloseC
8784
8784
  const [contextLocale] = useLocale$1("global", localeValues.global);
8785
8785
  const closeBtnIsDisabled = typeof propCloseConfig !== "boolean" ? !!(propCloseConfig === null || propCloseConfig === void 0 ? void 0 : propCloseConfig.disabled) : false;
8786
8786
  const mergedFallbackCloseCollection = React__default.useMemo(() => Object.assign({
8787
- closeIcon: /* @__PURE__ */ React__default.createElement(RefIcon$z, null)
8787
+ closeIcon: /* @__PURE__ */ React__default.createElement(RefIcon$A, null)
8788
8788
  }, fallbackCloseCollection), [fallbackCloseCollection]);
8789
8789
  const mergedClosableConfig = React__default.useMemo(() => {
8790
8790
  if (propCloseConfig === false) {
@@ -9109,11 +9109,11 @@ const useStyle$u = genStyleHooks("Message", (token2) => {
9109
9109
  return t2;
9110
9110
  });
9111
9111
  const TypeIcon = {
9112
- info: /* @__PURE__ */ React.createElement(RefIcon$x, null),
9113
- success: /* @__PURE__ */ React.createElement(RefIcon$B, null),
9114
- error: /* @__PURE__ */ React.createElement(RefIcon$A, null),
9115
- warning: /* @__PURE__ */ React.createElement(RefIcon$y, null),
9116
- loading: /* @__PURE__ */ React.createElement(RefIcon$w, null)
9112
+ info: /* @__PURE__ */ React.createElement(RefIcon$y, null),
9113
+ success: /* @__PURE__ */ React.createElement(RefIcon$C, null),
9114
+ error: /* @__PURE__ */ React.createElement(RefIcon$B, null),
9115
+ warning: /* @__PURE__ */ React.createElement(RefIcon$z, null),
9116
+ loading: /* @__PURE__ */ React.createElement(RefIcon$x, null)
9117
9117
  };
9118
9118
  const PureContent$1 = ({
9119
9119
  prefixCls,
@@ -9200,7 +9200,7 @@ const Holder$1 = /* @__PURE__ */ React.forwardRef((props, ref) => {
9200
9200
  const getNotificationMotion = () => getMotion$3(prefixCls, transitionName);
9201
9201
  const mergedCloseIcon = /* @__PURE__ */ React.createElement("span", {
9202
9202
  className: `${prefixCls}-close-x`
9203
- }, /* @__PURE__ */ React.createElement(RefIcon$z, {
9203
+ }, /* @__PURE__ */ React.createElement(RefIcon$A, {
9204
9204
  className: `${prefixCls}-close-icon`
9205
9205
  }));
9206
9206
  const [api2, holder] = useNotification$1({
@@ -10240,7 +10240,7 @@ const InnerLoadingIcon = /* @__PURE__ */ forwardRef((props, ref) => {
10240
10240
  className: mergedIconCls,
10241
10241
  style: style2,
10242
10242
  ref
10243
- }, /* @__PURE__ */ React__default.createElement(RefIcon$w, {
10243
+ }, /* @__PURE__ */ React__default.createElement(RefIcon$x, {
10244
10244
  className: iconClassName
10245
10245
  }));
10246
10246
  });
@@ -10976,9 +10976,9 @@ var RightOutlined = function RightOutlined2(props, ref) {
10976
10976
  icon: RightOutlined$1
10977
10977
  }));
10978
10978
  };
10979
- var RefIcon$v = /* @__PURE__ */ React.forwardRef(RightOutlined);
10979
+ var RefIcon$w = /* @__PURE__ */ React.forwardRef(RightOutlined);
10980
10980
  if (process.env.NODE_ENV !== "production") {
10981
- RefIcon$v.displayName = "RightOutlined";
10981
+ RefIcon$w.displayName = "RightOutlined";
10982
10982
  }
10983
10983
  const genCollapseMotion = (token2) => ({
10984
10984
  [token2.componentCls]: {
@@ -17099,7 +17099,7 @@ const NormalOkBtn = () => {
17099
17099
  function renderCloseIcon(prefixCls, closeIcon) {
17100
17100
  return /* @__PURE__ */ React__default.createElement("span", {
17101
17101
  className: `${prefixCls}-close-x`
17102
- }, closeIcon || /* @__PURE__ */ React__default.createElement(RefIcon$z, {
17102
+ }, closeIcon || /* @__PURE__ */ React__default.createElement(RefIcon$A, {
17103
17103
  className: `${prefixCls}-close-icon`
17104
17104
  }));
17105
17105
  }
@@ -17691,7 +17691,7 @@ const Modal = (props) => {
17691
17691
  })) : null;
17692
17692
  const [mergedClosable, mergedCloseIcon, closeBtnIsDisabled, ariaProps] = useClosable(pickClosable(props), pickClosable(modalContext), {
17693
17693
  closable: true,
17694
- closeIcon: /* @__PURE__ */ React.createElement(RefIcon$z, {
17694
+ closeIcon: /* @__PURE__ */ React.createElement(RefIcon$A, {
17695
17695
  className: `${prefixCls}-close-icon`
17696
17696
  }),
17697
17697
  closeIconRender: (icon2) => renderCloseIcon(prefixCls, icon2)
@@ -17888,16 +17888,16 @@ const ConfirmContent = (props) => {
17888
17888
  if (!icon2 && icon2 !== null) {
17889
17889
  switch (type4) {
17890
17890
  case "info":
17891
- mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$x, null);
17891
+ mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$y, null);
17892
17892
  break;
17893
17893
  case "success":
17894
- mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$B, null);
17894
+ mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$C, null);
17895
17895
  break;
17896
17896
  case "error":
17897
- mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$A, null);
17897
+ mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$B, null);
17898
17898
  break;
17899
17899
  default:
17900
- mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$y, null);
17900
+ mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$z, null);
17901
17901
  }
17902
17902
  }
17903
17903
  const mergedOkCancel = okCancel !== null && okCancel !== void 0 ? okCancel : type4 === "confirm";
@@ -18661,15 +18661,15 @@ function getCloseIcon(prefixCls, closeIcon) {
18661
18661
  if (closeIcon === null || closeIcon === false) {
18662
18662
  return null;
18663
18663
  }
18664
- return closeIcon || /* @__PURE__ */ React.createElement(RefIcon$z, {
18664
+ return closeIcon || /* @__PURE__ */ React.createElement(RefIcon$A, {
18665
18665
  className: `${prefixCls}-close-icon`
18666
18666
  });
18667
18667
  }
18668
18668
  const typeToIcon = {
18669
- success: RefIcon$B,
18670
- info: RefIcon$x,
18671
- error: RefIcon$A,
18672
- warning: RefIcon$y
18669
+ success: RefIcon$C,
18670
+ info: RefIcon$y,
18671
+ error: RefIcon$B,
18672
+ warning: RefIcon$z
18673
18673
  };
18674
18674
  const PureContent = (props) => {
18675
18675
  const {
@@ -25280,9 +25280,9 @@ var CheckOutlined = function CheckOutlined2(props, ref) {
25280
25280
  icon: CheckOutlined$1
25281
25281
  }));
25282
25282
  };
25283
- var RefIcon$u = /* @__PURE__ */ React.forwardRef(CheckOutlined);
25283
+ var RefIcon$v = /* @__PURE__ */ React.forwardRef(CheckOutlined);
25284
25284
  if (process.env.NODE_ENV !== "production") {
25285
- RefIcon$u.displayName = "CheckOutlined";
25285
+ RefIcon$v.displayName = "CheckOutlined";
25286
25286
  }
25287
25287
  var DownOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, "name": "down", "theme": "outlined" };
25288
25288
  var DownOutlined = function DownOutlined2(props, ref) {
@@ -25291,9 +25291,9 @@ var DownOutlined = function DownOutlined2(props, ref) {
25291
25291
  icon: DownOutlined$1
25292
25292
  }));
25293
25293
  };
25294
- var RefIcon$t = /* @__PURE__ */ React.forwardRef(DownOutlined);
25294
+ var RefIcon$u = /* @__PURE__ */ React.forwardRef(DownOutlined);
25295
25295
  if (process.env.NODE_ENV !== "production") {
25296
- RefIcon$t.displayName = "DownOutlined";
25296
+ RefIcon$u.displayName = "DownOutlined";
25297
25297
  }
25298
25298
  var SearchOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, "name": "search", "theme": "outlined" };
25299
25299
  var SearchOutlined = function SearchOutlined2(props, ref) {
@@ -25302,9 +25302,9 @@ var SearchOutlined = function SearchOutlined2(props, ref) {
25302
25302
  icon: SearchOutlined$1
25303
25303
  }));
25304
25304
  };
25305
- var RefIcon$s = /* @__PURE__ */ React.forwardRef(SearchOutlined);
25305
+ var RefIcon$t = /* @__PURE__ */ React.forwardRef(SearchOutlined);
25306
25306
  if (process.env.NODE_ENV !== "production") {
25307
- RefIcon$s.displayName = "SearchOutlined";
25307
+ RefIcon$t.displayName = "SearchOutlined";
25308
25308
  }
25309
25309
  function useIcons$1({
25310
25310
  suffixIcon,
@@ -25324,7 +25324,7 @@ function useIcons$1({
25324
25324
  const warning3 = devUseWarning(componentName);
25325
25325
  warning3.deprecated(!clearIcon, "clearIcon", "allowClear={{ clearIcon: React.ReactNode }}");
25326
25326
  }
25327
- const mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : /* @__PURE__ */ React.createElement(RefIcon$A, null);
25327
+ const mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : /* @__PURE__ */ React.createElement(RefIcon$B, null);
25328
25328
  const getSuffixIconNode = (arrowIcon) => {
25329
25329
  if (suffixIcon === null && !hasFeedback && !showArrow) {
25330
25330
  return null;
@@ -25335,7 +25335,7 @@ function useIcons$1({
25335
25335
  if (suffixIcon !== void 0) {
25336
25336
  mergedSuffixIcon = getSuffixIconNode(suffixIcon);
25337
25337
  } else if (loading) {
25338
- mergedSuffixIcon = getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$w, {
25338
+ mergedSuffixIcon = getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$x, {
25339
25339
  spin: true
25340
25340
  }));
25341
25341
  } else {
@@ -25345,11 +25345,11 @@ function useIcons$1({
25345
25345
  showSearch
25346
25346
  }) => {
25347
25347
  if (open && showSearch) {
25348
- return getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$s, {
25348
+ return getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$t, {
25349
25349
  className: iconCls
25350
25350
  }));
25351
25351
  }
25352
- return getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$t, {
25352
+ return getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$u, {
25353
25353
  className: iconCls
25354
25354
  }));
25355
25355
  };
@@ -25358,7 +25358,7 @@ function useIcons$1({
25358
25358
  if (menuItemSelectedIcon !== void 0) {
25359
25359
  mergedItemIcon = menuItemSelectedIcon;
25360
25360
  } else if (multiple) {
25361
- mergedItemIcon = /* @__PURE__ */ React.createElement(RefIcon$u, null);
25361
+ mergedItemIcon = /* @__PURE__ */ React.createElement(RefIcon$v, null);
25362
25362
  } else {
25363
25363
  mergedItemIcon = null;
25364
25364
  }
@@ -25366,7 +25366,7 @@ function useIcons$1({
25366
25366
  if (removeIcon !== void 0) {
25367
25367
  mergedRemoveIcon = removeIcon;
25368
25368
  } else {
25369
- mergedRemoveIcon = /* @__PURE__ */ React.createElement(RefIcon$z, null);
25369
+ mergedRemoveIcon = /* @__PURE__ */ React.createElement(RefIcon$A, null);
25370
25370
  }
25371
25371
  return {
25372
25372
  clearIcon: mergedClearIcon,
@@ -27693,9 +27693,9 @@ var LeftOutlined = function LeftOutlined2(props, ref) {
27693
27693
  icon: LeftOutlined$1
27694
27694
  }));
27695
27695
  };
27696
- var RefIcon$r = /* @__PURE__ */ React.forwardRef(LeftOutlined);
27696
+ var RefIcon$s = /* @__PURE__ */ React.forwardRef(LeftOutlined);
27697
27697
  if (process.env.NODE_ENV !== "production") {
27698
- RefIcon$r.displayName = "LeftOutlined";
27698
+ RefIcon$s.displayName = "LeftOutlined";
27699
27699
  }
27700
27700
  var ESC$1 = KeyCode.ESC, TAB = KeyCode.TAB;
27701
27701
  function useAccessibility$1(_ref) {
@@ -29284,9 +29284,9 @@ var EllipsisOutlined = function EllipsisOutlined2(props, ref) {
29284
29284
  icon: EllipsisOutlined$1
29285
29285
  }));
29286
29286
  };
29287
- var RefIcon$q = /* @__PURE__ */ React.forwardRef(EllipsisOutlined);
29287
+ var RefIcon$r = /* @__PURE__ */ React.forwardRef(EllipsisOutlined);
29288
29288
  if (process.env.NODE_ENV !== "production") {
29289
- RefIcon$q.displayName = "EllipsisOutlined";
29289
+ RefIcon$r.displayName = "EllipsisOutlined";
29290
29290
  }
29291
29291
  var dayjs_min$1 = { exports: {} };
29292
29292
  var dayjs_min = dayjs_min$1.exports;
@@ -30612,7 +30612,7 @@ function getWeekStartDate(locale2, generateConfig2, value) {
30612
30612
  }
30613
30613
  return alignStartDate;
30614
30614
  }
30615
- function formatValue(value, _ref) {
30615
+ function formatValue$1(value, _ref) {
30616
30616
  var generateConfig2 = _ref.generateConfig, locale2 = _ref.locale, format3 = _ref.format;
30617
30617
  if (!value) {
30618
30618
  return "";
@@ -31084,7 +31084,7 @@ var EMPTY_VALUE = [];
31084
31084
  function useUtil(generateConfig2, locale2, formatList) {
31085
31085
  var getDateTexts = function getDateTexts2(dates) {
31086
31086
  return dates.map(function(date4) {
31087
- return formatValue(date4, {
31087
+ return formatValue$1(date4, {
31088
31088
  generateConfig: generateConfig2,
31089
31089
  locale: locale2,
31090
31090
  format: formatList[0]
@@ -31503,7 +31503,7 @@ function PanelBody(props) {
31503
31503
  rangeStart = isSame(generateConfig2, locale2, currentDate, hoverStart, type4);
31504
31504
  rangeEnd2 = isSame(generateConfig2, locale2, currentDate, hoverEnd, type4);
31505
31505
  }
31506
- var title = titleFormat ? formatValue(currentDate, {
31506
+ var title = titleFormat ? formatValue$1(currentDate, {
31507
31507
  locale: locale2,
31508
31508
  format: titleFormat,
31509
31509
  generateConfig: generateConfig2
@@ -31720,7 +31720,7 @@ function DatePanel(props) {
31720
31720
  return generateConfig2.addDate(date4, offset2);
31721
31721
  };
31722
31722
  var getCellText = function getCellText2(date4) {
31723
- return formatValue(date4, {
31723
+ return formatValue$1(date4, {
31724
31724
  locale: locale2,
31725
31725
  format: locale2.cellDateFormat,
31726
31726
  generateConfig: generateConfig2
@@ -31740,7 +31740,7 @@ function DatePanel(props) {
31740
31740
  },
31741
31741
  tabIndex: -1,
31742
31742
  className: "".concat(prefixCls, "-year-btn")
31743
- }, formatValue(pickerValue, {
31743
+ }, formatValue$1(pickerValue, {
31744
31744
  locale: locale2,
31745
31745
  format: locale2.yearFormat,
31746
31746
  generateConfig: generateConfig2
@@ -31754,7 +31754,7 @@ function DatePanel(props) {
31754
31754
  },
31755
31755
  tabIndex: -1,
31756
31756
  className: "".concat(prefixCls, "-month-btn")
31757
- }, locale2.monthFormat ? formatValue(pickerValue, {
31757
+ }, locale2.monthFormat ? formatValue$1(pickerValue, {
31758
31758
  locale: locale2,
31759
31759
  format: locale2.monthFormat,
31760
31760
  generateConfig: generateConfig2
@@ -32008,7 +32008,7 @@ function TimePanelBody(props) {
32008
32008
  var pmDate = generateConfig2.setHour(base2, 18);
32009
32009
  var formatMeridiem = function formatMeridiem2(date4, defaultLabel) {
32010
32010
  var cellMeridiemFormat = locale2.cellMeridiemFormat;
32011
- return cellMeridiemFormat ? formatValue(date4, {
32011
+ return cellMeridiemFormat ? formatValue$1(date4, {
32012
32012
  generateConfig: generateConfig2,
32013
32013
  locale: locale2,
32014
32014
  format: cellMeridiemFormat
@@ -32165,7 +32165,7 @@ function TimePanel(props) {
32165
32165
  value: info
32166
32166
  }, /* @__PURE__ */ React.createElement("div", {
32167
32167
  className: classNames(panelPrefixCls)
32168
- }, /* @__PURE__ */ React.createElement(PanelHeader, null, value ? formatValue(value, {
32168
+ }, /* @__PURE__ */ React.createElement(PanelHeader, null, value ? formatValue$1(value, {
32169
32169
  locale: locale2,
32170
32170
  format: format3,
32171
32171
  generateConfig: generateConfig2
@@ -32215,12 +32215,12 @@ function DecadePanel(props) {
32215
32215
  };
32216
32216
  var getCellText = function getCellText2(date4) {
32217
32217
  var cellYearFormat = locale2.cellYearFormat;
32218
- var startYearStr = formatValue(date4, {
32218
+ var startYearStr = formatValue$1(date4, {
32219
32219
  locale: locale2,
32220
32220
  format: cellYearFormat,
32221
32221
  generateConfig: generateConfig2
32222
32222
  });
32223
- var endYearStr = formatValue(generateConfig2.addYear(date4, 9), {
32223
+ var endYearStr = formatValue$1(generateConfig2.addYear(date4, 9), {
32224
32224
  locale: locale2,
32225
32225
  format: cellYearFormat,
32226
32226
  generateConfig: generateConfig2
@@ -32238,11 +32238,11 @@ function DecadePanel(props) {
32238
32238
  var baseEndDate = generateConfig2.addDate(baseEndYear, -1);
32239
32239
  return disabledDate(baseStartYear, disabledInfo) && disabledDate(baseEndDate, disabledInfo);
32240
32240
  } : null;
32241
- var yearNode = "".concat(formatValue(startYearDate, {
32241
+ var yearNode = "".concat(formatValue$1(startYearDate, {
32242
32242
  locale: locale2,
32243
32243
  format: locale2.yearFormat,
32244
32244
  generateConfig: generateConfig2
32245
- }), "-").concat(formatValue(endYearDate, {
32245
+ }), "-").concat(formatValue$1(endYearDate, {
32246
32246
  locale: locale2,
32247
32247
  format: locale2.yearFormat,
32248
32248
  generateConfig: generateConfig2
@@ -32279,7 +32279,7 @@ function MonthPanel(props) {
32279
32279
  };
32280
32280
  var getCellText = function getCellText2(date4) {
32281
32281
  var month = generateConfig2.getMonth(date4);
32282
- return locale2.monthFormat ? formatValue(date4, {
32282
+ return locale2.monthFormat ? formatValue$1(date4, {
32283
32283
  locale: locale2,
32284
32284
  format: locale2.monthFormat,
32285
32285
  generateConfig: generateConfig2
@@ -32303,7 +32303,7 @@ function MonthPanel(props) {
32303
32303
  },
32304
32304
  tabIndex: -1,
32305
32305
  className: "".concat(prefixCls, "-year-btn")
32306
- }, formatValue(pickerValue, {
32306
+ }, formatValue$1(pickerValue, {
32307
32307
  locale: locale2,
32308
32308
  format: locale2.yearFormat,
32309
32309
  generateConfig: generateConfig2
@@ -32343,7 +32343,7 @@ function QuarterPanel(props) {
32343
32343
  return generateConfig2.addMonth(date4, offset2 * 3);
32344
32344
  };
32345
32345
  var getCellText = function getCellText2(date4) {
32346
- return formatValue(date4, {
32346
+ return formatValue$1(date4, {
32347
32347
  locale: locale2,
32348
32348
  format: locale2.cellQuarterFormat,
32349
32349
  generateConfig: generateConfig2
@@ -32361,7 +32361,7 @@ function QuarterPanel(props) {
32361
32361
  },
32362
32362
  tabIndex: -1,
32363
32363
  className: "".concat(prefixCls, "-year-btn")
32364
- }, formatValue(pickerValue, {
32364
+ }, formatValue$1(pickerValue, {
32365
32365
  locale: locale2,
32366
32366
  format: locale2.yearFormat,
32367
32367
  generateConfig: generateConfig2
@@ -32442,7 +32442,7 @@ function YearPanel(props) {
32442
32442
  return generateConfig2.addYear(date4, offset2);
32443
32443
  };
32444
32444
  var getCellText = function getCellText2(date4) {
32445
- return formatValue(date4, {
32445
+ return formatValue$1(date4, {
32446
32446
  locale: locale2,
32447
32447
  format: locale2.cellYearFormat,
32448
32448
  generateConfig: generateConfig2
@@ -32467,11 +32467,11 @@ function YearPanel(props) {
32467
32467
  },
32468
32468
  tabIndex: -1,
32469
32469
  className: "".concat(prefixCls, "-decade-btn")
32470
- }, formatValue(startYearDate, {
32470
+ }, formatValue$1(startYearDate, {
32471
32471
  locale: locale2,
32472
32472
  format: locale2.yearFormat,
32473
32473
  generateConfig: generateConfig2
32474
- }), "-", formatValue(endYearDate, {
32474
+ }), "-", formatValue$1(endYearDate, {
32475
32475
  locale: locale2,
32476
32476
  format: locale2.yearFormat,
32477
32477
  generateConfig: generateConfig2
@@ -32883,7 +32883,7 @@ function useInputProps(props, postProps) {
32883
32883
  };
32884
32884
  var firstFormat = format3[0];
32885
32885
  var getText = React.useCallback(function(date4) {
32886
- return formatValue(date4, {
32886
+ return formatValue$1(date4, {
32887
32887
  locale: locale2,
32888
32888
  format: firstFormat,
32889
32889
  generateConfig: generateConfig2
@@ -37395,9 +37395,9 @@ var PlusOutlined = function PlusOutlined2(props, ref) {
37395
37395
  icon: PlusOutlined$1
37396
37396
  }));
37397
37397
  };
37398
- var RefIcon$p = /* @__PURE__ */ React.forwardRef(PlusOutlined);
37398
+ var RefIcon$q = /* @__PURE__ */ React.forwardRef(PlusOutlined);
37399
37399
  if (process.env.NODE_ENV !== "production") {
37400
- RefIcon$p.displayName = "PlusOutlined";
37400
+ RefIcon$q.displayName = "PlusOutlined";
37401
37401
  }
37402
37402
  const TabContext = /* @__PURE__ */ createContext(null);
37403
37403
  var useIndicator = function useIndicator2(options) {
@@ -39693,8 +39693,8 @@ const InternalTabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
39693
39693
  }) => {
39694
39694
  onEdit === null || onEdit === void 0 ? void 0 : onEdit(editType === "add" ? event : key, editType);
39695
39695
  },
39696
- removeIcon: (_a2 = removeIcon !== null && removeIcon !== void 0 ? removeIcon : tabs === null || tabs === void 0 ? void 0 : tabs.removeIcon) !== null && _a2 !== void 0 ? _a2 : /* @__PURE__ */ React.createElement(RefIcon$z, null),
39697
- addIcon: (addIcon !== null && addIcon !== void 0 ? addIcon : tabs === null || tabs === void 0 ? void 0 : tabs.addIcon) || /* @__PURE__ */ React.createElement(RefIcon$p, null),
39696
+ removeIcon: (_a2 = removeIcon !== null && removeIcon !== void 0 ? removeIcon : tabs === null || tabs === void 0 ? void 0 : tabs.removeIcon) !== null && _a2 !== void 0 ? _a2 : /* @__PURE__ */ React.createElement(RefIcon$A, null),
39697
+ addIcon: (addIcon !== null && addIcon !== void 0 ? addIcon : tabs === null || tabs === void 0 ? void 0 : tabs.addIcon) || /* @__PURE__ */ React.createElement(RefIcon$q, null),
39698
39698
  showAdd: hideAdd !== true
39699
39699
  };
39700
39700
  }
@@ -39729,7 +39729,7 @@ const InternalTabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
39729
39729
  style: mergedStyle,
39730
39730
  editable: editable2,
39731
39731
  more: Object.assign({
39732
- icon: (_l = (_k = (_j = (_h = tabs === null || tabs === void 0 ? void 0 : tabs.more) === null || _h === void 0 ? void 0 : _h.icon) !== null && _j !== void 0 ? _j : tabs === null || tabs === void 0 ? void 0 : tabs.moreIcon) !== null && _k !== void 0 ? _k : moreIcon) !== null && _l !== void 0 ? _l : /* @__PURE__ */ React.createElement(RefIcon$q, null),
39732
+ icon: (_l = (_k = (_j = (_h = tabs === null || tabs === void 0 ? void 0 : tabs.more) === null || _h === void 0 ? void 0 : _h.icon) !== null && _j !== void 0 ? _j : tabs === null || tabs === void 0 ? void 0 : tabs.moreIcon) !== null && _k !== void 0 ? _k : moreIcon) !== null && _l !== void 0 ? _l : /* @__PURE__ */ React.createElement(RefIcon$r, null),
39733
39733
  transitionName: `${rootPrefixCls}-slide-up`
39734
39734
  }, more),
39735
39735
  prefixCls,
@@ -41245,9 +41245,9 @@ var UpOutlined = function UpOutlined2(props, ref) {
41245
41245
  icon: UpOutlined$1
41246
41246
  }));
41247
41247
  };
41248
- var RefIcon$o = /* @__PURE__ */ React.forwardRef(UpOutlined);
41248
+ var RefIcon$p = /* @__PURE__ */ React.forwardRef(UpOutlined);
41249
41249
  if (process.env.NODE_ENV !== "production") {
41250
- RefIcon$o.displayName = "UpOutlined";
41250
+ RefIcon$p.displayName = "UpOutlined";
41251
41251
  }
41252
41252
  function hasAddon(props) {
41253
41253
  return !!(props.addonBefore || props.addonAfter);
@@ -41607,7 +41607,7 @@ const getAllowClear = (allowClear) => {
41607
41607
  mergedAllowClear = allowClear;
41608
41608
  } else if (allowClear) {
41609
41609
  mergedAllowClear = {
41610
- clearIcon: /* @__PURE__ */ React__default.createElement(RefIcon$A, null)
41610
+ clearIcon: /* @__PURE__ */ React__default.createElement(RefIcon$B, null)
41611
41611
  };
41612
41612
  }
41613
41613
  return mergedAllowClear;
@@ -41795,9 +41795,9 @@ var SwapRightOutlined = function SwapRightOutlined2(props, ref) {
41795
41795
  icon: SwapRightOutlined$1
41796
41796
  }));
41797
41797
  };
41798
- var RefIcon$n = /* @__PURE__ */ React.forwardRef(SwapRightOutlined);
41798
+ var RefIcon$o = /* @__PURE__ */ React.forwardRef(SwapRightOutlined);
41799
41799
  if (process.env.NODE_ENV !== "production") {
41800
- RefIcon$n.displayName = "SwapRightOutlined";
41800
+ RefIcon$o.displayName = "SwapRightOutlined";
41801
41801
  }
41802
41802
  const useMergedPickerSemantic = (pickerType, classNames$1, styles2, popupClassName, popupStyle) => {
41803
41803
  const {
@@ -41900,9 +41900,9 @@ var CalendarOutlined = function CalendarOutlined2(props, ref) {
41900
41900
  icon: CalendarOutlined$1
41901
41901
  }));
41902
41902
  };
41903
- var RefIcon$m = /* @__PURE__ */ React.forwardRef(CalendarOutlined);
41903
+ var RefIcon$n = /* @__PURE__ */ React.forwardRef(CalendarOutlined);
41904
41904
  if (process.env.NODE_ENV !== "production") {
41905
- RefIcon$m.displayName = "CalendarOutlined";
41905
+ RefIcon$n.displayName = "CalendarOutlined";
41906
41906
  }
41907
41907
  var ClockCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z" } }] }, "name": "clock-circle", "theme": "outlined" };
41908
41908
  var ClockCircleOutlined = function ClockCircleOutlined2(props, ref) {
@@ -41911,9 +41911,9 @@ var ClockCircleOutlined = function ClockCircleOutlined2(props, ref) {
41911
41911
  icon: ClockCircleOutlined$1
41912
41912
  }));
41913
41913
  };
41914
- var RefIcon$l = /* @__PURE__ */ React.forwardRef(ClockCircleOutlined);
41914
+ var RefIcon$m = /* @__PURE__ */ React.forwardRef(ClockCircleOutlined);
41915
41915
  if (process.env.NODE_ENV !== "production") {
41916
- RefIcon$l.displayName = "ClockCircleOutlined";
41916
+ RefIcon$m.displayName = "ClockCircleOutlined";
41917
41917
  }
41918
41918
  const SuffixIcon = ({
41919
41919
  picker,
@@ -41925,7 +41925,7 @@ const SuffixIcon = ({
41925
41925
  return null;
41926
41926
  }
41927
41927
  if (suffixIcon === true || suffixIcon === void 0) {
41928
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, picker === TIME ? /* @__PURE__ */ React__default.createElement(RefIcon$l, null) : /* @__PURE__ */ React__default.createElement(RefIcon$m, null), hasFeedback && feedbackIcon);
41928
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, picker === TIME ? /* @__PURE__ */ React__default.createElement(RefIcon$m, null) : /* @__PURE__ */ React__default.createElement(RefIcon$n, null), hasFeedback && feedbackIcon);
41929
41929
  }
41930
41930
  return suffixIcon;
41931
41931
  };
@@ -42032,7 +42032,7 @@ const generateRangePicker = (generateConfig2) => {
42032
42032
  separator: /* @__PURE__ */ React.createElement("span", {
42033
42033
  "aria-label": "to",
42034
42034
  className: `${prefixCls}-separator`
42035
- }, /* @__PURE__ */ React.createElement(RefIcon$n, null)),
42035
+ }, /* @__PURE__ */ React.createElement(RefIcon$o, null)),
42036
42036
  disabled: mergedDisabled,
42037
42037
  ref: innerRef,
42038
42038
  placement,
@@ -44524,9 +44524,9 @@ var QuestionCircleOutlined = function QuestionCircleOutlined2(props, ref) {
44524
44524
  icon: QuestionCircleOutlined$1
44525
44525
  }));
44526
44526
  };
44527
- var RefIcon$k = /* @__PURE__ */ React.forwardRef(QuestionCircleOutlined);
44527
+ var RefIcon$l = /* @__PURE__ */ React.forwardRef(QuestionCircleOutlined);
44528
44528
  if (process.env.NODE_ENV !== "production") {
44529
- RefIcon$k.displayName = "QuestionCircleOutlined";
44529
+ RefIcon$l.displayName = "QuestionCircleOutlined";
44530
44530
  }
44531
44531
  var __rest$h = function(s2, e3) {
44532
44532
  var t2 = {};
@@ -44574,7 +44574,7 @@ const FormItemLabel = ({
44574
44574
  const tooltipProps = convertToTooltipProps(tooltip);
44575
44575
  if (tooltipProps) {
44576
44576
  const {
44577
- icon: icon2 = /* @__PURE__ */ React.createElement(RefIcon$k, null)
44577
+ icon: icon2 = /* @__PURE__ */ React.createElement(RefIcon$l, null)
44578
44578
  } = tooltipProps, restTooltipProps = __rest$h(tooltipProps, ["icon"]);
44579
44579
  const tooltipNode = /* @__PURE__ */ React.createElement(Tooltip2, Object.assign({}, restTooltipProps), /* @__PURE__ */ React.cloneElement(icon2, {
44580
44580
  className: `${prefixCls}-item-tooltip`,
@@ -44619,10 +44619,10 @@ const FormItemLabel = ({
44619
44619
  }, labelChildren));
44620
44620
  };
44621
44621
  const iconMap = {
44622
- success: RefIcon$B,
44623
- warning: RefIcon$y,
44624
- error: RefIcon$A,
44625
- validating: RefIcon$w
44622
+ success: RefIcon$C,
44623
+ warning: RefIcon$z,
44624
+ error: RefIcon$B,
44625
+ validating: RefIcon$x
44626
44626
  };
44627
44627
  function StatusProvider({
44628
44628
  children,
@@ -45112,9 +45112,9 @@ var EyeOutlined = function EyeOutlined2(props, ref) {
45112
45112
  icon: EyeOutlined$1
45113
45113
  }));
45114
45114
  };
45115
- var RefIcon$j = /* @__PURE__ */ React.forwardRef(EyeOutlined);
45115
+ var RefIcon$k = /* @__PURE__ */ React.forwardRef(EyeOutlined);
45116
45116
  if (process.env.NODE_ENV !== "production") {
45117
- RefIcon$j.displayName = "EyeOutlined";
45117
+ RefIcon$k.displayName = "EyeOutlined";
45118
45118
  }
45119
45119
  const Group = (props) => {
45120
45120
  const {
@@ -45472,9 +45472,9 @@ var EyeInvisibleOutlined = function EyeInvisibleOutlined2(props, ref) {
45472
45472
  icon: EyeInvisibleOutlined$1
45473
45473
  }));
45474
45474
  };
45475
- var RefIcon$i = /* @__PURE__ */ React.forwardRef(EyeInvisibleOutlined);
45475
+ var RefIcon$j = /* @__PURE__ */ React.forwardRef(EyeInvisibleOutlined);
45476
45476
  if (process.env.NODE_ENV !== "production") {
45477
- RefIcon$i.displayName = "EyeInvisibleOutlined";
45477
+ RefIcon$j.displayName = "EyeInvisibleOutlined";
45478
45478
  }
45479
45479
  var __rest$c = function(s2, e3) {
45480
45480
  var t2 = {};
@@ -45484,7 +45484,7 @@ var __rest$c = function(s2, e3) {
45484
45484
  }
45485
45485
  return t2;
45486
45486
  };
45487
- const defaultIconRender = (visible) => visible ? /* @__PURE__ */ React.createElement(RefIcon$j, null) : /* @__PURE__ */ React.createElement(RefIcon$i, null);
45487
+ const defaultIconRender = (visible) => visible ? /* @__PURE__ */ React.createElement(RefIcon$k, null) : /* @__PURE__ */ React.createElement(RefIcon$j, null);
45488
45488
  const actionMap = {
45489
45489
  click: "onClick",
45490
45490
  hover: "onMouseOver"
@@ -45639,7 +45639,7 @@ const Search = /* @__PURE__ */ React.forwardRef((props, ref) => {
45639
45639
  customOnPressEnter === null || customOnPressEnter === void 0 ? void 0 : customOnPressEnter(e3);
45640
45640
  onSearch(e3);
45641
45641
  };
45642
- const searchIcon = typeof enterButton === "boolean" ? /* @__PURE__ */ React.createElement(RefIcon$s, null) : null;
45642
+ const searchIcon = typeof enterButton === "boolean" ? /* @__PURE__ */ React.createElement(RefIcon$t, null) : null;
45643
45643
  const btnClassName = `${prefixCls}-button`;
45644
45644
  let button;
45645
45645
  const enterButtonAsElement = enterButton || {};
@@ -46308,9 +46308,9 @@ var DoubleLeftOutlined = function DoubleLeftOutlined2(props, ref) {
46308
46308
  icon: DoubleLeftOutlined$1
46309
46309
  }));
46310
46310
  };
46311
- var RefIcon$h = /* @__PURE__ */ React.forwardRef(DoubleLeftOutlined);
46311
+ var RefIcon$i = /* @__PURE__ */ React.forwardRef(DoubleLeftOutlined);
46312
46312
  if (process.env.NODE_ENV !== "production") {
46313
- RefIcon$h.displayName = "DoubleLeftOutlined";
46313
+ RefIcon$i.displayName = "DoubleLeftOutlined";
46314
46314
  }
46315
46315
  var DoubleRightOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z" } }] }, "name": "double-right", "theme": "outlined" };
46316
46316
  var DoubleRightOutlined = function DoubleRightOutlined2(props, ref) {
@@ -46319,9 +46319,9 @@ var DoubleRightOutlined = function DoubleRightOutlined2(props, ref) {
46319
46319
  icon: DoubleRightOutlined$1
46320
46320
  }));
46321
46321
  };
46322
- var RefIcon$g = /* @__PURE__ */ React.forwardRef(DoubleRightOutlined);
46322
+ var RefIcon$h = /* @__PURE__ */ React.forwardRef(DoubleRightOutlined);
46323
46323
  if (process.env.NODE_ENV !== "production") {
46324
- RefIcon$g.displayName = "DoubleRightOutlined";
46324
+ RefIcon$h.displayName = "DoubleRightOutlined";
46325
46325
  }
46326
46326
  var locale = {
46327
46327
  // Options
@@ -47553,21 +47553,21 @@ const Pagination2 = (props) => {
47553
47553
  className: `${prefixCls}-item-link`,
47554
47554
  type: "button",
47555
47555
  tabIndex: -1
47556
- }, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$v, null) : /* @__PURE__ */ React.createElement(RefIcon$r, null));
47556
+ }, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$w, null) : /* @__PURE__ */ React.createElement(RefIcon$s, null));
47557
47557
  const nextIcon = /* @__PURE__ */ React.createElement("button", {
47558
47558
  className: `${prefixCls}-item-link`,
47559
47559
  type: "button",
47560
47560
  tabIndex: -1
47561
- }, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$r, null) : /* @__PURE__ */ React.createElement(RefIcon$v, null));
47561
+ }, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$s, null) : /* @__PURE__ */ React.createElement(RefIcon$w, null));
47562
47562
  const jumpPrevIcon = (
47563
47563
  // biome-ignore lint/a11y/useValidAnchor: it is hard to refactor
47564
47564
  /* @__PURE__ */ React.createElement("a", {
47565
47565
  className: `${prefixCls}-item-link`
47566
47566
  }, /* @__PURE__ */ React.createElement("div", {
47567
47567
  className: `${prefixCls}-item-container`
47568
- }, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$g, {
47568
+ }, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$h, {
47569
47569
  className: `${prefixCls}-item-link-icon`
47570
- }) : /* @__PURE__ */ React.createElement(RefIcon$h, {
47570
+ }) : /* @__PURE__ */ React.createElement(RefIcon$i, {
47571
47571
  className: `${prefixCls}-item-link-icon`
47572
47572
  }), ellipsis))
47573
47573
  );
@@ -47577,9 +47577,9 @@ const Pagination2 = (props) => {
47577
47577
  className: `${prefixCls}-item-link`
47578
47578
  }, /* @__PURE__ */ React.createElement("div", {
47579
47579
  className: `${prefixCls}-item-container`
47580
- }, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$h, {
47580
+ }, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$i, {
47581
47581
  className: `${prefixCls}-item-link-icon`
47582
- }) : /* @__PURE__ */ React.createElement(RefIcon$g, {
47582
+ }) : /* @__PURE__ */ React.createElement(RefIcon$h, {
47583
47583
  className: `${prefixCls}-item-link-icon`
47584
47584
  }), ellipsis))
47585
47585
  );
@@ -48018,7 +48018,7 @@ const InternalSwitch = /* @__PURE__ */ React.forwardRef((props, ref) => {
48018
48018
  const prefixCls = getPrefixCls("switch", customizePrefixCls);
48019
48019
  const loadingIcon = /* @__PURE__ */ React.createElement("div", {
48020
48020
  className: `${prefixCls}-handle`
48021
- }, loading && /* @__PURE__ */ React.createElement(RefIcon$w, {
48021
+ }, loading && /* @__PURE__ */ React.createElement(RefIcon$x, {
48022
48022
  className: `${prefixCls}-loading-icon`
48023
48023
  }));
48024
48024
  const [wrapCSSVar, hashId, cssVarCls] = useStyle$2(prefixCls);
@@ -48359,9 +48359,9 @@ var DeleteOutlined = function DeleteOutlined2(props, ref) {
48359
48359
  icon: DeleteOutlined$1
48360
48360
  }));
48361
48361
  };
48362
- var RefIcon$f = /* @__PURE__ */ React.forwardRef(DeleteOutlined);
48362
+ var RefIcon$g = /* @__PURE__ */ React.forwardRef(DeleteOutlined);
48363
48363
  if (process.env.NODE_ENV !== "production") {
48364
- RefIcon$f.displayName = "DeleteOutlined";
48364
+ RefIcon$g.displayName = "DeleteOutlined";
48365
48365
  }
48366
48366
  var EditOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z" } }] }, "name": "edit", "theme": "outlined" };
48367
48367
  var EditOutlined = function EditOutlined2(props, ref) {
@@ -48370,9 +48370,9 @@ var EditOutlined = function EditOutlined2(props, ref) {
48370
48370
  icon: EditOutlined$1
48371
48371
  }));
48372
48372
  };
48373
- var RefIcon$e = /* @__PURE__ */ React.forwardRef(EditOutlined);
48373
+ var RefIcon$f = /* @__PURE__ */ React.forwardRef(EditOutlined);
48374
48374
  if (process.env.NODE_ENV !== "production") {
48375
- RefIcon$e.displayName = "EditOutlined";
48375
+ RefIcon$f.displayName = "EditOutlined";
48376
48376
  }
48377
48377
  var EnterOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z" } }] }, "name": "enter", "theme": "outlined" };
48378
48378
  var EnterOutlined = function EnterOutlined2(props, ref) {
@@ -48381,9 +48381,9 @@ var EnterOutlined = function EnterOutlined2(props, ref) {
48381
48381
  icon: EnterOutlined$1
48382
48382
  }));
48383
48383
  };
48384
- var RefIcon$d = /* @__PURE__ */ React.forwardRef(EnterOutlined);
48384
+ var RefIcon$e = /* @__PURE__ */ React.forwardRef(EnterOutlined);
48385
48385
  if (process.env.NODE_ENV !== "production") {
48386
- RefIcon$d.displayName = "EnterOutlined";
48386
+ RefIcon$e.displayName = "EnterOutlined";
48387
48387
  }
48388
48388
  const getTitleStyle = (fontSize, lineHeight, color, token2) => {
48389
48389
  const {
@@ -48705,7 +48705,7 @@ const Editable = (props) => {
48705
48705
  onCancel,
48706
48706
  onEnd,
48707
48707
  component,
48708
- enterIcon = /* @__PURE__ */ React.createElement(RefIcon$d, null)
48708
+ enterIcon = /* @__PURE__ */ React.createElement(RefIcon$e, null)
48709
48709
  } = props;
48710
48710
  const ref = React.useRef(null);
48711
48711
  const inComposition = React.useRef(false);
@@ -49091,9 +49091,9 @@ var CopyOutlined = function CopyOutlined2(props, ref) {
49091
49091
  icon: CopyOutlined$1
49092
49092
  }));
49093
49093
  };
49094
- var RefIcon$c = /* @__PURE__ */ React.forwardRef(CopyOutlined);
49094
+ var RefIcon$d = /* @__PURE__ */ React.forwardRef(CopyOutlined);
49095
49095
  if (process.env.NODE_ENV !== "production") {
49096
- RefIcon$c.displayName = "CopyOutlined";
49096
+ RefIcon$d.displayName = "CopyOutlined";
49097
49097
  }
49098
49098
  function toList(val) {
49099
49099
  if (val === false) {
@@ -49154,7 +49154,7 @@ const CopyBtn = ({
49154
49154
  onClick: onCopy,
49155
49155
  "aria-label": ariaLabel,
49156
49156
  tabIndex
49157
- }, copied ? getNode(iconNodes[1], /* @__PURE__ */ React.createElement(RefIcon$u, null), true) : getNode(iconNodes[0], btnLoading ? /* @__PURE__ */ React.createElement(RefIcon$w, null) : /* @__PURE__ */ React.createElement(RefIcon$c, null), true)));
49157
+ }, copied ? getNode(iconNodes[1], /* @__PURE__ */ React.createElement(RefIcon$v, null), true) : getNode(iconNodes[0], btnLoading ? /* @__PURE__ */ React.createElement(RefIcon$x, null) : /* @__PURE__ */ React.createElement(RefIcon$d, null), true)));
49158
49158
  };
49159
49159
  const MeasureText = /* @__PURE__ */ React.forwardRef(({
49160
49160
  style: style2,
@@ -49593,7 +49593,7 @@ const Base = /* @__PURE__ */ React.forwardRef((props, ref) => {
49593
49593
  onClick: onEditClick,
49594
49594
  "aria-label": ariaLabel,
49595
49595
  tabIndex
49596
- }, icon2 || /* @__PURE__ */ React.createElement(RefIcon$e, {
49596
+ }, icon2 || /* @__PURE__ */ React.createElement(RefIcon$f, {
49597
49597
  role: "button"
49598
49598
  }))) : null;
49599
49599
  };
@@ -49770,9 +49770,9 @@ var AppstoreOutlined = function AppstoreOutlined2(props, ref) {
49770
49770
  icon: AppstoreOutlined$1
49771
49771
  }));
49772
49772
  };
49773
- var RefIcon$b = /* @__PURE__ */ React.forwardRef(AppstoreOutlined);
49773
+ var RefIcon$c = /* @__PURE__ */ React.forwardRef(AppstoreOutlined);
49774
49774
  if (process.env.NODE_ENV !== "production") {
49775
- RefIcon$b.displayName = "AppstoreOutlined";
49775
+ RefIcon$c.displayName = "AppstoreOutlined";
49776
49776
  }
49777
49777
  var ArrowLeftOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" } }] }, "name": "arrow-left", "theme": "outlined" };
49778
49778
  var ArrowLeftOutlined = function ArrowLeftOutlined2(props, ref) {
@@ -49781,9 +49781,9 @@ var ArrowLeftOutlined = function ArrowLeftOutlined2(props, ref) {
49781
49781
  icon: ArrowLeftOutlined$1
49782
49782
  }));
49783
49783
  };
49784
- var RefIcon$a = /* @__PURE__ */ React.forwardRef(ArrowLeftOutlined);
49784
+ var RefIcon$b = /* @__PURE__ */ React.forwardRef(ArrowLeftOutlined);
49785
49785
  if (process.env.NODE_ENV !== "production") {
49786
- RefIcon$a.displayName = "ArrowLeftOutlined";
49786
+ RefIcon$b.displayName = "ArrowLeftOutlined";
49787
49787
  }
49788
49788
  var ArrowRightOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z" } }] }, "name": "arrow-right", "theme": "outlined" };
49789
49789
  var ArrowRightOutlined = function ArrowRightOutlined2(props, ref) {
@@ -49792,9 +49792,9 @@ var ArrowRightOutlined = function ArrowRightOutlined2(props, ref) {
49792
49792
  icon: ArrowRightOutlined$1
49793
49793
  }));
49794
49794
  };
49795
- var RefIcon$9 = /* @__PURE__ */ React.forwardRef(ArrowRightOutlined);
49795
+ var RefIcon$a = /* @__PURE__ */ React.forwardRef(ArrowRightOutlined);
49796
49796
  if (process.env.NODE_ENV !== "production") {
49797
- RefIcon$9.displayName = "ArrowRightOutlined";
49797
+ RefIcon$a.displayName = "ArrowRightOutlined";
49798
49798
  }
49799
49799
  var CodeOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, "name": "code", "theme": "outlined" };
49800
49800
  var CodeOutlined = function CodeOutlined2(props, ref) {
@@ -49803,9 +49803,9 @@ var CodeOutlined = function CodeOutlined2(props, ref) {
49803
49803
  icon: CodeOutlined$1
49804
49804
  }));
49805
49805
  };
49806
- var RefIcon$8 = /* @__PURE__ */ React.forwardRef(CodeOutlined);
49806
+ var RefIcon$9 = /* @__PURE__ */ React.forwardRef(CodeOutlined);
49807
49807
  if (process.env.NODE_ENV !== "production") {
49808
- RefIcon$8.displayName = "CodeOutlined";
49808
+ RefIcon$9.displayName = "CodeOutlined";
49809
49809
  }
49810
49810
  var ControlOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM340 683v77c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-77c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198V264c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v221c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8s0 .1.1.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8 0 0 0 .1-.1.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7zM620 539v221c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V539c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198v-77c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v77c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8v.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8v.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7z" } }] }, "name": "control", "theme": "outlined" };
49811
49811
  var ControlOutlined = function ControlOutlined2(props, ref) {
@@ -49814,9 +49814,20 @@ var ControlOutlined = function ControlOutlined2(props, ref) {
49814
49814
  icon: ControlOutlined$1
49815
49815
  }));
49816
49816
  };
49817
- var RefIcon$7 = /* @__PURE__ */ React.forwardRef(ControlOutlined);
49817
+ var RefIcon$8 = /* @__PURE__ */ React.forwardRef(ControlOutlined);
49818
49818
  if (process.env.NODE_ENV !== "production") {
49819
- RefIcon$7.displayName = "ControlOutlined";
49819
+ RefIcon$8.displayName = "ControlOutlined";
49820
+ }
49821
+ var DiffOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M476 399.1c0-3.9-3.1-7.1-7-7.1h-42c-3.8 0-7 3.2-7 7.1V484h-84.5c-4.1 0-7.5 3.1-7.5 7v42c0 3.8 3.4 7 7.5 7H420v84.9c0 3.9 3.2 7.1 7 7.1h42c3.9 0 7-3.2 7-7.1V540h84.5c4.1 0 7.5-3.2 7.5-7v-42c0-3.9-3.4-7-7.5-7H476v-84.9zM560.5 704h-225c-4.1 0-7.5 3.2-7.5 7v42c0 3.8 3.4 7 7.5 7h225c4.1 0 7.5-3.2 7.5-7v-42c0-3.8-3.4-7-7.5-7zm-7.1-502.6c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v704c0 17.7 14.3 32 32 32h512c17.7 0 32-14.3 32-32V397.3c0-8.5-3.4-16.6-9.4-22.6L553.4 201.4zM664 888H232V264h282.2L664 413.8V888zm190.2-581.4L611.3 72.9c-6-5.7-13.9-8.9-22.2-8.9H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h277l219 210.6V824c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V329.6c0-8.7-3.5-17-9.8-23z" } }] }, "name": "diff", "theme": "outlined" };
49822
+ var DiffOutlined = function DiffOutlined2(props, ref) {
49823
+ return /* @__PURE__ */ React.createElement(Icon$2, _extends$1({}, props, {
49824
+ ref,
49825
+ icon: DiffOutlined$1
49826
+ }));
49827
+ };
49828
+ var RefIcon$7 = /* @__PURE__ */ React.forwardRef(DiffOutlined);
49829
+ if (process.env.NODE_ENV !== "production") {
49830
+ RefIcon$7.displayName = "DiffOutlined";
49820
49831
  }
49821
49832
  var ExportOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z" } }] }, "name": "export", "theme": "outlined" };
49822
49833
  var ExportOutlined = function ExportOutlined2(props, ref) {
@@ -60101,7 +60112,7 @@ const Text$2 = ({
60101
60112
  color: "green",
60102
60113
  size: "middle",
60103
60114
  danger: !isValidTextValue,
60104
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$u, {})
60115
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$v, {})
60105
60116
  }
60106
60117
  )
60107
60118
  ] }),
@@ -67653,7 +67664,12 @@ const useStateStore = () => {
67653
67664
  const scopedStore = useContext(StateStoreContext);
67654
67665
  return useStore(scopedStore ?? defaultStore);
67655
67666
  };
67656
- const EntityId = ({ entity, onUpdate }) => {
67667
+ const AiEditedFieldBadge = ({
67668
+ className = "",
67669
+ title = "Edited by AI",
67670
+ ariaLabel = "Edited by AI"
67671
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `describo-ai-edited-icon ${className}`, "aria-label": ariaLabel, children: "✦" }) });
67672
+ const EntityId = ({ entity, onUpdate, aiEdited = false }) => {
67657
67673
  var _a2;
67658
67674
  const state = useStateStore();
67659
67675
  const handleSave = async (data) => {
@@ -67667,7 +67683,10 @@ const EntityId = ({ entity, onUpdate }) => {
67667
67683
  return entity["@id"] === "./" || types2.some((type4) => ["Dataset", "File"].includes(type4));
67668
67684
  };
67669
67685
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row", children: [
67670
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-32 w-1/3 xl:w-1/5 flex flex-col describo-property-name", children: "@id" }),
67686
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 describo-property-name describo-property-name-with-ai", children: [
67687
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "@id" }),
67688
+ aiEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(AiEditedFieldBadge, {})
67689
+ ] }),
67671
67690
  !((_a2 = state.configuration) == null ? void 0 : _a2.readonly) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-2/3 xl:w-4/5 flex flex-row describo-property-value", children: [
67672
67691
  isURL(entity["@id"]) && /* @__PURE__ */ jsxRuntimeExports.jsx(
67673
67692
  Button$1,
@@ -67693,7 +67712,7 @@ const EntityId = ({ entity, onUpdate }) => {
67693
67712
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: entity["@id"] }) })
67694
67713
  ] });
67695
67714
  };
67696
- const EntityType = ({ entity, onUpdateEntity }) => {
67715
+ const EntityType = ({ entity, onUpdateEntity, aiEdited = false }) => {
67697
67716
  var _a2;
67698
67717
  const [selectedClass, setSelectedClass] = useState(void 0);
67699
67718
  const profileManager = useContext(ProfileManagerContext);
@@ -67728,7 +67747,10 @@ const EntityType = ({ entity, onUpdateEntity }) => {
67728
67747
  setSelectedClass("");
67729
67748
  };
67730
67749
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "flex-row", children: [
67731
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-32 w-1/3 xl:w-1/5 flex flex-col describo-property-name", children: "@type" }),
67750
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 describo-property-name describo-property-name-with-ai", children: [
67751
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "@type" }),
67752
+ aiEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(AiEditedFieldBadge, {})
67753
+ ] }),
67732
67754
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "w-2/3 xl:w-4/5 flex-row flex-wrap", children: [
67733
67755
  types2.map((etype) => /* @__PURE__ */ jsxRuntimeExports.jsx(
67734
67756
  Tag$1,
@@ -67761,27 +67783,129 @@ const EntityType = ({ entity, onUpdateEntity }) => {
67761
67783
  ] })
67762
67784
  ] });
67763
67785
  };
67764
- const EntityName = ({ entity, onUpdate, showHelp = true }) => {
67786
+ const valueIsEmpty = (value) => {
67787
+ if (value === void 0 || value === null) return true;
67788
+ if (typeof value === "string") return value.trim().length === 0;
67789
+ if (Array.isArray(value)) return value.length === 0;
67790
+ return false;
67791
+ };
67792
+ const formatValue = (value) => {
67793
+ if (valueIsEmpty(value)) return "empty";
67794
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
67795
+ return String(value);
67796
+ }
67797
+ try {
67798
+ return JSON.stringify(value, null, 2);
67799
+ } catch {
67800
+ return String(value);
67801
+ }
67802
+ };
67803
+ const AiFieldDiffView = ({
67804
+ previousValue,
67805
+ currentValue,
67806
+ operation
67807
+ }) => {
67808
+ const isDelete = operation === "delete";
67809
+ const removedValue = formatValue(previousValue);
67810
+ const addedValue = isDelete ? "empty" : formatValue(currentValue);
67811
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-field-diff", "aria-label": "AI field diff", children: [
67812
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-field-diff-head", children: [
67813
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: isDelete ? "Proposed deletion" : "Proposed change" }),
67814
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-field-diff-chip", children: "AI edit" })
67815
+ ] }),
67816
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-field-diff-line describo-ai-field-diff-line-removed", children: [
67817
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-field-diff-marker", children: "-" }),
67818
+ /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `describo-ai-field-diff-value ${valueIsEmpty(previousValue) ? "describo-ai-field-diff-empty" : ""}`, children: removedValue })
67819
+ ] }),
67820
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-field-diff-line describo-ai-field-diff-line-added", children: [
67821
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-field-diff-marker", children: "+" }),
67822
+ /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `describo-ai-field-diff-value ${valueIsEmpty(isDelete ? void 0 : currentValue) ? "describo-ai-field-diff-empty" : ""}`, children: addedValue })
67823
+ ] })
67824
+ ] });
67825
+ };
67826
+ const EntityName = ({
67827
+ entity,
67828
+ onUpdate,
67829
+ showHelp = true,
67830
+ aiEdited = false,
67831
+ aiReview
67832
+ }) => {
67765
67833
  var _a2;
67766
67834
  const [t2, i18n] = useTranslation();
67767
67835
  const state = useStateStore();
67836
+ const [showAiDiff, setShowAiDiff] = useState(false);
67837
+ const showAiReview = Boolean(aiReview);
67838
+ const isAiDelete = (aiReview == null ? void 0 : aiReview.operation) === "delete";
67768
67839
  const handleSave = async (data) => {
67769
67840
  onUpdate(data);
67770
67841
  };
67771
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row", children: [
67772
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 flex flex-col", children: [
67773
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-property-name", children: t2("name_field_label") }),
67774
- showHelp && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-600 font-light text-xs pr-1 describo-property-help", children: t2("name_field_help") })
67775
- ] }),
67776
- !((_a2 = state.configuration) == null ? void 0 : _a2.readonly) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2/3 xl:w-4/5 flex flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
67777
- Text$2,
67778
- {
67779
- property: "name",
67780
- value: entity.name,
67781
- onSaveProperty: handleSave
67782
- }
67783
- ) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2/3 xl:w-4/5 flex flex-row", children: entity.name })
67784
- ] });
67842
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
67843
+ "div",
67844
+ {
67845
+ className: `flex flex-row ${showAiReview ? `${showHelp ? "p-2" : "px-2 py-1 describo-property-compact"} describo-ai-review ${isAiDelete ? "describo-ai-delete" : "describo-ai-suggestion"}` : ""} describo-property describo-property-name-name`,
67846
+ children: [
67847
+ showAiReview && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-suggestion-badge", children: [
67848
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-suggestion-badge-icon", children: "✦" }),
67849
+ isAiDelete ? "AI delete" : "AI suggestion"
67850
+ ] }),
67851
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 flex flex-col", children: [
67852
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-property-name describo-property-name-with-ai", children: [
67853
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("name_field_label") }),
67854
+ aiEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(AiEditedFieldBadge, {})
67855
+ ] }),
67856
+ showHelp && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-600 font-light text-xs pr-1 describo-property-help", children: t2("name_field_help") })
67857
+ ] }),
67858
+ !((_a2 = state.configuration) == null ? void 0 : _a2.readonly) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2/3 xl:w-4/5 flex flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex flex-row gap-2 ${showAiReview ? "describo-ai-field-row" : ""}`, children: [
67859
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `flex-grow min-w-0 ${showAiReview ? "describo-ai-field-control" : ""}`, children: showAiDiff && (aiReview == null ? void 0 : aiReview.previousValueDiffers) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
67860
+ AiFieldDiffView,
67861
+ {
67862
+ previousValue: aiReview == null ? void 0 : aiReview.previousValue,
67863
+ currentValue: entity.name,
67864
+ operation: aiReview == null ? void 0 : aiReview.operation
67865
+ }
67866
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
67867
+ Text$2,
67868
+ {
67869
+ property: "name",
67870
+ value: entity.name,
67871
+ onSaveProperty: handleSave
67872
+ }
67873
+ ) }),
67874
+ showAiReview && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-actions", children: [
67875
+ (aiReview == null ? void 0 : aiReview.previousValueDiffers) && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showAiDiff ? "Hide diff" : "Show diff", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
67876
+ Button$1,
67877
+ {
67878
+ size: "middle",
67879
+ className: "describo-ai-action-diff",
67880
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$7, {}),
67881
+ "aria-label": showAiDiff ? "Hide AI diff" : "Show AI diff",
67882
+ "aria-pressed": showAiDiff,
67883
+ onClick: () => setShowAiDiff((visible) => !visible)
67884
+ }
67885
+ ) }),
67886
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: isAiDelete ? "Approve this AI deletion" : "Approve this AI-suggested value", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
67887
+ Button$1,
67888
+ {
67889
+ size: "middle",
67890
+ className: "describo-ai-action-approve",
67891
+ onClick: aiReview == null ? void 0 : aiReview.onApprove,
67892
+ children: isAiDelete ? "Delete" : "Accept"
67893
+ }
67894
+ ) }),
67895
+ (aiReview == null ? void 0 : aiReview.previousValueDiffers) && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Restore the previous value and mark this suggestion reviewed", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
67896
+ Button$1,
67897
+ {
67898
+ size: "middle",
67899
+ className: "describo-ai-action-reject",
67900
+ onClick: aiReview == null ? void 0 : aiReview.onReject,
67901
+ children: isAiDelete ? "Restore" : "Reject"
67902
+ }
67903
+ ) })
67904
+ ] })
67905
+ ] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2/3 xl:w-4/5 flex flex-row", children: entity.name })
67906
+ ]
67907
+ }
67908
+ );
67785
67909
  };
67786
67910
  const PropertyHelp = ({ help }) => {
67787
67911
  const [showMore, setShowMore] = useState(false);
@@ -68067,7 +68191,7 @@ const NumberComponent = ({
68067
68191
  color: "green",
68068
68192
  size: "middle",
68069
68193
  disabled: !isValidNumber || !isValidConstraints,
68070
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$u, {})
68194
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$v, {})
68071
68195
  }
68072
68196
  )
68073
68197
  ] }),
@@ -68093,6 +68217,7 @@ const SelectComponent = ({
68093
68217
  const [internalValue, setInternalValue] = useState(value === "" ? void 0 : value);
68094
68218
  const [hasValidValues, setHasValidValues] = useState(false);
68095
68219
  useEffect(() => {
68220
+ setInternalValue(value === "" ? void 0 : value);
68096
68221
  setHasValidValues(verifySelectValuesAreStrings(definition.values));
68097
68222
  }, [value]);
68098
68223
  useEffect(() => {
@@ -68205,7 +68330,7 @@ const Url = ({
68205
68330
  color: "green",
68206
68331
  size: "middle",
68207
68332
  danger: !isValidUrl,
68208
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$u, {})
68333
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$v, {})
68209
68334
  }
68210
68335
  )
68211
68336
  ] }),
@@ -68453,98 +68578,6 @@ const EntityPropertyInstance = ({
68453
68578
  }
68454
68579
  );
68455
68580
  };
68456
- /*!
68457
- * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
68458
- * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
68459
- * Copyright 2024 Fonticons, Inc.
68460
- */
68461
- const faJs = {
68462
- prefix: "fab",
68463
- iconName: "js",
68464
- icon: [448, 512, [], "f3b8", "M0 32v448h448V32H0zm243.8 349.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z"]
68465
- };
68466
- const typeIcons = {
68467
- Book: faBookOpen,
68468
- ContactPoint: faAddressCard,
68469
- ComputerLanguage: faJs,
68470
- CreateAction: faPlus,
68471
- CreativeWork: faImage,
68472
- Country: faFlag,
68473
- Dataset: faFolder,
68474
- DataDownload: faDownload,
68475
- DerivedMaterial: faDownload,
68476
- File: faFile,
68477
- GeoCoordinates: faMapMarkerAlt,
68478
- GeoShape: faMapMarkerAlt,
68479
- IndividualProduct: faBarcode,
68480
- Language: faSignLanguage,
68481
- Organization: faUniversity,
68482
- Organisation: faUniversity,
68483
- Person: faUser,
68484
- Place: faGlobe,
68485
- PropertyValue: faParagraph,
68486
- Publication: faNewspaper,
68487
- RepositoryCollection: faCubes,
68488
- RepositoryObject: faCube,
68489
- ScholarlyArticle: faScroll,
68490
- Script: faCode,
68491
- SoftwareApplication: faCode,
68492
- URL: faLink,
68493
- Workflow: faProjectDiagram,
68494
- WorkflowSketch: faProjectDiagram
68495
- };
68496
- const RenderTypes = ({ types: types2 }) => {
68497
- const profileManager = useContext(ProfileManagerContext);
68498
- const getTypeLabelFromProfile = (type4) => {
68499
- return (profileManager == null ? void 0 : profileManager.getTypeLabel(type4)) || type4;
68500
- };
68501
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row space-x-1", children: types2.map((etype, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
68502
- Tag$1,
68503
- {
68504
- className: "text-gray-800 font-light flex flex-row items-center space-x-1",
68505
- style: {
68506
- backgroundColor: "#f0f0f0",
68507
- borderRadius: "16px",
68508
- padding: "0 12px",
68509
- height: "32px",
68510
- display: "flex",
68511
- alignItems: "center",
68512
- margin: "4px"
68513
- },
68514
- children: [
68515
- typeIcons[etype] && /* @__PURE__ */ jsxRuntimeExports.jsx(
68516
- FontAwesomeIcon,
68517
- {
68518
- icon: typeIcons[etype],
68519
- fixedWidth: true
68520
- }
68521
- ),
68522
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: getTypeLabelFromProfile(etype) })
68523
- ]
68524
- },
68525
- idx
68526
- )) });
68527
- };
68528
- const ItemLink = ({ entity, onLoadEntity, className }) => {
68529
- const handleLoadEntity = () => {
68530
- onLoadEntity({ id: entity["@id"] });
68531
- };
68532
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex min-w-0 w-full flex-col ${className || ""}`, onClick: handleLoadEntity, children: [
68533
- /* @__PURE__ */ jsxRuntimeExports.jsx(
68534
- Typography.Text,
68535
- {
68536
- type: "secondary",
68537
- style: { fontSize: "0.75rem" },
68538
- className: "pb-1 mb-1 border-b border-black/20",
68539
- children: decodeURIComponent(entity["@id"])
68540
- }
68541
- ),
68542
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row space-x-2 items-center", children: [
68543
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-base flex flex-row space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderTypes, { types: entity["@type"] }) }),
68544
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { strong: true, children: entity.name })
68545
- ] })
68546
- ] });
68547
- };
68548
68581
  const UnlinkEntity = ({ entity, onUnlinkEntity }) => {
68549
68582
  const handleUnlink = () => {
68550
68583
  onUnlinkEntity({ entity: { "@id": entity["@id"] } });
@@ -79784,18 +79817,563 @@ const Map$1 = ({ entity, crateManager }) => {
79784
79817
  };
79785
79818
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: mapId, className: "w-[600px] h-[520px] describo-property-type-map", ref: mapRef });
79786
79819
  };
79820
+ const formatEntityDiffValue = (value) => {
79821
+ if (value === void 0 || value === null) return "empty";
79822
+ if (Array.isArray(value)) return value.map(formatEntityDiffValue).join(", ");
79823
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
79824
+ return String(value);
79825
+ }
79826
+ if (typeof (value == null ? void 0 : value["@id"]) === "string") return value["@id"];
79827
+ try {
79828
+ return JSON.stringify(value);
79829
+ } catch {
79830
+ return String(value);
79831
+ }
79832
+ };
79833
+ const AiEntityDiffView = ({
79834
+ entityId,
79835
+ rows,
79836
+ operation = "edit",
79837
+ readonly = false,
79838
+ onClose,
79839
+ onAccept,
79840
+ onReject
79841
+ }) => {
79842
+ const isDelete = operation === "delete";
79843
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `describo-ai-entity-diff-card ${isDelete ? "describo-ai-entity-diff-card-delete" : ""}`, children: [
79844
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-entity-diff-head", children: [
79845
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: isDelete ? `AI deleted entity: ${entityId}` : `AI edited entity: ${entityId}` }),
79846
+ onClose && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Hide entity diff", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79847
+ Button$1,
79848
+ {
79849
+ type: "text",
79850
+ size: "small",
79851
+ className: "describo-ai-entity-diff-close",
79852
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$A, {}),
79853
+ "aria-label": "Hide AI entity diff",
79854
+ onClick: (event) => {
79855
+ event.stopPropagation();
79856
+ onClose();
79857
+ }
79858
+ }
79859
+ ) })
79860
+ ] }),
79861
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-entity-diff-body", children: rows.map((row, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
79862
+ "div",
79863
+ {
79864
+ className: `describo-ai-entity-diff-line describo-ai-entity-diff-line-${row.kind}`,
79865
+ children: [
79866
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-entity-diff-marker", children: row.kind === "removed" ? "-" : row.kind === "added" ? "+" : "" }),
79867
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-entity-diff-key", children: row.label }),
79868
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-entity-diff-value", children: formatEntityDiffValue(row.value) })
79869
+ ]
79870
+ },
79871
+ `${row.kind}-${row.propertyName}-${index2}`
79872
+ )) }),
79873
+ !readonly && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-entity-diff-actions", children: [
79874
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: isDelete ? "Approve this AI deletion" : "Accept every AI edit for this entity", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79875
+ Button$1,
79876
+ {
79877
+ size: "middle",
79878
+ className: "describo-ai-entity-diff-button",
79879
+ onClick: (event) => {
79880
+ event.stopPropagation();
79881
+ onAccept == null ? void 0 : onAccept();
79882
+ },
79883
+ children: isDelete ? "Delete entity" : "Accept edit"
79884
+ }
79885
+ ) }),
79886
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: isDelete ? "Restore this entity and mark the deletion reviewed" : "Restore previous values for this entity", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79887
+ Button$1,
79888
+ {
79889
+ size: "middle",
79890
+ className: "describo-ai-entity-diff-button describo-ai-entity-diff-button-reject",
79891
+ onClick: (event) => {
79892
+ event.stopPropagation();
79893
+ onReject == null ? void 0 : onReject();
79894
+ },
79895
+ children: isDelete ? "Keep entity" : "Reject edit"
79896
+ }
79897
+ ) })
79898
+ ] })
79899
+ ] });
79900
+ };
79901
+ /*!
79902
+ * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
79903
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
79904
+ * Copyright 2024 Fonticons, Inc.
79905
+ */
79906
+ const faJs = {
79907
+ prefix: "fab",
79908
+ iconName: "js",
79909
+ icon: [448, 512, [], "f3b8", "M0 32v448h448V32H0zm243.8 349.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z"]
79910
+ };
79911
+ const typeIcons = {
79912
+ Book: faBookOpen,
79913
+ ContactPoint: faAddressCard,
79914
+ ComputerLanguage: faJs,
79915
+ CreateAction: faPlus,
79916
+ CreativeWork: faImage,
79917
+ Country: faFlag,
79918
+ Dataset: faFolder,
79919
+ DataDownload: faDownload,
79920
+ DerivedMaterial: faDownload,
79921
+ File: faFile,
79922
+ GeoCoordinates: faMapMarkerAlt,
79923
+ GeoShape: faMapMarkerAlt,
79924
+ IndividualProduct: faBarcode,
79925
+ Language: faSignLanguage,
79926
+ Organization: faUniversity,
79927
+ Organisation: faUniversity,
79928
+ Person: faUser,
79929
+ Place: faGlobe,
79930
+ PropertyValue: faParagraph,
79931
+ Publication: faNewspaper,
79932
+ RepositoryCollection: faCubes,
79933
+ RepositoryObject: faCube,
79934
+ ScholarlyArticle: faScroll,
79935
+ Script: faCode,
79936
+ SoftwareApplication: faCode,
79937
+ URL: faLink,
79938
+ Workflow: faProjectDiagram,
79939
+ WorkflowSketch: faProjectDiagram
79940
+ };
79941
+ const RenderTypes = ({ types: types2 }) => {
79942
+ const profileManager = useContext(ProfileManagerContext);
79943
+ const getTypeLabelFromProfile = (type4) => {
79944
+ return (profileManager == null ? void 0 : profileManager.getTypeLabel(type4)) || type4;
79945
+ };
79946
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row space-x-1", children: types2.map((etype, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
79947
+ Tag$1,
79948
+ {
79949
+ className: "text-gray-800 font-light flex flex-row items-center space-x-1",
79950
+ style: {
79951
+ backgroundColor: "#f0f0f0",
79952
+ borderRadius: "16px",
79953
+ padding: "0 12px",
79954
+ height: "32px",
79955
+ display: "flex",
79956
+ alignItems: "center",
79957
+ margin: "4px"
79958
+ },
79959
+ children: [
79960
+ typeIcons[etype] && /* @__PURE__ */ jsxRuntimeExports.jsx(
79961
+ FontAwesomeIcon,
79962
+ {
79963
+ icon: typeIcons[etype],
79964
+ fixedWidth: true
79965
+ }
79966
+ ),
79967
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: getTypeLabelFromProfile(etype) })
79968
+ ]
79969
+ },
79970
+ idx
79971
+ )) });
79972
+ };
79973
+ const LinkedEntityCardHeader = ({ entity }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 w-full flex-col", children: [
79974
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
79975
+ Typography.Text,
79976
+ {
79977
+ type: "secondary",
79978
+ style: { fontSize: "0.75rem" },
79979
+ className: "pb-1 mb-1 border-b border-black/20",
79980
+ children: decodeURIComponent(entity["@id"])
79981
+ }
79982
+ ),
79983
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row space-x-2 items-center", children: [
79984
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-base flex flex-row space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderTypes, { types: entity["@type"] }) }),
79985
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { strong: true, children: entity.name })
79986
+ ] })
79987
+ ] });
79988
+ const DeletedLinkedEntityCard = ({
79989
+ entity,
79990
+ displayEntity,
79991
+ fieldCount,
79992
+ fields,
79993
+ readonly,
79994
+ onLoadEntity,
79995
+ onAcceptDelete,
79996
+ onRestore
79997
+ }) => {
79998
+ const [showDeletedFields, setShowDeletedFields] = useState(false);
79999
+ const deletedDiffRows = fields.map((field) => ({
80000
+ kind: "removed",
80001
+ propertyName: field.propertyName,
80002
+ label: field.label,
80003
+ value: field.previousValue
80004
+ }));
80005
+ if (showDeletedFields) {
80006
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
80007
+ AiEntityDiffView,
80008
+ {
80009
+ entityId: entity["@id"],
80010
+ rows: deletedDiffRows,
80011
+ operation: "delete",
80012
+ readonly,
80013
+ onClose: () => setShowDeletedFields(false),
80014
+ onAccept: () => onAcceptDelete == null ? void 0 : onAcceptDelete(entity),
80015
+ onReject: () => onRestore == null ? void 0 : onRestore(entity)
80016
+ }
80017
+ );
80018
+ }
80019
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
80020
+ Card,
80021
+ {
80022
+ className: "describo-ai-entity-delete-card describo-ai-entity-reviewed-card",
80023
+ style: {
80024
+ backgroundColor: "#fef2f2",
80025
+ cursor: "pointer",
80026
+ transition: "background-color 0.2s",
80027
+ borderLeft: "3px solid #ef4444"
80028
+ },
80029
+ styles: { body: { padding: "22px 12px 8px" } },
80030
+ hoverable: true,
80031
+ onClick: () => onLoadEntity({ id: entity["@id"] }),
80032
+ children: [
80033
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-suggestion-badge describo-ai-entity-status-badge", children: [
80034
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-suggestion-badge-icon", children: "✦" }),
80035
+ "AI delete"
80036
+ ] }),
80037
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LinkedEntityCardHeader, { entity: displayEntity }),
80038
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-deleted-entity-controls", children: [
80039
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-deleted-entity-summary", children: [
80040
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
80041
+ fieldCount,
80042
+ " fields can be restored."
80043
+ ] }),
80044
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showDeletedFields ? "Hide deleted fields" : "Show deleted fields", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
80045
+ Button$1,
80046
+ {
80047
+ size: "small",
80048
+ className: "describo-ai-entity-delete-details-toggle",
80049
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$7, {}),
80050
+ "aria-label": showDeletedFields ? "Hide deleted AI fields" : "Show deleted AI fields",
80051
+ "aria-pressed": showDeletedFields,
80052
+ onClick: (event) => {
80053
+ event.stopPropagation();
80054
+ setShowDeletedFields((visible) => !visible);
80055
+ }
80056
+ }
80057
+ ) })
80058
+ ] }),
80059
+ !readonly && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-actions", children: [
80060
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Approve this AI deletion", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
80061
+ Button$1,
80062
+ {
80063
+ size: "small",
80064
+ className: "describo-ai-action-approve",
80065
+ onClick: (event) => {
80066
+ event.stopPropagation();
80067
+ onAcceptDelete == null ? void 0 : onAcceptDelete(entity);
80068
+ },
80069
+ children: "Delete"
80070
+ }
80071
+ ) }),
80072
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Restore this entity and mark the deletion reviewed", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
80073
+ Button$1,
80074
+ {
80075
+ size: "small",
80076
+ className: "describo-ai-action-reject",
80077
+ onClick: (event) => {
80078
+ event.stopPropagation();
80079
+ onRestore == null ? void 0 : onRestore(entity);
80080
+ },
80081
+ children: "Restore"
80082
+ }
80083
+ ) })
80084
+ ] })
80085
+ ] })
80086
+ ]
80087
+ }
80088
+ );
80089
+ };
80090
+ const LinkedEntityAssociations = ({
80091
+ associations,
80092
+ onLoadEntity
80093
+ }) => {
80094
+ if (!associations.length) return null;
80095
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "mt-2 flex-col space-y-2 border-l-2 pl-1 border-solid border-slate-700", children: associations.map((association) => /* @__PURE__ */ jsxRuntimeExports.jsx(
80096
+ Flex,
80097
+ {
80098
+ onClick: () => onLoadEntity({ id: association["@id"] }),
80099
+ className: "cursor-pointer",
80100
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "flex-row text-base border-solid border-black", children: [
80101
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "bg-slate-700 w-3 h-3 rounded-lg -4 mt-4" }),
80102
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "bg-slate-700 w-6 h-1 mt-5 -mx-1" }),
80103
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "bg-purple-200 hover:bg-cyan-200 flex flex-row p-2 rounded space-x-2", children: [
80104
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: association.property }),
80105
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$a, {}) }),
80106
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "flex-row space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: association.name || association["@id"] }) })
80107
+ ] })
80108
+ ] })
80109
+ },
80110
+ association["@id"]
80111
+ )) });
80112
+ };
80113
+ const AiEntityReviewSummary = ({
80114
+ fieldCount,
80115
+ onReview,
80116
+ onDiff
80117
+ }) => {
80118
+ if (fieldCount <= 0) return null;
80119
+ const fieldLabel = fieldCount === 1 ? "field" : "fields";
80120
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-entity-review-summary", children: [
80121
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-entity-review-meta", children: [
80122
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "describo-ai-entity-review-count", children: [
80123
+ fieldCount,
80124
+ " ",
80125
+ fieldLabel,
80126
+ " to review"
80127
+ ] }),
80128
+ onDiff && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Show entity diff", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
80129
+ Button$1,
80130
+ {
80131
+ className: "describo-ai-entity-diff-toggle",
80132
+ size: "small",
80133
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$7, {}),
80134
+ "aria-label": "Show AI entity diff",
80135
+ onClick: (event) => {
80136
+ event.stopPropagation();
80137
+ onDiff();
80138
+ }
80139
+ }
80140
+ ) })
80141
+ ] }),
80142
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
80143
+ Button$1,
80144
+ {
80145
+ className: "describo-ai-entity-review-button",
80146
+ size: "small",
80147
+ onClick: (event) => {
80148
+ event.stopPropagation();
80149
+ onReview();
80150
+ },
80151
+ children: "Review entity"
80152
+ }
80153
+ )
80154
+ ] });
80155
+ };
80156
+ const LinkedEntityCard = ({
80157
+ entity,
80158
+ displayEntity,
80159
+ hasPendingAiReview,
80160
+ hasAiTouchedEntity,
80161
+ pendingAiReviewFieldCount,
80162
+ readonly,
80163
+ onLoadEntity,
80164
+ onUnlinkEntity,
80165
+ onShowEntityDiff
80166
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
80167
+ Card,
80168
+ {
80169
+ className: `${hasPendingAiReview ? "describo-ai-entity-review-card" : ""} ${hasAiTouchedEntity ? "describo-ai-entity-reviewed-card" : ""}`,
80170
+ style: {
80171
+ backgroundColor: hasPendingAiReview ? "#e6f8ef" : "#e6f0ff",
80172
+ cursor: "pointer",
80173
+ transition: "background-color 0.2s",
80174
+ borderLeft: hasPendingAiReview ? "3px solid #38c88a" : "3px solid #409eff"
80175
+ },
80176
+ styles: { body: { padding: hasPendingAiReview ? "22px 12px 8px" : "8px 12px" } },
80177
+ hoverable: true,
80178
+ onClick: () => onLoadEntity({ id: entity["@id"] }),
80179
+ children: [
80180
+ hasPendingAiReview && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-suggestion-badge describo-ai-entity-status-badge", children: [
80181
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-suggestion-badge-icon", children: "✦" }),
80182
+ "AI suggestion"
80183
+ ] }),
80184
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "space-between", align: "middle", gap: 8, children: [
80185
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LinkedEntityCardHeader, { entity: displayEntity }),
80186
+ !readonly && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(UnlinkEntity, { entity, onUnlinkEntity }) })
80187
+ ] }),
80188
+ hasAiTouchedEntity && !hasPendingAiReview && /* @__PURE__ */ jsxRuntimeExports.jsx(
80189
+ AiEditedFieldBadge,
80190
+ {
80191
+ className: "describo-ai-entity-edited-badge",
80192
+ title: "Entity was added by AI",
80193
+ ariaLabel: "Entity was added by AI"
80194
+ }
80195
+ ),
80196
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
80197
+ AiEntityReviewSummary,
80198
+ {
80199
+ fieldCount: hasPendingAiReview ? pendingAiReviewFieldCount : 0,
80200
+ onReview: () => onLoadEntity({ id: entity["@id"] }),
80201
+ onDiff: hasPendingAiReview ? onShowEntityDiff : void 0
80202
+ }
80203
+ )
80204
+ ]
80205
+ }
80206
+ );
80207
+ const approvalIsApproved = (approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.approved) === true || (approvalRecord == null ? void 0 : approvalRecord.approved) === "true";
80208
+ const getApprovalEntities = (approvalData) => {
80209
+ if (!approvalData) return [];
80210
+ if (Array.isArray(approvalData)) return approvalData;
80211
+ if (Array.isArray(approvalData.items)) return approvalData.items;
80212
+ if (Array.isArray(approvalData.approval)) return [approvalData];
80213
+ return [];
80214
+ };
80215
+ const hasUrlScheme = (id2) => /^[a-z][a-z0-9+.-]*:\/\//i.test(id2);
80216
+ const stripLocalEntityIdPrefix = (id2) => {
80217
+ if (id2.startsWith("file://./")) return id2.slice("file://./".length);
80218
+ if (id2.startsWith("./")) return id2.slice("./".length);
80219
+ if (id2.startsWith("/")) return id2.slice(1);
80220
+ return id2;
80221
+ };
80222
+ const getEntityIdAliases = (id2) => {
80223
+ if (!id2) return [];
80224
+ const aliases = /* @__PURE__ */ new Set([id2]);
80225
+ const decodedId = decodeURI(id2);
80226
+ aliases.add(decodedId);
80227
+ const isLocalFileUrl = decodedId.startsWith("file://./");
80228
+ const isLocalPath = !hasUrlScheme(decodedId) || isLocalFileUrl;
80229
+ if (decodedId !== "./" && isLocalPath) {
80230
+ const localPath = stripLocalEntityIdPrefix(decodedId);
80231
+ if (localPath) {
80232
+ aliases.add(localPath);
80233
+ aliases.add(`./${localPath}`);
80234
+ aliases.add(`file://./${localPath}`);
80235
+ }
80236
+ }
80237
+ return Array.from(aliases);
80238
+ };
80239
+ const entityIdsMatch = (left, right) => {
80240
+ if (!left || !right) return false;
80241
+ const rightAliases = new Set(getEntityIdAliases(right));
80242
+ return getEntityIdAliases(left).some((alias) => rightAliases.has(alias));
80243
+ };
80244
+ const isPendingEntityDeleteApproval = (entityApproval) => {
80245
+ const approvalRecords = entityApproval == null ? void 0 : entityApproval.approval;
80246
+ if (!Array.isArray(approvalRecords) || approvalRecords.length === 0) return false;
80247
+ return approvalRecords.every((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.operation) === "delete") && approvalRecords.some((approvalRecord) => !approvalIsApproved(approvalRecord));
80248
+ };
80249
+ const getDeletedEntityFromApproval = (entityApproval) => {
80250
+ if (!(entityApproval == null ? void 0 : entityApproval["@id"]) || !isPendingEntityDeleteApproval(entityApproval)) return void 0;
80251
+ const deletedEntity = entityApproval.approval.reduce((entity, approvalRecord) => {
80252
+ const propertyName2 = approvalRecord == null ? void 0 : approvalRecord.propertyName;
80253
+ if (!propertyName2 || (approvalRecord == null ? void 0 : approvalRecord.operation) !== "delete") return entity;
80254
+ if (!propertyValueHasContent(approvalRecord.previousValue)) return entity;
80255
+ if (propertyName2 === "@id") {
80256
+ entity["@id"] = approvalRecord.previousValue;
80257
+ } else if (propertyName2 === "@type") {
80258
+ entity["@type"] = [].concat(approvalRecord.previousValue);
80259
+ } else {
80260
+ entity[propertyName2] = approvalRecord.previousValue;
80261
+ }
80262
+ return entity;
80263
+ }, {
80264
+ "@id": entityApproval["@id"],
80265
+ "@type": ["Thing"],
80266
+ name: entityApproval["@id"],
80267
+ __aiDeletedEntity: true
80268
+ });
80269
+ if (!propertyValueHasContent(deletedEntity.name)) {
80270
+ deletedEntity.name = deletedEntity["@id"];
80271
+ }
80272
+ return deletedEntity;
80273
+ };
80274
+ const getPendingDeletedEntitiesForReverseProperty = (approvalData, sourceEntityId, property) => {
80275
+ if (!sourceEntityId || !property) return [];
80276
+ return getApprovalEntities(approvalData).map(getDeletedEntityFromApproval).filter(Boolean).filter((deletedEntity) => {
80277
+ var _a2;
80278
+ const reverseValue = (_a2 = deletedEntity == null ? void 0 : deletedEntity["@reverse"]) == null ? void 0 : _a2[property];
80279
+ if (!reverseValue) return false;
80280
+ return [].concat(reverseValue).some((sourceRef) => entityIdsMatch(sourceRef == null ? void 0 : sourceRef["@id"], sourceEntityId));
80281
+ });
80282
+ };
80283
+ const getDeletedEntityReviewTarget = (entityApproval) => {
80284
+ const deletedEntity = getDeletedEntityFromApproval(entityApproval);
80285
+ const reverse = deletedEntity == null ? void 0 : deletedEntity["@reverse"];
80286
+ if (!reverse || typeof reverse !== "object") return void 0;
80287
+ for (const [property, sourceRefs] of Object.entries(reverse)) {
80288
+ const sourceRef = [].concat(sourceRefs).find((ref) => typeof (ref == null ? void 0 : ref["@id"]) === "string" && ref["@id"].length > 0);
80289
+ if (sourceRef == null ? void 0 : sourceRef["@id"]) {
80290
+ return {
80291
+ entityId: sourceRef["@id"],
80292
+ property
80293
+ };
80294
+ }
80295
+ }
80296
+ return void 0;
80297
+ };
80298
+ const getPendingDeletedEntityReversePropertiesForSource = (approvalData, sourceEntityId) => {
80299
+ if (!sourceEntityId) return [];
80300
+ return Array.from(new Set(
80301
+ getApprovalEntities(approvalData).map(getDeletedEntityFromApproval).filter(Boolean).flatMap((deletedEntity) => Object.entries((deletedEntity == null ? void 0 : deletedEntity["@reverse"]) ?? {}).filter(([, sourceRefs]) => [].concat(sourceRefs).some((sourceRef) => entityIdsMatch(sourceRef == null ? void 0 : sourceRef["@id"], sourceEntityId))).map(([property]) => property))
80302
+ ));
80303
+ };
80304
+ const getEntityApproval = (approvalData, entityId) => {
80305
+ if (!entityId) return void 0;
80306
+ return getApprovalEntities(approvalData).find((item) => entityIdsMatch(item == null ? void 0 : item["@id"], entityId));
80307
+ };
80308
+ const getEntityApprovalRecords = (approvalData, entityId, property) => {
80309
+ if (!entityId || !property) return [];
80310
+ const entityApproval = getEntityApproval(approvalData, entityId);
80311
+ if (!Array.isArray(entityApproval == null ? void 0 : entityApproval.approval)) return [];
80312
+ return entityApproval.approval.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) === property);
80313
+ };
80314
+ const getPendingEntityApprovalRecords = (approvalData, entityId) => {
80315
+ const entityApproval = getEntityApproval(approvalData, entityId);
80316
+ if (!Array.isArray(entityApproval == null ? void 0 : entityApproval.approval)) return [];
80317
+ const approvedPropertyNames = new Set(
80318
+ entityApproval.approval.filter(approvalIsApproved).map((approvalRecord) => approvalRecord == null ? void 0 : approvalRecord.propertyName).filter((propertyName2) => typeof propertyName2 === "string" && propertyName2.length > 0)
80319
+ );
80320
+ return entityApproval.approval.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) && !approvalIsApproved(approvalRecord) && !approvedPropertyNames.has(approvalRecord.propertyName));
80321
+ };
80322
+ const getPendingEntityApprovalFieldCount = (approvalData, entityId) => new Set(
80323
+ getPendingEntityApprovalRecords(approvalData, entityId).map((approvalRecord) => approvalRecord == null ? void 0 : approvalRecord.propertyName).filter((propertyName2) => typeof propertyName2 === "string" && propertyName2.length > 0)
80324
+ ).size;
80325
+ const getPendingApprovalEntities = (approvalData) => getApprovalEntities(approvalData).filter((entityApproval) => getPendingEntityApprovalRecords(approvalData, entityApproval == null ? void 0 : entityApproval["@id"]).length > 0);
80326
+ const getPendingApprovalFieldCount = (approvalData, excludedEntityId) => getPendingApprovalEntities(approvalData).reduce((count, entityApproval) => {
80327
+ const entityId = entityApproval == null ? void 0 : entityApproval["@id"];
80328
+ if (excludedEntityId && entityIdsMatch(entityId, excludedEntityId)) return count;
80329
+ return count + getPendingEntityApprovalFieldCount(approvalData, entityId);
80330
+ }, 0);
80331
+ const getApprovedEntityApprovalRecords = (approvalData, entityId) => {
80332
+ const entityApproval = getEntityApproval(approvalData, entityId);
80333
+ if (!Array.isArray(entityApproval == null ? void 0 : entityApproval.approval)) return [];
80334
+ return entityApproval.approval.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) && approvalIsApproved(approvalRecord));
80335
+ };
80336
+ const getApprovedEntityApprovalFieldCount = (approvalData, entityId) => new Set(
80337
+ getApprovedEntityApprovalRecords(approvalData, entityId).map((approvalRecord) => approvalRecord == null ? void 0 : approvalRecord.propertyName).filter((propertyName2) => typeof propertyName2 === "string" && propertyName2.length > 0)
80338
+ ).size;
80339
+ const normaliseComparableValue = (value) => {
80340
+ if (Array.isArray(value)) {
80341
+ return value.map(normaliseComparableValue);
80342
+ }
80343
+ if (lodashExports.isPlainObject(value)) {
80344
+ return Object.keys(value).sort().reduce((acc, key) => {
80345
+ acc[key] = normaliseComparableValue(value[key]);
80346
+ return acc;
80347
+ }, {});
80348
+ }
80349
+ return value;
80350
+ };
80351
+ const valuesAreEqual = (left, right) => JSON.stringify(normaliseComparableValue(left)) === JSON.stringify(normaliseComparableValue(right));
80352
+ const propertyValueHasContent = (value) => {
80353
+ if (Array.isArray(value)) {
80354
+ return value.some(propertyValueHasContent);
80355
+ }
80356
+ return value !== void 0 && value !== null;
80357
+ };
80358
+ const entityHasPropertyValue = (entity, property) => Object.prototype.hasOwnProperty.call(entity ?? {}, property) && propertyValueHasContent(entity == null ? void 0 : entity[property]);
79787
80359
  const RenderLinkedItem = ({
79788
80360
  entity,
79789
80361
  property,
79790
80362
  readonly,
79791
80363
  onLoadEntity,
79792
- onUnlinkEntity
80364
+ onUnlinkEntity,
80365
+ onAcceptAiEntityDelete,
80366
+ onRestoreAiDeletedEntity,
80367
+ onAcceptAiEntityEdit,
80368
+ onRejectAiEntityEdit
79793
80369
  }) => {
79794
- var _a2, _b;
80370
+ var _a2, _b, _c, _d;
79795
80371
  const state = useStateStore();
79796
80372
  const crateManager = useContext(CrateManagerContext);
79797
80373
  const profileManager = useContext(ProfileManagerContext);
80374
+ const approvalContext = useContext(RoCrateApprovalContext);
79798
80375
  const [associations, setAssociations] = useState([]);
80376
+ const [showAiEntityDiff, setShowAiEntityDiff] = useState(false);
79799
80377
  const effectiveEntity = useMemo$1(() => {
79800
80378
  const hasTypes = Boolean(entity == null ? void 0 : entity["@type"]);
79801
80379
  const hasName = Boolean(entity == null ? void 0 : entity.name);
@@ -79875,6 +80453,90 @@ const RenderLinkedItem = ({
79875
80453
  name: (effectiveEntity == null ? void 0 : effectiveEntity.name) || entity["@id"]
79876
80454
  };
79877
80455
  }, [effectiveEntity, entity]);
80456
+ const pendingAiReviewFieldCount = useMemo$1(() => getPendingEntityApprovalFieldCount(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"]), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity]);
80457
+ const isPendingAiEntityDelete = useMemo$1(() => Boolean((entity == null ? void 0 : entity.__aiDeletedEntity) && isPendingEntityDeleteApproval(
80458
+ getEntityApproval(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"])
80459
+ )), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity]);
80460
+ const visiblePendingAiReviewFieldCount = useMemo$1(() => {
80461
+ if (!isPendingAiEntityDelete) return pendingAiReviewFieldCount;
80462
+ return getPendingEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"]).filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) !== "@reverse").length;
80463
+ }, [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity, isPendingAiEntityDelete, pendingAiReviewFieldCount]);
80464
+ const deletedEntityFieldRows = useMemo$1(() => {
80465
+ if (!isPendingAiEntityDelete) return [];
80466
+ return getPendingEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"]).filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.operation) === "delete" && (approvalRecord == null ? void 0 : approvalRecord.propertyName) && approvalRecord.propertyName !== "@reverse");
80467
+ }, [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity, isPendingAiEntityDelete]);
80468
+ const getDeletedFieldLabel = (fieldName) => {
80469
+ var _a3, _b2;
80470
+ if (fieldName === "name") return "Name";
80471
+ if (fieldName === "@type") return "@type";
80472
+ return ((_b2 = (_a3 = profileManager == null ? void 0 : profileManager.getPropertyDefinition({
80473
+ property: fieldName,
80474
+ entity: effectiveEntity
80475
+ })) == null ? void 0 : _a3.propertyDefinition) == null ? void 0 : _b2.label) || fieldName;
80476
+ };
80477
+ const deletedEntityFields = useMemo$1(() => deletedEntityFieldRows.map((approvalRecord) => ({
80478
+ label: getDeletedFieldLabel(approvalRecord.propertyName),
80479
+ propertyName: approvalRecord.propertyName,
80480
+ previousValue: approvalRecord.previousValue
80481
+ })), [deletedEntityFieldRows, effectiveEntity, profileManager]);
80482
+ const reviewedAiEditFieldCount = useMemo$1(() => getApprovedEntityApprovalFieldCount(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"]), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity]);
80483
+ const hasReviewedAiEdits = reviewedAiEditFieldCount > 0;
80484
+ const hasPendingAiReview = pendingAiReviewFieldCount > 0 && !hasReviewedAiEdits;
80485
+ const hasAiTouchedEntity = hasPendingAiReview || hasReviewedAiEdits;
80486
+ const getEntityDiffLabel = (fieldName) => {
80487
+ var _a3, _b2;
80488
+ if (fieldName === "@id") return "@id";
80489
+ if (fieldName === "@type") return "type";
80490
+ if (fieldName === "name") return "name";
80491
+ return ((_b2 = (_a3 = profileManager == null ? void 0 : profileManager.getPropertyDefinition({
80492
+ property: fieldName,
80493
+ entity: effectiveEntity
80494
+ })) == null ? void 0 : _a3.propertyDefinition) == null ? void 0 : _b2.label) || fieldName;
80495
+ };
80496
+ const pendingAiEntityDiffRecords = useMemo$1(() => getPendingEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"]).filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) !== "@reverse"), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity]);
80497
+ const aiEntityDiffRows = useMemo$1(() => {
80498
+ const contextRows = [
80499
+ {
80500
+ kind: "context",
80501
+ propertyName: "@id",
80502
+ label: "@id",
80503
+ value: entity["@id"]
80504
+ }
80505
+ ];
80506
+ if (effectiveEntity == null ? void 0 : effectiveEntity["@type"]) {
80507
+ contextRows.push({
80508
+ kind: "context",
80509
+ propertyName: "@type",
80510
+ label: "type",
80511
+ value: effectiveEntity["@type"]
80512
+ });
80513
+ }
80514
+ const changedRows = pendingAiEntityDiffRecords.flatMap((approvalRecord) => {
80515
+ const propertyName2 = approvalRecord == null ? void 0 : approvalRecord.propertyName;
80516
+ if (!propertyName2) return [];
80517
+ const label = getEntityDiffLabel(propertyName2);
80518
+ const currentValue = propertyName2 === "@id" ? entity["@id"] : effectiveEntity == null ? void 0 : effectiveEntity[propertyName2];
80519
+ const rows = [];
80520
+ if ((approvalRecord == null ? void 0 : approvalRecord.operation) !== "add") {
80521
+ rows.push({
80522
+ kind: "removed",
80523
+ propertyName: propertyName2,
80524
+ label,
80525
+ value: approvalRecord == null ? void 0 : approvalRecord.previousValue
80526
+ });
80527
+ }
80528
+ if ((approvalRecord == null ? void 0 : approvalRecord.operation) !== "delete") {
80529
+ rows.push({
80530
+ kind: "added",
80531
+ propertyName: propertyName2,
80532
+ label,
80533
+ value: currentValue
80534
+ });
80535
+ }
80536
+ return rows;
80537
+ });
80538
+ return [...contextRows, ...changedRows];
80539
+ }, [effectiveEntity, entity, pendingAiEntityDiffRecords, profileManager]);
79878
80540
  if (showMap) {
79879
80541
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "describo-render-item-link py-1 rounded bg-blue-200 hover:text-black hover:bg-blue-300 hover:rounded-r-none", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { vertical: true, className: "space-y-2", children: [
79880
80542
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "p-2", children: [
@@ -79892,47 +80554,49 @@ const RenderLinkedItem = ({
79892
80554
  className: "h-full min-w-0 flex-1",
79893
80555
  style: { margin: (associations == null ? void 0 : associations.length) ? 8 : 0 },
79894
80556
  children: [
79895
- /* @__PURE__ */ jsxRuntimeExports.jsx(
79896
- Card,
80557
+ showAiEntityDiff && hasPendingAiReview ? /* @__PURE__ */ jsxRuntimeExports.jsx(
80558
+ AiEntityDiffView,
79897
80559
  {
79898
- className: "h-full",
79899
- style: {
79900
- backgroundColor: "#e6f0ff",
79901
- cursor: "pointer",
79902
- transition: "background-color 0.2s",
79903
- borderLeft: "3px solid #409eff"
79904
- },
79905
- styles: { body: { padding: "8px 12px" } },
79906
- hoverable: true,
79907
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "space-between", align: "middle", gap: 8, children: [
79908
- /* @__PURE__ */ jsxRuntimeExports.jsx(
79909
- ItemLink,
79910
- {
79911
- entity: linkDisplayEntity,
79912
- onLoadEntity: handleLoadEntity
79913
- }
79914
- ),
79915
- !((_b = state.configuration) == null ? void 0 : _b.readonly) && !readonly && /* @__PURE__ */ jsxRuntimeExports.jsx(UnlinkEntity, { entity, onUnlinkEntity: handleUnlinkEntity })
79916
- ] })
80560
+ entityId: entity["@id"],
80561
+ rows: aiEntityDiffRows,
80562
+ readonly: Boolean(((_b = state.configuration) == null ? void 0 : _b.readonly) || readonly),
80563
+ onClose: () => setShowAiEntityDiff(false),
80564
+ onAccept: () => onAcceptAiEntityEdit == null ? void 0 : onAcceptAiEntityEdit(effectiveEntity),
80565
+ onReject: () => onRejectAiEntityEdit == null ? void 0 : onRejectAiEntityEdit(effectiveEntity)
80566
+ }
80567
+ ) : isPendingAiEntityDelete ? /* @__PURE__ */ jsxRuntimeExports.jsx(
80568
+ DeletedLinkedEntityCard,
80569
+ {
80570
+ entity,
80571
+ displayEntity: linkDisplayEntity,
80572
+ fieldCount: visiblePendingAiReviewFieldCount,
80573
+ fields: deletedEntityFields,
80574
+ readonly: Boolean((_c = state.configuration) == null ? void 0 : _c.readonly),
80575
+ onLoadEntity: handleLoadEntity,
80576
+ onAcceptDelete: onAcceptAiEntityDelete,
80577
+ onRestore: onRestoreAiDeletedEntity
80578
+ }
80579
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
80580
+ LinkedEntityCard,
80581
+ {
80582
+ entity,
80583
+ displayEntity: linkDisplayEntity,
80584
+ hasPendingAiReview,
80585
+ hasAiTouchedEntity,
80586
+ pendingAiReviewFieldCount,
80587
+ readonly: Boolean(((_d = state.configuration) == null ? void 0 : _d.readonly) || readonly),
80588
+ onLoadEntity: handleLoadEntity,
80589
+ onUnlinkEntity: handleUnlinkEntity,
80590
+ onShowEntityDiff: () => setShowAiEntityDiff(true)
79917
80591
  }
79918
80592
  ),
79919
- (associations == null ? void 0 : associations.length) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "mt-2 flex-col space-y-2 border-l-2 pl-1 border-solid border-slate-700", children: associations.map((association) => /* @__PURE__ */ jsxRuntimeExports.jsx(
79920
- Flex,
80593
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
80594
+ LinkedEntityAssociations,
79921
80595
  {
79922
- onClick: () => handleLoadEntity({ id: association["@id"] }),
79923
- className: "cursor-pointer",
79924
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "flex-row text-base border-solid border-black", children: [
79925
- /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "bg-slate-700 w-3 h-3 rounded-lg -4 mt-4" }),
79926
- /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "bg-slate-700 w-6 h-1 mt-5 -mx-1" }),
79927
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "bg-purple-200 hover:bg-cyan-200 flex flex-row p-2 rounded space-x-2", children: [
79928
- /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: association.property }),
79929
- /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$9, {}) }),
79930
- /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "flex-row space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: association.name || association["@id"] }) })
79931
- ] })
79932
- ] })
79933
- },
79934
- association["@id"]
79935
- )) })
80596
+ associations,
80597
+ onLoadEntity: handleLoadEntity
80598
+ }
80599
+ )
79936
80600
  ]
79937
80601
  }
79938
80602
  ) });
@@ -79944,7 +80608,11 @@ const PaginateLinkedEntities = ({
79944
80608
  className = "",
79945
80609
  onLoadEntity,
79946
80610
  onUnlinkEntity,
79947
- onPageChange
80611
+ onPageChange,
80612
+ onAcceptAiEntityDelete,
80613
+ onRestoreAiDeletedEntity,
80614
+ onAcceptAiEntityEdit,
80615
+ onRejectAiEntityEdit
79948
80616
  }) => {
79949
80617
  var _a2, _b;
79950
80618
  const { t: t2 } = useTranslation();
@@ -80026,14 +80694,18 @@ const PaginateLinkedEntities = ({
80026
80694
  ),
80027
80695
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { type: "primary", onClick: filterAndChunkEntitiesForDisplay, children: t2("search") || "Search" })
80028
80696
  ] }) }) }),
80029
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row flex-wrap pt-2", style: { gap: 8 }, children: displayEntities.map((entity) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-72 flex-[1_1_360px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
80697
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row flex-wrap items-start pt-2", style: { gap: 8 }, children: displayEntities.map((entity) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-72 flex-[1_1_360px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
80030
80698
  RenderLinkedItem,
80031
80699
  {
80032
80700
  entity: entity.value,
80033
80701
  property,
80034
80702
  readonly,
80035
80703
  onLoadEntity,
80036
- onUnlinkEntity
80704
+ onUnlinkEntity,
80705
+ onAcceptAiEntityDelete,
80706
+ onRestoreAiDeletedEntity,
80707
+ onAcceptAiEntityEdit,
80708
+ onRejectAiEntityEdit
80037
80709
  }
80038
80710
  ) }, entity.value["@id"])) }),
80039
80711
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row justify-center pt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -80067,7 +80739,7 @@ const DeleteProperty = ({
80067
80739
  variant: "solid",
80068
80740
  color: "red",
80069
80741
  className: "describo-delete-property",
80070
- icon: type4 === "delete" ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$f, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$3, {})
80742
+ icon: type4 === "delete" ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$g, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$3, {})
80071
80743
  }
80072
80744
  );
80073
80745
  };
@@ -80112,7 +80784,7 @@ const AddControl = ({
80112
80784
  type: "primary",
80113
80785
  size: "middle",
80114
80786
  className: "focus:outline-none focus:border-2 focus:border-green-600",
80115
- icon: !selectedType || selectedType !== type4 ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$p, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$z, {}),
80787
+ icon: !selectedType || selectedType !== type4 ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$A, {}),
80116
80788
  children: [
80117
80789
  " ",
80118
80790
  getTypeLabelFromProfile(type4)
@@ -80126,7 +80798,7 @@ const AddControl = ({
80126
80798
  type: "primary",
80127
80799
  size: "middle",
80128
80800
  className: "focus:outline-none focus:border-2 focus:border-green-600",
80129
- icon: !selectedType || selectedType !== "bulkAdd" ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$1, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$z, {}),
80801
+ icon: !selectedType || selectedType !== "bulkAdd" ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$1, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$A, {}),
80130
80802
  children: "  Bulk Add"
80131
80803
  }
80132
80804
  ) })
@@ -81274,7 +81946,7 @@ const AutoComplete = ({ type: type4, onLinkEntity, onCreateEntity }) => {
81274
81946
  variant: "solid",
81275
81947
  color: "green",
81276
81948
  block: true,
81277
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$p, {}),
81949
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}),
81278
81950
  children: [
81279
81951
  t2("create_new_of_type", { type: entity["@type"] }),
81280
81952
  ": ",
@@ -81411,7 +82083,7 @@ const BulkAdd = ({ types: types2, primitives, onCreateEntity }) => {
81411
82083
  variant: "solid",
81412
82084
  color: "red",
81413
82085
  onClick: () => deleteRow(idx),
81414
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$f, {})
82086
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$g, {})
81415
82087
  }
81416
82088
  )
81417
82089
  ] }) }, idx)),
@@ -81421,7 +82093,7 @@ const BulkAdd = ({ types: types2, primitives, onCreateEntity }) => {
81421
82093
  {
81422
82094
  type: "primary",
81423
82095
  onClick: addRow,
81424
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$p, {}),
82096
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}),
81425
82097
  children: "Add row"
81426
82098
  }
81427
82099
  ),
@@ -81658,10 +82330,14 @@ const Add = ({
81658
82330
  const DisplayPropertyName = ({
81659
82331
  property,
81660
82332
  label,
81661
- className = ""
82333
+ className = "",
81662
82334
  // Default to empty string
82335
+ aiEdited = false
81663
82336
  }) => {
81664
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `describo-property-name ${className}`, children: label || property });
82337
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `describo-property-name describo-property-name-with-ai ${className}`, children: [
82338
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: label || property }),
82339
+ aiEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(AiEditedFieldBadge, {})
82340
+ ] });
81665
82341
  };
81666
82342
  const EntityProperty = ({
81667
82343
  entity,
@@ -81670,20 +82346,27 @@ const EntityProperty = ({
81670
82346
  highlightRequired = false,
81671
82347
  savedProperty = false,
81672
82348
  showHelp = true,
82349
+ aiEdited = false,
81673
82350
  onLoadEntity,
81674
82351
  onCreateProperty,
81675
82352
  onCreateEntity,
81676
82353
  onLinkEntity,
81677
82354
  onSaveProperty,
81678
82355
  onDeleteProperty,
81679
- onUnlinkEntity
82356
+ onUnlinkEntity,
82357
+ onAcceptAiEntityDelete,
82358
+ onRestoreAiDeletedEntity,
82359
+ onAcceptAiEntityEdit,
82360
+ onRejectAiEntityEdit
81680
82361
  }) => {
81681
82362
  var _a2, _b;
81682
82363
  const { t: t2 } = useTranslation();
81683
82364
  const profileManager = useContext(ProfileManagerContext);
81684
82365
  const crateManager = useContext(CrateManagerContext);
82366
+ const approvalContext = useContext(RoCrateApprovalContext);
81685
82367
  const state = useStateStore();
81686
82368
  const propertyRef = useRef(null);
82369
+ const [showAiDiff, setShowAiDiff] = useState(false);
81687
82370
  const propertyDefinition = (_a2 = profileManager == null ? void 0 : profileManager.getPropertyDefinition({
81688
82371
  property,
81689
82372
  entity
@@ -81692,7 +82375,6 @@ const EntityProperty = ({
81692
82375
  const isRequired = propertyDefinition == null ? void 0 : propertyDefinition.required;
81693
82376
  const isNotValue = (propertyDefinition == null ? void 0 : propertyDefinition.type) !== "Value";
81694
82377
  const profileWarnMissingProperty = profileManager == null ? void 0 : profileManager.profile.warnMissingProperty;
81695
- const showAddControl = !(propertyDefinition == null ? void 0 : propertyDefinition.readonly) && ((propertyDefinition == null ? void 0 : propertyDefinition.multiple) || !(values == null ? void 0 : values.length));
81696
82378
  const simpleInstances = useMemo$1(() => {
81697
82379
  const simpleInsts = (propertyDefinition == null ? void 0 : propertyDefinition.handlesMultipleValues) === true ? values.length === 0 ? values : [values] : values;
81698
82380
  return simpleInsts.map((v2, i) => {
@@ -81711,6 +82393,29 @@ const EntityProperty = ({
81711
82393
  ["value.@id"]
81712
82394
  );
81713
82395
  }, [values]);
82396
+ const renderedLinkInstances = useMemo$1(() => {
82397
+ const deletedEntities = getPendingDeletedEntitiesForReverseProperty(
82398
+ approvalContext == null ? void 0 : approvalContext.roCrateApproval,
82399
+ entity == null ? void 0 : entity["@id"],
82400
+ property
82401
+ );
82402
+ if (!deletedEntities.length) return linkInstances;
82403
+ const linkedEntityIds = linkInstances.map((instance2) => {
82404
+ var _a3;
82405
+ return (_a3 = instance2.value) == null ? void 0 : _a3["@id"];
82406
+ }).filter((id2) => typeof id2 === "string" && id2.length > 0);
82407
+ const deletedLinkInstances = deletedEntities.filter((deletedEntity) => !linkedEntityIds.some((linkedEntityId) => entityIdsMatch(linkedEntityId, deletedEntity == null ? void 0 : deletedEntity["@id"]))).map((deletedEntity, idx) => ({
82408
+ idx: -1 - idx,
82409
+ value: deletedEntity
82410
+ }));
82411
+ return lodashExports.orderBy(
82412
+ [...linkInstances, ...deletedLinkInstances],
82413
+ [(instance2) => {
82414
+ var _a3;
82415
+ return ((_a3 = instance2.value) == null ? void 0 : _a3.__aiDeletedEntity) ? 0 : 1;
82416
+ }, "value.@id"]
82417
+ );
82418
+ }, [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity, linkInstances, property]);
81714
82419
  const scrollToPropertyTop = useCallback(() => {
81715
82420
  var _a3;
81716
82421
  (_a3 = propertyRef.current) == null ? void 0 : _a3.scrollIntoView({
@@ -81718,12 +82423,96 @@ const EntityProperty = ({
81718
82423
  behavior: "auto"
81719
82424
  });
81720
82425
  }, []);
82426
+ const approvalRecords = useMemo$1(() => getEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity == null ? void 0 : entity["@id"], property), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity, property]);
82427
+ const unapprovedApprovalRecord = approvalRecords.find((approvalRecord) => !approvalIsApproved(approvalRecord));
82428
+ const isAiDelete = (unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.operation) === "delete";
82429
+ const hasDeletedPreviousValue = isAiDelete && (unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue) !== void 0;
82430
+ const hasCurrentPropertyValue = entityHasPropertyValue(entity, property);
82431
+ const renderedSimpleInstances = useMemo$1(() => {
82432
+ if (isAiDelete && !hasCurrentPropertyValue && hasDeletedPreviousValue) {
82433
+ if (Array.isArray(unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue) && (propertyDefinition == null ? void 0 : propertyDefinition.handlesMultipleValues) !== true) {
82434
+ return unapprovedApprovalRecord.previousValue.map((value, idx) => ({ idx, value }));
82435
+ }
82436
+ return [{ idx: 0, value: unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue }];
82437
+ }
82438
+ if (simpleInstances.length > 0) return simpleInstances;
82439
+ if (!hasDeletedPreviousValue) return simpleInstances;
82440
+ if (Array.isArray(unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue) && (propertyDefinition == null ? void 0 : propertyDefinition.handlesMultipleValues) !== true) {
82441
+ return unapprovedApprovalRecord.previousValue.map((value, idx) => ({ idx, value }));
82442
+ }
82443
+ return [{ idx: 0, value: unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue }];
82444
+ }, [
82445
+ hasDeletedPreviousValue,
82446
+ hasCurrentPropertyValue,
82447
+ isAiDelete,
82448
+ propertyDefinition == null ? void 0 : propertyDefinition.handlesMultipleValues,
82449
+ simpleInstances,
82450
+ unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue
82451
+ ]);
82452
+ const showAiReview = Boolean(unapprovedApprovalRecord && renderedSimpleInstances.length > 0);
82453
+ const previousValueDiffers = showAiReview && !valuesAreEqual(unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue, entity == null ? void 0 : entity[property]);
82454
+ const showAiDiffToggle = Boolean(showAiReview && previousValueDiffers);
82455
+ const showAddControl = !showAiReview && !(propertyDefinition == null ? void 0 : propertyDefinition.readonly) && ((propertyDefinition == null ? void 0 : propertyDefinition.multiple) || !(values == null ? void 0 : values.length));
82456
+ const markAiSuggestionApproved = useCallback(() => {
82457
+ var _a3;
82458
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
82459
+ entityId: entity == null ? void 0 : entity["@id"],
82460
+ propertyName: property,
82461
+ decision: "accept",
82462
+ value: entity == null ? void 0 : entity[property]
82463
+ });
82464
+ }, [approvalContext, entity, property]);
82465
+ const handleSaveProperty = useCallback((data) => {
82466
+ var _a3;
82467
+ if (unapprovedApprovalRecord) {
82468
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
82469
+ entityId: entity == null ? void 0 : entity["@id"],
82470
+ propertyName: property,
82471
+ decision: "manual-edit",
82472
+ value: data == null ? void 0 : data.value
82473
+ });
82474
+ }
82475
+ if (isAiDelete && !hasCurrentPropertyValue) {
82476
+ onCreateProperty(data);
82477
+ return;
82478
+ }
82479
+ onSaveProperty(data);
82480
+ }, [approvalContext, entity, hasCurrentPropertyValue, isAiDelete, onCreateProperty, onSaveProperty, property, unapprovedApprovalRecord]);
82481
+ const handleApproveAiSuggestion = useCallback(() => {
82482
+ markAiSuggestionApproved();
82483
+ }, [markAiSuggestionApproved]);
82484
+ const handleRejectAiSuggestion = useCallback((idx) => {
82485
+ var _a3;
82486
+ if (!unapprovedApprovalRecord || !previousValueDiffers) return;
82487
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
82488
+ entityId: entity == null ? void 0 : entity["@id"],
82489
+ propertyName: property,
82490
+ decision: "reject",
82491
+ value: unapprovedApprovalRecord.previousValue
82492
+ });
82493
+ if (isAiDelete && !hasCurrentPropertyValue) {
82494
+ onCreateProperty({
82495
+ property,
82496
+ value: unapprovedApprovalRecord.previousValue
82497
+ });
82498
+ return;
82499
+ }
82500
+ onSaveProperty({
82501
+ property,
82502
+ value: unapprovedApprovalRecord.previousValue,
82503
+ idx
82504
+ });
82505
+ }, [approvalContext, entity, hasCurrentPropertyValue, isAiDelete, onCreateProperty, onSaveProperty, previousValueDiffers, property, unapprovedApprovalRecord]);
81721
82506
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
81722
82507
  "div",
81723
82508
  {
81724
82509
  ref: propertyRef,
81725
- className: `flex flex-row flex-grow ${showHelp ? "p-2" : "px-2 py-1 describo-property-compact"} describo-property-background ${highlightRequired && isRequired && !isValid ? "bg-red-200" : ""} ${savedProperty ? "bg-green-100 transition-colors duration-1000" : ""} describo-property describo-property-name-${property}`,
82510
+ className: `flex flex-row flex-grow ${showHelp ? "p-2" : "px-2 py-1 describo-property-compact"} describo-property-background ${highlightRequired && isRequired && !isValid ? "bg-red-200" : ""} ${savedProperty ? "bg-green-100 transition-colors duration-1000" : ""} ${showAiReview ? `describo-ai-review ${isAiDelete ? "describo-ai-delete" : "describo-ai-suggestion"}` : ""} describo-property describo-property-name-${property}`,
81726
82511
  children: [
82512
+ showAiReview && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-suggestion-badge", children: [
82513
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-suggestion-badge-icon", children: "✦" }),
82514
+ isAiDelete ? "AI delete" : "AI suggestion"
82515
+ ] }),
81727
82516
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 flex flex-col describo-property-heading", children: [
81728
82517
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row items-center", children: [
81729
82518
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -81731,7 +82520,8 @@ const EntityProperty = ({
81731
82520
  {
81732
82521
  property,
81733
82522
  label: propertyDefinition == null ? void 0 : propertyDefinition.label,
81734
- className: `inline-block ${isRequired && !isValid ? "text-red-600" : ""}`
82523
+ className: `inline-block ${isRequired && !isValid ? "text-red-600" : ""}`,
82524
+ aiEdited
81735
82525
  }
81736
82526
  ),
81737
82527
  isRequired && !isValid && /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { status: "error", dot: true, className: "animate-pulse ml-2" })
@@ -81744,10 +82534,17 @@ const EntityProperty = ({
81744
82534
  ] })
81745
82535
  ] }),
81746
82536
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-2/3 xl:w-4/5 flex flex-col flex-grow describo-property-value", children: [
81747
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col space-y-1", children: simpleInstances.map((instance2) => {
81748
- var _a3, _b2;
81749
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: (propertyDefinition == null ? void 0 : propertyDefinition.readonly) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-property-value-readonly", children: instance2.value }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row space-x-2", children: [
81750
- /* @__PURE__ */ jsxRuntimeExports.jsx(
82537
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col space-y-1", children: renderedSimpleInstances.map((instance2) => {
82538
+ var _a3, _b2, _c, _d;
82539
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: (propertyDefinition == null ? void 0 : propertyDefinition.readonly) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: showAiReview ? "describo-property-value-readonly describo-ai-field-control" : "describo-property-value-readonly", children: instance2.value }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex flex-row gap-2 ${showAiReview ? "describo-ai-field-row" : ""}`, children: [
82540
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `flex-grow min-w-0 ${showAiReview ? "describo-ai-field-control" : ""}`, children: showAiDiff && showAiDiffToggle ? /* @__PURE__ */ jsxRuntimeExports.jsx(
82541
+ AiFieldDiffView,
82542
+ {
82543
+ previousValue: unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue,
82544
+ currentValue: instance2.value,
82545
+ operation: unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.operation
82546
+ }
82547
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
81751
82548
  EntityPropertyInstance,
81752
82549
  {
81753
82550
  className: "flex-grow",
@@ -81755,11 +82552,42 @@ const EntityProperty = ({
81755
82552
  value: instance2.value,
81756
82553
  idx: instance2.idx,
81757
82554
  definition: propertyDefinition,
81758
- onSaveProperty,
82555
+ onSaveProperty: handleSaveProperty,
81759
82556
  onCreateEntity
81760
82557
  }
81761
- ),
81762
- isNotValue && !((_a3 = state.configuration) == null ? void 0 : _a3.readonly) && (instance2.value || instance2.value === false) && !((_b2 = instance2.value) == null ? void 0 : _b2["@id"]) && /* @__PURE__ */ jsxRuntimeExports.jsx(
82558
+ ) }),
82559
+ showAiReview && instance2.idx === ((_a3 = renderedSimpleInstances[0]) == null ? void 0 : _a3.idx) && !((_b2 = state.configuration) == null ? void 0 : _b2.readonly) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-actions", children: [
82560
+ showAiDiffToggle && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showAiDiff ? "Hide diff" : "Show diff", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
82561
+ Button$1,
82562
+ {
82563
+ size: "middle",
82564
+ className: "describo-ai-action-diff",
82565
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$7, {}),
82566
+ "aria-label": showAiDiff ? "Hide AI diff" : "Show AI diff",
82567
+ "aria-pressed": showAiDiff,
82568
+ onClick: () => setShowAiDiff((visible) => !visible)
82569
+ }
82570
+ ) }),
82571
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: isAiDelete ? "Approve this AI deletion" : "Approve this AI-suggested value", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
82572
+ Button$1,
82573
+ {
82574
+ size: "middle",
82575
+ className: "describo-ai-action-approve",
82576
+ onClick: handleApproveAiSuggestion,
82577
+ children: isAiDelete ? "Delete" : "Accept"
82578
+ }
82579
+ ) }),
82580
+ previousValueDiffers && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Restore the previous value and mark this suggestion reviewed", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
82581
+ Button$1,
82582
+ {
82583
+ size: "middle",
82584
+ className: "describo-ai-action-reject",
82585
+ onClick: () => handleRejectAiSuggestion(instance2.idx),
82586
+ children: isAiDelete ? "Restore" : "Reject"
82587
+ }
82588
+ ) })
82589
+ ] }),
82590
+ isNotValue && !showAiReview && !((_c = state.configuration) == null ? void 0 : _c.readonly) && (instance2.value || instance2.value === false) && !((_d = instance2.value) == null ? void 0 : _d["@id"]) && /* @__PURE__ */ jsxRuntimeExports.jsx(
81763
82591
  DeleteProperty,
81764
82592
  {
81765
82593
  type: "delete",
@@ -81769,16 +82597,20 @@ const EntityProperty = ({
81769
82597
  )
81770
82598
  ] }) }, instance2.idx);
81771
82599
  }) }),
81772
- linkInstances.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
82600
+ renderedLinkInstances.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
81773
82601
  PaginateLinkedEntities,
81774
82602
  {
81775
- className: simpleInstances.length && linkInstances.length ? "mt-2" : "",
81776
- entities: linkInstances,
82603
+ className: renderedSimpleInstances.length && renderedLinkInstances.length ? "mt-2" : "",
82604
+ entities: renderedLinkInstances,
81777
82605
  property,
81778
82606
  readonly: propertyDefinition == null ? void 0 : propertyDefinition.readonly,
81779
82607
  onLoadEntity,
81780
82608
  onUnlinkEntity,
81781
- onPageChange: scrollToPropertyTop
82609
+ onPageChange: scrollToPropertyTop,
82610
+ onAcceptAiEntityDelete,
82611
+ onRestoreAiDeletedEntity,
82612
+ onAcceptAiEntityEdit,
82613
+ onRejectAiEntityEdit
81782
82614
  }
81783
82615
  ),
81784
82616
  showAddControl && !((_b = state.configuration) == null ? void 0 : _b.readonly) && /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -81880,9 +82712,9 @@ const DialogAddProperty = ({
81880
82712
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { vertical: true, children: [
81881
82713
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 6, className: "describo-add-property-row-header", children: [
81882
82714
  item.label ? /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { className: "describo-add-property-row-name", children: item.label }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { className: "describo-add-property-row-name", children: item.name }),
81883
- /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$9, {}),
82715
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$a, {}),
81884
82716
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { className: "describo-add-property-row-type", children: renderPropertyType(item.type) }),
81885
- isSelected && /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$u, { className: "describo-add-property-row-check" })
82717
+ isSelected && /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$v, { className: "describo-add-property-row-check" })
81886
82718
  ] }),
81887
82719
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "secondary", className: "describo-add-property-row-help", children: item.help })
81888
82720
  ] })
@@ -107098,6 +107930,26 @@ const DialogPreviewCrate = ({ onClose, open }) => {
107098
107930
  }
107099
107931
  );
107100
107932
  };
107933
+ const ItemLink = ({ entity, onLoadEntity, className }) => {
107934
+ const handleLoadEntity = () => {
107935
+ onLoadEntity({ id: entity["@id"] });
107936
+ };
107937
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex min-w-0 w-full flex-col ${className || ""}`, onClick: handleLoadEntity, children: [
107938
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
107939
+ Typography.Text,
107940
+ {
107941
+ type: "secondary",
107942
+ style: { fontSize: "0.75rem" },
107943
+ className: "pb-1 mb-1 border-b border-black/20",
107944
+ children: decodeURIComponent(entity["@id"])
107945
+ }
107946
+ ),
107947
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row space-x-2 items-center", children: [
107948
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-base flex flex-row space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderTypes, { types: entity["@type"] }) }),
107949
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { strong: true, children: entity.name })
107950
+ ] })
107951
+ ] });
107952
+ };
107101
107953
  const DialogBrowseEntities = ({
107102
107954
  onClose,
107103
107955
  open,
@@ -107105,6 +107957,7 @@ const DialogBrowseEntities = ({
107105
107957
  }) => {
107106
107958
  const { t: t2 } = useTranslation();
107107
107959
  const crateManager = useContext(CrateManagerContext);
107960
+ const approvalContext = useContext(RoCrateApprovalContext);
107108
107961
  const [data, setData] = useState({
107109
107962
  filterInputModel: "",
107110
107963
  pageSize: 10,
@@ -107205,30 +108058,61 @@ const DialogBrowseEntities = ({
107205
108058
  )
107206
108059
  ] })
107207
108060
  ] }),
107208
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow", children: entities.map((entity) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
107209
- Card,
107210
- {
107211
- style: {
107212
- backgroundColor: "#e6f0ff",
107213
- cursor: "pointer",
107214
- transition: "background-color 0.2s",
107215
- borderLeft: "3px solid #409eff"
107216
- },
107217
- hoverable: true,
107218
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
107219
- Card.Meta,
107220
- {
107221
- title: /* @__PURE__ */ jsxRuntimeExports.jsx(
107222
- ItemLink,
108061
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow", children: entities.map((entity) => (() => {
108062
+ const pendingFieldCount = getPendingEntityApprovalFieldCount(
108063
+ approvalContext == null ? void 0 : approvalContext.roCrateApproval,
108064
+ entity["@id"]
108065
+ );
108066
+ const approvedFieldCount = getApprovedEntityApprovalFieldCount(
108067
+ approvalContext == null ? void 0 : approvalContext.roCrateApproval,
108068
+ entity["@id"]
108069
+ );
108070
+ const hasReviewedAiEdits = approvedFieldCount > 0;
108071
+ const hasPendingAiReview = pendingFieldCount > 0 && !hasReviewedAiEdits;
108072
+ const hasAiTouchedEntity = hasPendingAiReview || hasReviewedAiEdits;
108073
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
108074
+ Card,
108075
+ {
108076
+ className: `${hasPendingAiReview ? "describo-ai-entity-review-card" : ""} ${hasAiTouchedEntity ? "describo-ai-entity-reviewed-card" : ""}`,
108077
+ style: {
108078
+ backgroundColor: hasPendingAiReview ? "#e6f8ef" : "#e6f0ff",
108079
+ cursor: "pointer",
108080
+ transition: "background-color 0.2s",
108081
+ borderLeft: hasPendingAiReview ? "3px solid #38c88a" : "3px solid #409eff"
108082
+ },
108083
+ hoverable: true,
108084
+ children: [
108085
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
108086
+ Card.Meta,
107223
108087
  {
107224
- entity,
107225
- onLoadEntity: () => handleLoadEntity(entity)
108088
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(
108089
+ ItemLink,
108090
+ {
108091
+ entity,
108092
+ onLoadEntity: () => handleLoadEntity(entity)
108093
+ }
108094
+ )
108095
+ }
108096
+ ),
108097
+ hasAiTouchedEntity && !hasPendingAiReview && /* @__PURE__ */ jsxRuntimeExports.jsx(
108098
+ AiEditedFieldBadge,
108099
+ {
108100
+ className: "describo-ai-entity-edited-badge",
108101
+ title: "Entity was added by AI",
108102
+ ariaLabel: "Entity was added by AI"
108103
+ }
108104
+ ),
108105
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
108106
+ AiEntityReviewSummary,
108107
+ {
108108
+ fieldCount: hasPendingAiReview ? pendingFieldCount : 0,
108109
+ onReview: () => handleLoadEntity(entity)
107226
108110
  }
107227
108111
  )
107228
- }
107229
- )
107230
- }
107231
- ) }, entity["@id"])) })
108112
+ ]
108113
+ }
108114
+ ) }, entity["@id"]);
108115
+ })()) })
107232
108116
  ] }) })
107233
108117
  }
107234
108118
  );
@@ -107381,7 +108265,7 @@ const RenderControls = ({
107381
108265
  {
107382
108266
  onClick: handleBack,
107383
108267
  type: "primary",
107384
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$a, {}),
108268
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$b, {}),
107385
108269
  disabled: !canGoBack
107386
108270
  }
107387
108271
  ),
@@ -107399,7 +108283,7 @@ const RenderControls = ({
107399
108283
  {
107400
108284
  onClick: handleForward,
107401
108285
  type: "primary",
107402
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$9, {}),
108286
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$a, {}),
107403
108287
  disabled: !canGoForward
107404
108288
  }
107405
108289
  )
@@ -107409,7 +108293,7 @@ const RenderControls = ({
107409
108293
  {
107410
108294
  onClick: () => toggle("addProperty"),
107411
108295
  type: "primary",
107412
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$p, {}),
108296
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}),
107413
108297
  children: t2("add_label")
107414
108298
  }
107415
108299
  ),
@@ -107418,7 +108302,7 @@ const RenderControls = ({
107418
108302
  {
107419
108303
  onClick: () => toggle("editContext"),
107420
108304
  type: "primary",
107421
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$e, {}),
108305
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$f, {}),
107422
108306
  children: t2("edit_context_label")
107423
108307
  }
107424
108308
  ),
@@ -107427,7 +108311,7 @@ const RenderControls = ({
107427
108311
  {
107428
108312
  onClick: () => toggle("previewCrate"),
107429
108313
  type: "primary",
107430
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$j, {}),
108314
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$k, {}),
107431
108315
  children: t2("preview_label")
107432
108316
  }
107433
108317
  ),
@@ -107436,7 +108320,7 @@ const RenderControls = ({
107436
108320
  {
107437
108321
  onClick: () => toggle("browseEntities"),
107438
108322
  type: "primary",
107439
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$8, {}),
108323
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$9, {}),
107440
108324
  children: t2("browse_entities_label")
107441
108325
  }
107442
108326
  ),
@@ -107471,7 +108355,7 @@ const RenderControls = ({
107471
108355
  color: "red",
107472
108356
  variant: "solid",
107473
108357
  danger: true,
107474
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$f, {}),
108358
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$g, {}),
107475
108359
  children: entity.etype !== "File" && t2("delete_entity_label")
107476
108360
  }
107477
108361
  )
@@ -109596,16 +110480,19 @@ const QuickSettingsHeader = ({
109596
110480
  showFieldHelp,
109597
110481
  fieldTitleFilter,
109598
110482
  hideEmptyFields,
110483
+ showAiEditedFields,
110484
+ aiEditedFieldCount = 0,
109599
110485
  onToggleFieldHelp,
109600
110486
  onFieldTitleFilterChange,
109601
- onToggleEmptyFields
110487
+ onToggleEmptyFields,
110488
+ onToggleAiEditedFields
109602
110489
  }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-quick-settings-header", role: "region", "aria-label": "Quick filter settings", children: [
109603
110490
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-quick-settings-actions", "aria-label": "Field display settings", children: [
109604
110491
  /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showFieldHelp ? "Hide field help" : "Show field help", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
109605
110492
  Button$1,
109606
110493
  {
109607
110494
  type: showFieldHelp ? "default" : "primary",
109608
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$k, {}),
110495
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$l, {}),
109609
110496
  "aria-label": showFieldHelp ? "Hide field help" : "Show field help",
109610
110497
  "aria-pressed": !showFieldHelp,
109611
110498
  onClick: onToggleFieldHelp
@@ -109620,6 +110507,18 @@ const QuickSettingsHeader = ({
109620
110507
  "aria-pressed": hideEmptyFields,
109621
110508
  onClick: onToggleEmptyFields
109622
110509
  }
110510
+ ) }),
110511
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showAiEditedFields ? "Show all fields" : "Show AI-edited fields", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
110512
+ Button$1,
110513
+ {
110514
+ type: showAiEditedFields ? "primary" : "default",
110515
+ className: "describo-ai-edited-filter-button",
110516
+ "aria-label": showAiEditedFields ? "Show all fields" : "Show AI-edited fields",
110517
+ "aria-pressed": showAiEditedFields,
110518
+ disabled: aiEditedFieldCount === 0,
110519
+ onClick: onToggleAiEditedFields,
110520
+ children: "✦"
110521
+ }
109623
110522
  ) })
109624
110523
  ] }),
109625
110524
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -109627,15 +110526,113 @@ const QuickSettingsHeader = ({
109627
110526
  {
109628
110527
  className: "describo-quick-settings-filter",
109629
110528
  value: fieldTitleFilter,
109630
- placeholder: "Filter fields by title",
109631
- "aria-label": "Filter fields by title",
110529
+ placeholder: "Filter fields by name or value",
110530
+ "aria-label": "Filter fields by name or value",
109632
110531
  onChange: (event) => onFieldTitleFilterChange(event.target.value),
109633
110532
  allowClear: {
109634
- clearIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$A, { "aria-label": "Clear field filter" })
110533
+ clearIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$B, { "aria-label": "Clear field filter" })
109635
110534
  }
109636
110535
  }
109637
110536
  )
109638
110537
  ] });
110538
+ const AiApprovalStepperHeader = ({
110539
+ activeIndex,
110540
+ pendingCount,
110541
+ activePropertyLabel,
110542
+ remainingEntityCount = 0,
110543
+ remainingFieldCount = 0,
110544
+ readonly = false,
110545
+ canGoPrevious,
110546
+ canGoNext,
110547
+ onPrevious,
110548
+ onNext,
110549
+ onAcceptAll,
110550
+ onRejectAll,
110551
+ onReviewNextEntity
110552
+ }) => {
110553
+ if (!pendingCount && !remainingEntityCount) return null;
110554
+ if (!pendingCount) {
110555
+ const entityLabel = remainingEntityCount === 1 ? "entity" : "entities";
110556
+ const fieldLabel = remainingFieldCount === 1 ? "field" : "fields";
110557
+ const remainingMessage = `${remainingFieldCount} AI ${fieldLabel} still need review in ${remainingEntityCount} other ${entityLabel}`;
110558
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-confirm-bar describo-ai-confirm-bar-remaining", role: "status", "aria-label": "AI changes remaining", children: [
110559
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-confirm-message", children: [
110560
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-confirm-spark", children: "✦" }),
110561
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: remainingMessage })
110562
+ ] }),
110563
+ onReviewNextEntity && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-confirm-controls", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
110564
+ Button$1,
110565
+ {
110566
+ className: "describo-ai-review-next-entity",
110567
+ onClick: onReviewNextEntity,
110568
+ children: "Review next"
110569
+ }
110570
+ ) })
110571
+ ] });
110572
+ }
110573
+ const stepLabel = `${Math.min(activeIndex + 1, pendingCount)}/${pendingCount}`;
110574
+ const message = activePropertyLabel ? `AI changes need review: ${activePropertyLabel}` : "AI changes need review";
110575
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-confirm-bar", role: "region", "aria-label": "AI change review", children: [
110576
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-confirm-message", children: [
110577
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-confirm-spark", children: "✦" }),
110578
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: message })
110579
+ ] }),
110580
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-confirm-controls", children: [
110581
+ onReviewNextEntity && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: remainingEntityCount > 0 ? "Review the next entity with pending AI changes" : "No other entities need AI review", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
110582
+ Button$1,
110583
+ {
110584
+ className: "describo-ai-review-next-entity",
110585
+ disabled: remainingEntityCount === 0,
110586
+ onClick: onReviewNextEntity,
110587
+ children: "Review next"
110588
+ }
110589
+ ) }),
110590
+ !readonly && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
110591
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Accept every pending AI change in this entity", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
110592
+ Button$1,
110593
+ {
110594
+ className: "describo-ai-bulk-action describo-ai-bulk-accept",
110595
+ onClick: onAcceptAll,
110596
+ children: "Accept all"
110597
+ }
110598
+ ) }),
110599
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Restore previous values for every pending AI change in this entity", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
110600
+ Button$1,
110601
+ {
110602
+ className: "describo-ai-bulk-action describo-ai-bulk-reject",
110603
+ onClick: onRejectAll,
110604
+ children: "Reject all"
110605
+ }
110606
+ ) })
110607
+ ] }),
110608
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-stepper", "aria-label": "Pending AI field navigation", children: [
110609
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Previous pending field", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
110610
+ Button$1,
110611
+ {
110612
+ type: "text",
110613
+ size: "small",
110614
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$p, {}),
110615
+ "aria-label": "Previous pending AI field",
110616
+ disabled: !canGoPrevious,
110617
+ onClick: onPrevious
110618
+ }
110619
+ ) }),
110620
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-step-count", children: stepLabel }),
110621
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Next pending field", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
110622
+ Button$1,
110623
+ {
110624
+ type: "text",
110625
+ size: "small",
110626
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$u, {}),
110627
+ "aria-label": "Next pending AI field",
110628
+ disabled: !canGoNext,
110629
+ onClick: onNext
110630
+ }
110631
+ ) })
110632
+ ] })
110633
+ ] })
110634
+ ] });
110635
+ };
109639
110636
  var _baseDifference;
109640
110637
  var hasRequired_baseDifference;
109641
110638
  function require_baseDifference() {
@@ -111307,11 +112304,12 @@ const clearPendingAddedProfileTabKeys = (entityId) => {
111307
112304
  }
111308
112305
  };
111309
112306
  const RenderEntity = forwardRef((props, ref) => {
111310
- var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
112307
+ var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
111311
112308
  const { entity, onLoadEntity, onSaveCrate, onSaveEntityTemplate, onWarning, onError, onAddNewProfileRequest, onRemoveProfile } = props;
111312
112309
  const state = useStateStore();
111313
112310
  const profileManager = useContext(ProfileManagerContext);
111314
112311
  const crateManager = useContext(CrateManagerContext);
112312
+ const approvalContext = useContext(RoCrateApprovalContext);
111315
112313
  const { t: t2 } = useTranslation();
111316
112314
  const [contextEntity, setContextEntity] = useState(entity);
111317
112315
  const [activeTab, setActiveTab] = useState("about");
@@ -111327,6 +112325,8 @@ const RenderEntity = forwardRef((props, ref) => {
111327
112325
  const [showFieldHelp, setShowFieldHelp] = useState(true);
111328
112326
  const [fieldTitleFilter, setFieldTitleFilter] = useState("");
111329
112327
  const [hideEmptyFields, setHideEmptyFields] = useState(false);
112328
+ const [showAiEditedFields, setShowAiEditedFields] = useState(false);
112329
+ const [selectedAiApprovalIndex, setSelectedAiApprovalIndex] = useState(0);
111330
112330
  const [iconView, setIconView] = useState(false);
111331
112331
  const [hoveredTabKey, setHoveredTabKey] = useState(null);
111332
112332
  const initialTabPaneWidth = useMemo$1(() => {
@@ -111353,8 +112353,49 @@ const RenderEntity = forwardRef((props, ref) => {
111353
112353
  const restoreInProgressRef = useRef(false);
111354
112354
  const pendingAddedProfileSelectionRef = useRef(null);
111355
112355
  const pendingAddedPropertyRef = useRef(null);
112356
+ const pendingAiScrollPropertyRef = useRef(null);
112357
+ const lastAutoNavigatedAiApprovalRef = useRef(null);
111356
112358
  const [tabRailScrollState, setTabRailScrollState] = useState({ canScrollUp: false, canScrollDown: false });
111357
112359
  const debugScroll = (...args) => console.log("[recrate-scroll-debug]", ...args);
112360
+ const pendingAiApprovals = useMemo$1(() => getPendingEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]]);
112361
+ const pendingAiApprovalProperties = useMemo$1(() => pendingAiApprovals.map((approvalRecord) => approvalRecord == null ? void 0 : approvalRecord.propertyName).filter((property) => typeof property === "string" && property.length > 0), [pendingAiApprovals]);
112362
+ const pendingDeletedEntityReviewProperties = useMemo$1(() => getPendingDeletedEntityReversePropertiesForSource(
112363
+ approvalContext == null ? void 0 : approvalContext.roCrateApproval,
112364
+ contextEntity == null ? void 0 : contextEntity["@id"]
112365
+ ), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]]);
112366
+ const approvedAiApprovals = useMemo$1(() => getApprovedEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]]);
112367
+ const approvedAiApprovalProperties = useMemo$1(() => Array.from(new Set(
112368
+ approvedAiApprovals.map((approvalRecord) => approvalRecord == null ? void 0 : approvalRecord.propertyName).filter((property) => typeof property === "string" && property.length > 0)
112369
+ )), [approvedAiApprovals]);
112370
+ const selectedAiApproval = pendingAiApprovals[selectedAiApprovalIndex] ?? pendingAiApprovals[0];
112371
+ const selectedAiApprovalProperty = selectedAiApproval == null ? void 0 : selectedAiApproval.propertyName;
112372
+ const pendingOtherAiApprovalEntities = useMemo$1(() => getPendingApprovalEntities(approvalContext == null ? void 0 : approvalContext.roCrateApproval).filter((entityApproval) => !entityIdsMatch(entityApproval == null ? void 0 : entityApproval["@id"], contextEntity == null ? void 0 : contextEntity["@id"])), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]]);
112373
+ const pendingOtherAiApprovalFieldCount = useMemo$1(() => getPendingApprovalFieldCount(approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]]);
112374
+ const handleReviewNextAiApprovalEntity = useCallback(() => {
112375
+ for (const entityApproval of pendingOtherAiApprovalEntities) {
112376
+ const nextEntityId = entityApproval == null ? void 0 : entityApproval["@id"];
112377
+ if (!nextEntityId) continue;
112378
+ if (isPendingEntityDeleteApproval(entityApproval)) {
112379
+ const reviewTarget = getDeletedEntityReviewTarget(entityApproval);
112380
+ if (!reviewTarget) continue;
112381
+ const targetEntity = crateManager == null ? void 0 : crateManager.getEntity({
112382
+ id: reviewTarget.entityId,
112383
+ link: false,
112384
+ materialise: false
112385
+ });
112386
+ if (!targetEntity) continue;
112387
+ setFieldTitleFilter("");
112388
+ if (hideEmptyFields) {
112389
+ setHideEmptyFields(false);
112390
+ }
112391
+ pendingAiScrollPropertyRef.current = reviewTarget.property;
112392
+ onLoadEntity({ id: reviewTarget.entityId });
112393
+ return;
112394
+ }
112395
+ onLoadEntity({ id: nextEntityId });
112396
+ return;
112397
+ }
112398
+ }, [crateManager, hideEmptyFields, onLoadEntity, pendingOtherAiApprovalEntities]);
111358
112399
  const getVisibleContextMarkers = (selector, dataAttribute) => {
111359
112400
  const source = activeContentRef.current;
111360
112401
  if (!source) return [];
@@ -111502,17 +112543,35 @@ const RenderEntity = forwardRef((props, ref) => {
111502
112543
  captureViewContext(activeTab);
111503
112544
  }
111504
112545
  setExtraProperties([]);
112546
+ setFieldTitleFilter("");
111505
112547
  init2({ entity });
111506
112548
  }, [entity]);
112549
+ useEffect(() => {
112550
+ if (!pendingAiApprovals.length) {
112551
+ setSelectedAiApprovalIndex(0);
112552
+ return;
112553
+ }
112554
+ setSelectedAiApprovalIndex((currentIndex) => Math.min(currentIndex, pendingAiApprovals.length - 1));
112555
+ }, [pendingAiApprovals.length]);
112556
+ useEffect(() => {
112557
+ if (approvedAiApprovalProperties.length === 0) {
112558
+ setShowAiEditedFields(false);
112559
+ }
112560
+ }, [approvedAiApprovalProperties.length]);
111507
112561
  useEffect(() => {
111508
112562
  if (profileManager && profileManager.$key) {
112563
+ if (entity == null ? void 0 : entity.__aiDeletedEntity) {
112564
+ init2({ entity });
112565
+ return;
112566
+ }
111509
112567
  const entityObj = crateManager.getEntity({ id: entity["@id"], link: false, materialise: false });
112568
+ if (!entityObj) return;
111510
112569
  init2({ entity: entityObj });
111511
112570
  }
111512
112571
  }, [profileManager == null ? void 0 : profileManager.$key]);
111513
112572
  const init2 = ({ entity: entity2, extraPropertiesOverride }) => {
111514
112573
  var _a3, _b2, _c2, _d2, _e3, _f2;
111515
- if (!entity2["@id"]) return;
112574
+ if (!(entity2 == null ? void 0 : entity2["@id"])) return;
111516
112575
  const latestEntry = state.editorState.latest();
111517
112576
  const isCurrentHistoryEntity = (latestEntry == null ? void 0 : latestEntry.id) === entity2["@id"];
111518
112577
  const layout = applyLayout({
@@ -111528,7 +112587,8 @@ const RenderEntity = forwardRef((props, ref) => {
111528
112587
  const navState = isCurrentHistoryEntity ? latestEntry == null ? void 0 : latestEntry.navigationState : state.editorState.getNavigationState(entity2["@id"]);
111529
112588
  const tabNames = layout.tabs.map((tab) => tab.name);
111530
112589
  const fallbackTab = tabNames.includes("about") ? "about" : tabNames[0] ?? "about";
111531
- const restoredTab = layout.renderTabs && (navState == null ? void 0 : navState.activeTab) && tabNames.includes(navState.activeTab) ? navState.activeTab : fallbackTab;
112590
+ const currentTabStillValid = layout.renderTabs && (contextEntity == null ? void 0 : contextEntity["@id"]) === entity2["@id"] && tabNames.includes(activeTab);
112591
+ const restoredTab = currentTabStillValid ? activeTab : layout.renderTabs && (navState == null ? void 0 : navState.activeTab) && tabNames.includes(navState.activeTab) ? navState.activeTab : fallbackTab;
111532
112592
  const pendingAddedProfileSelection = pendingAddedProfileSelectionRef.current;
111533
112593
  const pendingAddedProfileTabKeys = Array.isArray((_a3 = navState == null ? void 0 : navState.uiState) == null ? void 0 : _a3.pendingAddedProfileTabKeys) ? navState.uiState.pendingAddedProfileTabKeys : readPendingAddedProfileTabKeys(entity2["@id"]);
111534
112594
  let nextActiveTab = restoredTab;
@@ -111615,7 +112675,12 @@ const RenderEntity = forwardRef((props, ref) => {
111615
112675
  }
111616
112676
  };
111617
112677
  const refresh = () => {
112678
+ if (entity == null ? void 0 : entity.__aiDeletedEntity) {
112679
+ init2({ entity });
112680
+ return;
112681
+ }
111618
112682
  const entityObj = crateManager.getEntity({ id: entity["@id"], link: false, materialise: false });
112683
+ if (!entityObj) return;
111619
112684
  init2({ entity: entityObj });
111620
112685
  };
111621
112686
  const handleLoadEntityWithContext = (params) => {
@@ -111637,6 +112702,11 @@ const RenderEntity = forwardRef((props, ref) => {
111637
112702
  state.editorState.update({ id: activeEntityId, tab: tabName });
111638
112703
  state.editorState.updateNavigationState({ activeTab: tabName });
111639
112704
  };
112705
+ const saveCratePreservingView = () => {
112706
+ saveTabToState(activeTab);
112707
+ captureViewContext(activeTab);
112708
+ onSaveCrate();
112709
+ };
111640
112710
  useEffect(() => {
111641
112711
  if (entity == null ? void 0 : entity["@id"]) {
111642
112712
  refresh();
@@ -111901,7 +112971,7 @@ const RenderEntity = forwardRef((props, ref) => {
111901
112971
  if (data.property === "@id" && (updatedEntity == null ? void 0 : updatedEntity["@id"])) {
111902
112972
  state.editorState.replaceId({ id: entity["@id"], newId: updatedEntity["@id"] });
111903
112973
  }
111904
- onSaveCrate();
112974
+ saveCratePreservingView();
111905
112975
  notifySave(data.property);
111906
112976
  } catch (error2) {
111907
112977
  console.error(error2);
@@ -111927,7 +112997,7 @@ const RenderEntity = forwardRef((props, ref) => {
111927
112997
  });
111928
112998
  }
111929
112999
  refresh();
111930
- onSaveCrate();
113000
+ saveCratePreservingView();
111931
113001
  notifySave(data.property);
111932
113002
  } catch (error2) {
111933
113003
  onError();
@@ -111948,7 +113018,7 @@ const RenderEntity = forwardRef((props, ref) => {
111948
113018
  onWarning();
111949
113019
  }
111950
113020
  refresh();
111951
- onSaveCrate();
113021
+ saveCratePreservingView();
111952
113022
  return data.json["@id"];
111953
113023
  } catch (error2) {
111954
113024
  onError();
@@ -111964,7 +113034,7 @@ const RenderEntity = forwardRef((props, ref) => {
111964
113034
  value: { "@id": data.json["@id"] }
111965
113035
  });
111966
113036
  refresh();
111967
- onSaveCrate();
113037
+ saveCratePreservingView();
111968
113038
  } catch (error2) {
111969
113039
  onError();
111970
113040
  }
@@ -111977,7 +113047,7 @@ const RenderEntity = forwardRef((props, ref) => {
111977
113047
  idx: data.idx
111978
113048
  });
111979
113049
  refresh();
111980
- onSaveCrate();
113050
+ saveCratePreservingView();
111981
113051
  } catch (error2) {
111982
113052
  onError();
111983
113053
  }
@@ -111990,7 +113060,7 @@ const RenderEntity = forwardRef((props, ref) => {
111990
113060
  value: { "@id": data.tgtEntityId }
111991
113061
  });
111992
113062
  refresh();
111993
- onSaveCrate();
113063
+ saveCratePreservingView();
111994
113064
  } catch (error2) {
111995
113065
  console.error(error2);
111996
113066
  onError();
@@ -112000,7 +113070,7 @@ const RenderEntity = forwardRef((props, ref) => {
112000
113070
  try {
112001
113071
  crateManager.deleteEntity({ id: data.id });
112002
113072
  handleLoadEntityWithContext({ id: "./" });
112003
- onSaveCrate();
113073
+ saveCratePreservingView();
112004
113074
  } catch (error2) {
112005
113075
  onError();
112006
113076
  }
@@ -112008,7 +113078,7 @@ const RenderEntity = forwardRef((props, ref) => {
112008
113078
  const handleUpdateContext = (context) => {
112009
113079
  try {
112010
113080
  crateManager.setContext(context);
112011
- onSaveCrate();
113081
+ saveCratePreservingView();
112012
113082
  } catch (error2) {
112013
113083
  onError();
112014
113084
  }
@@ -112030,7 +113100,7 @@ const RenderEntity = forwardRef((props, ref) => {
112030
113100
  {
112031
113101
  type: "default",
112032
113102
  shape: "circle",
112033
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$p, {}),
113103
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}),
112034
113104
  "aria-label": "Add Profile",
112035
113105
  "aria-controls": "add-property-panel",
112036
113106
  "aria-expanded": showAddPanel,
@@ -112050,7 +113120,7 @@ const RenderEntity = forwardRef((props, ref) => {
112050
113120
  {
112051
113121
  type: iconView ? "primary" : "default",
112052
113122
  shape: "circle",
112053
- icon: iconView ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$b, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
113123
+ icon: iconView ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$c, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
112054
113124
  "aria-pressed": iconView,
112055
113125
  onClick: (e3) => {
112056
113126
  e3.stopPropagation();
@@ -112083,7 +113153,7 @@ const RenderEntity = forwardRef((props, ref) => {
112083
113153
  {
112084
113154
  type: iconView ? "primary" : "default",
112085
113155
  shape: "circle",
112086
- icon: iconView ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$b, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
113156
+ icon: iconView ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$c, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
112087
113157
  "aria-pressed": iconView,
112088
113158
  onClick: (e3) => {
112089
113159
  e3.stopPropagation();
@@ -112096,7 +113166,7 @@ const RenderEntity = forwardRef((props, ref) => {
112096
113166
  {
112097
113167
  type: "default",
112098
113168
  shape: "circle",
112099
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$p, {}),
113169
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}),
112100
113170
  "aria-label": "Add Profile",
112101
113171
  "aria-controls": "add-property-panel",
112102
113172
  "aria-expanded": showAddPanel,
@@ -112161,7 +113231,7 @@ const RenderEntity = forwardRef((props, ref) => {
112161
113231
  e3.stopPropagation();
112162
113232
  handleRemoveProfile(tab);
112163
113233
  },
112164
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$f, { style: { color: "oklch(57.7% 0.245 27.325)" } })
113234
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$g, { style: { color: "oklch(57.7% 0.245 27.325)" } })
112165
113235
  }
112166
113236
  )
112167
113237
  ] })
@@ -112181,7 +113251,7 @@ const RenderEntity = forwardRef((props, ref) => {
112181
113251
  shape: "circle",
112182
113252
  size: "small",
112183
113253
  className: "describo-tab-rail-scroll-button describo-tab-rail-scroll-button-up",
112184
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$o, {}),
113254
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$p, {}),
112185
113255
  "aria-label": "Scroll profile tabs up",
112186
113256
  onClick: () => scrollTabRail("up")
112187
113257
  }
@@ -112193,7 +113263,7 @@ const RenderEntity = forwardRef((props, ref) => {
112193
113263
  shape: "circle",
112194
113264
  size: "small",
112195
113265
  className: "describo-tab-rail-scroll-button describo-tab-rail-scroll-button-down",
112196
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$t, {}),
113266
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$u, {}),
112197
113267
  "aria-label": "Scroll profile tabs down",
112198
113268
  onClick: () => scrollTabRail("down")
112199
113269
  }
@@ -112207,11 +113277,390 @@ const RenderEntity = forwardRef((props, ref) => {
112207
113277
  showFieldHelp,
112208
113278
  fieldTitleFilter,
112209
113279
  hideEmptyFields,
113280
+ showAiEditedFields,
113281
+ aiEditedFieldCount: approvedAiApprovalProperties.length,
112210
113282
  onToggleFieldHelp: () => setShowFieldHelp((visible) => !visible),
112211
113283
  onFieldTitleFilterChange: setFieldTitleFilter,
112212
- onToggleEmptyFields: () => setHideEmptyFields((hidden) => !hidden)
113284
+ onToggleEmptyFields: () => setHideEmptyFields((hidden) => !hidden),
113285
+ onToggleAiEditedFields: () => setShowAiEditedFields((visible) => !visible)
112213
113286
  }
112214
113287
  ) : null;
113288
+ const findPropertyElement = (property) => {
113289
+ var _a3;
113290
+ return Array.from(((_a3 = activeContentRef.current) == null ? void 0 : _a3.querySelectorAll("[data-recrate-property]")) ?? []).find((element) => element.dataset.recrateProperty === property);
113291
+ };
113292
+ const scrollToAiApprovalProperty = useCallback((property) => {
113293
+ let attempts = 0;
113294
+ let timerId = 0;
113295
+ let rafId = 0;
113296
+ const maxAttempts = 30;
113297
+ const attemptScroll = () => {
113298
+ attempts += 1;
113299
+ const propertyElement = findPropertyElement(property);
113300
+ const viewport = activeContentRef.current;
113301
+ if (propertyElement && viewport) {
113302
+ const viewportRect = viewport.getBoundingClientRect();
113303
+ const propertyRect = propertyElement.getBoundingClientRect();
113304
+ const targetTop = viewport.scrollTop + propertyRect.top - viewportRect.top - 8;
113305
+ const maxScrollable = Math.max(0, viewport.scrollHeight - viewport.clientHeight);
113306
+ viewport.scrollTo({
113307
+ top: Math.max(0, Math.min(targetTop, maxScrollable)),
113308
+ behavior: "smooth"
113309
+ });
113310
+ return;
113311
+ }
113312
+ if (attempts < maxAttempts) {
113313
+ timerId = window.setTimeout(() => {
113314
+ rafId = window.requestAnimationFrame(attemptScroll);
113315
+ }, 50);
113316
+ }
113317
+ };
113318
+ rafId = window.requestAnimationFrame(attemptScroll);
113319
+ return () => {
113320
+ window.cancelAnimationFrame(rafId);
113321
+ window.clearTimeout(timerId);
113322
+ };
113323
+ }, []);
113324
+ const navigateToAiApproval = useCallback((index2) => {
113325
+ if (!pendingAiApprovals.length) return;
113326
+ if (index2 < 0 || index2 >= pendingAiApprovals.length) return;
113327
+ const approvalRecord = pendingAiApprovals[index2];
113328
+ const property = approvalRecord == null ? void 0 : approvalRecord.propertyName;
113329
+ if (!property) return;
113330
+ setSelectedAiApprovalIndex(index2);
113331
+ setFieldTitleFilter("");
113332
+ if (!hasFieldValue(contextEntity == null ? void 0 : contextEntity[property]) && hideEmptyFields) {
113333
+ setHideEmptyFields(false);
113334
+ }
113335
+ pendingAiScrollPropertyRef.current = property;
113336
+ const propertyTab = renderTabs ? findTabForProperty(tabs, property) : null;
113337
+ if ((propertyTab == null ? void 0 : propertyTab.name) && propertyTab.name !== activeTab) {
113338
+ captureViewContext(activeTab);
113339
+ setActiveTab(propertyTab.name);
113340
+ saveTabToState(propertyTab.name);
113341
+ }
113342
+ window.setTimeout(() => scrollToAiApprovalProperty(property), 0);
113343
+ window.setTimeout(() => scrollToAiApprovalProperty(property), 120);
113344
+ }, [
113345
+ activeTab,
113346
+ contextEntity,
113347
+ hideEmptyFields,
113348
+ pendingAiApprovals,
113349
+ renderTabs,
113350
+ scrollToAiApprovalProperty,
113351
+ tabs
113352
+ ]);
113353
+ useEffect(() => {
113354
+ var _a3;
113355
+ const entityId = contextEntity == null ? void 0 : contextEntity["@id"];
113356
+ const firstPendingProperty = (_a3 = pendingAiApprovals[0]) == null ? void 0 : _a3.propertyName;
113357
+ if (!entityId || !firstPendingProperty) {
113358
+ lastAutoNavigatedAiApprovalRef.current = null;
113359
+ return;
113360
+ }
113361
+ const autoNavigationKey = `${entityId}:${firstPendingProperty}`;
113362
+ if (lastAutoNavigatedAiApprovalRef.current === autoNavigationKey) return;
113363
+ lastAutoNavigatedAiApprovalRef.current = autoNavigationKey;
113364
+ navigateToAiApproval(0);
113365
+ }, [contextEntity == null ? void 0 : contextEntity["@id"], navigateToAiApproval, pendingAiApprovals]);
113366
+ useEffect(() => {
113367
+ const pendingProperty = pendingAiScrollPropertyRef.current;
113368
+ if (!pendingProperty) return;
113369
+ const propertyTab = renderTabs ? findTabForProperty(tabs, pendingProperty) : null;
113370
+ if ((propertyTab == null ? void 0 : propertyTab.name) && propertyTab.name !== activeTab) {
113371
+ setActiveTab(propertyTab.name);
113372
+ saveTabToState(propertyTab.name);
113373
+ return;
113374
+ }
113375
+ const cancelScroll = scrollToAiApprovalProperty(pendingProperty);
113376
+ pendingAiScrollPropertyRef.current = null;
113377
+ return cancelScroll;
113378
+ }, [activeTab, contextEntity == null ? void 0 : contextEntity["@id"], renderTabs, selectedAiApprovalIndex, tabs, scrollToAiApprovalProperty]);
113379
+ const isEntityReference2 = (value) => Boolean(value && typeof value === "object" && typeof value["@id"] === "string");
113380
+ const restoreNonCoreApprovalValue = (approvalRecord) => {
113381
+ const property = approvalRecord == null ? void 0 : approvalRecord.propertyName;
113382
+ if (!property) return;
113383
+ if (entityHasPropertyValue(contextEntity, property)) {
113384
+ crateManager.deleteProperty({ id: entity["@id"], property });
113385
+ }
113386
+ const previousValue = approvalRecord == null ? void 0 : approvalRecord.previousValue;
113387
+ if (!propertyValueHasContent(previousValue)) return;
113388
+ const previousValues = Array.isArray(previousValue) ? previousValue : [previousValue];
113389
+ if (previousValues.length === 0) return;
113390
+ if (previousValues.every(isEntityReference2)) {
113391
+ previousValues.forEach((value) => {
113392
+ crateManager.setProperty({ id: entity["@id"], property, value });
113393
+ });
113394
+ return;
113395
+ }
113396
+ crateManager.updateProperty({
113397
+ id: entity["@id"],
113398
+ property,
113399
+ value: previousValues
113400
+ });
113401
+ };
113402
+ const restoreApprovalValue = (approvalRecord) => {
113403
+ const property = approvalRecord == null ? void 0 : approvalRecord.propertyName;
113404
+ if (!property) return;
113405
+ if (["@id", "@type", "name"].includes(property)) {
113406
+ if (propertyValueHasContent(approvalRecord == null ? void 0 : approvalRecord.previousValue)) {
113407
+ crateManager.updateProperty({
113408
+ id: entity["@id"],
113409
+ property,
113410
+ value: approvalRecord.previousValue
113411
+ });
113412
+ }
113413
+ return;
113414
+ }
113415
+ restoreNonCoreApprovalValue(approvalRecord);
113416
+ };
113417
+ const restoreEntityApprovalValue = (targetEntity, approvalRecord) => {
113418
+ const property = approvalRecord == null ? void 0 : approvalRecord.propertyName;
113419
+ const entityId = targetEntity == null ? void 0 : targetEntity["@id"];
113420
+ if (!entityId || !property || property === "@reverse") return;
113421
+ const previousValue = approvalRecord == null ? void 0 : approvalRecord.previousValue;
113422
+ if (["@id", "@type", "name"].includes(property)) {
113423
+ if (propertyValueHasContent(previousValue)) {
113424
+ crateManager.updateProperty({
113425
+ id: entityId,
113426
+ property,
113427
+ value: previousValue
113428
+ });
113429
+ }
113430
+ return;
113431
+ }
113432
+ if (entityHasPropertyValue(targetEntity, property)) {
113433
+ crateManager.deleteProperty({ id: entityId, property });
113434
+ }
113435
+ if (!propertyValueHasContent(previousValue)) return;
113436
+ const previousValues = Array.isArray(previousValue) ? previousValue : [previousValue];
113437
+ if (previousValues.length === 0) return;
113438
+ if (previousValues.every(isEntityReference2)) {
113439
+ previousValues.forEach((value) => {
113440
+ crateManager.setProperty({ id: entityId, property, value });
113441
+ });
113442
+ return;
113443
+ }
113444
+ crateManager.updateProperty({
113445
+ id: entityId,
113446
+ property,
113447
+ value: previousValues
113448
+ });
113449
+ };
113450
+ const getPendingApprovalForProperty = (property) => pendingAiApprovals.find((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) === property);
113451
+ const handleApproveAiProperty = (property) => {
113452
+ var _a3;
113453
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
113454
+ entityId: entity["@id"],
113455
+ propertyName: property,
113456
+ decision: "accept",
113457
+ value: contextEntity == null ? void 0 : contextEntity[property]
113458
+ });
113459
+ };
113460
+ const handleRejectAiProperty = (approvalRecord) => {
113461
+ var _a3;
113462
+ try {
113463
+ if (!(approvalRecord == null ? void 0 : approvalRecord.propertyName) || !propertyValueHasContent(approvalRecord.previousValue)) return;
113464
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
113465
+ entityId: entity["@id"],
113466
+ propertyName: approvalRecord.propertyName,
113467
+ decision: "reject",
113468
+ value: approvalRecord.previousValue
113469
+ });
113470
+ crateManager.updateProperty({
113471
+ id: entity["@id"],
113472
+ property: approvalRecord.propertyName,
113473
+ value: approvalRecord.previousValue
113474
+ });
113475
+ refresh();
113476
+ saveCratePreservingView();
113477
+ notifySave(approvalRecord.propertyName);
113478
+ } catch (error2) {
113479
+ console.error(error2);
113480
+ onError();
113481
+ }
113482
+ };
113483
+ const handleUpdateCoreProperty = (data) => {
113484
+ var _a3;
113485
+ const approvalRecord = getPendingApprovalForProperty(data.property);
113486
+ if (approvalRecord) {
113487
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
113488
+ entityId: entity["@id"],
113489
+ propertyName: data.property,
113490
+ decision: "manual-edit",
113491
+ value: data.value
113492
+ });
113493
+ }
113494
+ handleUpdateEntity(data);
113495
+ };
113496
+ const getCoreAiReviewProps = (property) => {
113497
+ const approvalRecord = getPendingApprovalForProperty(property);
113498
+ if (!approvalRecord) return void 0;
113499
+ return {
113500
+ operation: approvalRecord.operation,
113501
+ previousValue: approvalRecord.previousValue,
113502
+ previousValueDiffers: !valuesAreEqual(approvalRecord.previousValue, contextEntity == null ? void 0 : contextEntity[property]),
113503
+ onApprove: () => handleApproveAiProperty(property),
113504
+ onReject: () => handleRejectAiProperty(approvalRecord)
113505
+ };
113506
+ };
113507
+ const handleAcceptAllAiApprovals = () => {
113508
+ var _a3;
113509
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
113510
+ entityId: entity["@id"],
113511
+ decision: "accept"
113512
+ });
113513
+ };
113514
+ const handleAcceptAiEntityEdit = (editedEntity) => {
113515
+ var _a3;
113516
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
113517
+ entityId: editedEntity == null ? void 0 : editedEntity["@id"],
113518
+ decision: "accept",
113519
+ value: editedEntity
113520
+ });
113521
+ };
113522
+ const handleRejectAiEntityEdit = (editedEntity) => {
113523
+ var _a3;
113524
+ try {
113525
+ const entityId = editedEntity == null ? void 0 : editedEntity["@id"];
113526
+ if (!entityId) return;
113527
+ const targetEntity = crateManager.getEntity({
113528
+ id: entityId,
113529
+ link: false,
113530
+ materialise: false
113531
+ });
113532
+ if (!targetEntity) return;
113533
+ const approvalRecords = getPendingEntityApprovalRecords(
113534
+ approvalContext == null ? void 0 : approvalContext.roCrateApproval,
113535
+ entityId
113536
+ ).filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) !== "@reverse");
113537
+ const restoredValues = approvalRecords.reduce((acc, approvalRecord) => {
113538
+ if (approvalRecord == null ? void 0 : approvalRecord.propertyName) {
113539
+ acc[approvalRecord.propertyName] = approvalRecord.previousValue;
113540
+ }
113541
+ return acc;
113542
+ }, {});
113543
+ approvalRecords.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) !== "@id").forEach((approvalRecord) => restoreEntityApprovalValue(targetEntity, approvalRecord));
113544
+ approvalRecords.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) === "@id").forEach((approvalRecord) => restoreEntityApprovalValue(targetEntity, approvalRecord));
113545
+ if (entityIdsMatch(entityId, entity == null ? void 0 : entity["@id"])) {
113546
+ refresh();
113547
+ }
113548
+ saveCratePreservingView();
113549
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
113550
+ entityId,
113551
+ decision: "reject",
113552
+ value: restoredValues
113553
+ });
113554
+ } catch (error2) {
113555
+ console.error(error2);
113556
+ onError();
113557
+ }
113558
+ };
113559
+ const handleRejectAllAiApprovals = () => {
113560
+ var _a3;
113561
+ try {
113562
+ const restoredValues = pendingAiApprovals.reduce((acc, approvalRecord) => {
113563
+ if (approvalRecord == null ? void 0 : approvalRecord.propertyName) {
113564
+ acc[approvalRecord.propertyName] = approvalRecord.previousValue;
113565
+ }
113566
+ restoreApprovalValue(approvalRecord);
113567
+ return acc;
113568
+ }, {});
113569
+ refresh();
113570
+ saveCratePreservingView();
113571
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
113572
+ entityId: entity["@id"],
113573
+ decision: "reject",
113574
+ value: restoredValues
113575
+ });
113576
+ } catch (error2) {
113577
+ console.error(error2);
113578
+ onError();
113579
+ }
113580
+ };
113581
+ const getPendingDeletedEntityApprovalRecords = (deletedEntity) => {
113582
+ const entityApproval = getEntityApproval(approvalContext == null ? void 0 : approvalContext.roCrateApproval, deletedEntity == null ? void 0 : deletedEntity["@id"]);
113583
+ if (!Array.isArray(entityApproval == null ? void 0 : entityApproval.approval)) return [];
113584
+ return entityApproval.approval.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.operation) === "delete" && !approvalIsApproved(approvalRecord));
113585
+ };
113586
+ const buildRestoredDeletedEntity = (deletedEntity, approvalRecords) => {
113587
+ const restoredEntity = approvalRecords.reduce((acc, approvalRecord) => {
113588
+ const property = approvalRecord == null ? void 0 : approvalRecord.propertyName;
113589
+ if (!property || property === "@reverse" || (approvalRecord == null ? void 0 : approvalRecord.operation) !== "delete") return acc;
113590
+ if (!propertyValueHasContent(approvalRecord.previousValue)) return acc;
113591
+ if (property === "@id") {
113592
+ acc["@id"] = approvalRecord.previousValue;
113593
+ } else if (property === "@type") {
113594
+ acc["@type"] = [].concat(approvalRecord.previousValue);
113595
+ } else {
113596
+ acc[property] = approvalRecord.previousValue;
113597
+ }
113598
+ return acc;
113599
+ }, {
113600
+ "@id": deletedEntity == null ? void 0 : deletedEntity["@id"],
113601
+ "@type": (deletedEntity == null ? void 0 : deletedEntity["@type"]) ?? ["Thing"],
113602
+ name: (deletedEntity == null ? void 0 : deletedEntity.name) ?? (deletedEntity == null ? void 0 : deletedEntity["@id"])
113603
+ });
113604
+ if (!propertyValueHasContent(restoredEntity.name)) {
113605
+ restoredEntity.name = restoredEntity["@id"];
113606
+ }
113607
+ return restoredEntity;
113608
+ };
113609
+ const restoreDeletedEntityReverseConnections = (restoredEntityId, approvalRecords) => {
113610
+ var _a3;
113611
+ const reverseConnections = (_a3 = approvalRecords.find((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) === "@reverse" && (approvalRecord == null ? void 0 : approvalRecord.operation) === "delete")) == null ? void 0 : _a3.previousValue;
113612
+ if (!reverseConnections || typeof reverseConnections !== "object") return;
113613
+ Object.entries(reverseConnections).forEach(([property, sourceRefs]) => {
113614
+ const refs = Array.isArray(sourceRefs) ? sourceRefs : [sourceRefs];
113615
+ refs.forEach((sourceRef) => {
113616
+ const sourceId = sourceRef == null ? void 0 : sourceRef["@id"];
113617
+ if (!sourceId) return;
113618
+ crateManager.setProperty({
113619
+ id: sourceId,
113620
+ property,
113621
+ value: { "@id": restoredEntityId }
113622
+ });
113623
+ });
113624
+ });
113625
+ };
113626
+ const handleAcceptAiEntityDelete = (deletedEntity = contextEntity, navigateToRoot = false) => {
113627
+ var _a3;
113628
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
113629
+ entityId: deletedEntity == null ? void 0 : deletedEntity["@id"],
113630
+ decision: "accept"
113631
+ });
113632
+ if (navigateToRoot) {
113633
+ onLoadEntity({ id: "./" });
113634
+ }
113635
+ };
113636
+ const handleRestoreAiDeletedEntity = (deletedEntity = contextEntity, navigateToRestored = false) => {
113637
+ var _a3;
113638
+ try {
113639
+ const approvalRecords = getPendingDeletedEntityApprovalRecords(deletedEntity);
113640
+ const restoredEntity = buildRestoredDeletedEntity(deletedEntity, approvalRecords);
113641
+ crateManager.addEntity(restoredEntity);
113642
+ restoreDeletedEntityReverseConnections(restoredEntity["@id"], approvalRecords);
113643
+ const nextEntityId = navigateToRestored ? restoredEntity["@id"] : entity["@id"];
113644
+ const nextEntity = crateManager.getEntity({
113645
+ id: nextEntityId,
113646
+ link: false,
113647
+ materialise: false
113648
+ });
113649
+ if (nextEntity) init2({ entity: nextEntity });
113650
+ saveCratePreservingView();
113651
+ (_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
113652
+ entityId: deletedEntity == null ? void 0 : deletedEntity["@id"],
113653
+ decision: "reject",
113654
+ value: restoredEntity
113655
+ });
113656
+ if (navigateToRestored) {
113657
+ onLoadEntity({ id: restoredEntity["@id"], updateState: false });
113658
+ }
113659
+ } catch (error2) {
113660
+ console.error(error2);
113661
+ onError();
113662
+ }
113663
+ };
112215
113664
  const hasFieldValue = (value) => {
112216
113665
  if (Array.isArray(value)) {
112217
113666
  return value.some(hasFieldValue);
@@ -112224,6 +113673,8 @@ const RenderEntity = forwardRef((props, ref) => {
112224
113673
  }
112225
113674
  return true;
112226
113675
  };
113676
+ const fieldHasPendingAiApproval = (property) => pendingAiApprovalProperties.includes(property) || pendingDeletedEntityReviewProperties.includes(property);
113677
+ const fieldWasAiEdited = (property) => approvedAiApprovalProperties.includes(property);
112227
113678
  const getFieldTitle = (property, label) => {
112228
113679
  var _a3, _b2;
112229
113680
  if (label) return label;
@@ -112233,13 +113684,59 @@ const RenderEntity = forwardRef((props, ref) => {
112233
113684
  entity: contextEntity
112234
113685
  })) == null ? void 0 : _a3.propertyDefinition) == null ? void 0 : _b2.label) || property;
112235
113686
  };
112236
- const matchesFieldTitleFilter = (property, label) => {
113687
+ const getSearchableScalarText = (value) => {
113688
+ if (value === null || typeof value === "undefined") return [];
113689
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
113690
+ return [String(value)];
113691
+ }
113692
+ return [];
113693
+ };
113694
+ const getLinkedEntitySearchText = (value) => {
113695
+ const id2 = typeof (value == null ? void 0 : value["@id"]) === "string" ? value["@id"] : void 0;
113696
+ if (!id2) return [];
113697
+ try {
113698
+ const linkedEntity = crateManager == null ? void 0 : crateManager.getEntity({ id: id2, link: false, materialise: false });
113699
+ if (!linkedEntity || linkedEntity === value) return [];
113700
+ return [
113701
+ ...getSearchableScalarText(linkedEntity["@id"]),
113702
+ ...getSearchableScalarText(linkedEntity.name),
113703
+ ...getSearchableValueText(linkedEntity["@type"])
113704
+ ];
113705
+ } catch {
113706
+ return [];
113707
+ }
113708
+ };
113709
+ const getSearchableValueText = (value) => {
113710
+ const scalarText = getSearchableScalarText(value);
113711
+ if (scalarText.length) return scalarText;
113712
+ if (Array.isArray(value)) {
113713
+ return value.flatMap(getSearchableValueText);
113714
+ }
113715
+ if (value && typeof value === "object") {
113716
+ return [
113717
+ ...Object.values(value).flatMap(getSearchableValueText),
113718
+ ...getLinkedEntitySearchText(value)
113719
+ ];
113720
+ }
113721
+ return [];
113722
+ };
113723
+ const matchesFieldFilter = (property, label) => {
112237
113724
  const filter2 = fieldTitleFilter.trim().toLowerCase();
112238
113725
  if (!filter2) return true;
112239
- return getFieldTitle(property, label).toLowerCase().includes(filter2);
112240
- };
112241
- const shouldRenderCoreField = (property, label) => matchesFieldTitleFilter(property, label);
112242
- const shouldRenderField = (property, label) => matchesFieldTitleFilter(property, label) && (!hideEmptyFields || hasFieldValue(contextEntity == null ? void 0 : contextEntity[property]));
113726
+ const fieldText = [
113727
+ getFieldTitle(property, label),
113728
+ ...getSearchableValueText(contextEntity == null ? void 0 : contextEntity[property])
113729
+ ].join(" ").toLowerCase();
113730
+ return fieldText.includes(filter2);
113731
+ };
113732
+ const shouldRenderCoreField = (property, label) => matchesFieldFilter(property, label) && (!showAiEditedFields || fieldWasAiEdited(property));
113733
+ const shouldRenderField = (property, label) => matchesFieldFilter(property, label) && (!showAiEditedFields || fieldWasAiEdited(property)) && (fieldHasPendingAiApproval(property) || !hideEmptyFields || hasFieldValue(contextEntity == null ? void 0 : contextEntity[property]));
113734
+ const entityPropertyNames = useMemo$1(() => Array.from(/* @__PURE__ */ new Set([
113735
+ ...Object.keys(contextEntity ?? {}),
113736
+ ...pendingAiApprovalProperties,
113737
+ ...pendingDeletedEntityReviewProperties,
113738
+ ...approvedAiApprovalProperties
113739
+ ])).sort(), [approvedAiApprovalProperties, contextEntity, pendingAiApprovalProperties, pendingDeletedEntityReviewProperties]);
112243
113740
  const editorScrollClassName = `describo-editor-scroll ${quickSettingsVisible ? "px-3 pb-3 pt-0" : "p-3"}`;
112244
113741
  if (!entity || !entity["@id"]) {
112245
113742
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "No entity selected" });
@@ -112267,7 +113764,7 @@ const RenderEntity = forwardRef((props, ref) => {
112267
113764
  style: { marginRight: 8 },
112268
113765
  onClick: () => setQuickSettingsVisible((visible) => !visible),
112269
113766
  type: quickSettingsVisible ? "primary" : "default",
112270
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$7, {}),
113767
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$8, {}),
112271
113768
  "aria-label": "Quick filter settings",
112272
113769
  "aria-pressed": quickSettingsVisible
112273
113770
  }
@@ -112287,13 +113784,31 @@ const RenderEntity = forwardRef((props, ref) => {
112287
113784
  }
112288
113785
  )
112289
113786
  ] }),
112290
- !renderTabs && (((_c = state.configuration) == null ? void 0 : _c.tabLocation) === "left" || ((_d = state.configuration) == null ? void 0 : _d.tabLocation) === "right" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: contentContainerRef, className: "min-h-0 overflow-hidden", style: { height: scrollViewportHeight ? `${scrollViewportHeight}px` : "calc(100vh - 200px)" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Ve, { vertical: false, proportionalLayout: false, separator: !iconView, onChange: (sizes2) => {
113787
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
113788
+ AiApprovalStepperHeader,
113789
+ {
113790
+ activeIndex: selectedAiApprovalIndex,
113791
+ pendingCount: pendingAiApprovals.length,
113792
+ activePropertyLabel: selectedAiApprovalProperty ? getFieldTitle(selectedAiApprovalProperty) : void 0,
113793
+ remainingEntityCount: pendingOtherAiApprovalEntities.length,
113794
+ remainingFieldCount: pendingOtherAiApprovalFieldCount,
113795
+ readonly: (_c = state.configuration) == null ? void 0 : _c.readonly,
113796
+ canGoPrevious: selectedAiApprovalIndex > 0,
113797
+ canGoNext: selectedAiApprovalIndex < pendingAiApprovals.length - 1,
113798
+ onPrevious: () => navigateToAiApproval(selectedAiApprovalIndex - 1),
113799
+ onNext: () => navigateToAiApproval(selectedAiApprovalIndex + 1),
113800
+ onAcceptAll: handleAcceptAllAiApprovals,
113801
+ onRejectAll: handleRejectAllAiApprovals,
113802
+ onReviewNextEntity: handleReviewNextAiApprovalEntity
113803
+ }
113804
+ ),
113805
+ !renderTabs && (((_d = state.configuration) == null ? void 0 : _d.tabLocation) === "left" || ((_e2 = state.configuration) == null ? void 0 : _e2.tabLocation) === "right" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: contentContainerRef, className: "min-h-0 overflow-hidden", style: { height: scrollViewportHeight ? `${scrollViewportHeight}px` : "calc(100vh - 200px)" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Ve, { vertical: false, proportionalLayout: false, separator: !iconView, onChange: (sizes2) => {
112291
113806
  var _a3;
112292
113807
  const w2 = ((_a3 = state.configuration) == null ? void 0 : _a3.tabLocation) === "left" ? sizes2[0] : sizes2[1];
112293
113808
  setTabPaneWidth(w2);
112294
113809
  persistTabWidth(w2);
112295
113810
  }, children: [
112296
- ((_e2 = state.configuration) == null ? void 0 : _e2.tabLocation) === "left" && /* @__PURE__ */ jsxRuntimeExports.jsx(Ve.Pane, { minSize: iconView ? ICON_TAB_PANE_WIDTH : MIN_LABEL_TAB_PANE_WIDTH, maxSize: iconView ? ICON_TAB_PANE_WIDTH : MAX_LABEL_TAB_PANE_WIDTH, preferredSize: iconView ? ICON_TAB_PANE_WIDTH : tabPaneWidth, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative group h-full border-r border-slate-200", children: [
113811
+ ((_f = state.configuration) == null ? void 0 : _f.tabLocation) === "left" && /* @__PURE__ */ jsxRuntimeExports.jsx(Ve.Pane, { minSize: iconView ? ICON_TAB_PANE_WIDTH : MIN_LABEL_TAB_PANE_WIDTH, maxSize: iconView ? ICON_TAB_PANE_WIDTH : MAX_LABEL_TAB_PANE_WIDTH, preferredSize: iconView ? ICON_TAB_PANE_WIDTH : tabPaneWidth, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative group h-full border-r border-slate-200", children: [
112297
113812
  renderProfileActionRail(),
112298
113813
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute right-0 top-0 bottom-0 w-1 bg-slate-300 opacity-0 group-hover:opacity-100" })
112299
113814
  ] }) }),
@@ -112303,11 +113818,12 @@ const RenderEntity = forwardRef((props, ref) => {
112303
113818
  /* @__PURE__ */ jsxRuntimeExports.jsx(
112304
113819
  "div",
112305
113820
  {
112306
- className: `flex-grow describo-property describo-property-name-id ${savedProperty === "@id" ? "bg-green-200 rounded p-1 my-1" : ""}`,
112307
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityId, { entity: contextEntity, onUpdate: handleUpdateEntity })
113821
+ "data-recrate-property": "@id",
113822
+ className: `flex-grow describo-property describo-property-name-id ${savedProperty === "@id" ? "bg-green-200 rounded p-1 my-1" : ""} ${selectedAiApprovalProperty === "@id" ? "describo-ai-review-current" : ""}`,
113823
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityId, { entity: contextEntity, onUpdate: handleUpdateEntity, aiEdited: fieldWasAiEdited("@id") })
112308
113824
  }
112309
113825
  ),
112310
- !((_f = state.configuration) == null ? void 0 : _f.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx(
113826
+ !((_g = state.configuration) == null ? void 0 : _g.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx(
112311
113827
  "button",
112312
113828
  {
112313
113829
  className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",
@@ -112316,7 +113832,7 @@ const RenderEntity = forwardRef((props, ref) => {
112316
113832
  }
112317
113833
  )
112318
113834
  ] }),
112319
- !shouldRenderCoreField("@id") && !((_g = state.configuration) == null ? void 0 : _g.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row place-content-between my-2 p-2", children: [
113835
+ !shouldRenderCoreField("@id") && !((_h = state.configuration) == null ? void 0 : _h.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row place-content-between my-2 p-2", children: [
112320
113836
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow" }),
112321
113837
  /* @__PURE__ */ jsxRuntimeExports.jsx(
112322
113838
  "button",
@@ -112327,21 +113843,31 @@ const RenderEntity = forwardRef((props, ref) => {
112327
113843
  }
112328
113844
  )
112329
113845
  ] }),
112330
- shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `my-2 p-2 describo-property describo-property-name-type`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityType, { entity: contextEntity, onUpdateEntity: handleUpdateEntity }) }),
113846
+ shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-recrate-property": "@type", className: `my-2 p-2 describo-property describo-property-name-type ${selectedAiApprovalProperty === "@type" ? "describo-ai-review-current" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityType, { entity: contextEntity, onUpdateEntity: handleUpdateEntity, aiEdited: fieldWasAiEdited("@type") }) }),
112331
113847
  shouldRenderCoreField("name") && /* @__PURE__ */ jsxRuntimeExports.jsx(
112332
113848
  "div",
112333
113849
  {
113850
+ "data-recrate-property": "name",
112334
113851
  className: `my-2 p-2 describo-property describo-property-name-name ${savedProperty === "name" ? "bg-green-200 rounded" : ""}`,
112335
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityName, { entity: contextEntity, onUpdate: handleUpdateEntity, showHelp: showFieldHelp })
113852
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
113853
+ EntityName,
113854
+ {
113855
+ entity: contextEntity,
113856
+ onUpdate: handleUpdateCoreProperty,
113857
+ showHelp: showFieldHelp,
113858
+ aiEdited: fieldWasAiEdited("name"),
113859
+ aiReview: getCoreAiReviewProps("name")
113860
+ }
113861
+ )
112336
113862
  }
112337
113863
  ),
112338
- Object.keys(contextEntity).sort().map((property) => {
113864
+ entityPropertyNames.map((property) => {
112339
113865
  if (!["@id", "@type", "name", "@reverse"].includes(property) && shouldRenderField(property)) {
112340
113866
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
112341
113867
  "div",
112342
113868
  {
112343
113869
  "data-recrate-property": property,
112344
- className: `${showFieldHelp ? "my-2" : "my-1"} hover:bg-sky-100 ${savedProperty === property ? "bg-green-200 hover:bg-green-200" : ""}`,
113870
+ className: `${showFieldHelp ? "my-2" : "my-1"} hover:bg-sky-100 ${savedProperty === property ? "bg-green-200 hover:bg-green-200" : ""} ${selectedAiApprovalProperty === property ? "describo-ai-review-current" : ""}`,
112345
113871
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
112346
113872
  EntityProperty,
112347
113873
  {
@@ -112351,13 +113877,18 @@ const RenderEntity = forwardRef((props, ref) => {
112351
113877
  highlightRequired: highlightRequiredProperties,
112352
113878
  savedProperty: savedProperty === property,
112353
113879
  showHelp: showFieldHelp,
113880
+ aiEdited: fieldWasAiEdited(property),
112354
113881
  onLoadEntity: handleLoadEntityWithContext,
112355
113882
  onCreateEntity: handleCreateEntity,
112356
113883
  onLinkEntity: handleLinkEntity,
112357
113884
  onUnlinkEntity: handleUnlinkEntity,
112358
113885
  onCreateProperty: handleCreateProperty,
112359
113886
  onSaveProperty: handleUpdateEntity,
112360
- onDeleteProperty: handleDeleteProperty
113887
+ onDeleteProperty: handleDeleteProperty,
113888
+ onAcceptAiEntityDelete: (deletedEntity) => handleAcceptAiEntityDelete(deletedEntity),
113889
+ onRestoreAiDeletedEntity: (deletedEntity) => handleRestoreAiDeletedEntity(deletedEntity),
113890
+ onAcceptAiEntityEdit: (editedEntity) => handleAcceptAiEntityEdit(editedEntity),
113891
+ onRejectAiEntityEdit: (editedEntity) => handleRejectAiEntityEdit(editedEntity)
112361
113892
  }
112362
113893
  )
112363
113894
  },
@@ -112367,11 +113898,11 @@ const RenderEntity = forwardRef((props, ref) => {
112367
113898
  return null;
112368
113899
  })
112369
113900
  ] }) }),
112370
- ((_h = state.configuration) == null ? void 0 : _h.tabLocation) === "right" && /* @__PURE__ */ jsxRuntimeExports.jsx(Ve.Pane, { minSize: iconView ? ICON_TAB_PANE_WIDTH : MIN_LABEL_TAB_PANE_WIDTH, maxSize: iconView ? ICON_TAB_PANE_WIDTH : MAX_LABEL_TAB_PANE_WIDTH, preferredSize: iconView ? ICON_TAB_PANE_WIDTH : tabPaneWidth, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative group h-full border-l border-slate-200", children: [
113901
+ ((_i = state.configuration) == null ? void 0 : _i.tabLocation) === "right" && /* @__PURE__ */ jsxRuntimeExports.jsx(Ve.Pane, { minSize: iconView ? ICON_TAB_PANE_WIDTH : MIN_LABEL_TAB_PANE_WIDTH, maxSize: iconView ? ICON_TAB_PANE_WIDTH : MAX_LABEL_TAB_PANE_WIDTH, preferredSize: iconView ? ICON_TAB_PANE_WIDTH : tabPaneWidth, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative group h-full border-l border-slate-200", children: [
112371
113902
  renderProfileActionRail(),
112372
113903
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-slate-300 opacity-0 group-hover:opacity-100" })
112373
113904
  ] }) })
112374
- ] }, `untabbed-${(_i = state.configuration) == null ? void 0 : _i.tabLocation}-${iconView ? "icon" : "label"}`) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: contentContainerRef, className: "flex min-h-0 overflow-hidden", style: {
113905
+ ] }, `untabbed-${(_j = state.configuration) == null ? void 0 : _j.tabLocation}-${iconView ? "icon" : "label"}`) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: contentContainerRef, className: "flex min-h-0 overflow-hidden", style: {
112375
113906
  flexDirection: "column",
112376
113907
  height: scrollViewportHeight ? `${scrollViewportHeight}px` : "calc(100vh - 200px)"
112377
113908
  }, children: [
@@ -112393,11 +113924,12 @@ const RenderEntity = forwardRef((props, ref) => {
112393
113924
  /* @__PURE__ */ jsxRuntimeExports.jsx(
112394
113925
  "div",
112395
113926
  {
112396
- className: `flex-grow describo-property describo-property-name-id ${savedProperty === "@id" ? "bg-green-200 rounded p-1 my-1" : ""}`,
112397
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityId, { entity: contextEntity, onUpdate: handleUpdateEntity })
113927
+ "data-recrate-property": "@id",
113928
+ className: `flex-grow describo-property describo-property-name-id ${savedProperty === "@id" ? "bg-green-200 rounded p-1 my-1" : ""} ${selectedAiApprovalProperty === "@id" ? "describo-ai-review-current" : ""}`,
113929
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityId, { entity: contextEntity, onUpdate: handleUpdateEntity, aiEdited: fieldWasAiEdited("@id") })
112398
113930
  }
112399
113931
  ),
112400
- !((_j = state.configuration) == null ? void 0 : _j.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx(
113932
+ !((_k = state.configuration) == null ? void 0 : _k.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx(
112401
113933
  "button",
112402
113934
  {
112403
113935
  className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",
@@ -112406,7 +113938,7 @@ const RenderEntity = forwardRef((props, ref) => {
112406
113938
  }
112407
113939
  )
112408
113940
  ] }),
112409
- !shouldRenderCoreField("@id") && !((_k = state.configuration) == null ? void 0 : _k.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row place-content-between my-2 p-2", children: [
113941
+ !shouldRenderCoreField("@id") && !((_l = state.configuration) == null ? void 0 : _l.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row place-content-between my-2 p-2", children: [
112410
113942
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow" }),
112411
113943
  /* @__PURE__ */ jsxRuntimeExports.jsx(
112412
113944
  "button",
@@ -112417,21 +113949,31 @@ const RenderEntity = forwardRef((props, ref) => {
112417
113949
  }
112418
113950
  )
112419
113951
  ] }),
112420
- shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `my-2 p-2 describo-property describo-property-name-type`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityType, { entity: contextEntity, onUpdateEntity: handleUpdateEntity }) }),
113952
+ shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-recrate-property": "@type", className: `my-2 p-2 describo-property describo-property-name-type ${selectedAiApprovalProperty === "@type" ? "describo-ai-review-current" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityType, { entity: contextEntity, onUpdateEntity: handleUpdateEntity, aiEdited: fieldWasAiEdited("@type") }) }),
112421
113953
  shouldRenderCoreField("name") && /* @__PURE__ */ jsxRuntimeExports.jsx(
112422
113954
  "div",
112423
113955
  {
113956
+ "data-recrate-property": "name",
112424
113957
  className: `my-2 p-2 describo-property describo-property-name-name ${savedProperty === "name" ? "bg-green-200 rounded p-1 my-1" : ""}`,
112425
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityName, { entity: contextEntity, onUpdate: handleUpdateEntity, showHelp: showFieldHelp })
113958
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
113959
+ EntityName,
113960
+ {
113961
+ entity: contextEntity,
113962
+ onUpdate: handleUpdateCoreProperty,
113963
+ showHelp: showFieldHelp,
113964
+ aiEdited: fieldWasAiEdited("name"),
113965
+ aiReview: getCoreAiReviewProps("name")
113966
+ }
113967
+ )
112426
113968
  }
112427
113969
  ),
112428
- Object.keys(contextEntity).sort().map((property) => {
113970
+ entityPropertyNames.map((property) => {
112429
113971
  if (!["@id", "@type", "name", "@reverse"].includes(property) && shouldRenderField(property)) {
112430
113972
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
112431
113973
  "div",
112432
113974
  {
112433
113975
  "data-recrate-property": property,
112434
- className: `${showFieldHelp ? "my-2" : "my-1"} hover:bg-sky-100 ${savedProperty === property ? "bg-green-200 hover:bg-green-200" : ""}`,
113976
+ className: `${showFieldHelp ? "my-2" : "my-1"} hover:bg-sky-100 ${savedProperty === property ? "bg-green-200 hover:bg-green-200" : ""} ${selectedAiApprovalProperty === property ? "describo-ai-review-current" : ""}`,
112435
113977
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
112436
113978
  EntityProperty,
112437
113979
  {
@@ -112441,13 +113983,18 @@ const RenderEntity = forwardRef((props, ref) => {
112441
113983
  highlightRequired: highlightRequiredProperties,
112442
113984
  savedProperty: savedProperty === property,
112443
113985
  showHelp: showFieldHelp,
113986
+ aiEdited: fieldWasAiEdited(property),
112444
113987
  onLoadEntity: handleLoadEntityWithContext,
112445
113988
  onCreateEntity: handleCreateEntity,
112446
113989
  onLinkEntity: handleLinkEntity,
112447
113990
  onUnlinkEntity: handleUnlinkEntity,
112448
113991
  onCreateProperty: handleCreateProperty,
112449
113992
  onSaveProperty: handleUpdateEntity,
112450
- onDeleteProperty: handleDeleteProperty
113993
+ onDeleteProperty: handleDeleteProperty,
113994
+ onAcceptAiEntityDelete: (deletedEntity) => handleAcceptAiEntityDelete(deletedEntity),
113995
+ onRestoreAiDeletedEntity: (deletedEntity) => handleRestoreAiDeletedEntity(deletedEntity),
113996
+ onAcceptAiEntityEdit: (editedEntity) => handleAcceptAiEntityEdit(editedEntity),
113997
+ onRejectAiEntityEdit: (editedEntity) => handleRejectAiEntityEdit(editedEntity)
112451
113998
  }
112452
113999
  )
112453
114000
  },
@@ -112470,7 +114017,7 @@ const RenderEntity = forwardRef((props, ref) => {
112470
114017
  ] }) }),
112471
114018
  /* @__PURE__ */ jsxRuntimeExports.jsx(Ve.Pane, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: activeContentRef, className: `${editorScrollClassName} h-full overflow-y-auto scroll-smooth min-h-0`, children: [
112472
114019
  renderQuickSettingsHeader(),
112473
- !((_l = state.configuration) == null ? void 0 : _l.readonly) && ((_m = tabs.find((t22) => t22.name === activeTab)) == null ? void 0 : _m.missingRequiredData) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-red-600 float-right mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
114020
+ !((_m = state.configuration) == null ? void 0 : _m.readonly) && ((_n = tabs.find((t22) => t22.name === activeTab)) == null ? void 0 : _n.missingRequiredData) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-red-600 float-right mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
112474
114021
  "button",
112475
114022
  {
112476
114023
  className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded text-sm",
@@ -112482,25 +114029,36 @@ const RenderEntity = forwardRef((props, ref) => {
112482
114029
  shouldRenderCoreField("@id") && /* @__PURE__ */ jsxRuntimeExports.jsx(
112483
114030
  "div",
112484
114031
  {
112485
- className: `p-2 describo-property describo-property-name-id ${savedProperty === "@id" ? "bg-green-200 rounded" : ""}`,
112486
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityId, { entity: contextEntity, onUpdate: handleUpdateEntity })
114032
+ "data-recrate-property": "@id",
114033
+ className: `p-2 describo-property describo-property-name-id ${savedProperty === "@id" ? "bg-green-200 rounded" : ""} ${selectedAiApprovalProperty === "@id" ? "describo-ai-review-current" : ""}`,
114034
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityId, { entity: contextEntity, onUpdate: handleUpdateEntity, aiEdited: fieldWasAiEdited("@id") })
112487
114035
  }
112488
114036
  ),
112489
- shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-2 describo-property describo-property-name-type", children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityType, { entity: contextEntity, onUpdateEntity: handleUpdateEntity }) }),
114037
+ shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-recrate-property": "@type", className: `p-2 describo-property describo-property-name-type ${selectedAiApprovalProperty === "@type" ? "describo-ai-review-current" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityType, { entity: contextEntity, onUpdateEntity: handleUpdateEntity, aiEdited: fieldWasAiEdited("@type") }) }),
112490
114038
  shouldRenderCoreField("name") && /* @__PURE__ */ jsxRuntimeExports.jsx(
112491
114039
  "div",
112492
114040
  {
114041
+ "data-recrate-property": "name",
112493
114042
  className: `p-2 describo-property describo-property-name-name ${savedProperty === "name" ? "bg-green-200 rounded" : ""}`,
112494
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityName, { entity: contextEntity, onUpdate: handleUpdateEntity, showHelp: showFieldHelp })
114043
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
114044
+ EntityName,
114045
+ {
114046
+ entity: contextEntity,
114047
+ onUpdate: handleUpdateCoreProperty,
114048
+ showHelp: showFieldHelp,
114049
+ aiEdited: fieldWasAiEdited("name"),
114050
+ aiReview: getCoreAiReviewProps("name")
114051
+ }
114052
+ )
112495
114053
  }
112496
114054
  ),
112497
- (_n = tabs.find((tab) => tab.name === "about")) == null ? void 0 : _n.inputs.map((input) => {
114055
+ (_o = tabs.find((tab) => tab.name === "about")) == null ? void 0 : _o.inputs.map((input) => {
112498
114056
  if (!["@id", "@type", "name", "@reverse"].includes(input.name) && shouldRenderField(input.name, input.label)) {
112499
114057
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
112500
114058
  "div",
112501
114059
  {
112502
114060
  "data-recrate-property": input.name,
112503
- className: `${showFieldHelp ? "p-2" : "px-2 py-1"} hover:bg-sky-100 ${savedProperty === input.name ? "bg-green-200 hover:bg-green-200" : ""}`,
114061
+ className: `${showFieldHelp ? "p-2" : "px-2 py-1"} hover:bg-sky-100 ${savedProperty === input.name ? "bg-green-200 hover:bg-green-200" : ""} ${selectedAiApprovalProperty === input.name ? "describo-ai-review-current" : ""}`,
112504
114062
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
112505
114063
  EntityProperty,
112506
114064
  {
@@ -112510,13 +114068,18 @@ const RenderEntity = forwardRef((props, ref) => {
112510
114068
  highlightRequired: highlightRequiredProperties,
112511
114069
  savedProperty: savedProperty === input.name,
112512
114070
  showHelp: showFieldHelp,
114071
+ aiEdited: fieldWasAiEdited(input.name),
112513
114072
  onLoadEntity: handleLoadEntityWithContext,
112514
114073
  onCreateEntity: handleCreateEntity,
112515
114074
  onLinkEntity: handleLinkEntity,
112516
114075
  onUnlinkEntity: handleUnlinkEntity,
112517
114076
  onCreateProperty: handleCreateProperty,
112518
114077
  onSaveProperty: handleUpdateEntity,
112519
- onDeleteProperty: handleDeleteProperty
114078
+ onDeleteProperty: handleDeleteProperty,
114079
+ onAcceptAiEntityDelete: (deletedEntity) => handleAcceptAiEntityDelete(deletedEntity),
114080
+ onRestoreAiDeletedEntity: (deletedEntity) => handleRestoreAiDeletedEntity(deletedEntity),
114081
+ onAcceptAiEntityEdit: (editedEntity) => handleAcceptAiEntityEdit(editedEntity),
114082
+ onRejectAiEntityEdit: (editedEntity) => handleRejectAiEntityEdit(editedEntity)
112520
114083
  }
112521
114084
  )
112522
114085
  },
@@ -112534,7 +114097,7 @@ const RenderEntity = forwardRef((props, ref) => {
112534
114097
  "div",
112535
114098
  {
112536
114099
  "data-recrate-property": input.name,
112537
- className: `${showFieldHelp ? "p-2" : "px-2 py-1"} hover:bg-sky-100 ${savedProperty === input.name ? "bg-green-200 hover:bg-green-200" : ""}`,
114100
+ className: `${showFieldHelp ? "p-2" : "px-2 py-1"} hover:bg-sky-100 ${savedProperty === input.name ? "bg-green-200 hover:bg-green-200" : ""} ${selectedAiApprovalProperty === input.name ? "describo-ai-review-current" : ""}`,
112538
114101
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
112539
114102
  EntityProperty,
112540
114103
  {
@@ -112544,13 +114107,18 @@ const RenderEntity = forwardRef((props, ref) => {
112544
114107
  highlightRequired: highlightRequiredProperties,
112545
114108
  savedProperty: savedProperty === input.name,
112546
114109
  showHelp: showFieldHelp,
114110
+ aiEdited: fieldWasAiEdited(input.name),
112547
114111
  onLoadEntity: handleLoadEntityWithContext,
112548
114112
  onCreateEntity: handleCreateEntity,
112549
114113
  onLinkEntity: handleLinkEntity,
112550
114114
  onUnlinkEntity: handleUnlinkEntity,
112551
114115
  onCreateProperty: handleCreateProperty,
112552
114116
  onSaveProperty: handleUpdateEntity,
112553
- onDeleteProperty: handleDeleteProperty
114117
+ onDeleteProperty: handleDeleteProperty,
114118
+ onAcceptAiEntityDelete: (deletedEntity) => handleAcceptAiEntityDelete(deletedEntity),
114119
+ onRestoreAiDeletedEntity: (deletedEntity) => handleRestoreAiDeletedEntity(deletedEntity),
114120
+ onAcceptAiEntityEdit: (editedEntity) => handleAcceptAiEntityEdit(editedEntity),
114121
+ onRejectAiEntityEdit: (editedEntity) => handleRejectAiEntityEdit(editedEntity)
112554
114122
  }
112555
114123
  )
112556
114124
  },
@@ -112563,7 +114131,7 @@ const RenderEntity = forwardRef((props, ref) => {
112563
114131
  return null;
112564
114132
  })
112565
114133
  ] }) })
112566
- ] }, `tabbed-${(_o = state.configuration) == null ? void 0 : _o.tabLocation}-${iconView ? "icon" : "label"}`) })
114134
+ ] }, `tabbed-${(_p = state.configuration) == null ? void 0 : _p.tabLocation}-${iconView ? "icon" : "label"}`) })
112567
114135
  ] }),
112568
114136
  /* @__PURE__ */ jsxRuntimeExports.jsx(
112569
114137
  Drawer2,
@@ -120913,13 +122481,110 @@ var EmotionCacheContext = /* @__PURE__ */ React.createContext(
120913
122481
  }) : null
120914
122482
  );
120915
122483
  var CacheProvider = EmotionCacheContext.Provider;
120916
- const version = "0.1.30";
122484
+ const version = "0.1.32-test";
120917
122485
  const pkg = {
120918
122486
  version
120919
122487
  };
120920
122488
  const antdCache = createScopedCache("recrate");
122489
+ const markApprovalRecordsApproved = (approvalState, entityId, propertyName2) => {
122490
+ const approvalRecords = [];
122491
+ let changed = false;
122492
+ const updateEntityApproval = (entityApproval) => {
122493
+ if (!entityApproval || !entityIdsMatch(entityApproval["@id"], entityId) || !Array.isArray(entityApproval.approval)) {
122494
+ return entityApproval;
122495
+ }
122496
+ let entityChanged = false;
122497
+ const nextApprovalRecords = entityApproval.approval.map((approvalRecord) => {
122498
+ if ((approvalRecord == null ? void 0 : approvalRecord.propertyName) !== propertyName2) {
122499
+ return approvalRecord;
122500
+ }
122501
+ const nextApprovalRecord = { ...approvalRecord, approved: true };
122502
+ approvalRecords.push(nextApprovalRecord);
122503
+ if (approvalRecord.approved !== true) {
122504
+ entityChanged = true;
122505
+ }
122506
+ return nextApprovalRecord;
122507
+ });
122508
+ if (!entityChanged) return entityApproval;
122509
+ changed = true;
122510
+ return {
122511
+ ...entityApproval,
122512
+ approval: nextApprovalRecords
122513
+ };
122514
+ };
122515
+ if (Array.isArray(approvalState)) {
122516
+ const nextApprovalState = approvalState.map(updateEntityApproval);
122517
+ return { nextApprovalState, approvalRecords, changed };
122518
+ }
122519
+ if (approvalState && typeof approvalState === "object") {
122520
+ if (Array.isArray(approvalState.approval)) {
122521
+ return {
122522
+ nextApprovalState: updateEntityApproval(approvalState),
122523
+ approvalRecords,
122524
+ changed
122525
+ };
122526
+ }
122527
+ if (Array.isArray(approvalState.items)) {
122528
+ const nextItems = approvalState.items.map(updateEntityApproval);
122529
+ return {
122530
+ nextApprovalState: changed ? { ...approvalState, items: nextItems } : approvalState,
122531
+ approvalRecords,
122532
+ changed
122533
+ };
122534
+ }
122535
+ }
122536
+ return { nextApprovalState: approvalState, approvalRecords, changed };
122537
+ };
122538
+ const markEntityApprovalRecordsApproved = (approvalState, entityId) => {
122539
+ const approvalRecords = [];
122540
+ let changed = false;
122541
+ const updateEntityApproval = (entityApproval) => {
122542
+ if (!entityApproval || !entityIdsMatch(entityApproval["@id"], entityId) || !Array.isArray(entityApproval.approval)) {
122543
+ return entityApproval;
122544
+ }
122545
+ let entityChanged = false;
122546
+ const nextApprovalRecords = entityApproval.approval.map((approvalRecord) => {
122547
+ if ((approvalRecord == null ? void 0 : approvalRecord.approved) === true || (approvalRecord == null ? void 0 : approvalRecord.approved) === "true") {
122548
+ return approvalRecord;
122549
+ }
122550
+ const nextApprovalRecord = { ...approvalRecord, approved: true };
122551
+ approvalRecords.push(nextApprovalRecord);
122552
+ entityChanged = true;
122553
+ return nextApprovalRecord;
122554
+ });
122555
+ if (!entityChanged) return entityApproval;
122556
+ changed = true;
122557
+ return {
122558
+ ...entityApproval,
122559
+ approval: nextApprovalRecords
122560
+ };
122561
+ };
122562
+ if (Array.isArray(approvalState)) {
122563
+ const nextApprovalState = approvalState.map(updateEntityApproval);
122564
+ return { nextApprovalState, approvalRecords, changed };
122565
+ }
122566
+ if (approvalState && typeof approvalState === "object") {
122567
+ if (Array.isArray(approvalState.approval)) {
122568
+ return {
122569
+ nextApprovalState: updateEntityApproval(approvalState),
122570
+ approvalRecords,
122571
+ changed
122572
+ };
122573
+ }
122574
+ if (Array.isArray(approvalState.items)) {
122575
+ const nextItems = approvalState.items.map(updateEntityApproval);
122576
+ return {
122577
+ nextApprovalState: changed ? { ...approvalState, items: nextItems } : approvalState,
122578
+ approvalRecords,
122579
+ changed
122580
+ };
122581
+ }
122582
+ }
122583
+ return { nextApprovalState: approvalState, approvalRecords, changed };
122584
+ };
120921
122585
  const ProfileManagerContext = React__default.createContext(null);
120922
122586
  const CrateManagerContext = React__default.createContext(null);
122587
+ const RoCrateApprovalContext = React__default.createContext(null);
120923
122588
  const LookupsContext = React__default.createContext(null);
120924
122589
  function DescriboCrateBuilder(props) {
120925
122590
  const { stateScopeKey } = props;
@@ -120928,6 +122593,7 @@ function DescriboCrateBuilder(props) {
120928
122593
  function DescriboCrateBuilderInner(props) {
120929
122594
  const {
120930
122595
  crate,
122596
+ roCrateApproval,
120931
122597
  profile,
120932
122598
  entityId,
120933
122599
  lookup,
@@ -120953,6 +122619,7 @@ function DescriboCrateBuilderInner(props) {
120953
122619
  onWarning,
120954
122620
  onNavigation,
120955
122621
  onSaveCrate,
122622
+ onSaveRoCrateApproval,
120956
122623
  onSaveEntityTemplate,
120957
122624
  onAddNewProfileRequest,
120958
122625
  onRemoveProfile
@@ -120963,10 +122630,56 @@ function DescriboCrateBuilderInner(props) {
120963
122630
  const [cm, setCm] = useState(null);
120964
122631
  const [pm, setPm] = useState(null);
120965
122632
  const [lookups, setLookups] = useState(null);
122633
+ const [approvalState, setApprovalState] = useState(roCrateApproval);
120966
122634
  const state = useStateStore();
120967
122635
  const renderEntityRef = useRef(null);
120968
122636
  const keys2 = useRef({ cm: 0, pm: 0, lookups: 0 });
120969
122637
  const lastHandledEntityIdRef = useRef(void 0);
122638
+ useEffect(() => {
122639
+ setApprovalState(roCrateApproval);
122640
+ }, [roCrateApproval]);
122641
+ const markApprovalPropertyApproved = useCallback((params) => {
122642
+ const { entityId: entityId2, propertyName: propertyName2, decision, value } = params;
122643
+ if (!entityId2 || !propertyName2) return;
122644
+ const { nextApprovalState, approvalRecords, changed } = markApprovalRecordsApproved(
122645
+ approvalState,
122646
+ entityId2,
122647
+ propertyName2
122648
+ );
122649
+ if (!changed && approvalRecords.length === 0) return;
122650
+ setApprovalState(nextApprovalState);
122651
+ onSaveRoCrateApproval == null ? void 0 : onSaveRoCrateApproval({
122652
+ roCrateApproval: nextApprovalState,
122653
+ entityId: entityId2,
122654
+ propertyName: propertyName2,
122655
+ decision,
122656
+ approvalRecords,
122657
+ value
122658
+ });
122659
+ }, [approvalState, onSaveRoCrateApproval]);
122660
+ const markApprovalEntityApproved = useCallback((params) => {
122661
+ const { entityId: entityId2, decision, value } = params;
122662
+ if (!entityId2) return;
122663
+ const { nextApprovalState, approvalRecords, changed } = markEntityApprovalRecordsApproved(
122664
+ approvalState,
122665
+ entityId2
122666
+ );
122667
+ if (!changed && approvalRecords.length === 0) return;
122668
+ setApprovalState(nextApprovalState);
122669
+ onSaveRoCrateApproval == null ? void 0 : onSaveRoCrateApproval({
122670
+ roCrateApproval: nextApprovalState,
122671
+ entityId: entityId2,
122672
+ propertyName: "*",
122673
+ decision,
122674
+ approvalRecords,
122675
+ value
122676
+ });
122677
+ }, [approvalState, onSaveRoCrateApproval]);
122678
+ const approvalContextValue = useMemo$1(() => ({
122679
+ roCrateApproval: approvalState,
122680
+ markApprovalPropertyApproved,
122681
+ markApprovalEntityApproved
122682
+ }), [approvalState, markApprovalEntityApproved, markApprovalPropertyApproved]);
120970
122683
  const configuration = useMemo$1(() => {
120971
122684
  const config2 = {
120972
122685
  enableContextEditor,
@@ -121106,7 +122819,7 @@ function DescriboCrateBuilderInner(props) {
121106
122819
  console.error("Error in handleSetCurrentEntity:", error22);
121107
122820
  onError == null ? void 0 : onError({ error: "Failed to set entity" });
121108
122821
  }
121109
- }, [cm, onNavigation]);
122822
+ }, [cm, onNavigation, state.editorState]);
121110
122823
  const handleAddProfileRequest = useCallback((requested) => {
121111
122824
  try {
121112
122825
  onAddNewProfileRequest == null ? void 0 : onAddNewProfileRequest(requested);
@@ -121158,7 +122871,7 @@ function DescriboCrateBuilderInner(props) {
121158
122871
  onSaveCrate == null ? void 0 : onSaveCrate({ crate: exported, entityId: currentEntityId });
121159
122872
  };
121160
122873
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate", children: [
121161
- /* @__PURE__ */ jsxRuntimeExports.jsx(CacheProvider, { value: antdCache, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConfigProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, { className: "recrate-ant", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileManagerContext.Provider, { value: pm, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrateManagerContext.Provider, { value: cm, children: /* @__PURE__ */ jsxRuntimeExports.jsx(LookupsContext.Provider, { value: lookups, children: ready && !error2 && contextEntity && /* @__PURE__ */ jsxRuntimeExports.jsx(
122874
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CacheProvider, { value: antdCache, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConfigProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, { className: "recrate-ant", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileManagerContext.Provider, { value: pm, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrateManagerContext.Provider, { value: cm, children: /* @__PURE__ */ jsxRuntimeExports.jsx(RoCrateApprovalContext.Provider, { value: approvalContextValue, children: /* @__PURE__ */ jsxRuntimeExports.jsx(LookupsContext.Provider, { value: lookups, children: ready && !error2 && contextEntity && /* @__PURE__ */ jsxRuntimeExports.jsx(
121162
122875
  RenderEntity,
121163
122876
  {
121164
122877
  ref: renderEntityRef,
@@ -121171,7 +122884,7 @@ function DescriboCrateBuilderInner(props) {
121171
122884
  onAddNewProfileRequest: handleAddProfileRequest,
121172
122885
  onRemoveProfile
121173
122886
  }
121174
- ) }) }) }) }) }) }),
122887
+ ) }) }) }) }) }) }) }),
121175
122888
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pointer-events-none fixed bottom-2 right-2 z-50 text-xs text-gray-400", children: [
121176
122889
  "v",
121177
122890
  pkg.version