@univerjs/find-replace 0.5.1 → 0.5.2

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.
package/lib/cjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Te=Object.defineProperty;var Pe=(i,e,n)=>e in i?Te(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n;var l=(i,e,n)=>Pe(i,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@univerjs/core"),p=require("@univerjs/ui"),v=require("rxjs"),f=require("@univerjs/design"),Ee=require("@univerjs/engine-render"),c=require("react"),Ne="find-replace.config",Le={};var C=function(){return C=Object.assign||function(i){for(var e,n=1,t=arguments.length;n<t;n++){e=arguments[n];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},C.apply(this,arguments)},$e=function(i,e){var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.indexOf(t)<0&&(n[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,t=Object.getOwnPropertySymbols(i);s<t.length;s++)e.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(i,t[s])&&(n[t[s]]=i[t[s]]);return n},Q=c.forwardRef(function(i,e){var n=i.icon,t=i.id,s=i.className,r=i.extend,a=$e(i,["icon","id","className","extend"]),d="univerjs-icon univerjs-icon-".concat(t," ").concat(s||"").trim(),u=c.useRef("_".concat(we()));return X(n,"".concat(t),{defIds:n.defIds,idSuffix:u.current},C({ref:e,className:d},a),r)});function X(i,e,n,t,s){return c.createElement(i.tag,C(C({key:e},je(i,n,s)),t),(Ae(i,n).children||[]).map(function(r,a){return X(r,"".concat(e,"-").concat(i.tag,"-").concat(a),n,void 0,s)}))}function je(i,e,n){var t=C({},i.attrs);n!=null&&n.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=n.colorChannel1);var s=e.defIds;return!s||s.length===0||(i.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+e.idSuffix),Object.entries(t).forEach(function(r){var a=r[0],d=r[1];typeof d=="string"&&(t[a]=d.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),t}function Ae(i,e){var n,t=e.defIds;return!t||t.length===0?i:i.tag==="defs"&&(!((n=i.children)===null||n===void 0)&&n.length)?C(C({},i),{children:i.children.map(function(s){return typeof s.attrs.id=="string"&&t&&t.indexOf(s.attrs.id)>-1?C(C({},s),{attrs:C(C({},s.attrs),{id:s.attrs.id+e.idSuffix})}):s})}):i}function we(){return Math.random().toString(36).substring(2,8)}Q.displayName="UniverIcon";var Ue={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"}}]}]},ee=c.forwardRef(function(i,e){return c.createElement(Q,Object.assign({},i,{id:"search-single-16",ref:e,icon:Ue}))});ee.displayName="SearchSingle16";const te="FIND_REPLACE_INPUT_FOCUS",ie="FIND_REPLACE_DIALOG_FOCUS",ne="FIND_REPLACE_REPLACE_REVEALED";var Be=Object.defineProperty,ke=Object.getOwnPropertyDescriptor,se=(i,e,n,t)=>{for(var s=t>1?void 0:t?ke(e,n):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(t?a(e,n,s):a(s))||s);return t&&s&&Be(e,n,s),s},w=(i,e)=>(n,t)=>e(n,t,i);class We extends o.Disposable{}const R=o.createIdentifier("find-replace.service");function Ge(i){return typeof i.findString<"u"||typeof i.inputtingFindString<"u"||typeof i.findDirection<"u"||typeof i.matchesTheWholeCell<"u"||typeof i.caseSensitive<"u"||typeof i.findScope<"u"||typeof i.findBy<"u"}let U=class extends o.Disposable{constructor(e,n,t){super();l(this,"currentMatch$",new v.BehaviorSubject(null));l(this,"replaceables$",new v.BehaviorSubject([]));l(this,"_findModels",[]);l(this,"_matchingModel",null);l(this,"_matches",[]);l(this,"_currentSearchingDisposables",null);this._state=e,this._providers=n,this._univerInstanceService=t,this.disposeWithMe(this._state.stateUpdates$.pipe(v.throttleTime(200,void 0,{leading:!0,trailing:!0})).subscribe(async s=>{const r=this._state.state;Ge(s)&&(r.findString!==""&&!r.replaceRevealed?(await this._startSearching(),this._state.changeState({findCompleted:!0})):s.replaceRevealed!==!0&&this._stopSearching())}))}get searched(){return this._findModels.length>0}dispose(){super.dispose(),this._stopSearching(),this.currentMatch$.complete(),this.replaceables$.complete(),this._state.changeState({...k(),revealed:!1})}async start(){if(!this._state.findString)return{results:[]};const e=await this._startSearching();return this._state.changeState({findCompleted:!0}),e}async _startSearching(){if(!this._state.findString)return{results:[]};const e=Array.from(this._providers),n=this._findModels=(await Promise.all(e.map(s=>s.find({findString:this._state.findString,findDirection:this._state.findDirection,findScope:this._state.findScope,findBy:this._state.findBy,replaceRevealed:this._state.replaceRevealed,caseSensitive:this._state.caseSensitive,matchesTheWholeCell:this._state.matchesTheWholeCell})))).flat();this._subscribeToModelsChanges(n);const t=this._matches=n.map(s=>s.getMatches()).flat();return this.replaceables$.next(t.filter(s=>s.replaceable)),t.length?(this._moveToInitialMatch(n),this._state.changeState({matchesCount:t.length}),{results:t}):(this._state.changeState({matchesCount:0,matchesPosition:0}),{results:[]})}_stopSearching(){var e;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({findCompleted:!1,matchesCount:0,matchesPosition:0})}_subscribeToModelsChanges(e){const n=this._currentSearchingDisposables=new o.DisposableCollection,t=v.combineLatest(e.map(s=>s.matchesUpdate$)).pipe(v.debounceTime(220)).subscribe(([...s])=>{const r=this._matches=s.flat();r.length?(this._moveToInitialMatch(this._findModels,!0),this._state.changeState({matchesCount:r.length}),this.replaceables$.next(r.filter(a=>a.replaceable))):(this._state.changeState({matchesCount:0,matchesPosition:0}),this.replaceables$.next([]))});e.forEach(s=>n.add(o.toDisposable(s.activelyChangingMatch$.subscribe(r=>{const a=this._matches.findIndex(d=>d===r);this._state.changeState({matchesPosition:a+1})})))),n.add(o.toDisposable(t))}async replace(){return this._matchingModel?this._matchingModel.replace(this._state.replaceString):!1}async replaceAll(){const e=await Promise.all(this._findModels.map(n=>n.replaceAll(this._state.replaceString))).then(n=>n.reduce((t,s)=>(t.success+=s.success,t.failure+=s.failure,t),{success:0,failure:0}));return e.failure===0&&this._stopSearching(),e}getCurrentMatch(){return this._state.matchesPosition>0?this._matches[this._state.matchesPosition-1]:null}_markMatch(e){const n=this._matches.findIndex(t=>t===e);this.currentMatch$.next(e),this._state.changeState({matchesPosition:n+1})}moveToNextMatch(){if(!this._matchingModel)return;const e=this._findModels.length===1,n=this._matchingModel.moveToNextMatch({loop:e});if(n)this._markMatch(n);else{const t=this._findModels.findIndex(s=>s===this._matchingModel);this._moveToNextUnitMatch(t)}}_moveToNextUnitMatch(e){const n=this._findModels.length;for(let t=(e+1)%n;t!==e;){const s=this._findModels[t],r=s.moveToNextMatch({ignoreSelection:!0});if(r){this._matchingModel=s,this._markMatch(r);return}t=(t+1)%n}if(this._matchingModel){const t=this._matchingModel.moveToNextMatch({ignoreSelection:!0});t&&this._markMatch(t)}}moveToPreviousMatch(){if(!this._matchingModel)return;const e=this._findModels.length===1,n=this._matchingModel.moveToPreviousMatch({loop:e});if(n){const t=this._matches.findIndex(s=>s===n);this.currentMatch$.next(n),this._state.changeState({matchesPosition:t+1})}else{const t=this._findModels.length,s=this._findModels.findIndex(a=>a===this._matchingModel);for(let a=(s-1+t)%t;a!==s;){const d=this._findModels[a],u=d.moveToPreviousMatch({ignoreSelection:!0});if(u){this._matchingModel=d,this._markMatch(u);return}a=(a-1)%t}const r=this._matchingModel.moveToPreviousMatch({ignoreSelection:!0});r&&this._markMatch(r)}}_moveToInitialMatch(e,n=!1){var r;const t=(r=this._univerInstanceService.getFocusedUnit())==null?void 0:r.getUnitId();if(!t)return-1;const s=e.findIndex(a=>a.unitId===t);if(s!==-1){this._matchingModel=e[s];const a=this._matchingModel.moveToNextMatch({stayIfOnMatch:!0,noFocus:n});if(a)return this._markMatch(a),s}return this._moveToNextUnitMatch(s),0}};U=se([w(2,o.IUniverInstanceService)],U);var O=(i=>(i.ROW="row",i.COLUMN="column",i))(O||{}),T=(i=>(i.VALUE="value",i.FORMULA="formula",i))(T||{}),P=(i=>(i.SUBUNIT="subunit",i.UNIT="unit",i))(P||{});function k(){return{caseSensitive:!1,findBy:"value",findCompleted:!1,findDirection:"row",findScope:"subunit",findString:"",inputtingFindString:"",matchesCount:0,matchesPosition:0,matchesTheWholeCell:!1,replaceRevealed:!1,replaceString:"",revealed:!0}}class Ve{constructor(){l(this,"_stateUpdates$",new v.Subject);l(this,"stateUpdates$",this._stateUpdates$.asObservable());l(this,"_state$",new v.BehaviorSubject(k()));l(this,"state$",this._state$.asObservable());l(this,"_findString","");l(this,"_inputtingFindString","");l(this,"_replaceString","");l(this,"_revealed",!1);l(this,"_replaceRevealed",!1);l(this,"_matchesPosition",0);l(this,"_matchesCount",0);l(this,"_caseSensitive",!0);l(this,"_matchesTheWholeCell",!1);l(this,"_findDirection","row");l(this,"_findScope","subunit");l(this,"_findBy","value");l(this,"_findCompleted",!1)}get state(){return this._state$.getValue()}get inputtingFindString(){return this._inputtingFindString}get findString(){return this._findString}get revealed(){return this._revealed}get replaceRevealed(){return this._replaceRevealed}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get replaceString(){return this._replaceString}get caseSensitive(){return this._caseSensitive}get matchesTheWholeCell(){return this._matchesTheWholeCell}get findDirection(){return this._findDirection}get findScope(){return this._findScope}get findBy(){return this._findBy}get findCompleted(){return this._findCompleted}changeState(e){let n=!1;const t={};typeof e.findString<"u"&&e.findString!==this._findString&&(this._findString=e.findString,t.findString=this._findString,n=!0),typeof e.revealed<"u"&&e.revealed!==this._revealed&&(this._revealed=e.revealed,t.revealed=e.revealed,n=!0),typeof e.replaceRevealed<"u"&&e.replaceRevealed!==this._replaceRevealed&&(this._replaceRevealed=e.replaceRevealed,t.replaceRevealed=e.replaceRevealed,n=!0),typeof e.replaceString<"u"&&e.replaceString!==this._replaceString&&(this._replaceString=e.replaceString,t.replaceString=e.replaceString,n=!0),typeof e.matchesCount<"u"&&e.matchesCount!==this._matchesCount&&(this._matchesCount=e.matchesCount,t.matchesCount=e.matchesCount,n=!0),typeof e.matchesPosition<"u"&&e.matchesPosition!==this._matchesPosition&&(this._matchesPosition=e.matchesPosition,t.matchesPosition=e.matchesPosition,n=!0),typeof e.findBy<"u"&&e.findBy!==this._findBy&&(this._findBy=e.findBy,t.findBy=e.findBy,n=!0),typeof e.findScope<"u"&&e.findScope!==this._findScope&&(this._findScope=e.findScope,t.findScope=e.findScope,n=!0),typeof e.findDirection<"u"&&e.findDirection!==this._findDirection&&(this._findDirection=e.findDirection,t.findDirection=e.findDirection,n=!0),typeof e.caseSensitive<"u"&&e.caseSensitive!==this._caseSensitive&&(this._caseSensitive=e.caseSensitive,t.caseSensitive=e.caseSensitive,n=!0),typeof e.matchesTheWholeCell<"u"&&e.matchesTheWholeCell!==this._matchesTheWholeCell&&(this._matchesTheWholeCell=e.matchesTheWholeCell,t.matchesTheWholeCell=e.matchesTheWholeCell,n=!0),typeof e.inputtingFindString<"u"&&e.inputtingFindString!==this._inputtingFindString&&(this._inputtingFindString=e.inputtingFindString,t.inputtingFindString=e.inputtingFindString,n=!0),typeof e.findCompleted<"u"&&e.findCompleted!==this._findCompleted&&(this._findCompleted=e.findCompleted,t.findCompleted=e.findCompleted,n=!0),n&&(this._state$.next({caseSensitive:this._caseSensitive,findBy:this._findBy,findCompleted:this._findCompleted,findDirection:this._findDirection,findScope:this._findScope,findString:this._findString,inputtingFindString:this._inputtingFindString,matchesCount:this._matchesCount,matchesPosition:this._matchesPosition,matchesTheWholeCell:this._matchesTheWholeCell,replaceRevealed:this._replaceRevealed,revealed:this._revealed}),this._stateUpdates$.next(t))}}let B=class extends o.Disposable{constructor(e,n){super();l(this,"_providers",new Set);l(this,"_state",new Ve);l(this,"_model");l(this,"_currentMatch$",new v.BehaviorSubject(null));l(this,"currentMatch$",this._currentMatch$.asObservable());l(this,"_replaceables$",new v.BehaviorSubject([]));l(this,"replaceables$",this._replaceables$.asObservable());l(this,"_focusSignal$",new v.Subject);l(this,"focusSignal$",this._focusSignal$.asObservable());this._injector=e,this._contextService=n}get stateUpdates$(){return this._state.stateUpdates$}get state$(){return this._state.state$}get revealed(){return this._state.revealed}get replaceRevealed(){return this._state.replaceRevealed}dispose(){super.dispose(),this._currentMatch$.next(null),this._currentMatch$.complete(),this._replaceables$.next([]),this._replaceables$.complete(),this._focusSignal$.complete()}getCurrentMatch(){var e;return(e=this._model)==null?void 0:e.getCurrentMatch()}getFindString(){return this._state.findString}changeFindString(e){this._state.changeState({findString:e})}focusFindInput(){this._focusSignal$.next()}changeInputtingFindString(e){e?this._state.changeState({inputtingFindString:e}):this._state.changeState({inputtingFindString:"",findString:""})}changeReplaceString(e){this._state.changeState({replaceString:e})}changeMatchesTheWholeCell(e){this._state.changeState({matchesTheWholeCell:e})}changeCaseSensitive(e){this._state.changeState({caseSensitive:e})}changeFindBy(e){this._state.changeState({findBy:e}),this._toggleDisplayRawFormula(e==="formula")}changeFindScope(e){this._state.changeState({findScope:e})}changeFindDirection(e){this._state.changeState({findDirection:e})}moveToNextMatch(){this._model&&(this._state.replaceRevealed&&!this._model.searched?(this._state.changeState({findString:this._state.inputtingFindString}),this._model.start()):this._model.moveToNextMatch(),this._focusSignal$.next())}moveToPreviousMatch(){this._model&&(this._state.replaceRevealed&&!this._model.searched?(this._state.changeState({findString:this._state.inputtingFindString}),this._model.start()):this._model.moveToPreviousMatch(),this._focusSignal$.next())}async replace(){return this._model?this._model.replace():!1}async replaceAll(){if(!this._model)throw new Error("[FindReplaceService] replaceAll: model is not initialized!");return this._model.replaceAll()}revealReplace(){this._state.changeState({replaceRevealed:!0,inputtingFindString:this._state.findString}),this._toggleRevealReplace(!0)}start(e=!1){if(this._providers.size===0)return!1;this._model=this._injector.createInstance(U,this._state,this._providers),this._model.currentMatch$.subscribe(t=>this._currentMatch$.next(t)),this._model.replaceables$.subscribe(t=>this._replaceables$.next(t));const n=k();return e&&(n.replaceRevealed=!0),this._state.changeState(n),this._toggleRevealReplace(e),!0}find(){var e;(e=this._model)==null||e.start()}terminate(){var e;(e=this._model)==null||e.dispose(),this._model=null,this._toggleDisplayRawFormula(!1),this._toggleRevealReplace(!1)}registerFindReplaceProvider(e){return this._providers.add(e),o.toDisposable(()=>this._providers.delete(e))}_toggleRevealReplace(e){this._contextService.setContextValue(ne,e)}_toggleDisplayRawFormula(e){this._contextService.setContextValue(Ee.RENDER_RAW_FORMULA_KEY,e)}};B=se([w(0,o.Inject(o.Injector)),w(1,o.IContextService)],B);const W={id:"ui.command.replace-current-match",type:o.CommandType.COMMAND,handler:i=>i.get(R).replace()},He="CONFIRM_REPLACE_ALL",G={id:"ui.command.replace-all-matches",type:o.CommandType.COMMAND,handler:async i=>{const e=i.get(p.IConfirmService),n=i.get(o.LocaleService),t=i.get(p.IMessageService);if(!await e.confirm({id:He,title:{title:n.t("find-replace.replace.confirm.title")},cancelText:n.t("button.cancel"),confirmText:n.t("button.confirm")}))return!1;const r=await i.get(R).replaceAll(),{success:a,failure:d}=r;return d>0?(a===0?t.show({type:f.MessageType.Error,content:n.t("find-replace.replace.all-failure")}):t.show({type:f.MessageType.Warning,content:n.t("find-replace.replace.partial-success",`${a}`,`${d}`)}),!1):(t.show({type:f.MessageType.Success,content:n.t("find-replace.replace.all-success",`${a}`)}),!0)}},x={id:"ui.operation.open-find-dialog",type:o.CommandType.OPERATION,handler:i=>{const e=i.get(R);return e.revealed?e.focusFindInput():e.start(),!0}},N={id:"ui.operation.open-replace-dialog",type:o.CommandType.OPERATION,handler:i=>{const e=i.get(R);return e.revealed?e.replaceRevealed?e.focusFindInput():e.revealReplace():e.start(!0),!0}},V={type:o.CommandType.OPERATION,id:"ui.operation.go-to-next-match",handler:i=>(i.get(R).moveToNextMatch(),!0)},H={type:o.CommandType.OPERATION,id:"ui.operation.go-to-previous-match",handler:i=>(i.get(R).moveToPreviousMatch(),!0)};var j={exports:{}},I={};/**
1
+ "use strict";var Te=Object.defineProperty;var Pe=(i,e,n)=>e in i?Te(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n;var l=(i,e,n)=>Pe(i,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@univerjs/core"),p=require("@univerjs/ui"),v=require("rxjs"),f=require("@univerjs/design"),Ee=require("@univerjs/engine-render"),h=require("react"),Ne="find-replace.config",q={};var C=function(){return C=Object.assign||function(i){for(var e,n=1,t=arguments.length;n<t;n++){e=arguments[n];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},C.apply(this,arguments)},Le=function(i,e){var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.indexOf(t)<0&&(n[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,t=Object.getOwnPropertySymbols(i);s<t.length;s++)e.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(i,t[s])&&(n[t[s]]=i[t[s]]);return n},Q=h.forwardRef(function(i,e){var n=i.icon,t=i.id,s=i.className,r=i.extend,a=Le(i,["icon","id","className","extend"]),d="univerjs-icon univerjs-icon-".concat(t," ").concat(s||"").trim(),u=h.useRef("_".concat(Ae()));return X(n,"".concat(t),{defIds:n.defIds,idSuffix:u.current},C({ref:e,className:d},a),r)});function X(i,e,n,t,s){return h.createElement(i.tag,C(C({key:e},$e(i,n,s)),t),(je(i,n).children||[]).map(function(r,a){return X(r,"".concat(e,"-").concat(i.tag,"-").concat(a),n,void 0,s)}))}function $e(i,e,n){var t=C({},i.attrs);n!=null&&n.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=n.colorChannel1);var s=e.defIds;return!s||s.length===0||(i.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+e.idSuffix),Object.entries(t).forEach(function(r){var a=r[0],d=r[1];typeof d=="string"&&(t[a]=d.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),t}function je(i,e){var n,t=e.defIds;return!t||t.length===0?i:i.tag==="defs"&&(!((n=i.children)===null||n===void 0)&&n.length)?C(C({},i),{children:i.children.map(function(s){return typeof s.attrs.id=="string"&&t&&t.indexOf(s.attrs.id)>-1?C(C({},s),{attrs:C(C({},s.attrs),{id:s.attrs.id+e.idSuffix})}):s})}):i}function Ae(){return Math.random().toString(36).substring(2,8)}Q.displayName="UniverIcon";var we={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"}}]}]},ee=h.forwardRef(function(i,e){return h.createElement(Q,Object.assign({},i,{id:"search-single-16",ref:e,icon:we}))});ee.displayName="SearchSingle16";const te="FIND_REPLACE_INPUT_FOCUS",ie="FIND_REPLACE_DIALOG_FOCUS",ne="FIND_REPLACE_REPLACE_REVEALED";var Ue=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,se=(i,e,n,t)=>{for(var s=t>1?void 0:t?Be(e,n):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(t?a(e,n,s):a(s))||s);return t&&s&&Ue(e,n,s),s},A=(i,e)=>(n,t)=>e(n,t,i);class ke extends o.Disposable{}const R=o.createIdentifier("find-replace.service");function We(i){return typeof i.findString<"u"||typeof i.inputtingFindString<"u"||typeof i.findDirection<"u"||typeof i.matchesTheWholeCell<"u"||typeof i.caseSensitive<"u"||typeof i.findScope<"u"||typeof i.findBy<"u"}let w=class extends o.Disposable{constructor(e,n,t){super();l(this,"currentMatch$",new v.BehaviorSubject(null));l(this,"replaceables$",new v.BehaviorSubject([]));l(this,"_findModels",[]);l(this,"_matchingModel",null);l(this,"_matches",[]);l(this,"_currentSearchingDisposables",null);this._state=e,this._providers=n,this._univerInstanceService=t,this.disposeWithMe(this._state.stateUpdates$.pipe(v.throttleTime(200,void 0,{leading:!0,trailing:!0})).subscribe(async s=>{const r=this._state.state;We(s)&&(r.findString!==""&&!r.replaceRevealed?(await this._startSearching(),this._state.changeState({findCompleted:!0})):s.replaceRevealed!==!0&&this._stopSearching())}))}get searched(){return this._findModels.length>0}dispose(){super.dispose(),this._stopSearching(),this.currentMatch$.complete(),this.replaceables$.complete(),this._state.changeState({...B(),revealed:!1})}async start(){if(!this._state.findString)return{results:[]};const e=await this._startSearching();return this._state.changeState({findCompleted:!0}),e}async _startSearching(){if(!this._state.findString)return{results:[]};const e=Array.from(this._providers),n=this._findModels=(await Promise.all(e.map(s=>s.find({findString:this._state.findString,findDirection:this._state.findDirection,findScope:this._state.findScope,findBy:this._state.findBy,replaceRevealed:this._state.replaceRevealed,caseSensitive:this._state.caseSensitive,matchesTheWholeCell:this._state.matchesTheWholeCell})))).flat();this._subscribeToModelsChanges(n);const t=this._matches=n.map(s=>s.getMatches()).flat();return this.replaceables$.next(t.filter(s=>s.replaceable)),t.length?(this._moveToInitialMatch(n),this._state.changeState({matchesCount:t.length}),{results:t}):(this._state.changeState({matchesCount:0,matchesPosition:0}),{results:[]})}_stopSearching(){var e;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({findCompleted:!1,matchesCount:0,matchesPosition:0})}_subscribeToModelsChanges(e){const n=this._currentSearchingDisposables=new o.DisposableCollection,t=v.combineLatest(e.map(s=>s.matchesUpdate$)).pipe(v.debounceTime(220)).subscribe(([...s])=>{const r=this._matches=s.flat();r.length?(this._moveToInitialMatch(this._findModels,!0),this._state.changeState({matchesCount:r.length}),this.replaceables$.next(r.filter(a=>a.replaceable))):(this._state.changeState({matchesCount:0,matchesPosition:0}),this.replaceables$.next([]))});e.forEach(s=>n.add(o.toDisposable(s.activelyChangingMatch$.subscribe(r=>{const a=this._matches.findIndex(d=>d===r);this._state.changeState({matchesPosition:a+1})})))),n.add(o.toDisposable(t))}async replace(){return this._matchingModel?this._matchingModel.replace(this._state.replaceString):!1}async replaceAll(){const e=await Promise.all(this._findModels.map(n=>n.replaceAll(this._state.replaceString))).then(n=>n.reduce((t,s)=>(t.success+=s.success,t.failure+=s.failure,t),{success:0,failure:0}));return e.failure===0&&this._stopSearching(),e}getCurrentMatch(){return this._state.matchesPosition>0?this._matches[this._state.matchesPosition-1]:null}_markMatch(e){const n=this._matches.findIndex(t=>t===e);this.currentMatch$.next(e),this._state.changeState({matchesPosition:n+1})}moveToNextMatch(){if(!this._matchingModel)return;const e=this._findModels.length===1,n=this._matchingModel.moveToNextMatch({loop:e});if(n)this._markMatch(n);else{const t=this._findModels.findIndex(s=>s===this._matchingModel);this._moveToNextUnitMatch(t)}}_moveToNextUnitMatch(e){const n=this._findModels.length;for(let t=(e+1)%n;t!==e;){const s=this._findModels[t],r=s.moveToNextMatch({ignoreSelection:!0});if(r){this._matchingModel=s,this._markMatch(r);return}t=(t+1)%n}if(this._matchingModel){const t=this._matchingModel.moveToNextMatch({ignoreSelection:!0});t&&this._markMatch(t)}}moveToPreviousMatch(){if(!this._matchingModel)return;const e=this._findModels.length===1,n=this._matchingModel.moveToPreviousMatch({loop:e});if(n){const t=this._matches.findIndex(s=>s===n);this.currentMatch$.next(n),this._state.changeState({matchesPosition:t+1})}else{const t=this._findModels.length,s=this._findModels.findIndex(a=>a===this._matchingModel);for(let a=(s-1+t)%t;a!==s;){const d=this._findModels[a],u=d.moveToPreviousMatch({ignoreSelection:!0});if(u){this._matchingModel=d,this._markMatch(u);return}a=(a-1)%t}const r=this._matchingModel.moveToPreviousMatch({ignoreSelection:!0});r&&this._markMatch(r)}}_moveToInitialMatch(e,n=!1){var r;const t=(r=this._univerInstanceService.getFocusedUnit())==null?void 0:r.getUnitId();if(!t)return-1;const s=e.findIndex(a=>a.unitId===t);if(s!==-1){this._matchingModel=e[s];const a=this._matchingModel.moveToNextMatch({stayIfOnMatch:!0,noFocus:n});if(a)return this._markMatch(a),s}return this._moveToNextUnitMatch(s),0}};w=se([A(2,o.IUniverInstanceService)],w);var D=(i=>(i.ROW="row",i.COLUMN="column",i))(D||{}),O=(i=>(i.VALUE="value",i.FORMULA="formula",i))(O||{}),T=(i=>(i.SUBUNIT="subunit",i.UNIT="unit",i))(T||{});function B(){return{caseSensitive:!1,findBy:"value",findCompleted:!1,findDirection:"row",findScope:"subunit",findString:"",inputtingFindString:"",matchesCount:0,matchesPosition:0,matchesTheWholeCell:!1,replaceRevealed:!1,replaceString:"",revealed:!0}}class Ge{constructor(){l(this,"_stateUpdates$",new v.Subject);l(this,"stateUpdates$",this._stateUpdates$.asObservable());l(this,"_state$",new v.BehaviorSubject(B()));l(this,"state$",this._state$.asObservable());l(this,"_findString","");l(this,"_inputtingFindString","");l(this,"_replaceString","");l(this,"_revealed",!1);l(this,"_replaceRevealed",!1);l(this,"_matchesPosition",0);l(this,"_matchesCount",0);l(this,"_caseSensitive",!0);l(this,"_matchesTheWholeCell",!1);l(this,"_findDirection","row");l(this,"_findScope","subunit");l(this,"_findBy","value");l(this,"_findCompleted",!1)}get state(){return this._state$.getValue()}get inputtingFindString(){return this._inputtingFindString}get findString(){return this._findString}get revealed(){return this._revealed}get replaceRevealed(){return this._replaceRevealed}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get replaceString(){return this._replaceString}get caseSensitive(){return this._caseSensitive}get matchesTheWholeCell(){return this._matchesTheWholeCell}get findDirection(){return this._findDirection}get findScope(){return this._findScope}get findBy(){return this._findBy}get findCompleted(){return this._findCompleted}changeState(e){let n=!1;const t={};typeof e.findString<"u"&&e.findString!==this._findString&&(this._findString=e.findString,t.findString=this._findString,n=!0),typeof e.revealed<"u"&&e.revealed!==this._revealed&&(this._revealed=e.revealed,t.revealed=e.revealed,n=!0),typeof e.replaceRevealed<"u"&&e.replaceRevealed!==this._replaceRevealed&&(this._replaceRevealed=e.replaceRevealed,t.replaceRevealed=e.replaceRevealed,n=!0),typeof e.replaceString<"u"&&e.replaceString!==this._replaceString&&(this._replaceString=e.replaceString,t.replaceString=e.replaceString,n=!0),typeof e.matchesCount<"u"&&e.matchesCount!==this._matchesCount&&(this._matchesCount=e.matchesCount,t.matchesCount=e.matchesCount,n=!0),typeof e.matchesPosition<"u"&&e.matchesPosition!==this._matchesPosition&&(this._matchesPosition=e.matchesPosition,t.matchesPosition=e.matchesPosition,n=!0),typeof e.findBy<"u"&&e.findBy!==this._findBy&&(this._findBy=e.findBy,t.findBy=e.findBy,n=!0),typeof e.findScope<"u"&&e.findScope!==this._findScope&&(this._findScope=e.findScope,t.findScope=e.findScope,n=!0),typeof e.findDirection<"u"&&e.findDirection!==this._findDirection&&(this._findDirection=e.findDirection,t.findDirection=e.findDirection,n=!0),typeof e.caseSensitive<"u"&&e.caseSensitive!==this._caseSensitive&&(this._caseSensitive=e.caseSensitive,t.caseSensitive=e.caseSensitive,n=!0),typeof e.matchesTheWholeCell<"u"&&e.matchesTheWholeCell!==this._matchesTheWholeCell&&(this._matchesTheWholeCell=e.matchesTheWholeCell,t.matchesTheWholeCell=e.matchesTheWholeCell,n=!0),typeof e.inputtingFindString<"u"&&e.inputtingFindString!==this._inputtingFindString&&(this._inputtingFindString=e.inputtingFindString,t.inputtingFindString=e.inputtingFindString,n=!0),typeof e.findCompleted<"u"&&e.findCompleted!==this._findCompleted&&(this._findCompleted=e.findCompleted,t.findCompleted=e.findCompleted,n=!0),n&&(this._state$.next({caseSensitive:this._caseSensitive,findBy:this._findBy,findCompleted:this._findCompleted,findDirection:this._findDirection,findScope:this._findScope,findString:this._findString,inputtingFindString:this._inputtingFindString,matchesCount:this._matchesCount,matchesPosition:this._matchesPosition,matchesTheWholeCell:this._matchesTheWholeCell,replaceRevealed:this._replaceRevealed,revealed:this._revealed}),this._stateUpdates$.next(t))}}let U=class extends o.Disposable{constructor(e,n){super();l(this,"_providers",new Set);l(this,"_state",new Ge);l(this,"_model");l(this,"_currentMatch$",new v.BehaviorSubject(null));l(this,"currentMatch$",this._currentMatch$.asObservable());l(this,"_replaceables$",new v.BehaviorSubject([]));l(this,"replaceables$",this._replaceables$.asObservable());l(this,"_focusSignal$",new v.Subject);l(this,"focusSignal$",this._focusSignal$.asObservable());this._injector=e,this._contextService=n}get stateUpdates$(){return this._state.stateUpdates$}get state$(){return this._state.state$}get revealed(){return this._state.revealed}get replaceRevealed(){return this._state.replaceRevealed}dispose(){super.dispose(),this._currentMatch$.next(null),this._currentMatch$.complete(),this._replaceables$.next([]),this._replaceables$.complete(),this._focusSignal$.complete()}getCurrentMatch(){var e;return(e=this._model)==null?void 0:e.getCurrentMatch()}getFindString(){return this._state.findString}changeFindString(e){this._state.changeState({findString:e})}focusFindInput(){this._focusSignal$.next()}changeInputtingFindString(e){e?this._state.changeState({inputtingFindString:e}):this._state.changeState({inputtingFindString:"",findString:""})}changeReplaceString(e){this._state.changeState({replaceString:e})}changeMatchesTheWholeCell(e){this._state.changeState({matchesTheWholeCell:e})}changeCaseSensitive(e){this._state.changeState({caseSensitive:e})}changeFindBy(e){this._state.changeState({findBy:e}),this._toggleDisplayRawFormula(e==="formula")}changeFindScope(e){this._state.changeState({findScope:e})}changeFindDirection(e){this._state.changeState({findDirection:e})}moveToNextMatch(){this._model&&(this._state.replaceRevealed&&!this._model.searched?(this._state.changeState({findString:this._state.inputtingFindString}),this._model.start()):this._model.moveToNextMatch(),this._focusSignal$.next())}moveToPreviousMatch(){this._model&&(this._state.replaceRevealed&&!this._model.searched?(this._state.changeState({findString:this._state.inputtingFindString}),this._model.start()):this._model.moveToPreviousMatch(),this._focusSignal$.next())}async replace(){return this._model?this._model.replace():!1}async replaceAll(){if(!this._model)throw new Error("[FindReplaceService] replaceAll: model is not initialized!");return this._model.replaceAll()}revealReplace(){this._state.changeState({replaceRevealed:!0,inputtingFindString:this._state.findString}),this._toggleRevealReplace(!0)}start(e=!1){if(this._providers.size===0)return!1;this._model=this._injector.createInstance(w,this._state,this._providers),this._model.currentMatch$.subscribe(t=>this._currentMatch$.next(t)),this._model.replaceables$.subscribe(t=>this._replaceables$.next(t));const n=B();return e&&(n.replaceRevealed=!0),this._state.changeState(n),this._toggleRevealReplace(e),!0}find(){var e;(e=this._model)==null||e.start()}terminate(){var e;(e=this._model)==null||e.dispose(),this._model=null,this._toggleDisplayRawFormula(!1),this._toggleRevealReplace(!1)}registerFindReplaceProvider(e){return this._providers.add(e),o.toDisposable(()=>this._providers.delete(e))}_toggleRevealReplace(e){this._contextService.setContextValue(ne,e)}_toggleDisplayRawFormula(e){this._contextService.setContextValue(Ee.RENDER_RAW_FORMULA_KEY,e)}};U=se([A(0,o.Inject(o.Injector)),A(1,o.IContextService)],U);const k={id:"ui.command.replace-current-match",type:o.CommandType.COMMAND,handler:i=>i.get(R).replace()},Ve="CONFIRM_REPLACE_ALL",W={id:"ui.command.replace-all-matches",type:o.CommandType.COMMAND,handler:async i=>{const e=i.get(p.IConfirmService),n=i.get(o.LocaleService),t=i.get(p.IMessageService);if(!await e.confirm({id:Ve,title:{title:n.t("find-replace.replace.confirm.title")},cancelText:n.t("button.cancel"),confirmText:n.t("button.confirm")}))return!1;const r=await i.get(R).replaceAll(),{success:a,failure:d}=r;return d>0?(a===0?t.show({type:f.MessageType.Error,content:n.t("find-replace.replace.all-failure")}):t.show({type:f.MessageType.Warning,content:n.t("find-replace.replace.partial-success",`${a}`,`${d}`)}),!1):(t.show({type:f.MessageType.Success,content:n.t("find-replace.replace.all-success",`${a}`)}),!0)}},I={id:"ui.operation.open-find-dialog",type:o.CommandType.OPERATION,handler:i=>{const e=i.get(R);return e.revealed?e.focusFindInput():e.start(),!0}},E={id:"ui.operation.open-replace-dialog",type:o.CommandType.OPERATION,handler:i=>{const e=i.get(R);return e.revealed?e.replaceRevealed?e.focusFindInput():e.revealReplace():e.start(!0),!0}},G={type:o.CommandType.OPERATION,id:"ui.operation.go-to-next-match",handler:i=>(i.get(R).moveToNextMatch(),!0)},V={type:o.CommandType.OPERATION,id:"ui.operation.go-to-previous-match",handler:i=>(i.get(R).moveToPreviousMatch(),!0)};var $={exports:{}},x={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var J;function Ke(){if(J)return I;J=1;var i=c,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,s=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function a(d,u,S){var _,g={},y=null,b=null;S!==void 0&&(y=""+S),u.key!==void 0&&(y=""+u.key),u.ref!==void 0&&(b=u.ref);for(_ in u)t.call(u,_)&&!r.hasOwnProperty(_)&&(g[_]=u[_]);if(d&&d.defaultProps)for(_ in u=d.defaultProps,u)g[_]===void 0&&(g[_]=u[_]);return{$$typeof:e,type:d,key:y,ref:b,props:g,_owner:s.current}}return I.Fragment=n,I.jsx=a,I.jsxs=a,I}var z;function qe(){return z||(z=1,j.exports=Ke()),j.exports}var h=qe();function re(i){const{findCompleted:e,localeService:n,matchesCount:t,matchesPosition:s,findString:r,findReplaceService:a,onChange:d,...u}=i,_=e&&t===0?n.t("find-replace.dialog.no-result"):t===0?" ":void 0;return h.jsx(f.InputWithSlot,{autoFocus:!0,placeholder:n.t("find-replace.dialog.find-placeholder"),slot:h.jsx(f.Pager,{loop:!0,text:_,value:s,total:t,onChange:g=>{s===t&&g===1?a.moveToNextMatch():s===1&&g===t||g<s?a.moveToPreviousMatch():a.moveToNextMatch()}}),value:r,onChange:g=>d==null?void 0:d(g),...u})}const Je="univer-find-replace-dialog-container",ze="univer-find-replace-expand-container",Ye="univer-button-text",Ze="univer-find-replace-buttons-group",Qe="univer-find-replace-buttons-group-right",E={findReplaceDialogContainer:Je,findReplaceExpandContainer:ze,buttonText:Ye,findReplaceButtonsGroup:Ze,findReplaceButtonsGroupRight:Qe};function ae(i,e){const n=c.useCallback(()=>{var s;(s=document.querySelector(".univer-find-input input"))==null||s.focus()},[]),t=c.useCallback(()=>{const s=document.querySelectorAll(".univer-find-replace-dialog-container .univer-select-selection-search-input");return Array.from(s).some(r=>r===document.activeElement)},[]);return c.useImperativeHandle(e,()=>({focus:n,selectHasFocus:t})),c.useEffect(()=>{const s=i.focusSignal$.subscribe(()=>n());return()=>s.unsubscribe()},[i,n]),{focus:n,selectHasFocus:t}}const Xe=c.forwardRef(function(e,n){const t=o.useDependency(o.LocaleService),s=o.useDependency(R),r=o.useDependency(o.ICommandService),a=p.useObservable(s.state$,void 0,!0),{findCompleted:d,findString:u,matchesCount:S,matchesPosition:_}=a,g=c.useCallback(()=>{r.executeCommand(N.id)},[r]),y=c.useCallback(b=>s.changeFindString(b),[s]);return ae(s,n),h.jsxs(c.Fragment,{children:[h.jsx(re,{findCompleted:d,className:"univer-find-input",matchesCount:S,matchesPosition:_,findReplaceService:s,localeService:t,findString:u,onChange:y}),h.jsx("div",{className:E.findReplaceExpandContainer,children:h.jsx(f.Button,{type:"text",size:"small",onClick:g,children:t.t("find-replace.dialog.advanced-finding")})})]})}),et=c.forwardRef(function(e,n){const t=o.useDependency(R),s=o.useDependency(o.LocaleService),r=o.useDependency(o.ICommandService),a=o.useDependency(p.IMessageService),d=p.useObservable(t.currentMatch$,void 0,!0),u=p.useObservable(t.replaceables$,void 0,!0),S=p.useObservable(t.state$,void 0,!0),{matchesCount:_,matchesPosition:g,findString:y,inputtingFindString:b,replaceString:le,caseSensitive:de,matchesTheWholeCell:ue,findDirection:he,findScope:pe,findBy:fe,findCompleted:$}=S,_e=b.length===0,ge=_===0||!(d!=null&&d.replaceable),me=u.length===0,ve=c.useCallback(m=>t.changeInputtingFindString(m),[t]),Se=c.useCallback(m=>t.changeReplaceString(m),[t]),{focus:Ce}=ae(t,n),Re=c.useCallback(()=>{y===b?t.moveToNextMatch():(t.changeFindString(b),t.find())},[y,b,t]),be=c.useCallback(()=>r.executeCommand(W.id),[r]),Me=c.useCallback(async()=>{await r.executeCommand(G.id),Ce()},[r]),ye=c.useCallback(m=>{t.changeFindDirection(m)},[t]),xe=c.useCallback(m=>{t.changeFindScope(m)},[t]),Ie=c.useCallback(m=>{t.changeFindBy(m)},[t]),Fe=it(s),De=nt(s),Oe=st(s);return c.useEffect(()=>{const m=$&&_===0;let D=null;return m&&(D=a.show({content:s.t("find-replace.dialog.no-match"),type:f.MessageType.Warning,duration:5e3})),()=>D==null?void 0:D.dispose()},[$,_,a,s]),h.jsxs(c.Fragment,{children:[h.jsx(f.FormLayout,{label:s.t("find-replace.dialog.find"),children:h.jsx(re,{findCompleted:$,className:"univer-find-input",matchesCount:_,matchesPosition:g,findReplaceService:t,localeService:s,findString:b,onChange:ve})}),h.jsx(f.FormLayout,{label:s.t("find-replace.dialog.replace"),children:h.jsx(f.Input,{placeholder:s.t("find-replace.dialog.replace-placeholder"),value:le,onChange:m=>Se(m)})}),h.jsx(f.FormLayout,{label:s.t("find-replace.dialog.find-direction.title"),children:h.jsx(f.Select,{value:he,options:De,onChange:ye})}),h.jsx(f.FormDualColumnLayout,{children:h.jsxs(c.Fragment,{children:[h.jsx(f.FormLayout,{label:s.t("find-replace.dialog.find-scope.title"),children:h.jsx(f.Select,{value:pe,options:Fe,onChange:xe})}),h.jsx(f.FormLayout,{label:s.t("find-replace.dialog.find-by.title"),children:h.jsx(f.Select,{value:fe,options:Oe,onChange:Ie})})]})}),h.jsx(f.FormDualColumnLayout,{children:h.jsxs(c.Fragment,{children:[h.jsx(f.FormLayout,{children:h.jsx(f.Checkbox,{checked:de,onChange:m=>{t.changeCaseSensitive(m)},children:s.t("find-replace.dialog.case-sensitive")})}),h.jsx(f.FormLayout,{children:h.jsx(f.Checkbox,{checked:ue,onChange:m=>{t.changeMatchesTheWholeCell(m)},children:s.t("find-replace.dialog.match-the-whole-cell")})})]})}),h.jsxs("div",{className:E.findReplaceButtonsGroup,children:[h.jsx(f.Button,{type:"primary",onClick:Re,disabled:_e,children:s.t("find-replace.dialog.find")}),h.jsxs("span",{className:E.findReplaceButtonsGroupRight,children:[h.jsx(f.Button,{disabled:ge,onClick:be,children:s.t("find-replace.dialog.replace")}),h.jsx(f.Button,{disabled:me,onClick:Me,children:s.t("find-replace.dialog.replace-all")})]})]})]})});function tt(){const i=o.useDependency(R),e=o.useDependency(p.ILayoutService),n=o.useDependency(o.IContextService),t=p.useObservable(i.state$,void 0,!0),s=c.useRef(null);c.useEffect(()=>{let u;return s.current&&(u=e.registerContainerElement(s.current)),()=>u==null?void 0:u.dispose()},[e]);const r=c.useRef(null),a=c.useCallback(u=>n.setContextValue(ie,u),[n]),d=c.useCallback(u=>n.setContextValue(te,u),[n]);return c.useEffect(()=>{var S;const u=v.fromEvent(document,"focusin").subscribe(_=>{var g;_.target&&((g=s.current)!=null&&g.contains(_.target))?a(!0):a(!1),!r.current||!r.current.selectHasFocus()?d(!0):d(!1)});return(S=r.current)==null||S.focus(),a(!0),d(!0),()=>{u.unsubscribe(),a(!1)}},[a,d]),h.jsx("div",{className:E.findReplaceDialogContainer,ref:s,children:t.replaceRevealed?h.jsx(et,{ref:r}):h.jsx(Xe,{ref:r})})}function it(i){const e=i.getCurrentLocale();return c.useMemo(()=>[{label:i.t("find-replace.dialog.find-scope.current-sheet"),value:P.SUBUNIT},{label:i.t("find-replace.dialog.find-scope.workbook"),value:P.UNIT}],[e])}function nt(i){const e=i.getCurrentLocale();return c.useMemo(()=>[{label:i.t("find-replace.dialog.find-direction.row"),value:O.ROW},{label:i.t("find-replace.dialog.find-direction.column"),value:O.COLUMN}],[e])}function st(i){const e=i.getCurrentLocale();return c.useMemo(()=>[{label:i.t("find-replace.dialog.find-by.value"),value:T.VALUE},{label:i.t("find-replace.dialog.find-by.formula"),value:T.FORMULA}],[e])}function F(i){return i.getContextValue(ie)}function rt(i){return i.getContextValue(ne)}function oe(i){return i.getContextValue(te)}const L="7_find-replace-shortcuts";function K(i){return i.getContextValue(o.FOCUSING_SHEET)}function q(i){return!i.getContextValue(o.EDITOR_ACTIVATED)}const at={id:x.id,description:"find-replace.shortcut.open-find-dialog",binding:p.KeyCode.F|p.MetaKeys.CTRL_COMMAND,group:L,preconditions(i){return!F(i)&&K(i)&&q(i)}},ot={id:x.id,description:"find-replace.shortcut.open-find-dialog",binding:p.KeyCode.F|p.MetaKeys.CTRL_COMMAND,mac:p.KeyCode.F|p.MetaKeys.MAC_CTRL,preconditions(i){return!F(i)&&K(i)&&q(i)}},ct={id:N.id,description:"find-replace.shortcut.open-replace-dialog",binding:p.KeyCode.H|p.MetaKeys.CTRL_COMMAND,mac:p.KeyCode.H|p.MetaKeys.MAC_CTRL,group:L,preconditions(i){return K(i)&&q(i)&&(!F(i)||!rt(i))}},lt={id:V.id,description:"find-replace.shortcut.go-to-next-match",binding:p.KeyCode.ENTER,group:L,priority:1e3,preconditions(i){return oe(i)&&F(i)}},dt={id:H.id,description:"find-replace.shortcut.go-to-previous-match",binding:p.KeyCode.ENTER|p.MetaKeys.SHIFT,group:L,priority:1e3,preconditions(i){return oe(i)&&F(i)}};function ut(i){const e=i.get(o.IContextService);return{id:x.id,icon:"SearchIcon",tooltip:"find-replace.toolbar",type:p.MenuItemType.BUTTON,hidden$:p.getMenuHiddenObservable(i,o.UniverInstanceType.UNIVER_SHEET),disabled$:v.combineLatest([e.subscribeContextValue$(o.EDITOR_ACTIVATED),e.subscribeContextValue$(o.FOCUSING_SHEET)]).pipe(v.map(([n,t])=>n||!t))}}const ht={[p.RibbonStartGroup.OTHERS]:{[x.id]:{order:2,menuItemFactory:ut}}};var pt=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,_t=(i,e,n,t)=>{for(var s=t>1?void 0:t?ft(e,n):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(t?a(e,n,s):a(s))||s);return t&&s&&pt(e,n,s),s},M=(i,e)=>(n,t)=>e(n,t,i);const Y="DESKTOP_FIND_REPLACE_DIALOG",ce=350,gt=20,mt=-90;exports.FindReplaceController=class extends o.RxDisposable{constructor(n,t,s,r,a,d,u,S,_,g){super();l(this,"_closingListenerDisposable");this._univerInstanceService=n,this._menuManagerService=t,this._shortcutService=s,this._commandService=r,this._findReplaceService=a,this._dialogService=d,this._layoutService=u,this._localeService=S,this._componentManager=_,this._injector=g,this._initCommands(),this._initUI(),this._initShortcuts()}dispose(){var n;super.dispose(),(n=this._closingListenerDisposable)==null||n.dispose(),this._closingListenerDisposable=null}_initCommands(){[x,N,V,H,G,W].forEach(n=>{this.disposeWithMe(this._commandService.registerCommand(n))})}_initShortcuts(){[ct,at,ot,dt,lt].forEach(n=>this.disposeWithMe(this._shortcutService.registerShortcut(n)))}_initUI(){this.disposeWithMe(this._componentManager.register("FindReplaceDialog",tt)),this.disposeWithMe(this._componentManager.register("SearchIcon",ee)),this._menuManagerService.mergeMenu(ht),this._findReplaceService.stateUpdates$.pipe(v.takeUntil(this.dispose$)).subscribe(n=>{n.revealed===!0&&this._openPanel()})}_openPanel(){this._dialogService.open({id:Y,draggable:!0,width:ce,title:{title:this._localeService.t("find-replace.dialog.title")},children:{label:"FindReplaceDialog"},destroyOnClose:!0,defaultPosition:vt(),preservePositionOnDestroy:!0,onClose:()=>this.closePanel()}),this._closingListenerDisposable=o.toDisposable(this._univerInstanceService.focused$.pipe(v.takeUntil(this.dispose$)).subscribe(n=>{(!n||!this._univerInstanceService.getUniverSheetInstance(n))&&this.closePanel()}))}closePanel(){this._closingListenerDisposable&&(this._closingListenerDisposable.dispose(),this._closingListenerDisposable=null,this._dialogService.close(Y),this._findReplaceService.terminate(),queueMicrotask(()=>this._layoutService.focus()))}};exports.FindReplaceController=_t([M(0,o.IUniverInstanceService),M(1,p.IMenuManagerService),M(2,p.IShortcutService),M(3,o.ICommandService),M(4,R),M(5,p.IDialogService),M(6,p.ILayoutService),M(7,o.Inject(o.LocaleService)),M(8,o.Inject(p.ComponentManager)),M(9,o.Inject(o.Injector))],exports.FindReplaceController);function vt(){const{innerWidth:i}=window;return{x:(i-ce)/2-gt,y:mt}}var St=Object.defineProperty,Ct=Object.getOwnPropertyDescriptor,Rt=(i,e,n,t)=>{for(var s=t>1?void 0:t?Ct(e,n):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(t?a(e,n,s):a(s))||s);return t&&s&&St(e,n,s),s},Z=(i,e)=>(n,t)=>e(n,t,i);const bt="UNIVER_FIND_REPLACE_PLUGIN";var A;exports.UniverFindReplacePlugin=(A=class extends o.Plugin{constructor(e=Le,n,t){super(),this._config=e,this._injector=n,this._configService=t;const{...s}=this._config;this._configService.setConfig(Ne,s)}onStarting(){[[exports.FindReplaceController],[R,{useClass:B}]].forEach(e=>this._injector.add(e))}onRendered(){this._injector.get(exports.FindReplaceController)}},l(A,"pluginName",bt),A);exports.UniverFindReplacePlugin=Rt([Z(1,o.Inject(o.Injector)),Z(2,o.IConfigService)],exports.UniverFindReplacePlugin);exports.FindBy=T;exports.FindDirection=O;exports.FindModel=We;exports.FindScope=P;exports.GoToNextMatchOperation=V;exports.GoToPreviousMatchOperation=H;exports.IFindReplaceService=R;exports.OpenFindDialogOperation=x;exports.OpenReplaceDialogOperation=N;exports.ReplaceAllMatchesCommand=G;exports.ReplaceCurrentMatchCommand=W;
9
+ */var J;function He(){if(J)return x;J=1;var i=h,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,s=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function a(d,u,S){var _,g={},y=null,b=null;S!==void 0&&(y=""+S),u.key!==void 0&&(y=""+u.key),u.ref!==void 0&&(b=u.ref);for(_ in u)t.call(u,_)&&!r.hasOwnProperty(_)&&(g[_]=u[_]);if(d&&d.defaultProps)for(_ in u=d.defaultProps,u)g[_]===void 0&&(g[_]=u[_]);return{$$typeof:e,type:d,key:y,ref:b,props:g,_owner:s.current}}return x.Fragment=n,x.jsx=a,x.jsxs=a,x}var z;function Ke(){return z||(z=1,$.exports=He()),$.exports}var c=Ke();const qe="univer-find-replace-dialog-container",Je="univer-find-replace-expand-container",ze="univer-button-text",Ye="univer-find-replace-buttons-group",Ze="univer-find-replace-buttons-group-right",P={findReplaceDialogContainer:qe,findReplaceExpandContainer:Je,buttonText:ze,findReplaceButtonsGroup:Ye,findReplaceButtonsGroupRight:Ze};function re(i){const{findCompleted:e,localeService:n,matchesCount:t,matchesPosition:s,findString:r,findReplaceService:a,onChange:d,...u}=i,_=e&&t===0?n.t("find-replace.dialog.no-result"):t===0?" ":void 0;return c.jsx(f.InputWithSlot,{autoFocus:!0,placeholder:n.t("find-replace.dialog.find-placeholder"),slot:c.jsx(f.Pager,{loop:!0,text:_,value:s,total:t,onChange:g=>{s===t&&g===1?a.moveToNextMatch():s===1&&g===t||g<s?a.moveToPreviousMatch():a.moveToNextMatch()}}),value:r,onChange:g=>d==null?void 0:d(g),...u})}function ae(i,e){const n=h.useCallback(()=>{var s;(s=document.querySelector(".univer-find-input input"))==null||s.focus()},[]),t=h.useCallback(()=>{const s=document.querySelectorAll(".univer-find-replace-dialog-container .univer-select-selection-search-input");return Array.from(s).some(r=>r===document.activeElement)},[]);return h.useImperativeHandle(e,()=>({focus:n,selectHasFocus:t})),h.useEffect(()=>{const s=i.focusSignal$.subscribe(()=>n());return()=>s.unsubscribe()},[i,n]),{focus:n,selectHasFocus:t}}const Qe=h.forwardRef(function(e,n){const t=o.useDependency(o.LocaleService),s=o.useDependency(R),r=o.useDependency(o.ICommandService),a=p.useObservable(s.state$,void 0,!0),{findCompleted:d,findString:u,matchesCount:S,matchesPosition:_}=a,g=h.useCallback(()=>{r.executeCommand(E.id)},[r]),y=h.useCallback(b=>s.changeFindString(b),[s]);return ae(s,n),c.jsxs(c.Fragment,{children:[c.jsx(re,{findCompleted:d,className:"univer-find-input",matchesCount:S,matchesPosition:_,findReplaceService:s,localeService:t,findString:u,onChange:y}),c.jsx("div",{className:P.findReplaceExpandContainer,children:c.jsx(f.Button,{type:"text",size:"small",onClick:g,children:t.t("find-replace.dialog.advanced-finding")})})]})}),Xe=h.forwardRef(function(e,n){const t=o.useDependency(R),s=o.useDependency(o.LocaleService),r=o.useDependency(o.ICommandService),a=o.useDependency(p.IMessageService),d=p.useObservable(t.currentMatch$,void 0,!0),u=p.useObservable(t.replaceables$,void 0,!0),S=p.useObservable(t.state$,void 0,!0),{matchesCount:_,matchesPosition:g,findString:y,inputtingFindString:b,replaceString:le,caseSensitive:de,matchesTheWholeCell:ue,findDirection:he,findScope:pe,findBy:fe,findCompleted:L}=S,_e=b.length===0,ge=_===0||!(d!=null&&d.replaceable),me=u.length===0,ve=h.useCallback(m=>t.changeInputtingFindString(m),[t]),Se=h.useCallback(m=>t.changeReplaceString(m),[t]),{focus:Ce}=ae(t,n),Re=h.useCallback(()=>{y===b?t.moveToNextMatch():(t.changeFindString(b),t.find())},[y,b,t]),be=h.useCallback(()=>r.executeCommand(k.id),[r]),Me=h.useCallback(async()=>{await r.executeCommand(W.id),Ce()},[r]),ye=h.useCallback(m=>{t.changeFindDirection(m)},[t]),Ie=h.useCallback(m=>{t.changeFindScope(m)},[t]),xe=h.useCallback(m=>{t.changeFindBy(m)},[t]),Fe=tt(s),De=it(s),Oe=nt(s);return h.useEffect(()=>{L&&_===0&&a.show({content:s.t("find-replace.dialog.no-match"),type:f.MessageType.Warning,duration:5e3})},[L,_,a,s]),c.jsxs(c.Fragment,{children:[c.jsx(f.FormLayout,{label:s.t("find-replace.dialog.find"),children:c.jsx(re,{findCompleted:L,className:"univer-find-input",matchesCount:_,matchesPosition:g,findReplaceService:t,localeService:s,findString:b,onChange:ve})}),c.jsx(f.FormLayout,{label:s.t("find-replace.dialog.replace"),children:c.jsx(f.Input,{placeholder:s.t("find-replace.dialog.replace-placeholder"),value:le,onChange:m=>Se(m)})}),c.jsx(f.FormLayout,{label:s.t("find-replace.dialog.find-direction.title"),children:c.jsx(f.Select,{value:he,options:De,onChange:ye})}),c.jsx(f.FormDualColumnLayout,{children:c.jsxs(c.Fragment,{children:[c.jsx(f.FormLayout,{label:s.t("find-replace.dialog.find-scope.title"),children:c.jsx(f.Select,{value:pe,options:Fe,onChange:Ie})}),c.jsx(f.FormLayout,{label:s.t("find-replace.dialog.find-by.title"),children:c.jsx(f.Select,{value:fe,options:Oe,onChange:xe})})]})}),c.jsx(f.FormDualColumnLayout,{children:c.jsxs(c.Fragment,{children:[c.jsx(f.FormLayout,{children:c.jsx(f.Checkbox,{checked:de,onChange:m=>{t.changeCaseSensitive(m)},children:s.t("find-replace.dialog.case-sensitive")})}),c.jsx(f.FormLayout,{children:c.jsx(f.Checkbox,{checked:ue,onChange:m=>{t.changeMatchesTheWholeCell(m)},children:s.t("find-replace.dialog.match-the-whole-cell")})})]})}),c.jsxs("div",{className:P.findReplaceButtonsGroup,children:[c.jsx(f.Button,{type:"primary",onClick:Re,disabled:_e,children:s.t("find-replace.dialog.find")}),c.jsxs("span",{className:P.findReplaceButtonsGroupRight,children:[c.jsx(f.Button,{disabled:ge,onClick:be,children:s.t("find-replace.dialog.replace")}),c.jsx(f.Button,{disabled:me,onClick:Me,children:s.t("find-replace.dialog.replace-all")})]})]})]})});function et(){const i=o.useDependency(R),e=o.useDependency(p.ILayoutService),n=o.useDependency(o.IContextService),t=p.useObservable(i.state$,void 0,!0),s=h.useRef(null);h.useEffect(()=>{let u;return s.current&&(u=e.registerContainerElement(s.current)),()=>u==null?void 0:u.dispose()},[e]);const r=h.useRef(null),a=h.useCallback(u=>n.setContextValue(ie,u),[n]),d=h.useCallback(u=>n.setContextValue(te,u),[n]);return h.useEffect(()=>{var S;const u=v.fromEvent(document,"focusin").subscribe(_=>{var g;_.target&&((g=s.current)!=null&&g.contains(_.target))?a(!0):a(!1),!r.current||!r.current.selectHasFocus()?d(!0):d(!1)});return(S=r.current)==null||S.focus(),a(!0),d(!0),()=>{u.unsubscribe(),a(!1)}},[a,d]),c.jsx("div",{className:P.findReplaceDialogContainer,ref:s,children:t.replaceRevealed?c.jsx(Xe,{ref:r}):c.jsx(Qe,{ref:r})})}function tt(i){const e=i.getCurrentLocale();return h.useMemo(()=>[{label:i.t("find-replace.dialog.find-scope.current-sheet"),value:T.SUBUNIT},{label:i.t("find-replace.dialog.find-scope.workbook"),value:T.UNIT}],[e])}function it(i){const e=i.getCurrentLocale();return h.useMemo(()=>[{label:i.t("find-replace.dialog.find-direction.row"),value:D.ROW},{label:i.t("find-replace.dialog.find-direction.column"),value:D.COLUMN}],[e])}function nt(i){const e=i.getCurrentLocale();return h.useMemo(()=>[{label:i.t("find-replace.dialog.find-by.value"),value:O.VALUE},{label:i.t("find-replace.dialog.find-by.formula"),value:O.FORMULA}],[e])}function F(i){return i.getContextValue(ie)}function st(i){return i.getContextValue(ne)}function oe(i){return i.getContextValue(te)}const N="7_find-replace-shortcuts";function H(i){return i.getContextValue(o.FOCUSING_SHEET)}function K(i){return!i.getContextValue(o.EDITOR_ACTIVATED)}const rt={id:I.id,description:"find-replace.shortcut.open-find-dialog",binding:p.KeyCode.F|p.MetaKeys.CTRL_COMMAND,group:N,preconditions(i){return!F(i)&&H(i)&&K(i)}},at={id:I.id,description:"find-replace.shortcut.open-find-dialog",binding:p.KeyCode.F|p.MetaKeys.CTRL_COMMAND,mac:p.KeyCode.F|p.MetaKeys.MAC_CTRL,preconditions(i){return!F(i)&&H(i)&&K(i)}},ot={id:E.id,description:"find-replace.shortcut.open-replace-dialog",binding:p.KeyCode.H|p.MetaKeys.CTRL_COMMAND,mac:p.KeyCode.H|p.MetaKeys.MAC_CTRL,group:N,preconditions(i){return H(i)&&K(i)&&(!F(i)||!st(i))}},ct={id:G.id,description:"find-replace.shortcut.go-to-next-match",binding:p.KeyCode.ENTER,group:N,priority:1e3,preconditions(i){return oe(i)&&F(i)}},lt={id:V.id,description:"find-replace.shortcut.go-to-previous-match",binding:p.KeyCode.ENTER|p.MetaKeys.SHIFT,group:N,priority:1e3,preconditions(i){return oe(i)&&F(i)}};function dt(i){const e=i.get(o.IContextService);return{id:I.id,icon:"SearchIcon",tooltip:"find-replace.toolbar",type:p.MenuItemType.BUTTON,hidden$:p.getMenuHiddenObservable(i,o.UniverInstanceType.UNIVER_SHEET),disabled$:v.combineLatest([e.subscribeContextValue$(o.EDITOR_ACTIVATED),e.subscribeContextValue$(o.FOCUSING_SHEET)]).pipe(v.map(([n,t])=>n||!t))}}const ut={[p.RibbonStartGroup.OTHERS]:{[I.id]:{order:2,menuItemFactory:dt}}};var ht=Object.defineProperty,pt=Object.getOwnPropertyDescriptor,ft=(i,e,n,t)=>{for(var s=t>1?void 0:t?pt(e,n):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(t?a(e,n,s):a(s))||s);return t&&s&&ht(e,n,s),s},M=(i,e)=>(n,t)=>e(n,t,i);const Y="DESKTOP_FIND_REPLACE_DIALOG",ce=350,_t=20,gt=-90;exports.FindReplaceController=class extends o.RxDisposable{constructor(n,t,s,r,a,d,u,S,_,g){super();l(this,"_closingListenerDisposable");this._univerInstanceService=n,this._menuManagerService=t,this._shortcutService=s,this._commandService=r,this._findReplaceService=a,this._dialogService=d,this._layoutService=u,this._localeService=S,this._componentManager=_,this._injector=g,this._initCommands(),this._initUI(),this._initShortcuts()}dispose(){var n;super.dispose(),(n=this._closingListenerDisposable)==null||n.dispose(),this._closingListenerDisposable=null}_initCommands(){[I,E,G,V,W,k].forEach(n=>{this.disposeWithMe(this._commandService.registerCommand(n))})}_initShortcuts(){[ot,rt,at,lt,ct].forEach(n=>this.disposeWithMe(this._shortcutService.registerShortcut(n)))}_initUI(){this.disposeWithMe(this._componentManager.register("FindReplaceDialog",et)),this.disposeWithMe(this._componentManager.register("SearchIcon",ee)),this._menuManagerService.mergeMenu(ut),this._findReplaceService.stateUpdates$.pipe(v.takeUntil(this.dispose$)).subscribe(n=>{n.revealed===!0&&this._openPanel()})}_openPanel(){this._dialogService.open({id:Y,draggable:!0,width:ce,title:{title:this._localeService.t("find-replace.dialog.title")},children:{label:"FindReplaceDialog"},destroyOnClose:!0,defaultPosition:mt(),preservePositionOnDestroy:!0,onClose:()=>this.closePanel()}),this._closingListenerDisposable=o.toDisposable(this._univerInstanceService.focused$.pipe(v.takeUntil(this.dispose$)).subscribe(n=>{(!n||!this._univerInstanceService.getUniverSheetInstance(n))&&this.closePanel()}))}closePanel(){this._closingListenerDisposable&&(this._closingListenerDisposable.dispose(),this._closingListenerDisposable=null,this._dialogService.close(Y),this._findReplaceService.terminate(),queueMicrotask(()=>this._layoutService.focus()))}};exports.FindReplaceController=ft([M(0,o.IUniverInstanceService),M(1,p.IMenuManagerService),M(2,p.IShortcutService),M(3,o.ICommandService),M(4,R),M(5,p.IDialogService),M(6,p.ILayoutService),M(7,o.Inject(o.LocaleService)),M(8,o.Inject(p.ComponentManager)),M(9,o.Inject(o.Injector))],exports.FindReplaceController);function mt(){const{innerWidth:i}=window;return{x:(i-ce)/2-_t,y:gt}}var vt=Object.defineProperty,St=Object.getOwnPropertyDescriptor,Ct=(i,e,n,t)=>{for(var s=t>1?void 0:t?St(e,n):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(t?a(e,n,s):a(s))||s);return t&&s&&vt(e,n,s),s},Z=(i,e)=>(n,t)=>e(n,t,i);const Rt="UNIVER_FIND_REPLACE_PLUGIN";var j;exports.UniverFindReplacePlugin=(j=class extends o.Plugin{constructor(e=q,n,t){super(),this._config=e,this._injector=n,this._configService=t;const{...s}=o.merge({},q,this._config);this._configService.setConfig(Ne,s)}onStarting(){[[exports.FindReplaceController],[R,{useClass:U}]].forEach(e=>this._injector.add(e))}onRendered(){this._injector.get(exports.FindReplaceController)}},l(j,"pluginName",Rt),j);exports.UniverFindReplacePlugin=Ct([Z(1,o.Inject(o.Injector)),Z(2,o.IConfigService)],exports.UniverFindReplacePlugin);exports.FindBy=O;exports.FindDirection=D;exports.FindModel=ke;exports.FindScope=T;exports.GoToNextMatchOperation=G;exports.GoToPreviousMatchOperation=V;exports.IFindReplaceService=R;exports.OpenFindDialogOperation=I;exports.OpenReplaceDialogOperation=E;exports.ReplaceAllMatchesCommand=W;exports.ReplaceCurrentMatchCommand=k;