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