index.js 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. var at = Object.defineProperty;
  2. var ot = (t, e, n) => e in t ? at(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
  3. var l = (t, e, n) => ot(t, typeof e != "symbol" ? e + "" : e, n);
  4. import { createIdentifier as ct, Inject as F, Injector as Q, Disposable as X, DisposableCollection as lt, toDisposable as $, IUniverInstanceService as ge, IContextService as ee, CommandType as y, LocaleService as w, useDependency as C, ICommandService as te, FOCUSING_SHEET as me, EDITOR_ACTIVATED as ve, UniverInstanceType as dt, RxDisposable as ut, Plugin as ht, merge as ft, IConfigService as pt } from "@univerjs/core";
  5. import { IConfirmService as _t, IMessageService as Se, useObservable as D, ILayoutService as Ce, KeyCode as b, MetaKeys as x, MenuItemType as gt, getMenuHiddenObservable as mt, RibbonStartGroup as vt, ComponentManager as St, IMenuManagerService as Ct, IShortcutService as Rt, IDialogService as Mt } from "@univerjs/ui";
  6. import { throttleTime as bt, BehaviorSubject as P, combineLatest as Re, debounceTime as xt, Subject as Me, fromEvent as yt, map as It, takeUntil as oe } from "rxjs";
  7. import { MessageType as E, InputWithSlot as Ft, Pager as Dt, Button as N, FormLayout as M, Input as Pt, Select as G, FormDualColumnLayout as ce, Checkbox as le } from "@univerjs/design";
  8. import { RENDER_RAW_FORMULA_KEY as Ot } from "@univerjs/engine-render";
  9. import Tt, { forwardRef as U, useRef as H, createElement as be, useCallback as p, useEffect as A, useMemo as ie, useImperativeHandle as Et } from "react";
  10. const Nt = "find-replace.config", de = {};
  11. var g = function() {
  12. return g = Object.assign || function(t) {
  13. for (var e, n = 1, i = arguments.length; n < i; n++) {
  14. e = arguments[n];
  15. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
  16. }
  17. return t;
  18. }, g.apply(this, arguments);
  19. }, $t = function(t, e) {
  20. var n = {};
  21. for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
  22. if (t != null && typeof Object.getOwnPropertySymbols == "function")
  23. for (var r = 0, i = Object.getOwnPropertySymbols(t); r < i.length; r++)
  24. e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (n[i[r]] = t[i[r]]);
  25. return n;
  26. }, xe = U(function(t, e) {
  27. var n = t.icon, i = t.id, r = t.className, s = t.extend, a = $t(t, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), c = H("_".concat(jt()));
  28. return ye(n, "".concat(i), { defIds: n.defIds, idSuffix: c.current }, g({ ref: e, className: d }, a), s);
  29. });
  30. function ye(t, e, n, i, r) {
  31. return be(t.tag, g(g({ key: e }, At(t, n, r)), i), (Lt(t, n).children || []).map(function(s, a) {
  32. return ye(s, "".concat(e, "-").concat(t.tag, "-").concat(a), n, void 0, r);
  33. }));
  34. }
  35. function At(t, e, n) {
  36. var i = g({}, t.attrs);
  37. n != null && n.colorChannel1 && i.fill === "colorChannel1" && (i.fill = n.colorChannel1);
  38. var r = e.defIds;
  39. return !r || r.length === 0 || (t.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(s) {
  40. var a = s[0], d = s[1];
  41. typeof d == "string" && (i[a] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
  42. })), i;
  43. }
  44. function Lt(t, e) {
  45. var n, i = e.defIds;
  46. return !i || i.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? g(g({}, t), { children: t.children.map(function(r) {
  47. return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ? g(g({}, r), { attrs: g(g({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
  48. }) }) : t;
  49. }
  50. function jt() {
  51. return Math.random().toString(36).substring(2, 8);
  52. }
  53. xe.displayName = "UniverIcon";
  54. var wt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_217_40", style: { maskType: "alpha" }, width: 17, height: 17, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0.9 0.09H16.9V16.09H0.9z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_217_40)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.39551 7.37266C2.39551 4.18105 4.98281 1.59375 8.17441 1.59375C11.366 1.59375 13.9533 4.18105 13.9533 7.37266C13.9533 8.72342 13.4898 9.96603 12.7133 10.95L15.1964 13.4331C15.4619 13.6986 15.4619 14.1291 15.1964 14.3946C14.9309 14.6601 14.5004 14.6601 14.2349 14.3946L11.7518 11.9115C10.7678 12.6881 9.52525 13.1516 8.17441 13.1516C4.98281 13.1516 2.39551 10.5642 2.39551 7.37266ZM8.17441 2.95349C5.73378 2.95349 3.75525 4.93202 3.75525 7.37266C3.75525 9.81333 5.73378 11.7918 8.17441 11.7918C10.6151 11.7918 12.5936 9.81333 12.5936 7.37266C12.5936 4.93202 10.6151 2.95349 8.17441 2.95349Z", fillRule: "evenodd", clipRule: "evenodd" } }] }] }, Ie = U(function(t, e) {
  55. return be(xe, Object.assign({}, t, {
  56. id: "search-single-16",
  57. ref: e,
  58. icon: wt
  59. }));
  60. });
  61. Ie.displayName = "SearchSingle16";
  62. const Fe = "FIND_REPLACE_INPUT_FOCUS", De = "FIND_REPLACE_DIALOG_FOCUS", Pe = "FIND_REPLACE_REPLACE_REVEALED";
  63. var Ut = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, Oe = (t, e, n, i) => {
  64. for (var r = i > 1 ? void 0 : i ? Bt(e, n) : e, s = t.length - 1, a; s >= 0; s--)
  65. (a = t[s]) && (r = (i ? a(e, n, r) : a(r)) || r);
  66. return i && r && Ut(e, n, r), r;
  67. }, q = (t, e) => (n, i) => e(n, i, t);
  68. class Di extends X {
  69. }
  70. const m = ct("find-replace.service");
  71. function Wt(t) {
  72. return typeof t.findString < "u" || typeof t.inputtingFindString < "u" || typeof t.findDirection < "u" || typeof t.matchesTheWholeCell < "u" || typeof t.caseSensitive < "u" || typeof t.findScope < "u" || typeof t.findBy < "u";
  73. }
  74. let J = class extends X {
  75. constructor(e, n, i) {
  76. super();
  77. l(this, "currentMatch$", new P(null));
  78. l(this, "replaceables$", new P([]));
  79. /** All find models returned by providers. */
  80. l(this, "_findModels", []);
  81. /** The find model that the current match is from. */
  82. l(this, "_matchingModel", null);
  83. l(this, "_matches", []);
  84. l(this, "_currentSearchingDisposables", null);
  85. this._state = e, this._providers = n, this._univerInstanceService = i, this.disposeWithMe(
  86. this._state.stateUpdates$.pipe(bt(200, void 0, { leading: !0, trailing: !0 })).subscribe(async (r) => {
  87. const s = this._state.state;
  88. Wt(r) && (s.findString !== "" && !s.replaceRevealed ? (await this._startSearching(), this._state.changeState({ findCompleted: !0 })) : r.replaceRevealed !== !0 && this._stopSearching());
  89. })
  90. );
  91. }
  92. get searched() {
  93. return this._findModels.length > 0;
  94. }
  95. dispose() {
  96. super.dispose(), this._stopSearching(), this.currentMatch$.complete(), this.replaceables$.complete(), this._state.changeState({ ...ne(), revealed: !1 });
  97. }
  98. async start() {
  99. if (!this._state.findString)
  100. return { results: [] };
  101. const e = await this._startSearching();
  102. return this._state.changeState({ findCompleted: !0 }), e;
  103. }
  104. /** Call this method to start a `searching`. */
  105. async _startSearching() {
  106. if (!this._state.findString)
  107. return { results: [] };
  108. const e = Array.from(this._providers), n = this._findModels = (await Promise.all(e.map((r) => r.find({
  109. findString: this._state.findString,
  110. findDirection: this._state.findDirection,
  111. findScope: this._state.findScope,
  112. findBy: this._state.findBy,
  113. replaceRevealed: this._state.replaceRevealed,
  114. caseSensitive: this._state.caseSensitive,
  115. matchesTheWholeCell: this._state.matchesTheWholeCell
  116. })))).flat();
  117. this._subscribeToModelsChanges(n);
  118. const i = this._matches = n.map((r) => r.getMatches()).flat();
  119. return this.replaceables$.next(i.filter((r) => r.replaceable)), i.length ? (this._moveToInitialMatch(n), this._state.changeState({ matchesCount: i.length }), { results: i }) : (this._state.changeState({ matchesCount: 0, matchesPosition: 0 }), { results: [] });
  120. }
  121. /** Terminate the current searching session, when searching string is empty. */
  122. _stopSearching() {
  123. var e;
  124. this._providers.forEach((n) => n.terminate()), this._findModels = [], this._matches = [], this._matchingModel = null, (e = this._currentSearchingDisposables) == null || e.dispose(), this._currentSearchingDisposables = null, this.currentMatch$.next(null), this.replaceables$.next([]), this._state.changeState({
  125. findCompleted: !1,
  126. matchesCount: 0,
  127. matchesPosition: 0
  128. });
  129. }
  130. // When a document's content changes, we should reset all matches and try to move to the next match.
  131. _subscribeToModelsChanges(e) {
  132. const n = this._currentSearchingDisposables = new lt(), i = Re(e.map((r) => r.matchesUpdate$)).pipe(xt(220)).subscribe(([...r]) => {
  133. const s = this._matches = r.flat();
  134. s.length ? (this._moveToInitialMatch(this._findModels, !0), this._state.changeState({ matchesCount: s.length }), this.replaceables$.next(s.filter((a) => a.replaceable))) : (this._state.changeState({ matchesCount: 0, matchesPosition: 0 }), this.replaceables$.next([]));
  135. });
  136. e.forEach((r) => n.add($(r.activelyChangingMatch$.subscribe((s) => {
  137. const a = this._matches.findIndex((d) => d === s);
  138. this._state.changeState({ matchesPosition: a + 1 });
  139. })))), n.add($(i));
  140. }
  141. async replace() {
  142. return this._matchingModel ? this._matchingModel.replace(this._state.replaceString) : !1;
  143. }
  144. async replaceAll() {
  145. const e = await Promise.all(this._findModels.map((n) => n.replaceAll(this._state.replaceString))).then((n) => n.reduce((i, r) => (i.success += r.success, i.failure += r.failure, i), { success: 0, failure: 0 }));
  146. return e.failure === 0 && this._stopSearching(), e;
  147. }
  148. getCurrentMatch() {
  149. return this._state.matchesPosition > 0 ? this._matches[this._state.matchesPosition - 1] : null;
  150. }
  151. _markMatch(e) {
  152. const n = this._matches.findIndex((i) => i === e);
  153. this.currentMatch$.next(e), this._state.changeState({ matchesPosition: n + 1 });
  154. }
  155. moveToNextMatch() {
  156. if (!this._matchingModel)
  157. return;
  158. const e = this._findModels.length === 1, n = this._matchingModel.moveToNextMatch({ loop: e });
  159. if (n)
  160. return this._markMatch(n), n;
  161. {
  162. const i = this._findModels.findIndex((r) => r === this._matchingModel);
  163. return this._moveToNextUnitMatch(i);
  164. }
  165. }
  166. _moveToNextUnitMatch(e) {
  167. const n = this._findModels.length;
  168. for (let i = (e + 1) % n; i !== e; ) {
  169. const r = this._findModels[i], s = r.moveToNextMatch({ ignoreSelection: !0 });
  170. if (s)
  171. return this._matchingModel = r, this._markMatch(s), s;
  172. i = (i + 1) % n;
  173. }
  174. if (this._matchingModel) {
  175. const i = this._matchingModel.moveToNextMatch({ ignoreSelection: !0 });
  176. return i && this._markMatch(i), i;
  177. }
  178. }
  179. moveToPreviousMatch() {
  180. if (!this._matchingModel)
  181. return;
  182. const e = this._findModels.length === 1, n = this._matchingModel.moveToPreviousMatch({ loop: e });
  183. if (n) {
  184. const i = this._matches.findIndex((r) => r === n);
  185. return this.currentMatch$.next(n), this._state.changeState({ matchesPosition: i + 1 }), n;
  186. } else {
  187. const i = this._findModels.length, r = this._findModels.findIndex((a) => a === this._matchingModel);
  188. for (let a = (r - 1 + i) % i; a !== r; ) {
  189. const d = this._findModels[a], c = d.moveToPreviousMatch({ ignoreSelection: !0 });
  190. if (c)
  191. return this._matchingModel = d, this._markMatch(c), c;
  192. a = (a - 1) % i;
  193. }
  194. const s = this._matchingModel.moveToPreviousMatch({ ignoreSelection: !0 });
  195. return s && this._markMatch(s), s;
  196. }
  197. }
  198. _moveToInitialMatch(e, n = !1) {
  199. var s;
  200. const i = (s = this._univerInstanceService.getFocusedUnit()) == null ? void 0 : s.getUnitId();
  201. if (!i)
  202. return -1;
  203. const r = e.findIndex((a) => a.unitId === i);
  204. if (r !== -1) {
  205. this._matchingModel = e[r];
  206. const a = this._matchingModel.moveToNextMatch({ stayIfOnMatch: !0, noFocus: n });
  207. if (a)
  208. return this._markMatch(a), r;
  209. }
  210. return this._moveToNextUnitMatch(r), 0;
  211. }
  212. };
  213. J = Oe([
  214. q(2, ge)
  215. ], J);
  216. var K = /* @__PURE__ */ ((t) => (t.ROW = "row", t.COLUMN = "column", t))(K || {}), z = /* @__PURE__ */ ((t) => (t.VALUE = "value", t.FORMULA = "formula", t))(z || {}), Y = /* @__PURE__ */ ((t) => (t.SUBUNIT = "subunit", t.UNIT = "unit", t))(Y || {});
  217. function ne() {
  218. return {
  219. caseSensitive: !1,
  220. findBy: "value",
  221. findCompleted: !1,
  222. findDirection: "row",
  223. findScope: "subunit",
  224. findString: "",
  225. inputtingFindString: "",
  226. matchesCount: 0,
  227. matchesPosition: 0,
  228. matchesTheWholeCell: !1,
  229. replaceRevealed: !1,
  230. replaceString: "",
  231. revealed: !0
  232. };
  233. }
  234. class Gt {
  235. constructor() {
  236. l(this, "_stateUpdates$", new Me());
  237. l(this, "stateUpdates$", this._stateUpdates$.asObservable());
  238. l(this, "_state$", new P(ne()));
  239. l(this, "state$", this._state$.asObservable());
  240. l(this, "_findString", "");
  241. l(this, "_inputtingFindString", "");
  242. l(this, "_replaceString", "");
  243. l(this, "_revealed", !1);
  244. l(this, "_replaceRevealed", !1);
  245. l(this, "_matchesPosition", 0);
  246. l(this, "_matchesCount", 0);
  247. l(this, "_caseSensitive", !0);
  248. l(this, "_matchesTheWholeCell", !1);
  249. l(this, "_findDirection", "row");
  250. l(this, "_findScope", "subunit");
  251. l(this, "_findBy", "value");
  252. l(this, "_findCompleted", !1);
  253. }
  254. get state() {
  255. return this._state$.getValue();
  256. }
  257. get inputtingFindString() {
  258. return this._inputtingFindString;
  259. }
  260. get findString() {
  261. return this._findString;
  262. }
  263. get revealed() {
  264. return this._revealed;
  265. }
  266. get replaceRevealed() {
  267. return this._replaceRevealed;
  268. }
  269. get matchesPosition() {
  270. return this._matchesPosition;
  271. }
  272. get matchesCount() {
  273. return this._matchesCount;
  274. }
  275. get replaceString() {
  276. return this._replaceString;
  277. }
  278. get caseSensitive() {
  279. return this._caseSensitive;
  280. }
  281. get matchesTheWholeCell() {
  282. return this._matchesTheWholeCell;
  283. }
  284. get findDirection() {
  285. return this._findDirection;
  286. }
  287. get findScope() {
  288. return this._findScope;
  289. }
  290. get findBy() {
  291. return this._findBy;
  292. }
  293. get findCompleted() {
  294. return this._findCompleted;
  295. }
  296. // eslint-disable-next-line max-lines-per-function, complexity
  297. changeState(e) {
  298. let n = !1;
  299. const i = {};
  300. typeof e.findString < "u" && e.findString !== this._findString && (this._findString = e.findString, i.findString = this._findString, n = !0), typeof e.revealed < "u" && e.revealed !== this._revealed && (this._revealed = e.revealed, i.revealed = e.revealed, n = !0), typeof e.replaceRevealed < "u" && e.replaceRevealed !== this._replaceRevealed && (this._replaceRevealed = e.replaceRevealed, i.replaceRevealed = e.replaceRevealed, n = !0), typeof e.replaceString < "u" && e.replaceString !== this._replaceString && (this._replaceString = e.replaceString, i.replaceString = e.replaceString, n = !0), typeof e.matchesCount < "u" && e.matchesCount !== this._matchesCount && (this._matchesCount = e.matchesCount, i.matchesCount = e.matchesCount, n = !0), typeof e.matchesPosition < "u" && e.matchesPosition !== this._matchesPosition && (this._matchesPosition = e.matchesPosition, i.matchesPosition = e.matchesPosition, n = !0), typeof e.findBy < "u" && e.findBy !== this._findBy && (this._findBy = e.findBy, i.findBy = e.findBy, n = !0), typeof e.findScope < "u" && e.findScope !== this._findScope && (this._findScope = e.findScope, i.findScope = e.findScope, n = !0), typeof e.findDirection < "u" && e.findDirection !== this._findDirection && (this._findDirection = e.findDirection, i.findDirection = e.findDirection, n = !0), typeof e.caseSensitive < "u" && e.caseSensitive !== this._caseSensitive && (this._caseSensitive = e.caseSensitive, i.caseSensitive = e.caseSensitive, n = !0), typeof e.matchesTheWholeCell < "u" && e.matchesTheWholeCell !== this._matchesTheWholeCell && (this._matchesTheWholeCell = e.matchesTheWholeCell, i.matchesTheWholeCell = e.matchesTheWholeCell, n = !0), typeof e.inputtingFindString < "u" && e.inputtingFindString !== this._inputtingFindString && (this._inputtingFindString = e.inputtingFindString, i.inputtingFindString = e.inputtingFindString, n = !0), typeof e.findCompleted < "u" && e.findCompleted !== this._findCompleted && (this._findCompleted = e.findCompleted, i.findCompleted = e.findCompleted, n = !0), n && (this._state$.next({
  301. caseSensitive: this._caseSensitive,
  302. findBy: this._findBy,
  303. findCompleted: this._findCompleted,
  304. findDirection: this._findDirection,
  305. findScope: this._findScope,
  306. findString: this._findString,
  307. inputtingFindString: this._inputtingFindString,
  308. matchesCount: this._matchesCount,
  309. matchesPosition: this._matchesPosition,
  310. matchesTheWholeCell: this._matchesTheWholeCell,
  311. replaceRevealed: this._replaceRevealed,
  312. revealed: this._revealed
  313. }), this._stateUpdates$.next(i));
  314. }
  315. }
  316. let Z = class extends X {
  317. constructor(e, n) {
  318. super();
  319. l(this, "_providers", /* @__PURE__ */ new Set());
  320. l(this, "_state", new Gt());
  321. l(this, "_model");
  322. l(this, "_currentMatch$", new P(null));
  323. l(this, "currentMatch$", this._currentMatch$.asObservable());
  324. l(this, "_replaceables$", new P([]));
  325. l(this, "replaceables$", this._replaceables$.asObservable());
  326. l(this, "_focusSignal$", new Me());
  327. l(this, "focusSignal$", this._focusSignal$.asObservable());
  328. this._injector = e, this._contextService = n;
  329. }
  330. get stateUpdates$() {
  331. return this._state.stateUpdates$;
  332. }
  333. get state$() {
  334. return this._state.state$;
  335. }
  336. get revealed() {
  337. return this._state.revealed;
  338. }
  339. get replaceRevealed() {
  340. return this._state.replaceRevealed;
  341. }
  342. dispose() {
  343. super.dispose(), this._currentMatch$.next(null), this._currentMatch$.complete(), this._replaceables$.next([]), this._replaceables$.complete(), this._focusSignal$.complete();
  344. }
  345. getProviders() {
  346. return this._providers;
  347. }
  348. getCurrentMatch() {
  349. var e;
  350. return (e = this._model) == null ? void 0 : e.getCurrentMatch();
  351. }
  352. getFindString() {
  353. return this._state.findString;
  354. }
  355. changeFindString(e) {
  356. this._state.changeState({ findString: e });
  357. }
  358. focusFindInput() {
  359. this._focusSignal$.next();
  360. }
  361. changeInputtingFindString(e) {
  362. e ? this._state.changeState({ inputtingFindString: e }) : this._state.changeState({ inputtingFindString: "", findString: "" });
  363. }
  364. changeReplaceString(e) {
  365. this._state.changeState({ replaceString: e });
  366. }
  367. changeMatchesTheWholeCell(e) {
  368. this._state.changeState({ matchesTheWholeCell: e });
  369. }
  370. changeCaseSensitive(e) {
  371. this._state.changeState({ caseSensitive: e });
  372. }
  373. changeFindBy(e) {
  374. this._state.changeState({ findBy: e }), this._toggleDisplayRawFormula(
  375. e === "formula"
  376. /* FORMULA */
  377. );
  378. }
  379. changeFindScope(e) {
  380. this._state.changeState({ findScope: e });
  381. }
  382. changeFindDirection(e) {
  383. this._state.changeState({ findDirection: e });
  384. }
  385. moveToNextMatch() {
  386. this._model && (this._state.replaceRevealed && !this._model.searched ? (this._state.changeState({ findString: this._state.inputtingFindString }), this._model.start()) : this._model.moveToNextMatch(), this._focusSignal$.next());
  387. }
  388. moveToPreviousMatch() {
  389. this._model && (this._state.replaceRevealed && !this._model.searched ? (this._state.changeState({ findString: this._state.inputtingFindString }), this._model.start()) : this._model.moveToPreviousMatch(), this._focusSignal$.next());
  390. }
  391. async replace() {
  392. return this._model ? this._model.replace() : !1;
  393. }
  394. async replaceAll() {
  395. if (!this._model)
  396. throw new Error("[FindReplaceService] replaceAll: model is not initialized!");
  397. return this._model.replaceAll();
  398. }
  399. revealReplace() {
  400. this._state.changeState({ replaceRevealed: !0, inputtingFindString: this._state.findString }), this._toggleRevealReplace(!0);
  401. }
  402. start(e = !1) {
  403. if (this._providers.size === 0)
  404. return !1;
  405. this._model = this._injector.createInstance(J, this._state, this._providers), this._model.currentMatch$.subscribe((i) => this._currentMatch$.next(i)), this._model.replaceables$.subscribe((i) => this._replaceables$.next(i));
  406. const n = ne();
  407. return e && (n.replaceRevealed = !0), this._state.changeState(n), this._toggleRevealReplace(e), !0;
  408. }
  409. find() {
  410. var e;
  411. (e = this._model) == null || e.start();
  412. }
  413. terminate() {
  414. var e;
  415. (e = this._model) == null || e.dispose(), this._model = null, this._toggleDisplayRawFormula(!1), this._toggleRevealReplace(!1);
  416. }
  417. registerFindReplaceProvider(e) {
  418. return this._providers.add(e), $(() => this._providers.delete(e));
  419. }
  420. _toggleRevealReplace(e) {
  421. this._contextService.setContextValue(Pe, e);
  422. }
  423. _toggleDisplayRawFormula(e) {
  424. this._contextService.setContextValue(Ot, e);
  425. }
  426. };
  427. Z = Oe([
  428. q(0, F(Q)),
  429. q(1, ee)
  430. ], Z);
  431. const Te = {
  432. id: "ui.command.replace-current-match",
  433. type: y.COMMAND,
  434. handler: (t) => t.get(m).replace()
  435. }, kt = "CONFIRM_REPLACE_ALL", Ee = {
  436. id: "ui.command.replace-all-matches",
  437. type: y.COMMAND,
  438. handler: async (t) => {
  439. const e = t.get(_t), n = t.get(w), i = t.get(Se);
  440. if (!await e.confirm({
  441. id: kt,
  442. title: { title: n.t("find-replace.replace.confirm.title") },
  443. cancelText: n.t("button.cancel"),
  444. confirmText: n.t("button.confirm")
  445. }))
  446. return !1;
  447. const s = await t.get(m).replaceAll(), { success: a, failure: d } = s;
  448. return d > 0 ? (a === 0 ? i.show({
  449. type: E.Error,
  450. content: n.t("find-replace.replace.all-failure")
  451. }) : i.show({
  452. type: E.Warning,
  453. content: n.t("find-replace.replace.partial-success", `${a}`, `${d}`)
  454. }), !1) : (i.show({
  455. type: E.Success,
  456. content: n.t("find-replace.replace.all-success", `${a}`)
  457. }), !0);
  458. }
  459. }, O = {
  460. id: "ui.operation.open-find-dialog",
  461. type: y.OPERATION,
  462. handler: (t) => {
  463. const e = t.get(m);
  464. return e.revealed ? e.focusFindInput() : e.start(), !0;
  465. }
  466. }, re = {
  467. id: "ui.operation.open-replace-dialog",
  468. type: y.OPERATION,
  469. handler: (t) => {
  470. const e = t.get(m);
  471. return e.revealed ? e.replaceRevealed ? e.focusFindInput() : e.revealReplace() : e.start(!0), !0;
  472. }
  473. }, Ne = {
  474. type: y.OPERATION,
  475. id: "ui.operation.go-to-next-match",
  476. handler: (t) => (t.get(m).moveToNextMatch(), !0)
  477. }, $e = {
  478. type: y.OPERATION,
  479. id: "ui.operation.go-to-previous-match",
  480. handler: (t) => (t.get(m).moveToPreviousMatch(), !0)
  481. };
  482. var k = { exports: {} }, I = {};
  483. /**
  484. * @license React
  485. * react-jsx-runtime.production.min.js
  486. *
  487. * Copyright (c) Facebook, Inc. and its affiliates.
  488. *
  489. * This source code is licensed under the MIT license found in the
  490. * LICENSE file in the root directory of this source tree.
  491. */
  492. var ue;
  493. function Vt() {
  494. if (ue) return I;
  495. ue = 1;
  496. var t = Tt, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, r = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
  497. function a(d, c, _) {
  498. var u, h = {}, R = null, v = null;
  499. _ !== void 0 && (R = "" + _), c.key !== void 0 && (R = "" + c.key), c.ref !== void 0 && (v = c.ref);
  500. for (u in c) i.call(c, u) && !s.hasOwnProperty(u) && (h[u] = c[u]);
  501. if (d && d.defaultProps) for (u in c = d.defaultProps, c) h[u] === void 0 && (h[u] = c[u]);
  502. return { $$typeof: e, type: d, key: R, ref: v, props: h, _owner: r.current };
  503. }
  504. return I.Fragment = n, I.jsx = a, I.jsxs = a, I;
  505. }
  506. var he;
  507. function Ht() {
  508. return he || (he = 1, k.exports = Vt()), k.exports;
  509. }
  510. var o = Ht();
  511. const qt = "univer-find-replace-dialog-container", Jt = "univer-find-replace-expand-container", Kt = "univer-button-text", zt = "univer-find-replace-buttons-group", Yt = "univer-find-replace-buttons-group-right", L = {
  512. findReplaceDialogContainer: qt,
  513. findReplaceExpandContainer: Jt,
  514. buttonText: Kt,
  515. findReplaceButtonsGroup: zt,
  516. findReplaceButtonsGroupRight: Yt
  517. };
  518. function Ae(t) {
  519. const { findCompleted: e, localeService: n, matchesCount: i, matchesPosition: r, findString: s, findReplaceService: a, onChange: d, ...c } = t, u = e && i === 0 ? n.t("find-replace.dialog.no-result") : i === 0 ? " " : void 0;
  520. return /* @__PURE__ */ o.jsx(
  521. Ft,
  522. {
  523. autoFocus: !0,
  524. placeholder: n.t("find-replace.dialog.find-placeholder"),
  525. slot: /* @__PURE__ */ o.jsx(
  526. Dt,
  527. {
  528. loop: !0,
  529. text: u,
  530. value: r,
  531. total: i,
  532. onChange: (h) => {
  533. r === i && h === 1 ? a.moveToNextMatch() : r === 1 && h === i || h < r ? a.moveToPreviousMatch() : a.moveToNextMatch();
  534. }
  535. }
  536. ),
  537. value: s,
  538. onChange: (h) => d == null ? void 0 : d(h),
  539. ...c
  540. }
  541. );
  542. }
  543. function Le(t, e) {
  544. const n = p(() => {
  545. var r;
  546. (r = document.querySelector(".univer-find-input input")) == null || r.focus();
  547. }, []), i = p(() => {
  548. const r = document.querySelectorAll(".univer-find-replace-dialog-container .univer-select-selection-search-input");
  549. return Array.from(r).some((s) => s === document.activeElement);
  550. }, []);
  551. return Et(e, () => ({ focus: n, selectHasFocus: i })), A(() => {
  552. const r = t.focusSignal$.subscribe(() => n());
  553. return () => r.unsubscribe();
  554. }, [t, n]), { focus: n, selectHasFocus: i };
  555. }
  556. const Zt = U(function(e, n) {
  557. const i = C(w), r = C(m), s = C(te), a = D(r.state$, void 0, !0), { findCompleted: d, findString: c, matchesCount: _, matchesPosition: u } = a, h = p(() => {
  558. s.executeCommand(re.id);
  559. }, [s]), R = p((v) => r.changeFindString(v), [r]);
  560. return Le(r, n), /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
  561. /* @__PURE__ */ o.jsx(
  562. Ae,
  563. {
  564. findCompleted: d,
  565. className: "univer-find-input",
  566. matchesCount: _,
  567. matchesPosition: u,
  568. findReplaceService: r,
  569. localeService: i,
  570. findString: c,
  571. onChange: R
  572. }
  573. ),
  574. /* @__PURE__ */ o.jsx("div", { className: L.findReplaceExpandContainer, children: /* @__PURE__ */ o.jsx(N, { type: "text", size: "small", onClick: h, children: i.t("find-replace.dialog.advanced-finding") }) })
  575. ] });
  576. }), Qt = U(function(e, n) {
  577. const i = C(m), r = C(w), s = C(te), a = C(Se), d = D(i.currentMatch$, void 0, !0), c = D(i.replaceables$, void 0, !0), _ = D(i.state$, void 0, !0), {
  578. matchesCount: u,
  579. matchesPosition: h,
  580. findString: R,
  581. inputtingFindString: v,
  582. replaceString: Ue,
  583. caseSensitive: Be,
  584. matchesTheWholeCell: We,
  585. findDirection: Ge,
  586. findScope: ke,
  587. findBy: Ve,
  588. findCompleted: W
  589. } = _, He = v.length === 0, qe = u === 0 || !(d != null && d.replaceable), Je = c.length === 0, Ke = p(
  590. (f) => i.changeInputtingFindString(f),
  591. [i]
  592. ), ze = p(
  593. (f) => i.changeReplaceString(f),
  594. [i]
  595. ), { focus: Ye } = Le(i, n), Ze = p(() => {
  596. R === v ? i.moveToNextMatch() : (i.changeFindString(v), i.find());
  597. }, [R, v, i]), Qe = p(() => s.executeCommand(Te.id), [s]), Xe = p(async () => {
  598. await s.executeCommand(Ee.id), Ye();
  599. }, [s]), et = p((f) => {
  600. i.changeFindDirection(f);
  601. }, [i]), tt = p((f) => {
  602. i.changeFindScope(f);
  603. }, [i]), it = p((f) => {
  604. i.changeFindBy(f);
  605. }, [i]), nt = ei(r), rt = ti(r), st = ii(r);
  606. return A(() => {
  607. W && u === 0 && a.show({
  608. content: r.t("find-replace.dialog.no-match"),
  609. type: E.Warning,
  610. duration: 5e3
  611. });
  612. }, [W, u, a, r]), /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
  613. /* @__PURE__ */ o.jsx(M, { label: r.t("find-replace.dialog.find"), children: /* @__PURE__ */ o.jsx(
  614. Ae,
  615. {
  616. findCompleted: W,
  617. className: "univer-find-input",
  618. matchesCount: u,
  619. matchesPosition: h,
  620. findReplaceService: i,
  621. localeService: r,
  622. findString: v,
  623. onChange: Ke
  624. }
  625. ) }),
  626. /* @__PURE__ */ o.jsx(M, { label: r.t("find-replace.dialog.replace"), children: /* @__PURE__ */ o.jsx(
  627. Pt,
  628. {
  629. placeholder: r.t("find-replace.dialog.replace-placeholder"),
  630. value: Ue,
  631. onChange: (f) => ze(f)
  632. }
  633. ) }),
  634. /* @__PURE__ */ o.jsx(M, { label: r.t("find-replace.dialog.find-direction.title"), children: /* @__PURE__ */ o.jsx(G, { value: Ge, options: rt, onChange: et }) }),
  635. /* @__PURE__ */ o.jsx(ce, { children: /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
  636. /* @__PURE__ */ o.jsx(M, { label: r.t("find-replace.dialog.find-scope.title"), children: /* @__PURE__ */ o.jsx(G, { value: ke, options: nt, onChange: tt }) }),
  637. /* @__PURE__ */ o.jsx(M, { label: r.t("find-replace.dialog.find-by.title"), children: /* @__PURE__ */ o.jsx(G, { value: Ve, options: st, onChange: it }) })
  638. ] }) }),
  639. /* @__PURE__ */ o.jsx(ce, { children: /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
  640. /* @__PURE__ */ o.jsx(M, { children: /* @__PURE__ */ o.jsx(
  641. le,
  642. {
  643. checked: Be,
  644. onChange: (f) => {
  645. i.changeCaseSensitive(f);
  646. },
  647. children: r.t("find-replace.dialog.case-sensitive")
  648. }
  649. ) }),
  650. /* @__PURE__ */ o.jsx(M, { children: /* @__PURE__ */ o.jsx(
  651. le,
  652. {
  653. checked: We,
  654. onChange: (f) => {
  655. i.changeMatchesTheWholeCell(f);
  656. },
  657. children: r.t("find-replace.dialog.match-the-whole-cell")
  658. }
  659. ) })
  660. ] }) }),
  661. /* @__PURE__ */ o.jsxs("div", { className: L.findReplaceButtonsGroup, children: [
  662. /* @__PURE__ */ o.jsx(N, { type: "primary", onClick: Ze, disabled: He, children: r.t("find-replace.dialog.find") }),
  663. /* @__PURE__ */ o.jsxs("span", { className: L.findReplaceButtonsGroupRight, children: [
  664. /* @__PURE__ */ o.jsx(N, { disabled: qe, onClick: Qe, children: r.t("find-replace.dialog.replace") }),
  665. /* @__PURE__ */ o.jsx(N, { disabled: Je, onClick: Xe, children: r.t("find-replace.dialog.replace-all") })
  666. ] })
  667. ] })
  668. ] });
  669. });
  670. function Xt() {
  671. const t = C(m), e = C(Ce), n = C(ee), i = D(t.state$, void 0, !0), r = H(null);
  672. A(() => {
  673. let c;
  674. return r.current && (c = e.registerContainerElement(r.current)), () => c == null ? void 0 : c.dispose();
  675. }, [e]);
  676. const s = H(null), a = p(
  677. (c) => n.setContextValue(De, c),
  678. [n]
  679. ), d = p(
  680. (c) => n.setContextValue(Fe, c),
  681. [n]
  682. );
  683. return A(() => {
  684. var _;
  685. const c = yt(document, "focusin").subscribe((u) => {
  686. var h;
  687. u.target && ((h = r.current) != null && h.contains(u.target)) ? a(!0) : a(!1), !s.current || !s.current.selectHasFocus() ? d(!0) : d(!1);
  688. });
  689. return (_ = s.current) == null || _.focus(), a(!0), d(!0), () => {
  690. c.unsubscribe(), a(!1);
  691. };
  692. }, [a, d]), /* @__PURE__ */ o.jsx("div", { className: L.findReplaceDialogContainer, ref: r, children: i.replaceRevealed ? /* @__PURE__ */ o.jsx(Qt, { ref: s }) : /* @__PURE__ */ o.jsx(Zt, { ref: s }) });
  693. }
  694. function ei(t) {
  695. const e = t.getCurrentLocale();
  696. return ie(() => [
  697. { label: t.t("find-replace.dialog.find-scope.current-sheet"), value: Y.SUBUNIT },
  698. { label: t.t("find-replace.dialog.find-scope.workbook"), value: Y.UNIT }
  699. ], [e]);
  700. }
  701. function ti(t) {
  702. const e = t.getCurrentLocale();
  703. return ie(() => [
  704. { label: t.t("find-replace.dialog.find-direction.row"), value: K.ROW },
  705. { label: t.t("find-replace.dialog.find-direction.column"), value: K.COLUMN }
  706. ], [e]);
  707. }
  708. function ii(t) {
  709. const e = t.getCurrentLocale();
  710. return ie(() => [
  711. { label: t.t("find-replace.dialog.find-by.value"), value: z.VALUE },
  712. { label: t.t("find-replace.dialog.find-by.formula"), value: z.FORMULA }
  713. ], [e]);
  714. }
  715. function T(t) {
  716. return t.getContextValue(De);
  717. }
  718. function ni(t) {
  719. return t.getContextValue(Pe);
  720. }
  721. function je(t) {
  722. return t.getContextValue(Fe);
  723. }
  724. const B = "7_find-replace-shortcuts";
  725. function se(t) {
  726. return t.getContextValue(me);
  727. }
  728. function ae(t) {
  729. return !t.getContextValue(ve);
  730. }
  731. const ri = {
  732. id: O.id,
  733. description: "find-replace.shortcut.open-find-dialog",
  734. binding: b.F | x.CTRL_COMMAND,
  735. group: B,
  736. preconditions(t) {
  737. return !T(t) && se(t) && ae(t);
  738. }
  739. }, si = {
  740. id: O.id,
  741. description: "find-replace.shortcut.open-find-dialog",
  742. binding: b.F | x.CTRL_COMMAND,
  743. mac: b.F | x.MAC_CTRL,
  744. preconditions(t) {
  745. return !T(t) && se(t) && ae(t);
  746. }
  747. }, ai = {
  748. id: re.id,
  749. description: "find-replace.shortcut.open-replace-dialog",
  750. binding: b.H | x.CTRL_COMMAND,
  751. mac: b.H | x.MAC_CTRL,
  752. group: B,
  753. preconditions(t) {
  754. return se(t) && ae(t) && (!T(t) || !ni(t));
  755. }
  756. }, oi = {
  757. id: Ne.id,
  758. description: "find-replace.shortcut.go-to-next-match",
  759. binding: b.ENTER,
  760. group: B,
  761. priority: 1e3,
  762. preconditions(t) {
  763. return je(t) && T(t);
  764. }
  765. }, ci = {
  766. id: $e.id,
  767. description: "find-replace.shortcut.go-to-previous-match",
  768. binding: b.ENTER | x.SHIFT,
  769. group: B,
  770. priority: 1e3,
  771. preconditions(t) {
  772. return je(t) && T(t);
  773. }
  774. };
  775. function li(t) {
  776. const e = t.get(ee);
  777. return {
  778. id: O.id,
  779. icon: "SearchIcon",
  780. tooltip: "find-replace.toolbar",
  781. type: gt.BUTTON,
  782. hidden$: mt(t, dt.UNIVER_SHEET),
  783. disabled$: Re([
  784. e.subscribeContextValue$(ve),
  785. e.subscribeContextValue$(me)
  786. ]).pipe(It(([n, i]) => n || !i))
  787. };
  788. }
  789. const di = {
  790. [vt.OTHERS]: {
  791. [O.id]: {
  792. order: 2,
  793. menuItemFactory: li
  794. }
  795. }
  796. };
  797. var ui = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, fi = (t, e, n, i) => {
  798. for (var r = i > 1 ? void 0 : i ? hi(e, n) : e, s = t.length - 1, a; s >= 0; s--)
  799. (a = t[s]) && (r = (i ? a(e, n, r) : a(r)) || r);
  800. return i && r && ui(e, n, r), r;
  801. }, S = (t, e) => (n, i) => e(n, i, t);
  802. const fe = "DESKTOP_FIND_REPLACE_DIALOG", we = 350, pi = 20, _i = -90;
  803. let j = class extends ut {
  804. constructor(e, n, i, r, s, a, d, c, _, u) {
  805. super();
  806. l(this, "_closingListenerDisposable");
  807. this._univerInstanceService = e, this._menuManagerService = n, this._shortcutService = i, this._commandService = r, this._findReplaceService = s, this._dialogService = a, this._layoutService = d, this._localeService = c, this._componentManager = _, this._injector = u, this._initCommands(), this._initUI(), this._initShortcuts();
  808. }
  809. dispose() {
  810. var e;
  811. super.dispose(), (e = this._closingListenerDisposable) == null || e.dispose(), this._closingListenerDisposable = null;
  812. }
  813. _initCommands() {
  814. [
  815. O,
  816. re,
  817. Ne,
  818. $e,
  819. Ee,
  820. Te
  821. ].forEach((e) => {
  822. this.disposeWithMe(this._commandService.registerCommand(e));
  823. });
  824. }
  825. _initShortcuts() {
  826. [
  827. ai,
  828. ri,
  829. si,
  830. ci,
  831. oi
  832. ].forEach((e) => this.disposeWithMe(this._shortcutService.registerShortcut(e)));
  833. }
  834. _initUI() {
  835. this.disposeWithMe(this._componentManager.register("FindReplaceDialog", Xt)), this.disposeWithMe(this._componentManager.register("SearchIcon", Ie)), this._menuManagerService.mergeMenu(di), this._findReplaceService.stateUpdates$.pipe(oe(this.dispose$)).subscribe((e) => {
  836. e.revealed === !0 && this._openPanel();
  837. });
  838. }
  839. _openPanel() {
  840. this._dialogService.open({
  841. id: fe,
  842. draggable: !0,
  843. width: we,
  844. title: { title: this._localeService.t("find-replace.dialog.title") },
  845. children: { label: "FindReplaceDialog" },
  846. destroyOnClose: !0,
  847. defaultPosition: gi(),
  848. preservePositionOnDestroy: !0,
  849. onClose: () => this.closePanel()
  850. }), this._closingListenerDisposable = $(this._univerInstanceService.focused$.pipe(oe(this.dispose$)).subscribe((e) => {
  851. (!e || !this._univerInstanceService.getUniverSheetInstance(e)) && this.closePanel();
  852. }));
  853. }
  854. closePanel() {
  855. this._closingListenerDisposable && (this._closingListenerDisposable.dispose(), this._closingListenerDisposable = null, this._dialogService.close(fe), this._findReplaceService.terminate(), queueMicrotask(() => this._layoutService.focus()));
  856. }
  857. };
  858. j = fi([
  859. S(0, ge),
  860. S(1, Ct),
  861. S(2, Rt),
  862. S(3, te),
  863. S(4, m),
  864. S(5, Mt),
  865. S(6, Ce),
  866. S(7, F(w)),
  867. S(8, F(St)),
  868. S(9, F(Q))
  869. ], j);
  870. function gi() {
  871. const { innerWidth: t } = window;
  872. return { x: (t - we) / 2 - pi, y: _i };
  873. }
  874. var mi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, Si = (t, e, n, i) => {
  875. for (var r = i > 1 ? void 0 : i ? vi(e, n) : e, s = t.length - 1, a; s >= 0; s--)
  876. (a = t[s]) && (r = (i ? a(e, n, r) : a(r)) || r);
  877. return i && r && mi(e, n, r), r;
  878. }, pe = (t, e) => (n, i) => e(n, i, t);
  879. const Ci = "UNIVER_FIND_REPLACE_PLUGIN";
  880. var V;
  881. let _e = (V = class extends ht {
  882. constructor(t = de, e, n) {
  883. super(), this._config = t, this._injector = e, this._configService = n;
  884. const { ...i } = ft(
  885. {},
  886. de,
  887. this._config
  888. );
  889. this._configService.setConfig(Nt, i);
  890. }
  891. onStarting() {
  892. [
  893. [j],
  894. [m, { useClass: Z }]
  895. ].forEach((t) => this._injector.add(t));
  896. }
  897. onRendered() {
  898. this._injector.get(j);
  899. }
  900. }, l(V, "pluginName", Ci), V);
  901. _e = Si([
  902. pe(1, F(Q)),
  903. pe(2, pt)
  904. ], _e);
  905. export {
  906. z as FindBy,
  907. K as FindDirection,
  908. Di as FindModel,
  909. j as FindReplaceController,
  910. J as FindReplaceModel,
  911. Gt as FindReplaceState,
  912. Y as FindScope,
  913. Ne as GoToNextMatchOperation,
  914. $e as GoToPreviousMatchOperation,
  915. m as IFindReplaceService,
  916. O as OpenFindDialogOperation,
  917. re as OpenReplaceDialogOperation,
  918. Ee as ReplaceAllMatchesCommand,
  919. Te as ReplaceCurrentMatchCommand,
  920. _e as UniverFindReplacePlugin,
  921. ne as createInitFindReplaceState
  922. };