@univerjs/sheets-conditional-formatting-ui 0.1.12 → 0.1.13

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/umd/index.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(X,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("@univerjs/core"),require("@wendellhu/redi"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("rxjs"),require("rxjs/operators"),require("react"),require("@univerjs/design"),require("@wendellhu/redi/react-bindings"),require("@univerjs/engine-formula"),require("clsx"),require("react-dom"),require("@univerjs/sheets-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@wendellhu/redi","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","rxjs","rxjs/operators","react","@univerjs/design","@wendellhu/redi/react-bindings","@univerjs/engine-formula","clsx","react-dom","@univerjs/sheets-ui","@univerjs/engine-render"],m):(X=typeof globalThis<"u"?globalThis:X||self,m(X.UniverSheetsConditionalFormattingUi={},X.UniverCore,X["@wendellhu/redi"],X.UniverSheetsConditionalFormatting,X.UniverSheets,X.UniverUi,X.rxjs,X.rxjs.operators,X.React,X.UniverDesign,X["@wendellhu/redi/react-bindings"],X.UniverEngineFormula,X.clsx,X.ReactDOM,X.UniverSheetsUi,X.UniverEngineRender))})(this,function(X,m,U,s,k,ve,Ce,Oe,_,G,te,wr,He,_r,le,Co){"use strict";var Td=Object.defineProperty;var Rd=(X,m,U)=>m in X?Td(X,m,{enumerable:!0,configurable:!0,writable:!0,value:U}):X[m]=U;var Ge=(X,m,U)=>(Rd(X,typeof m!="symbol"?m+"":m,U),U);var Lt;const wo={type:m.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=t,i=e.get(s.ConditionalFormattingRuleModel),u=e.get(m.ICommandService),l=e.get(m.IUniverInstanceService),c=k.getSheetCommandTarget(l);if(!c)return!1;const{unitId:d,subUnitId:p}=c,h=i.createCfId(d,p),v={ranges:n,cfId:h,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:o,style:r}};return u.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:v})}},_o={type:m.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,config:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.ICommandService),u=e.get(m.IUniverInstanceService),l=k.getSheetCommandTarget(u);if(!l)return!1;const{unitId:c,subUnitId:d}=l,p=o.createCfId(c,d),h={ranges:n,cfId:p,stopIfTrue:!!a,rule:{type:s.CFRuleType.colorScale,config:r}};return i.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:h})}},Io={type:m.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,min:r,max:a,nativeColor:o,positiveColor:i,isGradient:u,stopIfTrue:l,isShowValue:c}=t,d=e.get(s.ConditionalFormattingRuleModel),p=e.get(m.IUniverInstanceService),h=k.getSheetCommandTarget(p);if(!h)return!1;const{unitId:v,subUnitId:y}=h,T=e.get(m.ICommandService),x=d.createCfId(v,y),w={ranges:n,cfId:x,stopIfTrue:!!l,rule:{type:s.CFRuleType.dataBar,isShowValue:c,config:{min:r,max:a,nativeColor:o,positiveColor:i,isGradient:u}}};return T.executeCommand(s.AddConditionalRuleMutation.id,{unitId:v,subUnitId:y,rule:w})}},xo={type:m.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.ICommandService),u=e.get(m.IUniverInstanceService),l=k.getSheetCommandTarget(u);if(!l)return!1;const{unitId:c,subUnitId:d}=l,p=o.createCfId(c,d),h={ranges:n,cfId:p,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.duplicateValues,style:r}};return i.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:h})}},Eo={type:m.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:i}=t,u=e.get(s.ConditionalFormattingRuleModel),l=e.get(m.ICommandService),c=e.get(m.IUniverInstanceService),d=k.getSheetCommandTarget(c);if(!d)return!1;const{unitId:p,subUnitId:h}=d,v=u.createCfId(p,h);let y;if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(o)){const T=i;if(T.length!==2||!Array.isArray(T))return!1;y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:o,style:r,value:T}}}else{const T=i;if(typeof T!="number")return!1;y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:o,style:r,value:T}}}return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:p,subUnitId:h,rule:y})}},Oo={type:m.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,isPercent:o,isBottom:i,value:u}=t,l=e.get(s.ConditionalFormattingRuleModel),c=e.get(m.IUniverInstanceService),d=e.get(m.ICommandService),p=k.getSheetCommandTarget(c);if(!p)return!1;const{unitId:h,subUnitId:v}=p,y=l.createCfId(h,v),T={ranges:n,cfId:y,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:o,isBottom:i,style:r,value:u}};return d.executeCommand(s.AddConditionalRuleMutation.id,{unitId:h,subUnitId:v,rule:T})}},Do={type:m.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:i}=t,u=e.get(s.ConditionalFormattingRuleModel),l=e.get(m.IUniverInstanceService),c=k.getSheetCommandTarget(l);if(!c)return!1;const{unitId:d,subUnitId:p}=c,h=e.get(m.ICommandService),v=u.createCfId(d,p),y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.text,operator:o,style:r,value:i}};return h.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:y})}},Mo={type:m.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=t,i=e.get(s.ConditionalFormattingRuleModel),u=e.get(m.IUniverInstanceService),l=e.get(m.ICommandService),c=k.getSheetCommandTarget(u);if(!c)return!1;const{unitId:d,subUnitId:p}=c,h=i.createCfId(d,p),v={ranges:n,cfId:h,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.timePeriod,operator:o,style:r}};return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:v})}},Po={type:m.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.IUniverInstanceService),u=e.get(m.ICommandService),l=k.getSheetCommandTarget(i);if(!l)return!1;const{unitId:c,subUnitId:d}=l,p=o.createCfId(c,d),h={ranges:n,cfId:p,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.uniqueValues,style:r}};return u.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:h})}},Ir={type:m.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(e,t){var T;if(!t)return!1;const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(m.IUniverInstanceService),a=e.get(m.ICommandService),o=e.get(m.IUndoRedoService),i=e.get(k.SelectionManagerService),u=k.getSheetCommandTarget(r,t);if(!u)return!1;const{unitId:l,subUnitId:c}=u,d=((T=i.getSelections())==null?void 0:T.map(x=>x.range))||[],p=n.getSubunitRules(l,c);if(!(p!=null&&p.length)||!d.length)return!1;const h=[],v=[];p.forEach(x=>{const w=new m.ObjectMatrix;x.ranges.forEach(S=>{m.Range.foreach(S,(C,g)=>{w.setValue(C,g,1)})}),d.forEach(S=>{m.Range.foreach(S,(C,g)=>{w.realDeleteValue(C,g)})});const b=k.findAllRectangle(k.createTopMatrixFromMatrix(w));if(b.length){const S={...x,ranges:b},C={unitId:l,subUnitId:c,rule:S},g=s.setConditionalRuleMutationUndoFactory(e,C);h.push({id:s.SetConditionalRuleMutation.id,params:C}),v.push(...g)}else{const S={unitId:l,subUnitId:c,cfId:x.cfId},C=s.DeleteConditionalRuleMutationUndoFactory(e,S);h.push({id:s.DeleteConditionalRuleMutation.id,params:S}),v.push(...C)}});const y=m.sequenceExecute(h,a).result;return y&&o.pushUndoRedo({unitID:l,redoMutations:h,undoMutations:v}),y}},Tn={type:m.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(e,t){const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(m.IUniverInstanceService),a=e.get(m.ICommandService),o=e.get(m.IUndoRedoService),i=k.getSheetCommandTarget(r,t);if(!i)return!1;const{unitId:u,subUnitId:l}=i,c=n.getSubunitRules(u,l);if(!(c!=null&&c.length))return!1;const d=c.map(y=>({cfId:y.cfId,unitId:u,subUnitId:l})),p=d.map(y=>({id:s.DeleteConditionalRuleMutation.id,params:y})),h=d.map(y=>s.DeleteConditionalRuleMutationUndoFactory(e,y)[0]),v=m.sequenceExecute(p,a).result;return v&&o.pushUndoRedo({unitID:u,redoMutations:p,undoMutations:h}),v}},xr=[k.SetWorksheetActiveOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],No=e=>{const t=[{label:"sheet.cf.ruleType.highlightCell",value:Ie.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:Ie.rank},{label:"sheet.cf.ruleType.formula",value:Ie.formula},{label:"sheet.cf.ruleType.colorScale",value:Ie.colorScale},{label:"sheet.cf.ruleType.dataBar",value:Ie.dataBar},{label:"sheet.cf.ruleType.iconSet",value:Ie.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:Ie.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:Ie.createRule},{label:"sheet.cf.menu.clearRangeRules",value:Ie.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:Ie.clearWorkSheetRules}],n=e.get(k.SelectionManagerService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=e.get(s.ConditionalFormattingRuleModel),i=new Ce.Observable(c=>Ce.merge(n.selectionMoveEnd$,new Ce.Observable(d=>{const p=r.onCommandExecuted(h=>{var x;const{id:v,params:y}=h,T=(x=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:x.getUnitId();xr.includes(v)&&y.unitId===T&&d.next(null)});return()=>p.dispose()})).pipe(Oe.debounceTime(16)).subscribe(()=>{var y;const d=((y=n.getSelections())==null?void 0:y.map(T=>T.range))||[],p=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!p)return;const v=(o.getSubunitRules(p.getUnitId(),p.getActiveSheet().getSheetId())||[]).filter(T=>T.ranges.some(x=>d.some(w=>m.Rectangle.intersects(w,x))));c.next(!!v.length)})),u=new Ce.Observable(c=>Ce.merge(n.selectionMoveEnd$,new Ce.Observable(d=>{const p=r.onCommandExecuted(h=>{var x;const{id:v,params:y}=h,T=(x=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:x.getUnitId();xr.includes(v)&&y.unitId===T&&d.next(null)});return()=>p.dispose()})).pipe(Oe.debounceTime(16)).subscribe(()=>{const d=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!d)return;const p=o.getSubunitRules(d.getUnitId(),d.getActiveSheet().getSheetId())||[];c.next(!!p.length)})),l=new Ce.Observable(c=>{i.subscribe(d=>{const p=t.find(h=>h.value===Ie.clearRangeRules);p&&(p.disabled=!d,c.next(t))}),u.subscribe(d=>{const p=t.find(h=>h.value===Ie.clearWorkSheetRules);p&&(p.disabled=!d,c.next(t))}),c.next(t)});return{id:yo.id,type:ve.MenuItemType.SELECTOR,group:ve.MenuGroup.TOOLBAR_FORMULAS_INSERT,positions:[ve.MenuPosition.TOOLBAR_START],icon:"Conditions",tooltip:"sheet.cf.title",selections:l,hidden$:ve.getMenuHiddenObservable(e,m.UniverInstanceType.UNIVER_SHEET)}};var Ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Er={exports:{}},Vt={};/**
1
+ (function(B,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("@univerjs/core"),require("@wendellhu/redi"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("rxjs"),require("rxjs/operators"),require("@univerjs/sheets-ui"),require("react"),require("@univerjs/design"),require("@wendellhu/redi/react-bindings"),require("@univerjs/engine-formula"),require("clsx"),require("react-dom"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@wendellhu/redi","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","rxjs","rxjs/operators","@univerjs/sheets-ui","react","@univerjs/design","@wendellhu/redi/react-bindings","@univerjs/engine-formula","clsx","react-dom","@univerjs/engine-render"],m):(B=typeof globalThis<"u"?globalThis:B||self,m(B.UniverSheetsConditionalFormattingUi={},B.UniverCore,B["@wendellhu/redi"],B.UniverSheetsConditionalFormatting,B.UniverSheets,B.UniverUi,B.rxjs,B.rxjs.operators,B.UniverSheetsUi,B.React,B.UniverDesign,B["@wendellhu/redi/react-bindings"],B.UniverEngineFormula,B.clsx,B.ReactDOM,B.UniverEngineRender))})(this,function(B,m,U,s,V,Te,we,De,le,I,q,ne,Or,qe,Er,wo){"use strict";var wd=Object.defineProperty;var Id=(B,m,U)=>m in B?wd(B,m,{enumerable:!0,configurable:!0,writable:!0,value:U}):B[m]=U;var Ze=(B,m,U)=>(Id(B,typeof m!="symbol"?m+"":m,U),U);var kt;const Io={type:m.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=t,i=e.get(s.ConditionalFormattingRuleModel),u=e.get(m.ICommandService),l=e.get(m.IUniverInstanceService),c=V.getSheetCommandTarget(l);if(!c)return!1;const{unitId:d,subUnitId:p}=c,f=i.createCfId(d,p),v={ranges:n,cfId:f,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:o,style:r}};return u.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:v})}},xo={type:m.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,config:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.ICommandService),u=e.get(m.IUniverInstanceService),l=V.getSheetCommandTarget(u);if(!l)return!1;const{unitId:c,subUnitId:d}=l,p=o.createCfId(c,d),f={ranges:n,cfId:p,stopIfTrue:!!a,rule:{type:s.CFRuleType.colorScale,config:r}};return i.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:f})}},Oo={type:m.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,min:r,max:a,nativeColor:o,positiveColor:i,isGradient:u,stopIfTrue:l,isShowValue:c}=t,d=e.get(s.ConditionalFormattingRuleModel),p=e.get(m.IUniverInstanceService),f=V.getSheetCommandTarget(p);if(!f)return!1;const{unitId:v,subUnitId:y}=f,b=e.get(m.ICommandService),x=d.createCfId(v,y),_={ranges:n,cfId:x,stopIfTrue:!!l,rule:{type:s.CFRuleType.dataBar,isShowValue:c,config:{min:r,max:a,nativeColor:o,positiveColor:i,isGradient:u}}};return b.executeCommand(s.AddConditionalRuleMutation.id,{unitId:v,subUnitId:y,rule:_})}},Eo={type:m.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.ICommandService),u=e.get(m.IUniverInstanceService),l=V.getSheetCommandTarget(u);if(!l)return!1;const{unitId:c,subUnitId:d}=l,p=o.createCfId(c,d),f={ranges:n,cfId:p,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.duplicateValues,style:r}};return i.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:f})}},Po={type:m.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:i}=t,u=e.get(s.ConditionalFormattingRuleModel),l=e.get(m.ICommandService),c=e.get(m.IUniverInstanceService),d=V.getSheetCommandTarget(c);if(!d)return!1;const{unitId:p,subUnitId:f}=d,v=u.createCfId(p,f);let y;if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(o)){const b=i;if(b.length!==2||!Array.isArray(b))return!1;y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:o,style:r,value:b}}}else{const b=i;if(typeof b!="number")return!1;y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:o,style:r,value:b}}}return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:p,subUnitId:f,rule:y})}},Do={type:m.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,isPercent:o,isBottom:i,value:u}=t,l=e.get(s.ConditionalFormattingRuleModel),c=e.get(m.IUniverInstanceService),d=e.get(m.ICommandService),p=V.getSheetCommandTarget(c);if(!p)return!1;const{unitId:f,subUnitId:v}=p,y=l.createCfId(f,v),b={ranges:n,cfId:y,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:o,isBottom:i,style:r,value:u}};return d.executeCommand(s.AddConditionalRuleMutation.id,{unitId:f,subUnitId:v,rule:b})}},Mo={type:m.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:i}=t,u=e.get(s.ConditionalFormattingRuleModel),l=e.get(m.IUniverInstanceService),c=V.getSheetCommandTarget(l);if(!c)return!1;const{unitId:d,subUnitId:p}=c,f=e.get(m.ICommandService),v=u.createCfId(d,p),y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.text,operator:o,style:r,value:i}};return f.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:y})}},No={type:m.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=t,i=e.get(s.ConditionalFormattingRuleModel),u=e.get(m.IUniverInstanceService),l=e.get(m.ICommandService),c=V.getSheetCommandTarget(u);if(!c)return!1;const{unitId:d,subUnitId:p}=c,f=i.createCfId(d,p),v={ranges:n,cfId:f,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.timePeriod,operator:o,style:r}};return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:v})}},jo={type:m.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.IUniverInstanceService),u=e.get(m.ICommandService),l=V.getSheetCommandTarget(i);if(!l)return!1;const{unitId:c,subUnitId:d}=l,p=o.createCfId(c,d),f={ranges:n,cfId:p,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.uniqueValues,style:r}};return u.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:f})}},Pr={type:m.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(e,t){var b;if(!t)return!1;const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(m.IUniverInstanceService),a=e.get(m.ICommandService),o=e.get(m.IUndoRedoService),i=e.get(V.SelectionManagerService),u=V.getSheetCommandTarget(r,t);if(!u)return!1;const{unitId:l,subUnitId:c}=u,d=((b=i.getSelections())==null?void 0:b.map(x=>x.range))||[],p=n.getSubunitRules(l,c);if(!(p!=null&&p.length)||!d.length)return!1;const f=[],v=[];p.forEach(x=>{const _=new m.ObjectMatrix;x.ranges.forEach(S=>{m.Range.foreach(S,(R,g)=>{_.setValue(R,g,1)})}),d.forEach(S=>{m.Range.foreach(S,(R,g)=>{_.realDeleteValue(R,g)})});const T=V.findAllRectangle(V.createTopMatrixFromMatrix(_));if(T.length){const S={...x,ranges:T},R={unitId:l,subUnitId:c,rule:S},g=s.setConditionalRuleMutationUndoFactory(e,R);f.push({id:s.SetConditionalRuleMutation.id,params:R}),v.push(...g)}else{const S={unitId:l,subUnitId:c,cfId:x.cfId},R=s.DeleteConditionalRuleMutationUndoFactory(e,S);f.push({id:s.DeleteConditionalRuleMutation.id,params:S}),v.push(...R)}});const y=m.sequenceExecute(f,a).result;return y&&o.pushUndoRedo({unitID:l,redoMutations:f,undoMutations:v}),y}},_n={type:m.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(e,t){const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(m.IUniverInstanceService),a=e.get(m.ICommandService),o=e.get(m.IUndoRedoService),i=V.getSheetCommandTarget(r,t);if(!i)return!1;const{unitId:u,subUnitId:l}=i,c=n.getSubunitRules(u,l);if(!(c!=null&&c.length))return!1;const d=c.map(y=>({cfId:y.cfId,unitId:u,subUnitId:l})),p=d.map(y=>({id:s.DeleteConditionalRuleMutation.id,params:y})),f=d.map(y=>s.DeleteConditionalRuleMutationUndoFactory(e,y)[0]),v=m.sequenceExecute(p,a).result;return v&&o.pushUndoRedo({unitID:u,redoMutations:p,undoMutations:f}),v}};var $e=(e=>(e[e.View=0]="View",e[e.Edit=1]="Edit",e[e.ManageCollaborator=2]="ManageCollaborator",e[e.Print=3]="Print",e[e.Duplicate=4]="Duplicate",e[e.Comment=5]="Comment",e[e.Copy=6]="Copy",e[e.Share=7]="Share",e[e.Export=8]="Export",e[e.MoveWorksheet=9]="MoveWorksheet",e[e.DeleteWorksheet=10]="DeleteWorksheet",e[e.HideWorksheet=11]="HideWorksheet",e[e.RenameWorksheet=12]="RenameWorksheet",e[e.CreateWorksheet=13]="CreateWorksheet",e[e.SetWorksheetStyle=14]="SetWorksheetStyle",e[e.EditWorksheetCell=15]="EditWorksheetCell",e[e.InsertHyperlink=16]="InsertHyperlink",e[e.Sort=17]="Sort",e[e.Filter=18]="Filter",e[e.PivotTable=19]="PivotTable",e[e.FloatImg=20]="FloatImg",e[e.History=21]="History",e[e.RwHgtClWdt=22]="RwHgtClWdt",e[e.ViemRwHgtClWdt=23]="ViemRwHgtClWdt",e[e.ViewFilter=24]="ViewFilter",e[e.MoveSheet=25]="MoveSheet",e[e.DeleteSheet=26]="DeleteSheet",e[e.HideSheet=27]="HideSheet",e[e.CopySheet=28]="CopySheet",e[e.RenameSheet=29]="RenameSheet",e[e.CreateSheet=30]="CreateSheet",e[e.SelectProtectedCells=31]="SelectProtectedCells",e[e.SelectUnProtectedCells=32]="SelectUnProtectedCells",e[e.SetCellStyle=33]="SetCellStyle",e[e.SetCellValue=34]="SetCellValue",e[e.SetRowStyle=35]="SetRowStyle",e[e.SetColumnStyle=36]="SetColumnStyle",e[e.InsertRow=37]="InsertRow",e[e.InsertColumn=38]="InsertColumn",e[e.DeleteRow=39]="DeleteRow",e[e.DeleteColumn=40]="DeleteColumn",e[e.EditExtraObject=41]="EditExtraObject",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))($e||{});const Dr=[V.SetWorksheetActiveOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],Lo=e=>{const t=[{label:"sheet.cf.ruleType.highlightCell",value:Oe.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:Oe.rank},{label:"sheet.cf.ruleType.formula",value:Oe.formula},{label:"sheet.cf.ruleType.colorScale",value:Oe.colorScale},{label:"sheet.cf.ruleType.dataBar",value:Oe.dataBar},{label:"sheet.cf.ruleType.iconSet",value:Oe.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:Oe.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:Oe.createRule},{label:"sheet.cf.menu.clearRangeRules",value:Oe.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:Oe.clearWorkSheetRules}],n=e.get(V.SelectionManagerService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=e.get(s.ConditionalFormattingRuleModel),i=new we.Observable(c=>we.merge(n.selectionMoveEnd$,new we.Observable(d=>{const p=r.onCommandExecuted(f=>{var x;const{id:v,params:y}=f,b=(x=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:x.getUnitId();Dr.includes(v)&&y.unitId===b&&d.next(null)});return()=>p.dispose()})).pipe(De.debounceTime(16)).subscribe(()=>{var y;const d=((y=n.getSelections())==null?void 0:y.map(b=>b.range))||[],p=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!p)return;const v=(o.getSubunitRules(p.getUnitId(),p.getActiveSheet().getSheetId())||[]).filter(b=>b.ranges.some(x=>d.some(_=>m.Rectangle.intersects(_,x))));c.next(!!v.length)})),u=new we.Observable(c=>we.merge(n.selectionMoveEnd$,new we.Observable(d=>{const p=r.onCommandExecuted(f=>{var x;const{id:v,params:y}=f,b=(x=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:x.getUnitId();Dr.includes(v)&&y.unitId===b&&d.next(null)});return()=>p.dispose()})).pipe(De.debounceTime(16)).subscribe(()=>{const d=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!d)return;const p=d.getActiveSheet(),v=(o.getSubunitRules(d.getUnitId(),d.getActiveSheet().getSheetId())||[]).some(y=>y.ranges.some(x=>{var g,O;const{startRow:_,startColumn:T,endRow:S,endColumn:R}=x;for(let E=_;E<=S;E++)for(let w=T;w<=R;w++){const j=(O=(g=p.getCell(E,w))==null?void 0:g.selectionProtection)==null?void 0:O[0];if((j==null?void 0:j[$e.Edit])===!1||(j==null?void 0:j[$e.View])===!1)return!0}return!1}));c.next(!v)})),l=new we.Observable(c=>{i.subscribe(d=>{const p=t.find(f=>f.value===Oe.clearRangeRules);p&&(p.disabled=!d,c.next(t))}),u.subscribe(d=>{const p=t.find(f=>f.value===Oe.clearWorkSheetRules);p&&(p.disabled=!d,c.next(t))}),c.next(t)});return{id:bo.id,type:Te.MenuItemType.SELECTOR,group:Te.MenuGroup.TOOLBAR_FORMULAS_INSERT,positions:[Te.MenuPosition.TOOLBAR_START],icon:"Conditions",tooltip:"sheet.cf.title",selections:l,hidden$:Te.getMenuHiddenObservable(e,m.UniverInstanceType.UNIVER_SHEET),disabled$:le.getCurrentRangeDisable$(e,{workbookTypes:[V.WorkbookEditablePermission],worksheetTypes:[V.WorksheetSetCellStylePermission,V.WorksheetEditPermission],rangeTypes:[V.RangeProtectionPermissionEditPoint]})}};var Be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Mr={exports:{}},Wt={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,6 +6,6 @@
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 Lo=_,Uo=Symbol.for("react.element"),Vo=Symbol.for("react.fragment"),zo=Object.prototype.hasOwnProperty,Ao=Lo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Wo={key:!0,ref:!0,__self:!0,__source:!0};function Or(e,t,n){var r,a={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)zo.call(t,r)&&!Wo.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:Uo,type:e,key:o,ref:i,props:a,_owner:Ao.current}}Vt.Fragment=Vo,Vt.jsx=Or,Vt.jsxs=Or,Er.exports=Vt;var f=Er.exports;const M={conditionalFormattingWrap:"univer-conditional-formatting-wrap",cfRuleItem:"univer-cf-rule-item",preview:"univer-preview",createRule:"univer-create-rule",button:"univer-button",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",inputWidth:"univer-input-width",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var xe=function(){return xe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},xe.apply(this,arguments)},ko=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n},lt=_.forwardRef(function(e,t){var n=e.icon,r=e.id,a=e.className,o=e.extend,i=ko(e,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(r," ").concat(a||"").trim(),l=_.useRef("_".concat(Bo()));return Dr(n,"".concat(r),{defIds:n.defIds,idSuffix:l.current},xe({ref:t,className:u},i),o)});function Dr(e,t,n,r,a){return _.createElement(e.tag,xe(xe({key:t},Ho(e,n,a)),r),($o(e,n).children||[]).map(function(o,i){return Dr(o,"".concat(t,"-").concat(e.tag,"-").concat(i),n,void 0,a)}))}function Ho(e,t,n){var r=xe({},e.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1);var a=t.defIds;return!a||a.length===0||(e.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+t.idSuffix),Object.entries(r).forEach(function(o){var i=o[0],u=o[1];typeof u=="string"&&(r[i]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function $o(e,t){var n,r=t.defIds;return!r||r.length===0?e:e.tag==="defs"&&(!((n=e.children)===null||n===void 0)&&n.length)?xe(xe({},e),{children:e.children.map(function(a){return typeof a.attrs.id=="string"&&r&&r.indexOf(a.attrs.id)>-1?xe(xe({},a),{attrs:xe(xe({},a.attrs),{id:a.attrs.id+t.idSuffix})}):a})}):e}function Bo(){return Math.random().toString(36).substring(2,8)}lt.displayName="UniverIcon";var Fo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Mr=_.forwardRef(function(e,t){return _.createElement(lt,Object.assign({},e,{id:"delete-single",ref:t,icon:Fo}))});Mr.displayName="DeleteSingle";const Cn=Mr;var Go={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Pr=_.forwardRef(function(e,t){return _.createElement(lt,Object.assign({},e,{id:"increase-single",ref:t,icon:Go}))});Pr.displayName="IncreaseSingle";const qo=Pr;var Xo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Nr=_.forwardRef(function(e,t){return _.createElement(lt,Object.assign({},e,{id:"more-down-single",ref:t,icon:Xo}))});Nr.displayName="MoreDownSingle";const wn=Nr;var Yo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},jr=_.forwardRef(function(e,t){return _.createElement(lt,Object.assign({},e,{id:"sequence-single",ref:t,icon:Yo}))});jr.displayName="SequenceSingle";const Ko=jr;var Zo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},Lr=_.forwardRef(function(e,t){return _.createElement(lt,Object.assign({},e,{id:"slash-single",ref:t,icon:Zo}))});Lr.displayName="SlashSingle";const zt=Lr;var Ur={exports:{}},Tt={},_n={exports:{}};(function(e,t){(function(n,r){r(t)})(Ae,function(n){function r(N){return function(ee,K,Z,oe,de,Ee,ie){return N(ee,K,ie)}}function a(N){return function(ee,K,Z,oe){if(!ee||!K||typeof ee!="object"||typeof K!="object")return N(ee,K,Z,oe);var de=oe.get(ee),Ee=oe.get(K);if(de&&Ee)return de===K&&Ee===ee;oe.set(ee,K),oe.set(K,ee);var ie=N(ee,K,Z,oe);return oe.delete(ee),oe.delete(K),ie}}function o(N,W){var ee={};for(var K in N)ee[K]=N[K];for(var K in W)ee[K]=W[K];return ee}function i(N){return N.constructor===Object||N.constructor==null}function u(N){return typeof N.then=="function"}function l(N,W){return N===W||N!==N&&W!==W}var c="[object Arguments]",d="[object Boolean]",p="[object Date]",h="[object RegExp]",v="[object Map]",y="[object Number]",T="[object Object]",x="[object Set]",w="[object String]",b=Object.prototype.toString;function S(N){var W=N.areArraysEqual,ee=N.areDatesEqual,K=N.areMapsEqual,Z=N.areObjectsEqual,oe=N.areRegExpsEqual,de=N.areSetsEqual,Ee=N.createIsNestedEqual,ie=Ee(Ue);function Ue(re,se,Ve){if(re===se)return!0;if(!re||!se||typeof re!="object"||typeof se!="object")return re!==re&&se!==se;if(i(re)&&i(se))return Z(re,se,ie,Ve);var To=Array.isArray(re),Ro=Array.isArray(se);if(To||Ro)return To===Ro&&W(re,se,ie,Ve);var ze=b.call(re);return ze!==b.call(se)?!1:ze===p?ee(re,se,ie,Ve):ze===h?oe(re,se,ie,Ve):ze===v?K(re,se,ie,Ve):ze===x?de(re,se,ie,Ve):ze===T||ze===c?u(re)||u(se)?!1:Z(re,se,ie,Ve):ze===d||ze===y||ze===w?l(re.valueOf(),se.valueOf()):!1}return Ue}function C(N,W,ee,K){var Z=N.length;if(W.length!==Z)return!1;for(;Z-- >0;)if(!ee(N[Z],W[Z],Z,Z,N,W,K))return!1;return!0}var g=a(C);function E(N,W){return l(N.valueOf(),W.valueOf())}function D(N,W,ee,K){var Z=N.size===W.size;if(!Z)return!1;if(!N.size)return!0;var oe={},de=0;return N.forEach(function(Ee,ie){if(Z){var Ue=!1,re=0;W.forEach(function(se,Ve){!Ue&&!oe[re]&&(Ue=ee(ie,Ve,de,re,N,W,K)&&ee(Ee,se,ie,Ve,N,W,K))&&(oe[re]=!0),re++}),de++,Z=Ue}}),Z}var I=a(D),j="_owner",L=Object.prototype.hasOwnProperty;function V(N,W,ee,K){var Z=Object.keys(N),oe=Z.length;if(Object.keys(W).length!==oe)return!1;for(var de;oe-- >0;){if(de=Z[oe],de===j){var Ee=!!N.$$typeof,ie=!!W.$$typeof;if((Ee||ie)&&Ee!==ie)return!1}if(!L.call(W,de)||!ee(N[de],W[de],de,de,N,W,K))return!1}return!0}var F=a(V);function R(N,W){return N.source===W.source&&N.flags===W.flags}function O(N,W,ee,K){var Z=N.size===W.size;if(!Z)return!1;if(!N.size)return!0;var oe={};return N.forEach(function(de,Ee){if(Z){var ie=!1,Ue=0;W.forEach(function(re,se){!ie&&!oe[Ue]&&(ie=ee(de,re,Ee,se,N,W,K))&&(oe[Ue]=!0),Ue++}),Z=ie}}),Z}var J=a(O),be=Object.freeze({areArraysEqual:C,areDatesEqual:E,areMapsEqual:D,areObjectsEqual:V,areRegExpsEqual:R,areSetsEqual:O,createIsNestedEqual:r}),z=Object.freeze({areArraysEqual:g,areDatesEqual:E,areMapsEqual:I,areObjectsEqual:F,areRegExpsEqual:R,areSetsEqual:J,createIsNestedEqual:r}),q=S(be);function ne(N,W){return q(N,W,void 0)}var ce=S(o(be,{createIsNestedEqual:function(){return l}}));function me(N,W){return ce(N,W,void 0)}var Te=S(z);function Re(N,W){return Te(N,W,new WeakMap)}var Le=S(o(z,{createIsNestedEqual:function(){return l}}));function st(N,W){return Le(N,W,new WeakMap)}function Ut(N){return S(o(be,N(be)))}function bd(N){var W=S(o(z,N(z)));return function(ee,K,Z){return Z===void 0&&(Z=new WeakMap),W(ee,K,Z)}}n.circularDeepEqual=Re,n.circularShallowEqual=st,n.createCustomCircularEqual=bd,n.createCustomEqual=Ut,n.deepEqual=ne,n.sameValueZeroEqual=l,n.shallowEqual=me,Object.defineProperty(n,"__esModule",{value:!0})})})(_n,_n.exports);var In=_n.exports,B={},Jo=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(B,"__esModule",{value:!0}),B.bottom=xn,B.childrenEqual=ti,B.cloneLayout=zr,B.cloneLayoutItem=qe,B.collides=At,B.compact=Wr,B.compactItem=kr,B.compactType=di,B.correctBounds=Hr,B.fastPositionEqual=ni,B.fastRGLPropsEqual=void 0,B.getAllCollisions=$r,B.getFirstCollision=Xe,B.getLayoutItem=On,B.getStatics=Dn,B.modifyLayout=Ar,B.moveElement=Ct,B.moveElementAwayFromCollision=Mn,B.noop=void 0,B.perc=ai,B.resizeItemInDirection=ii,B.setTopLeft=li,B.setTransform=si,B.sortLayoutItems=Vn,B.sortLayoutItemsByColRow=Xr,B.sortLayoutItemsByRowCol=qr,B.synchronizeLayoutWithChildren=ui,B.validateLayout=ci,B.withLayoutItem=ei;var Vr=In,Rt=Qo(_);function Qo(e){return e&&e.__esModule?e:{default:e}}function xn(e){let t=0,n;for(let r=0,a=e.length;r<a;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function zr(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=qe(e[n]);return t}function Ar(e,t){const n=Array(e.length);for(let r=0,a=e.length;r<a;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function ei(e,t,n){let r=On(e,t);return r?(r=n(qe(r)),e=Ar(e,r),[e,r]):[e,null]}function qe(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function ti(e,t){return(0,Vr.deepEqual)(Rt.default.Children.map(e,n=>n==null?void 0:n.key),Rt.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,Vr.deepEqual)(Rt.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Rt.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}B.fastRGLPropsEqual=Jo;function ni(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function At(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Wr(e,t,n,r){const a=Dn(e),o=Vn(e,t),i=Array(e.length);for(let u=0,l=o.length;u<l;u++){let c=qe(o[u]);c.static||(c=kr(a,c,t,n,o,r),a.push(c)),i[e.indexOf(o[u])]=c,c.moved=!1}return i}const ri={x:"w",y:"h"};function En(e,t,n,r){const a=ri[r];t[r]+=1;const o=e.map(i=>i.i).indexOf(t.i);for(let i=o+1;i<e.length;i++){const u=e[i];if(!u.static){if(u.y>t.y+t.h)break;At(t,u)&&En(e,u,n+t[a],r)}}t[r]=n}function kr(e,t,n,r,a,o){const i=n==="vertical",u=n==="horizontal";if(i)for(t.y=Math.min(xn(e),t.y);t.y>0&&!Xe(e,t);)t.y--;else if(u)for(;t.x>0&&!Xe(e,t);)t.x--;let l;for(;(l=Xe(e,t))&&!(n===null&&o);)if(u?En(a,t,l.x+l.w,"x"):En(a,t,l.y+l.h,"y"),u&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Xe(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function Hr(e,t){const n=Dn(e);for(let r=0,a=e.length;r<a;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Xe(n,o);)o.y++}return e}function On(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Xe(e,t){for(let n=0,r=e.length;n<r;n++)if(At(e[n],t))return e[n]}function $r(e,t){return e.filter(n=>At(n,t))}function Dn(e){return e.filter(t=>t.static)}function Ct(e,t,n,r,a,o,i,u,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let p=Vn(e,i);(i==="vertical"&&typeof r=="number"?d>=r:i==="horizontal"&&typeof n=="number"?c>=n:!1)&&(p=p.reverse());const v=$r(p,t),y=v.length>0;if(y&&l)return zr(e);if(y&&o)return`${t.i}`,t.x=c,t.y=d,t.moved=!1,e;for(let T=0,x=v.length;T<x;T++){const w=v[T];`${t.i}${t.x}${t.y}${w.i}${w.x}${w.y}`,!w.moved&&(w.static?e=Mn(e,w,t,a,i):e=Mn(e,t,w,a,i))}return e}function Mn(e,t,n,r,a,o){const i=a==="horizontal",u=a==="vertical",l=t.static;if(r){r=!1;const p={x:i?Math.max(t.x-n.w,0):n.x,y:u?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=Xe(e,p),v=h&&h.y+h.h>t.y,y=h&&t.x+t.w>h.x;if(h){if(v&&u)return Ct(e,n,void 0,t.y+1,r,l,a);if(v&&a==null)return t.y=n.y,n.y=n.y+n.h,e;if(y&&i)return Ct(e,t,n.x,void 0,r,l,a)}else return`${n.i}${p.x}${p.y}`,Ct(e,n,i?p.x:void 0,u?p.y:void 0,r,l,a)}const c=i?n.x+1:void 0,d=u?n.y+1:void 0;return c==null&&d==null?e:Ct(e,n,i?n.x+1:void 0,u?n.y+1:void 0,r,l,a)}function ai(e){return e*100+"%"}const Br=(e,t,n,r)=>e+n>r?t:n,Fr=(e,t,n)=>e<0?t:n,Gr=e=>Math.max(0,e),Pn=e=>Math.max(0,e),Nn=(e,t,n)=>{let{left:r,height:a,width:o}=t;const i=e.top-(a-e.height);return{left:r,width:o,height:Fr(i,e.height,a),top:Pn(i)}},jn=(e,t,n)=>{let{top:r,left:a,height:o,width:i}=t;return{top:r,height:o,width:Br(e.left,e.width,i,n),left:Gr(a)}},Ln=(e,t,n)=>{let{top:r,height:a,width:o}=t;const i=e.left-(o-e.width);return{height:a,width:i<0?e.width:Br(e.left,e.width,o,n),top:Pn(r),left:Gr(i)}},Un=(e,t,n)=>{let{top:r,left:a,height:o,width:i}=t;return{width:i,left:a,height:Fr(r,e.height,o),top:Pn(r)}},oi={n:Nn,ne:function(){return Nn(arguments.length<=0?void 0:arguments[0],jn(...arguments))},e:jn,se:function(){return Un(arguments.length<=0?void 0:arguments[0],jn(...arguments))},s:Un,sw:function(){return Un(arguments.length<=0?void 0:arguments[0],Ln(...arguments))},w:Ln,nw:function(){return Nn(arguments.length<=0?void 0:arguments[0],Ln(...arguments))}};function ii(e,t,n,r){const a=oi[e];return a?a(t,{...t,...n},r):n}function si(e){let{top:t,left:n,width:r,height:a}=e;const o=`translate(${n}px,${t}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${r}px`,height:`${a}px`,position:"absolute"}}function li(e){let{top:t,left:n,width:r,height:a}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${a}px`,position:"absolute"}}function Vn(e,t){return t==="horizontal"?Xr(e):t==="vertical"?qr(e):e}function qr(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function Xr(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function ui(e,t,n,r,a){e=e||[];const o=[];Rt.default.Children.forEach(t,u=>{if((u==null?void 0:u.key)==null)return;const l=On(e,String(u.key)),c=u.props["data-grid"];l&&c==null?o.push(qe(l)):c?o.push(qe({...c,i:u.key})):o.push(qe({w:1,h:1,x:0,y:xn(o),i:String(u.key)}))});const i=Hr(o,{cols:n});return a?i:Wr(i,r,n)}function ci(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,a=e.length;r<a;r++){const o=e[r];for(let i=0;i<n.length;i++)if(typeof o[n[i]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[i]+" must be a number!")}}function di(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function Bd(){}const fi=()=>{};B.noop=fi;var Me={};Object.defineProperty(Me,"__esModule",{value:!0}),Me.calcGridColWidth=Wt,Me.calcGridItemPosition=pi,Me.calcGridItemWHPx=zn,Me.calcWH=mi,Me.calcXY=hi,Me.clamp=Ye;function Wt(e){const{margin:t,containerPadding:n,containerWidth:r,cols:a}=e;return(r-t[0]*(a-1)-n[0]*2)/a}function zn(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function pi(e,t,n,r,a,o){const{margin:i,containerPadding:u,rowHeight:l}=e,c=Wt(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=zn(r,c,i[0]),d.height=zn(a,l,i[1])),o&&o.dragging?(d.top=Math.round(o.dragging.top),d.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(d.top=Math.round(o.resizing.top),d.left=Math.round(o.resizing.left)):(d.top=Math.round((l+i[1])*n+u[1]),d.left=Math.round((c+i[0])*t+u[0])),d}function hi(e,t,n,r,a){const{margin:o,cols:i,rowHeight:u,maxRows:l}=e,c=Wt(e);let d=Math.round((n-o[0])/(c+o[0])),p=Math.round((t-o[1])/(u+o[1]));return d=Ye(d,0,i-r),p=Ye(p,0,l-a),{x:d,y:p}}function mi(e,t,n,r,a,o){const{margin:i,maxRows:u,cols:l,rowHeight:c}=e,d=Wt(e);let p=Math.round((t+i[0])/(d+i[0])),h=Math.round((n+i[1])/(c+i[1])),v=Ye(p,0,l-r),y=Ye(h,0,u-a);return["sw","w","nw"].indexOf(o)!==-1&&(v=Ye(p,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(y=Ye(h,0,u)),{w:v,h:y}}function Ye(e,t,n){return Math.max(Math.min(e,n),t)}var kt={},Yr={exports:{}},gi="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",vi=gi,yi=vi;function Kr(){}function Zr(){}Zr.resetWarningCache=Kr;var Si=function(){function e(r,a,o,i,u,l){if(l!==yi){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Zr,resetWarningCache:Kr};return n.PropTypes=n,n};Yr.exports=Si();var $e=Yr.exports,Ht={exports:{}},Jr={},ae={},Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.dontSetMe=wi,Pe.findInArray=bi,Pe.int=Ci,Pe.isFunction=Ti,Pe.isNum=Ri;function bi(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Ti(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Ri(e){return typeof e=="number"&&!isNaN(e)}function Ci(e){return parseInt(e,10)}function wi(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.browserPrefixToKey=ea,Ke.browserPrefixToStyle=_i,Ke.default=void 0,Ke.getPrefix=Qr;const An=["Moz","Webkit","O","ms"];function Qr(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<An.length;r++)if(ea(t,An[r])in n)return An[r];return""}function ea(e,t){return t?"".concat(t).concat(Ii(e)):e}function _i(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Ii(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}Ke.default=Qr(),Object.defineProperty(ae,"__esModule",{value:!0}),ae.addClassName=aa,ae.addEvent=Oi,ae.addUserSelectStyles=Wi,ae.createCSSTransform=Ui,ae.createSVGTransform=Vi,ae.getTouch=zi,ae.getTouchIdentifier=Ai,ae.getTranslation=Wn,ae.innerHeight=Ni,ae.innerWidth=ji,ae.matchesSelector=ra,ae.matchesSelectorAndParentsTo=Ei,ae.offsetXYFromParent=Li,ae.outerHeight=Mi,ae.outerWidth=Pi,ae.removeClassName=oa,ae.removeEvent=Di,ae.removeUserSelectStyles=ki;var we=Pe,ta=xi(Ke);function na(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(na=function(r){return r?n:t})(e)}function xi(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=na(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}let $t="";function ra(e,t){return $t||($t=(0,we.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,we.isFunction)(e[n])})),(0,we.isFunction)(e[$t])?e[$t](t):!1}function Ei(e,t,n){let r=e;do{if(ra(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Oi(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,a):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function Di(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,a):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function Mi(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,we.int)(n.borderTopWidth),t+=(0,we.int)(n.borderBottomWidth),t}function Pi(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,we.int)(n.borderLeftWidth),t+=(0,we.int)(n.borderRightWidth),t}function Ni(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,we.int)(n.paddingTop),t-=(0,we.int)(n.paddingBottom),t}function ji(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,we.int)(n.paddingLeft),t-=(0,we.int)(n.paddingRight),t}function Li(e,t,n){const a=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-a.left)/n,i=(e.clientY+t.scrollTop-a.top)/n;return{x:o,y:i}}function Ui(e,t){const n=Wn(e,t,"px");return{[(0,ta.browserPrefixToKey)("transform",ta.default)]:n}}function Vi(e,t){return Wn(e,t,"")}function Wn(e,t,n){let{x:r,y:a}=e,o="translate(".concat(r).concat(n,",").concat(a).concat(n,")");if(t){const i="".concat(typeof t.x=="string"?t.x:t.x+n),u="".concat(typeof t.y=="string"?t.y:t.y+n);o="translate(".concat(i,", ").concat(u,")")+o}return o}function zi(e,t){return e.targetTouches&&(0,we.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,we.findInArray)(e.changedTouches,n=>t===n.identifier)}function Ai(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Wi(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
9
+ */var Uo=I,ko=Symbol.for("react.element"),Wo=Symbol.for("react.fragment"),zo=Object.prototype.hasOwnProperty,Ao=Uo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ho={key:!0,ref:!0,__self:!0,__source:!0};function Nr(e,t,n){var r,a={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)zo.call(t,r)&&!Ho.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:ko,type:e,key:o,ref:i,props:a,_owner:Ao.current}}Wt.Fragment=Wo,Wt.jsx=Nr,Wt.jsxs=Nr,Mr.exports=Wt;var h=Mr.exports;const D={conditionalFormattingWrap:"univer-conditional-formatting-wrap",cfRuleItem:"univer-cf-rule-item",preview:"univer-preview",createRule:"univer-create-rule",button:"univer-button",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",inputWidth:"univer-input-width",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var Ee=function(){return Ee=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ee.apply(this,arguments)},$o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n},dt=I.forwardRef(function(e,t){var n=e.icon,r=e.id,a=e.className,o=e.extend,i=$o(e,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(r," ").concat(a||"").trim(),l=I.useRef("_".concat(Go()));return jr(n,"".concat(r),{defIds:n.defIds,idSuffix:l.current},Ee({ref:t,className:u},i),o)});function jr(e,t,n,r,a){return I.createElement(e.tag,Ee(Ee({key:t},Bo(e,n,a)),r),(Fo(e,n).children||[]).map(function(o,i){return jr(o,"".concat(t,"-").concat(e.tag,"-").concat(i),n,void 0,a)}))}function Bo(e,t,n){var r=Ee({},e.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1);var a=t.defIds;return!a||a.length===0||(e.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+t.idSuffix),Object.entries(r).forEach(function(o){var i=o[0],u=o[1];typeof u=="string"&&(r[i]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function Fo(e,t){var n,r=t.defIds;return!r||r.length===0?e:e.tag==="defs"&&(!((n=e.children)===null||n===void 0)&&n.length)?Ee(Ee({},e),{children:e.children.map(function(a){return typeof a.attrs.id=="string"&&r&&r.indexOf(a.attrs.id)>-1?Ee(Ee({},a),{attrs:Ee(Ee({},a.attrs),{id:a.attrs.id+t.idSuffix})}):a})}):e}function Go(){return Math.random().toString(36).substring(2,8)}dt.displayName="UniverIcon";var qo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Lr=I.forwardRef(function(e,t){return I.createElement(dt,Object.assign({},e,{id:"delete-single",ref:t,icon:qo}))});Lr.displayName="DeleteSingle";const In=Lr;var Xo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Vr=I.forwardRef(function(e,t){return I.createElement(dt,Object.assign({},e,{id:"increase-single",ref:t,icon:Xo}))});Vr.displayName="IncreaseSingle";const Yo=Vr;var Ko={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ur=I.forwardRef(function(e,t){return I.createElement(dt,Object.assign({},e,{id:"more-down-single",ref:t,icon:Ko}))});Ur.displayName="MoreDownSingle";const xn=Ur;var Zo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},kr=I.forwardRef(function(e,t){return I.createElement(dt,Object.assign({},e,{id:"sequence-single",ref:t,icon:Zo}))});kr.displayName="SequenceSingle";const Jo=kr;var Qo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},Wr=I.forwardRef(function(e,t){return I.createElement(dt,Object.assign({},e,{id:"slash-single",ref:t,icon:Qo}))});Wr.displayName="SlashSingle";const zt=Wr;var zr={exports:{}},_t={},On={exports:{}};(function(e,t){(function(n,r){r(t)})(Be,function(n){function r(M){return function(J,Y,X,re,se,Se,te){return M(J,Y,te)}}function a(M){return function(J,Y,X,re){if(!J||!Y||typeof J!="object"||typeof Y!="object")return M(J,Y,X,re);var se=re.get(J),Se=re.get(Y);if(se&&Se)return se===Y&&Se===J;re.set(J,Y),re.set(Y,J);var te=M(J,Y,X,re);return re.delete(J),re.delete(Y),te}}function o(M,W){var J={};for(var Y in M)J[Y]=M[Y];for(var Y in W)J[Y]=W[Y];return J}function i(M){return M.constructor===Object||M.constructor==null}function u(M){return typeof M.then=="function"}function l(M,W){return M===W||M!==M&&W!==W}var c="[object Arguments]",d="[object Boolean]",p="[object Date]",f="[object RegExp]",v="[object Map]",y="[object Number]",b="[object Object]",x="[object Set]",_="[object String]",T=Object.prototype.toString;function S(M){var W=M.areArraysEqual,J=M.areDatesEqual,Y=M.areMapsEqual,X=M.areObjectsEqual,re=M.areRegExpsEqual,se=M.areSetsEqual,Se=M.createIsNestedEqual,te=Se(ze);function ze(ae,ue,Ae){if(ae===ue)return!0;if(!ae||!ue||typeof ae!="object"||typeof ue!="object")return ae!==ae&&ue!==ue;if(i(ae)&&i(ue))return X(ae,ue,te,Ae);var Co=Array.isArray(ae),_o=Array.isArray(ue);if(Co||_o)return Co===_o&&W(ae,ue,te,Ae);var He=T.call(ae);return He!==T.call(ue)?!1:He===p?J(ae,ue,te,Ae):He===f?re(ae,ue,te,Ae):He===v?Y(ae,ue,te,Ae):He===x?se(ae,ue,te,Ae):He===b||He===c?u(ae)||u(ue)?!1:X(ae,ue,te,Ae):He===d||He===y||He===_?l(ae.valueOf(),ue.valueOf()):!1}return ze}function R(M,W,J,Y){var X=M.length;if(W.length!==X)return!1;for(;X-- >0;)if(!J(M[X],W[X],X,X,M,W,Y))return!1;return!0}var g=a(R);function O(M,W){return l(M.valueOf(),W.valueOf())}function E(M,W,J,Y){var X=M.size===W.size;if(!X)return!1;if(!M.size)return!0;var re={},se=0;return M.forEach(function(Se,te){if(X){var ze=!1,ae=0;W.forEach(function(ue,Ae){!ze&&!re[ae]&&(ze=J(te,Ae,se,ae,M,W,Y)&&J(Se,ue,te,Ae,M,W,Y))&&(re[ae]=!0),ae++}),se++,X=ze}}),X}var w=a(E),j="_owner",L=Object.prototype.hasOwnProperty;function k(M,W,J,Y){var X=Object.keys(M),re=X.length;if(Object.keys(W).length!==re)return!1;for(var se;re-- >0;){if(se=X[re],se===j){var Se=!!M.$$typeof,te=!!W.$$typeof;if((Se||te)&&Se!==te)return!1}if(!L.call(W,se)||!J(M[se],W[se],se,se,M,W,Y))return!1}return!0}var G=a(k);function C(M,W){return M.source===W.source&&M.flags===W.flags}function P(M,W,J,Y){var X=M.size===W.size;if(!X)return!1;if(!M.size)return!0;var re={};return M.forEach(function(se,Se){if(X){var te=!1,ze=0;W.forEach(function(ae,ue){!te&&!re[ze]&&(te=J(se,ae,Se,ue,M,W,Y))&&(re[ze]=!0),ze++}),X=te}}),X}var Q=a(P),_e=Object.freeze({areArraysEqual:R,areDatesEqual:O,areMapsEqual:E,areObjectsEqual:k,areRegExpsEqual:C,areSetsEqual:P,createIsNestedEqual:r}),ve=Object.freeze({areArraysEqual:g,areDatesEqual:O,areMapsEqual:w,areObjectsEqual:G,areRegExpsEqual:C,areSetsEqual:Q,createIsNestedEqual:r}),ye=S(_e);function je(M,W){return ye(M,W,void 0)}var z=S(o(_e,{createIsNestedEqual:function(){return l}}));function Z(M,W){return z(M,W,void 0)}var ie=S(ve);function fe(M,W){return ie(M,W,new WeakMap)}var de=S(o(ve,{createIsNestedEqual:function(){return l}}));function pe(M,W){return de(M,W,new WeakMap)}function Pe(M){return S(o(_e,M(_e)))}function Le(M){var W=S(o(ve,M(ve)));return function(J,Y,X){return X===void 0&&(X=new WeakMap),W(J,Y,X)}}n.circularDeepEqual=fe,n.circularShallowEqual=pe,n.createCustomCircularEqual=Le,n.createCustomEqual=Pe,n.deepEqual=je,n.sameValueZeroEqual=l,n.shallowEqual=Z,Object.defineProperty(n,"__esModule",{value:!0})})})(On,On.exports);var En=On.exports,F={},ei=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(F,"__esModule",{value:!0}),F.bottom=Pn,F.childrenEqual=ri,F.cloneLayout=Hr,F.cloneLayoutItem=Je,F.collides=At,F.compact=Br,F.compactItem=Fr,F.compactType=pi,F.correctBounds=Gr,F.fastPositionEqual=ai,F.fastRGLPropsEqual=void 0,F.getAllCollisions=qr,F.getFirstCollision=Qe,F.getLayoutItem=Mn,F.getStatics=Nn,F.modifyLayout=$r,F.moveElement=It,F.moveElementAwayFromCollision=jn,F.noop=void 0,F.perc=ii,F.resizeItemInDirection=li,F.setTopLeft=ci,F.setTransform=ui,F.sortLayoutItems=zn,F.sortLayoutItemsByColRow=Jr,F.sortLayoutItemsByRowCol=Zr,F.synchronizeLayoutWithChildren=di,F.validateLayout=fi,F.withLayoutItem=ni;var Ar=En,wt=ti(I);function ti(e){return e&&e.__esModule?e:{default:e}}function Pn(e){let t=0,n;for(let r=0,a=e.length;r<a;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function Hr(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Je(e[n]);return t}function $r(e,t){const n=Array(e.length);for(let r=0,a=e.length;r<a;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function ni(e,t,n){let r=Mn(e,t);return r?(r=n(Je(r)),e=$r(e,r),[e,r]):[e,null]}function Je(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function ri(e,t){return(0,Ar.deepEqual)(wt.default.Children.map(e,n=>n==null?void 0:n.key),wt.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,Ar.deepEqual)(wt.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),wt.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}F.fastRGLPropsEqual=ei;function ai(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function At(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Br(e,t,n,r){const a=Nn(e),o=zn(e,t),i=Array(e.length);for(let u=0,l=o.length;u<l;u++){let c=Je(o[u]);c.static||(c=Fr(a,c,t,n,o,r),a.push(c)),i[e.indexOf(o[u])]=c,c.moved=!1}return i}const oi={x:"w",y:"h"};function Dn(e,t,n,r){const a=oi[r];t[r]+=1;const o=e.map(i=>i.i).indexOf(t.i);for(let i=o+1;i<e.length;i++){const u=e[i];if(!u.static){if(u.y>t.y+t.h)break;At(t,u)&&Dn(e,u,n+t[a],r)}}t[r]=n}function Fr(e,t,n,r,a,o){const i=n==="vertical",u=n==="horizontal";if(i)for(t.y=Math.min(Pn(e),t.y);t.y>0&&!Qe(e,t);)t.y--;else if(u)for(;t.x>0&&!Qe(e,t);)t.x--;let l;for(;(l=Qe(e,t))&&!(n===null&&o);)if(u?Dn(a,t,l.x+l.w,"x"):Dn(a,t,l.y+l.h,"y"),u&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Qe(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function Gr(e,t){const n=Nn(e);for(let r=0,a=e.length;r<a;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Qe(n,o);)o.y++}return e}function Mn(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Qe(e,t){for(let n=0,r=e.length;n<r;n++)if(At(e[n],t))return e[n]}function qr(e,t){return e.filter(n=>At(n,t))}function Nn(e){return e.filter(t=>t.static)}function It(e,t,n,r,a,o,i,u,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let p=zn(e,i);(i==="vertical"&&typeof r=="number"?d>=r:i==="horizontal"&&typeof n=="number"?c>=n:!1)&&(p=p.reverse());const v=qr(p,t),y=v.length>0;if(y&&l)return Hr(e);if(y&&o)return`${t.i}`,t.x=c,t.y=d,t.moved=!1,e;for(let b=0,x=v.length;b<x;b++){const _=v[b];`${t.i}${t.x}${t.y}${_.i}${_.x}${_.y}`,!_.moved&&(_.static?e=jn(e,_,t,a,i):e=jn(e,t,_,a,i))}return e}function jn(e,t,n,r,a,o){const i=a==="horizontal",u=a==="vertical",l=t.static;if(r){r=!1;const p={x:i?Math.max(t.x-n.w,0):n.x,y:u?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=Qe(e,p),v=f&&f.y+f.h>t.y,y=f&&t.x+t.w>f.x;if(f){if(v&&u)return It(e,n,void 0,t.y+1,r,l,a);if(v&&a==null)return t.y=n.y,n.y=n.y+n.h,e;if(y&&i)return It(e,t,n.x,void 0,r,l,a)}else return`${n.i}${p.x}${p.y}`,It(e,n,i?p.x:void 0,u?p.y:void 0,r,l,a)}const c=i?n.x+1:void 0,d=u?n.y+1:void 0;return c==null&&d==null?e:It(e,n,i?n.x+1:void 0,u?n.y+1:void 0,r,l,a)}function ii(e){return e*100+"%"}const Xr=(e,t,n,r)=>e+n>r?t:n,Yr=(e,t,n)=>e<0?t:n,Kr=e=>Math.max(0,e),Ln=e=>Math.max(0,e),Vn=(e,t,n)=>{let{left:r,height:a,width:o}=t;const i=e.top-(a-e.height);return{left:r,width:o,height:Yr(i,e.height,a),top:Ln(i)}},Un=(e,t,n)=>{let{top:r,left:a,height:o,width:i}=t;return{top:r,height:o,width:Xr(e.left,e.width,i,n),left:Kr(a)}},kn=(e,t,n)=>{let{top:r,height:a,width:o}=t;const i=e.left-(o-e.width);return{height:a,width:i<0?e.width:Xr(e.left,e.width,o,n),top:Ln(r),left:Kr(i)}},Wn=(e,t,n)=>{let{top:r,left:a,height:o,width:i}=t;return{width:i,left:a,height:Yr(r,e.height,o),top:Ln(r)}},si={n:Vn,ne:function(){return Vn(arguments.length<=0?void 0:arguments[0],Un(...arguments))},e:Un,se:function(){return Wn(arguments.length<=0?void 0:arguments[0],Un(...arguments))},s:Wn,sw:function(){return Wn(arguments.length<=0?void 0:arguments[0],kn(...arguments))},w:kn,nw:function(){return Vn(arguments.length<=0?void 0:arguments[0],kn(...arguments))}};function li(e,t,n,r){const a=si[e];return a?a(t,{...t,...n},r):n}function ui(e){let{top:t,left:n,width:r,height:a}=e;const o=`translate(${n}px,${t}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${r}px`,height:`${a}px`,position:"absolute"}}function ci(e){let{top:t,left:n,width:r,height:a}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${a}px`,position:"absolute"}}function zn(e,t){return t==="horizontal"?Jr(e):t==="vertical"?Zr(e):e}function Zr(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function Jr(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function di(e,t,n,r,a){e=e||[];const o=[];wt.default.Children.forEach(t,u=>{if((u==null?void 0:u.key)==null)return;const l=Mn(e,String(u.key)),c=u.props["data-grid"];l&&c==null?o.push(Je(l)):c?o.push(Je({...c,i:u.key})):o.push(Je({w:1,h:1,x:0,y:Pn(o),i:String(u.key)}))});const i=Gr(o,{cols:n});return a?i:Br(i,r,n)}function fi(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,a=e.length;r<a;r++){const o=e[r];for(let i=0;i<n.length;i++)if(typeof o[n[i]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[i]+" must be a number!")}}function pi(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function Xd(){}const hi=()=>{};F.noop=hi;var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.calcGridColWidth=Ht,Ve.calcGridItemPosition=mi,Ve.calcGridItemWHPx=An,Ve.calcWH=vi,Ve.calcXY=gi,Ve.clamp=et;function Ht(e){const{margin:t,containerPadding:n,containerWidth:r,cols:a}=e;return(r-t[0]*(a-1)-n[0]*2)/a}function An(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function mi(e,t,n,r,a,o){const{margin:i,containerPadding:u,rowHeight:l}=e,c=Ht(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=An(r,c,i[0]),d.height=An(a,l,i[1])),o&&o.dragging?(d.top=Math.round(o.dragging.top),d.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(d.top=Math.round(o.resizing.top),d.left=Math.round(o.resizing.left)):(d.top=Math.round((l+i[1])*n+u[1]),d.left=Math.round((c+i[0])*t+u[0])),d}function gi(e,t,n,r,a){const{margin:o,cols:i,rowHeight:u,maxRows:l}=e,c=Ht(e);let d=Math.round((n-o[0])/(c+o[0])),p=Math.round((t-o[1])/(u+o[1]));return d=et(d,0,i-r),p=et(p,0,l-a),{x:d,y:p}}function vi(e,t,n,r,a,o){const{margin:i,maxRows:u,cols:l,rowHeight:c}=e,d=Ht(e);let p=Math.round((t+i[0])/(d+i[0])),f=Math.round((n+i[1])/(c+i[1])),v=et(p,0,l-r),y=et(f,0,u-a);return["sw","w","nw"].indexOf(o)!==-1&&(v=et(p,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(y=et(f,0,u)),{w:v,h:y}}function et(e,t,n){return Math.max(Math.min(e,n),t)}var $t={},Qr={exports:{}},yi="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Si=yi,bi=Si;function ea(){}function ta(){}ta.resetWarningCache=ea;var Ti=function(){function e(r,a,o,i,u,l){if(l!==bi){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ta,resetWarningCache:ea};return n.PropTypes=n,n};Qr.exports=Ti();var Xe=Qr.exports,Bt={exports:{}},na={},oe={},Ue={};Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.dontSetMe=Ii,Ue.findInArray=Ri,Ue.int=wi,Ue.isFunction=Ci,Ue.isNum=_i;function Ri(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Ci(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function _i(e){return typeof e=="number"&&!isNaN(e)}function wi(e){return parseInt(e,10)}function Ii(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var tt={};Object.defineProperty(tt,"__esModule",{value:!0}),tt.browserPrefixToKey=aa,tt.browserPrefixToStyle=xi,tt.default=void 0,tt.getPrefix=ra;const Hn=["Moz","Webkit","O","ms"];function ra(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Hn.length;r++)if(aa(t,Hn[r])in n)return Hn[r];return""}function aa(e,t){return t?"".concat(t).concat(Oi(e)):e}function xi(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Oi(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}tt.default=ra(),Object.defineProperty(oe,"__esModule",{value:!0}),oe.addClassName=la,oe.addEvent=Di,oe.addUserSelectStyles=Hi,oe.createCSSTransform=ki,oe.createSVGTransform=Wi,oe.getTouch=zi,oe.getTouchIdentifier=Ai,oe.getTranslation=$n,oe.innerHeight=Li,oe.innerWidth=Vi,oe.matchesSelector=sa,oe.matchesSelectorAndParentsTo=Pi,oe.offsetXYFromParent=Ui,oe.outerHeight=Ni,oe.outerWidth=ji,oe.removeClassName=ua,oe.removeEvent=Mi,oe.removeUserSelectStyles=$i;var Ie=Ue,oa=Ei(tt);function ia(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ia=function(r){return r?n:t})(e)}function Ei(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ia(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}let Ft="";function sa(e,t){return Ft||(Ft=(0,Ie.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Ie.isFunction)(e[n])})),(0,Ie.isFunction)(e[Ft])?e[Ft](t):!1}function Pi(e,t,n){let r=e;do{if(sa(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Di(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,a):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function Mi(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,a):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function Ni(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Ie.int)(n.borderTopWidth),t+=(0,Ie.int)(n.borderBottomWidth),t}function ji(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Ie.int)(n.borderLeftWidth),t+=(0,Ie.int)(n.borderRightWidth),t}function Li(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Ie.int)(n.paddingTop),t-=(0,Ie.int)(n.paddingBottom),t}function Vi(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Ie.int)(n.paddingLeft),t-=(0,Ie.int)(n.paddingRight),t}function Ui(e,t,n){const a=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-a.left)/n,i=(e.clientY+t.scrollTop-a.top)/n;return{x:o,y:i}}function ki(e,t){const n=$n(e,t,"px");return{[(0,oa.browserPrefixToKey)("transform",oa.default)]:n}}function Wi(e,t){return $n(e,t,"")}function $n(e,t,n){let{x:r,y:a}=e,o="translate(".concat(r).concat(n,",").concat(a).concat(n,")");if(t){const i="".concat(typeof t.x=="string"?t.x:t.x+n),u="".concat(typeof t.y=="string"?t.y:t.y+n);o="translate(".concat(i,", ").concat(u,")")+o}return o}function zi(e,t){return e.targetTouches&&(0,Ie.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Ie.findInArray)(e.changedTouches,n=>t===n.identifier)}function Ai(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Hi(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
10
10
  `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
11
- `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&aa(e.body,"react-draggable-transparent-selection")}function ki(e){if(e)try{if(e.body&&oa(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function aa(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function oa(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.canDragX=Bi,Ne.canDragY=Fi,Ne.createCoreData=qi,Ne.createDraggableData=Xi,Ne.getBoundPosition=Hi,Ne.getControlPosition=Gi,Ne.snapToGrid=$i;var _e=Pe,ut=ae;function Hi(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:Yi(r);const a=kn(e);if(typeof r=="string"){const{ownerDocument:o}=a,i=o.defaultView;let u;if(r==="parent"?u=a.parentNode:u=o.querySelector(r),!(u instanceof i.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=u,c=i.getComputedStyle(a),d=i.getComputedStyle(l);r={left:-a.offsetLeft+(0,_e.int)(d.paddingLeft)+(0,_e.int)(c.marginLeft),top:-a.offsetTop+(0,_e.int)(d.paddingTop)+(0,_e.int)(c.marginTop),right:(0,ut.innerWidth)(l)-(0,ut.outerWidth)(a)-a.offsetLeft+(0,_e.int)(d.paddingRight)-(0,_e.int)(c.marginRight),bottom:(0,ut.innerHeight)(l)-(0,ut.outerHeight)(a)-a.offsetTop+(0,_e.int)(d.paddingBottom)-(0,_e.int)(c.marginBottom)}}return(0,_e.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,_e.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,_e.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,_e.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function $i(e,t,n){const r=Math.round(t/e[0])*e[0],a=Math.round(n/e[1])*e[1];return[r,a]}function Bi(e){return e.props.axis==="both"||e.props.axis==="x"}function Fi(e){return e.props.axis==="both"||e.props.axis==="y"}function Gi(e,t,n){const r=typeof t=="number"?(0,ut.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const a=kn(n),o=n.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,ut.offsetXYFromParent)(r||e,o,n.props.scale)}function qi(e,t,n){const r=!(0,_e.isNum)(e.lastX),a=kn(e);return r?{node:a,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:a,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function Xi(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Yi(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function kn(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Bt={},Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.default=Ki;function Ki(){}Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.default=void 0;var Hn=Ji(_),ye=Bn($e),Zi=Bn(_r),pe=ae,Be=Ne,$n=Pe,wt=Bn(Ft);function Bn(e){return e&&e.__esModule?e:{default:e}}function ia(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ia=function(r){return r?n:t})(e)}function Ji(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ia(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function ge(e,t,n){return t=Qi(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qi(e){var t=es(e,"string");return typeof t=="symbol"?t:String(t)}function es(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const De={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Fe=De.mouse,Gt=class extends Hn.Component{constructor(){super(...arguments),ge(this,"dragging",!1),ge(this,"lastX",NaN),ge(this,"lastY",NaN),ge(this,"touchIdentifier",null),ge(this,"mounted",!1),ge(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,pe.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,pe.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const a=(0,pe.getTouchIdentifier)(t);this.touchIdentifier=a;const o=(0,Be.getControlPosition)(t,a,this);if(o==null)return;const{x:i,y:u}=o,l=(0,Be.createCoreData)(this,i,u);(0,wt.default)("DraggableCore: handleDragStart: %j",l),(0,wt.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,pe.addUserSelectStyles)(r),this.dragging=!0,this.lastX=i,this.lastY=u,(0,pe.addEvent)(r,Fe.move,this.handleDrag),(0,pe.addEvent)(r,Fe.stop,this.handleDragStop))}),ge(this,"handleDrag",t=>{const n=(0,Be.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:a}=n;if(Array.isArray(this.props.grid)){let u=r-this.lastX,l=a-this.lastY;if([u,l]=(0,Be.snapToGrid)(this.props.grid,u,l),!u&&!l)return;r=this.lastX+u,a=this.lastY+l}const o=(0,Be.createCoreData)(this,r,a);if((0,wt.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=a}),ge(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Be.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:a}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=a-this.lastY||0;[l,c]=(0,Be.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,a=this.lastY+c}const o=(0,Be.createCoreData)(this,r,a);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const u=this.findDOMNode();u&&this.props.enableUserSelectHack&&(0,pe.removeUserSelectStyles)(u.ownerDocument),(0,wt.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,u&&((0,wt.default)("DraggableCore: Removing handlers"),(0,pe.removeEvent)(u.ownerDocument,Fe.move,this.handleDrag),(0,pe.removeEvent)(u.ownerDocument,Fe.stop,this.handleDragStop))}),ge(this,"onMouseDown",t=>(Fe=De.mouse,this.handleDragStart(t))),ge(this,"onMouseUp",t=>(Fe=De.mouse,this.handleDragStop(t))),ge(this,"onTouchStart",t=>(Fe=De.touch,this.handleDragStart(t))),ge(this,"onTouchEnd",t=>(Fe=De.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,pe.addEvent)(t,De.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,pe.removeEvent)(n,De.mouse.move,this.handleDrag),(0,pe.removeEvent)(n,De.touch.move,this.handleDrag),(0,pe.removeEvent)(n,De.mouse.stop,this.handleDragStop),(0,pe.removeEvent)(n,De.touch.stop,this.handleDragStop),(0,pe.removeEvent)(t,De.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,pe.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:Zi.default.findDOMNode(this)}render(){return Hn.cloneElement(Hn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Bt.default=Gt,ge(Gt,"displayName","DraggableCore"),ge(Gt,"propTypes",{allowAnyClick:ye.default.bool,children:ye.default.node.isRequired,disabled:ye.default.bool,enableUserSelectHack:ye.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:ye.default.arrayOf(ye.default.number),handle:ye.default.string,cancel:ye.default.string,nodeRef:ye.default.object,onStart:ye.default.func,onDrag:ye.default.func,onStop:ye.default.func,onMouseDown:ye.default.func,scale:ye.default.number,className:$n.dontSetMe,style:$n.dontSetMe,transform:$n.dontSetMe}),ge(Gt,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=h(_),n=d($e),r=d(_r),a=d(He),o=ae,i=Ne,u=Pe,l=d(Bt),c=d(Ft);function d(b){return b&&b.__esModule?b:{default:b}}function p(b){if(typeof WeakMap!="function")return null;var S=new WeakMap,C=new WeakMap;return(p=function(g){return g?C:S})(b)}function h(b,S){if(!S&&b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var C=p(S);if(C&&C.has(b))return C.get(b);var g={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in b)if(D!=="default"&&Object.prototype.hasOwnProperty.call(b,D)){var I=E?Object.getOwnPropertyDescriptor(b,D):null;I&&(I.get||I.set)?Object.defineProperty(g,D,I):g[D]=b[D]}return g.default=b,C&&C.set(b,g),g}function v(){return v=Object.assign?Object.assign.bind():function(b){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var g in C)Object.prototype.hasOwnProperty.call(C,g)&&(b[g]=C[g])}return b},v.apply(this,arguments)}function y(b,S,C){return S=T(S),S in b?Object.defineProperty(b,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):b[S]=C,b}function T(b){var S=x(b,"string");return typeof S=="symbol"?S:String(S)}function x(b,S){if(typeof b!="object"||b===null)return b;var C=b[Symbol.toPrimitive];if(C!==void 0){var g=C.call(b,S||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(b)}class w extends t.Component{static getDerivedStateFromProps(S,C){let{position:g}=S,{prevPropsPosition:E}=C;return g&&(!E||g.x!==E.x||g.y!==E.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:g,prevPropsPosition:E}),{x:g.x,y:g.y,prevPropsPosition:{...g}}):null}constructor(S){super(S),y(this,"onDragStart",(C,g)=>{if((0,c.default)("Draggable: onDragStart: %j",g),this.props.onStart(C,(0,i.createDraggableData)(this,g))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),y(this,"onDrag",(C,g)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",g);const E=(0,i.createDraggableData)(this,g),D={x:E.x,y:E.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:L}=D;D.x+=this.state.slackX,D.y+=this.state.slackY;const[V,F]=(0,i.getBoundPosition)(this,D.x,D.y);D.x=V,D.y=F,D.slackX=this.state.slackX+(j-D.x),D.slackY=this.state.slackY+(L-D.y),E.x=D.x,E.y=D.y,E.deltaX=D.x-this.state.x,E.deltaY=D.y-this.state.y}if(this.props.onDrag(C,E)===!1)return!1;this.setState(D)}),y(this,"onDragStop",(C,g)=>{if(!this.state.dragging||this.props.onStop(C,(0,i.createDraggableData)(this,g))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",g);const D={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:j,y:L}=this.props.position;D.x=j,D.y=L}this.setState(D)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var S,C;return(S=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:C,children:g,defaultPosition:E,defaultClassName:D,defaultClassNameDragging:I,defaultClassNameDragged:j,position:L,positionOffset:V,scale:F,...R}=this.props;let O={},J=null;const z=!!!L||this.state.dragging,q=L||E,ne={x:(0,i.canDragX)(this)&&z?this.state.x:q.x,y:(0,i.canDragY)(this)&&z?this.state.y:q.y};this.state.isElementSVG?J=(0,o.createSVGTransform)(ne,V):O=(0,o.createCSSTransform)(ne,V);const ce=(0,a.default)(g.props.className||"",D,{[I]:this.state.dragging,[j]:this.state.dragged});return t.createElement(l.default,v({},R,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(g),{className:ce,style:{...g.props.style,...O},transform:J}))}}e.default=w,y(w,"displayName","Draggable"),y(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),y(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Jr);const{default:sa,DraggableCore:ts}=Jr;Ht.exports=sa,Ht.exports.default=sa,Ht.exports.DraggableCore=ts;var la=Ht.exports,qt={exports:{}},_t={},Fn={};Fn.__esModule=!0,Fn.cloneElement=ss;var ns=rs(_);function rs(e){return e&&e.__esModule?e:{default:e}}function ua(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ca(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ua(Object(n),!0).forEach(function(r){as(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ua(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function as(e,t,n){return t=os(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function os(e){var t=is(e,"string");return typeof t=="symbol"?t:String(t)}function is(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ss(e,t){return t.style&&e.props.style&&(t.style=ca(ca({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),ns.default.cloneElement(e,t)}var It={};It.__esModule=!0,It.resizableProps=void 0;var H=ls($e);function ls(e){return e&&e.__esModule?e:{default:e}}var us={axis:H.default.oneOf(["both","x","y","none"]),className:H.default.string,children:H.default.element.isRequired,draggableOpts:H.default.shape({allowAnyClick:H.default.bool,cancel:H.default.string,children:H.default.node,disabled:H.default.bool,enableUserSelectHack:H.default.bool,offsetParent:H.default.node,grid:H.default.arrayOf(H.default.number),handle:H.default.string,nodeRef:H.default.object,onStart:H.default.func,onDrag:H.default.func,onStop:H.default.func,onMouseDown:H.default.func,scale:H.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(a.axis==="both"||a.axis==="y"){var o;return(o=H.default.number).isRequired.apply(o,n)}return H.default.number.apply(H.default,n)},handle:H.default.oneOfType([H.default.node,H.default.func]),handleSize:H.default.arrayOf(H.default.number),lockAspectRatio:H.default.bool,maxConstraints:H.default.arrayOf(H.default.number),minConstraints:H.default.arrayOf(H.default.number),onResizeStop:H.default.func,onResizeStart:H.default.func,onResize:H.default.func,resizeHandles:H.default.arrayOf(H.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:H.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(a.axis==="both"||a.axis==="x"){var o;return(o=H.default.number).isRequired.apply(o,n)}return H.default.number.apply(H.default,n)}};It.resizableProps=us,_t.__esModule=!0,_t.default=void 0;var xt=hs(_),cs=la,ds=Fn,fs=It,ps=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function da(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(da=function(a){return a?n:t})(e)}function hs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=da(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Gn(){return Gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gn.apply(this,arguments)}function ms(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function fa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fa(Object(n),!0).forEach(function(r){gs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fa(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gs(e,t,n){return t=vs(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vs(e){var t=ys(e,"string");return typeof t=="symbol"?t:String(t)}function ys(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ss(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Xn(e,t)}function Xn(e,t){return Xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Xn(e,t)}var Yn=function(e){Ss(t,e);function t(){for(var r,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return r=e.call.apply(e,[this].concat(o))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(a,o){var i=this.props,u=i.minConstraints,l=i.maxConstraints,c=i.lockAspectRatio;if(!u&&!l&&!c)return[a,o];if(c){var d=this.props.width/this.props.height,p=a-this.props.width,h=o-this.props.height;Math.abs(p)>Math.abs(h*d)?o=a/d:a=o*d}var v=a,y=o,T=this.slack||[0,0],x=T[0],w=T[1];return a+=x,o+=w,u&&(a=Math.max(u[0],a),o=Math.max(u[1],o)),l&&(a=Math.min(l[0],a),o=Math.min(l[1],o)),this.slack=[x+(v-a),w+(y-o)],[a,o]},n.resizeHandler=function(a,o){var i=this;return function(u,l){var c=l.node,d=l.deltaX,p=l.deltaY;a==="onResizeStart"&&i.resetData();var h=(i.props.axis==="both"||i.props.axis==="x")&&o!=="n"&&o!=="s",v=(i.props.axis==="both"||i.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!h&&!v)){var y=o[0],T=o[o.length-1],x=c.getBoundingClientRect();if(i.lastHandleRect!=null){if(T==="w"){var w=x.left-i.lastHandleRect.left;d+=w}if(y==="n"){var b=x.top-i.lastHandleRect.top;p+=b}}i.lastHandleRect=x,T==="w"&&(d=-d),y==="n"&&(p=-p);var S=i.props.width+(h?d/i.props.transformScale:0),C=i.props.height+(v?p/i.props.transformScale:0),g=i.runConstraints(S,C);S=g[0],C=g[1];var E=S!==i.props.width||C!==i.props.height,D=typeof i.props[a]=="function"?i.props[a]:null,I=a==="onResize"&&!E;D&&!I&&(u.persist==null||u.persist(),D(u,{node:c,size:{width:S,height:C},handle:o})),a==="onResizeStop"&&i.resetData()}}},n.renderResizeHandle=function(a,o){var i=this.props.handle;if(!i)return xt.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+a,ref:o});if(typeof i=="function")return i(a,o);var u=typeof i.type=="string",l=qn({ref:o},u?{}:{handleAxis:a});return xt.cloneElement(i,l)},n.render=function(){var a=this,o=this.props,i=o.children,u=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var d=ms(o,ps);return(0,ds.cloneElement)(i,qn(qn({},d),{},{className:(u?u+" ":"")+"react-resizable",children:[].concat(i.props.children,c.map(function(p){var h,v=(h=a.handleRefs[p])!=null?h:a.handleRefs[p]=xt.createRef();return xt.createElement(cs.DraggableCore,Gn({},l,{nodeRef:v,key:"resizableHandle-"+p,onStop:a.resizeHandler("onResizeStop",p),onStart:a.resizeHandler("onResizeStart",p),onDrag:a.resizeHandler("onResize",p)}),a.renderResizeHandle(p,v))}))}))},t}(xt.Component);_t.default=Yn,Yn.propTypes=fs.resizableProps,Yn.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Xt={};Xt.__esModule=!0,Xt.default=void 0;var Kn=ws(_),bs=pa($e),Ts=pa(_t),Rs=It,Cs=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function pa(e){return e&&e.__esModule?e:{default:e}}function ha(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ha=function(a){return a?n:t})(e)}function ws(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ha(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Zn(){return Zn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zn.apply(this,arguments)}function ma(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ma(Object(n),!0).forEach(function(r){_s(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ma(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _s(e,t,n){return t=Is(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Is(e){var t=xs(e,"string");return typeof t=="symbol"?t:String(t)}function xs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Es(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Os(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Jn(e,t)}function Jn(e,t){return Jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Jn(e,t)}var ga=function(e){Os(t,e);function t(){for(var r,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return r=e.call.apply(e,[this].concat(o))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(u,l){var c=l.size;r.props.onResize?(u.persist==null||u.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(u,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(a,o){return o.propsWidth!==a.width||o.propsHeight!==a.height?{width:a.width,height:a.height,propsWidth:a.width,propsHeight:a.height}:null};var n=t.prototype;return n.render=function(){var a=this.props,o=a.handle,i=a.handleSize;a.onResize;var u=a.onResizeStart,l=a.onResizeStop,c=a.draggableOpts,d=a.minConstraints,p=a.maxConstraints,h=a.lockAspectRatio,v=a.axis;a.width,a.height;var y=a.resizeHandles,T=a.style,x=a.transformScale,w=Es(a,Cs);return Kn.createElement(Ts.default,{axis:v,draggableOpts:c,handle:o,handleSize:i,height:this.state.height,lockAspectRatio:h,maxConstraints:p,minConstraints:d,onResizeStart:u,onResize:this.onResize,onResizeStop:l,resizeHandles:y,transformScale:x,width:this.state.width},Kn.createElement("div",Zn({},w,{style:Yt(Yt({},T),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Kn.Component);Xt.default=ga,ga.propTypes=Yt(Yt({},Rs.resizableProps),{},{children:bs.default.element}),qt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},qt.exports.Resizable=_t.default,qt.exports.ResizableBox=Xt.default;var Ds=qt.exports,We={};Object.defineProperty(We,"__esModule",{value:!0}),We.resizeHandleType=We.resizeHandleAxesType=We.default=void 0;var $=va($e),Ms=va(_);function va(e){return e&&e.__esModule?e:{default:e}}const Ps=We.resizeHandleAxesType=$.default.arrayOf($.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),Ns=We.resizeHandleType=$.default.oneOfType([$.default.node,$.default.func]);We.default={className:$.default.string,style:$.default.object,width:$.default.number,autoSize:$.default.bool,cols:$.default.number,draggableCancel:$.default.string,draggableHandle:$.default.string,verticalCompact:function(e){e.verticalCompact},compactType:$.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&B.validateLayout(t,"layout")},margin:$.default.arrayOf($.default.number),containerPadding:$.default.arrayOf($.default.number),rowHeight:$.default.number,maxRows:$.default.number,isBounded:$.default.bool,isDraggable:$.default.bool,isResizable:$.default.bool,allowOverlap:$.default.bool,preventCollision:$.default.bool,useCSSTransforms:$.default.bool,transformScale:$.default.number,isDroppable:$.default.bool,resizeHandles:Ps,resizeHandle:Ns,onLayoutChange:$.default.func,onDragStart:$.default.func,onDrag:$.default.func,onDragStop:$.default.func,onResizeStart:$.default.func,onResize:$.default.func,onResizeStop:$.default.func,onDrop:$.default.func,droppingItem:$.default.shape({i:$.default.string.isRequired,w:$.default.number.isRequired,h:$.default.number.isRequired}),children:function(e,t){const n=e[t],r={};Ms.default.Children.forEach(n,function(a){if((a==null?void 0:a.key)!=null){if(r[a.key])throw new Error('Duplicate child key "'+a.key+'" found! This will cause problems in ReactGridLayout.');r[a.key]=!0}})},innerRef:$.default.any},Object.defineProperty(kt,"__esModule",{value:!0}),kt.default=void 0;var ct=Qn(_),Y=Qn($e),js=la,Ls=Ds,dt=B,fe=Me,ya=We,Us=Qn(He);function Qn(e){return e&&e.__esModule?e:{default:e}}function je(e,t,n){return t=Vs(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vs(e){var t=zs(e,"string");return typeof t=="symbol"?t:String(t)}function zs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class er extends ct.default.Component{constructor(){super(...arguments),je(this,"state",{resizing:null,dragging:null,className:""}),je(this,"elementRef",ct.default.createRef()),je(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:a,transformScale:o}=this.props;if(!a)return;const i={top:0,left:0},{offsetParent:u}=r;if(!u)return;const l=u.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.left/o,p=l.left/o,h=c.top/o,v=l.top/o;i.left=d-p+u.scrollLeft,i.top=h-v+u.scrollTop,this.setState({dragging:i});const{x:y,y:T}=(0,fe.calcXY)(this.getPositionParams(),i.top,i.left,this.props.w,this.props.h);return a.call(this,this.props.i,y,T,{e:t,node:r,newPosition:i})}),je(this,"onDrag",(t,n)=>{let{node:r,deltaX:a,deltaY:o}=n;const{onDrag:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let u=this.state.dragging.top+o,l=this.state.dragging.left+a;const{isBounded:c,i:d,w:p,h,containerWidth:v}=this.props,y=this.getPositionParams();if(c){const{offsetParent:S}=r;if(S){const{margin:C,rowHeight:g,containerPadding:E}=this.props,D=S.clientHeight-(0,fe.calcGridItemWHPx)(h,g,C[1]);u=(0,fe.clamp)(u-E[1],0,D);const I=(0,fe.calcGridColWidth)(y),j=v-(0,fe.calcGridItemWHPx)(p,I,C[0]);l=(0,fe.clamp)(l-E[0],0,j)}}const T={top:u,left:l};this.setState({dragging:T});const{containerPadding:x}=this.props,{x:w,y:b}=(0,fe.calcXY)(y,u-x[1],l-x[0],p,h);return i.call(this,d,w,b,{e:t,node:r,newPosition:T})}),je(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:i,i:u,containerPadding:l}=this.props,{left:c,top:d}=this.state.dragging,p={top:d,left:c};this.setState({dragging:null});const{x:h,y:v}=(0,fe.calcXY)(this.getPositionParams(),d-l[1],c-l[0],o,i);return a.call(this,u,h,v,{e:t,node:r,newPosition:p})}),je(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),je(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),je(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,fe.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),a=(0,fe.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,dt.fastPositionEqual)(r,a)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const a=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,i=o&&n.left!==a.left||n.top!==a.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(i){const u=n.left-o.left,l=n.top-o.top;this.onDrag(n.e,{node:r,deltaX:u,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:a}=this.props;let o;return a?o=(0,dt.setTransform)(t):(o=(0,dt.setTopLeft)(t),n&&(o.left=(0,dt.perc)(t.left/r),o.width=(0,dt.perc)(t.width/r))),o}mixinDraggable(t,n){return ct.default.createElement(js.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,a)=>n(r,a,t)}mixinResizable(t,n,r){const{cols:a,minW:o,minH:i,maxW:u,maxH:l,transformScale:c,resizeHandles:d,resizeHandle:p}=this.props,h=this.getPositionParams(),v=(0,fe.calcGridItemPosition)(h,0,0,a,0).width,y=(0,fe.calcGridItemPosition)(h,0,0,o,i),T=(0,fe.calcGridItemPosition)(h,0,0,u,l),x=[y.width,y.height],w=[Math.min(T.width,v),Math.min(T.height,1/0)];return ct.default.createElement(Ls.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:d,handle:p},t)}onResizeHandler(t,n,r,a){let{node:o,size:i,handle:u}=n;const l=this.props[a];if(!l)return;const{x:c,y:d,i:p,maxH:h,minH:v,containerWidth:y}=this.props,{minW:T,maxW:x}=this.props;let w=i;o&&(w=(0,dt.resizeItemInDirection)(u,r,i,y),this.setState({resizing:a==="onResizeStop"?null:w}));let{w:b,h:S}=(0,fe.calcWH)(this.getPositionParams(),w.width,w.height,c,d,u);b=(0,fe.clamp)(b,Math.max(T,1),x),S=(0,fe.clamp)(S,v,h),l.call(this,p,b,S,{e:t,node:o,size:w,handle:u})}render(){const{x:t,y:n,w:r,h:a,isDraggable:o,isResizable:i,droppingPosition:u,useCSSTransforms:l}=this.props,c=(0,fe.calcGridItemPosition)(this.getPositionParams(),t,n,r,a,this.state),d=ct.default.Children.only(this.props.children);let p=ct.default.cloneElement(d,{ref:this.elementRef,className:(0,Us.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!u,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(c)}});return p=this.mixinResizable(p,c,i),p=this.mixinDraggable(p,o),p}}kt.default=er,je(er,"propTypes",{children:Y.default.element,cols:Y.default.number.isRequired,containerWidth:Y.default.number.isRequired,rowHeight:Y.default.number.isRequired,margin:Y.default.array.isRequired,maxRows:Y.default.number.isRequired,containerPadding:Y.default.array.isRequired,x:Y.default.number.isRequired,y:Y.default.number.isRequired,w:Y.default.number.isRequired,h:Y.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:Y.default.string.isRequired,resizeHandles:ya.resizeHandleAxesType,resizeHandle:ya.resizeHandleType,onDragStop:Y.default.func,onDragStart:Y.default.func,onDrag:Y.default.func,onResizeStop:Y.default.func,onResizeStart:Y.default.func,onResize:Y.default.func,isDraggable:Y.default.bool.isRequired,isResizable:Y.default.bool.isRequired,isBounded:Y.default.bool.isRequired,static:Y.default.bool,useCSSTransforms:Y.default.bool.isRequired,transformScale:Y.default.number,className:Y.default.string,handle:Y.default.string,cancel:Y.default.string,droppingPosition:Y.default.shape({e:Y.default.object.isRequired,left:Y.default.number.isRequired,top:Y.default.number.isRequired})}),je(er,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.default=void 0;var Ze=Hs(_),tr=In,As=nr(He),A=B,Ws=Me,Sa=nr(kt),ks=nr(We);function nr(e){return e&&e.__esModule?e:{default:e}}function ba(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ba=function(r){return r?n:t})(e)}function Hs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ba(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function he(e,t,n){return t=$s(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $s(e){var t=Bs(e,"string");return typeof t=="symbol"?t:String(t)}function Bs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Ta="react-grid-layout";let Ra=!1;try{Ra=/firefox/i.test(navigator.userAgent)}catch{}class Kt extends Ze.Component{constructor(){super(...arguments),he(this,"state",{activeDrag:null,layout:(0,A.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,A.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),he(this,"dragEnterCounter",0),he(this,"onDragStart",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u}=this.state,l=(0,A.getLayoutItem)(u,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,A.cloneLayoutItem)(l),oldLayout:u,activeDrag:c}),this.props.onDragStart(u,l,l,null,o,i)}),he(this,"onDrag",(t,n,r,a)=>{let{e:o,node:i}=a;const{oldDragItem:u}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:d,preventCollision:p}=this.props,h=(0,A.getLayoutItem)(l,t);if(!h)return;const v={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t};l=(0,A.moveElement)(l,h,n,r,!0,p,(0,A.compactType)(this.props),c,d),this.props.onDrag(l,u,h,v,o,i),this.setState({layout:d?l:(0,A.compact)(l,(0,A.compactType)(this.props),c),activeDrag:v})}),he(this,"onDragStop",(t,n,r,a)=>{let{e:o,node:i}=a;if(!this.state.activeDrag)return;const{oldDragItem:u}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:d,allowOverlap:p}=this.props,h=(0,A.getLayoutItem)(l,t);if(!h)return;l=(0,A.moveElement)(l,h,n,r,!0,d,(0,A.compactType)(this.props),c,p);const y=p?l:(0,A.compact)(l,(0,A.compactType)(this.props),c);this.props.onDragStop(y,u,h,null,o,i);const{oldLayout:T}=this.state;this.setState({activeDrag:null,layout:y,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(y,T)}),he(this,"onResizeStart",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u}=this.state,l=(0,A.getLayoutItem)(u,t);l&&(this.setState({oldResizeItem:(0,A.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(u,l,l,null,o,i))}),he(this,"onResize",(t,n,r,a)=>{let{e:o,node:i,size:u,handle:l}=a;const{oldResizeItem:c}=this.state,{layout:d}=this.state,{cols:p,preventCollision:h,allowOverlap:v}=this.props;let y=!1,T,x,w;const[b,S]=(0,A.withLayoutItem)(d,t,g=>{let E;return x=g.x,w=g.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=g.x+(g.w-n),n=g.x!==x&&x<0?g.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=g.y+(g.h-r),r=g.y!==w&&w<0?g.h:r,w=w<0?0:w),y=!0),h&&!v&&(E=(0,A.getAllCollisions)(d,{...g,w:n,h:r,x,y:w}).filter(I=>I.i!==g.i).length>0,E&&(w=g.y,r=g.h,x=g.x,n=g.w,y=!1)),g.w=n,g.h=r,g});if(!S)return;T=b,y&&(T=(0,A.moveElement)(b,S,x,w,!0,this.props.preventCollision,(0,A.compactType)(this.props),p,v));const C={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(T,c,S,C,o,i),this.setState({layout:v?T:(0,A.compact)(T,(0,A.compactType)(this.props),p),activeDrag:C})}),he(this,"onResizeStop",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u,oldResizeItem:l}=this.state,{cols:c,allowOverlap:d}=this.props,p=(0,A.getLayoutItem)(u,t),h=d?u:(0,A.compact)(u,(0,A.compactType)(this.props),c);this.props.onResizeStop(h,l,p,null,o,i);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,v)}),he(this,"onDragOver",t=>{var b;if(t.preventDefault(),t.stopPropagation(),Ra&&!((b=t.nativeEvent.target)!=null&&b.classList.contains(Ta)))return!1;const{droppingItem:n,onDropDragOver:r,margin:a,cols:o,rowHeight:i,maxRows:u,width:l,containerPadding:c,transformScale:d}=this.props,p=r==null?void 0:r(t);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const h={...n,...p},{layout:v}=this.state,y=t.currentTarget.getBoundingClientRect(),T=t.clientX-y.left,x=t.clientY-y.top,w={left:T/d,top:x/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:S,top:C}=this.state.droppingPosition;(S!=T||C!=x)&&this.setState({droppingPosition:w})}}else{const S={cols:o,margin:a,maxRows:u,rowHeight:i,containerWidth:l,containerPadding:c||a},C=(0,Ws.calcXY)(S,x,T,h.w,h.h);this.setState({droppingDOMNode:Ze.createElement("div",{key:h.i}),droppingPosition:w,layout:[...v,{...h,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),he(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,a=(0,A.compact)(r.filter(o=>o.i!==t.i),(0,A.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:a,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),he(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),he(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),he(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,a=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,a,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,tr.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,A.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,A.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,A.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,A.fastRGLPropsEqual)(this.props,t,tr.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,a=n.layout;this.onLayoutMaybeChanged(r,a)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,A.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,tr.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:a,containerPadding:o,rowHeight:i,maxRows:u,useCSSTransforms:l,transformScale:c}=this.props;return Ze.createElement(Sa.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:a,containerPadding:o||a,maxRows:u,rowHeight:i,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Ze.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,A.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:a,cols:o,margin:i,containerPadding:u,rowHeight:l,maxRows:c,isDraggable:d,isResizable:p,isBounded:h,useCSSTransforms:v,transformScale:y,draggableCancel:T,draggableHandle:x,resizeHandles:w,resizeHandle:b}=this.props,{mounted:S,droppingPosition:C}=this.state,g=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,E=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&p,D=r.resizeHandles||w,I=g&&h&&r.isBounded!==!1;return Ze.createElement(Sa.default,{containerWidth:a,cols:o,margin:i,containerPadding:u||i,maxRows:c,rowHeight:l,cancel:T,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:g,isResizable:E,isBounded:I,useCSSTransforms:v&&S,usePercentages:!S,transformScale:y,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?C:void 0,resizeHandles:D,resizeHandle:b},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:a}=this.props,o=(0,As.default)(Ta,t),i={height:this.containerHeight(),...n};return Ze.createElement("div",{ref:a,className:o,style:i,onDrop:r?this.onDrop:A.noop,onDragLeave:r?this.onDragLeave:A.noop,onDragEnter:r?this.onDragEnter:A.noop,onDragOver:r?this.onDragOver:A.noop},Ze.Children.map(this.props.children,u=>this.processGridItem(u)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Tt.default=Kt,he(Kt,"displayName","ReactGridLayout"),he(Kt,"propTypes",ks.default),he(Kt,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:A.noop,onDragStart:A.noop,onDrag:A.noop,onDragStop:A.noop,onResizeStart:A.noop,onResize:A.noop,onResizeStop:A.noop,onDrop:A.noop,onDropDragOver:A.noop});var Zt={},Je={};Object.defineProperty(Je,"__esModule",{value:!0}),Je.findOrGenerateResponsiveLayout=qs,Je.getBreakpointFromWidth=Fs,Je.getColsFromBreakpoint=Gs,Je.sortBreakpoints=rr;var Jt=B;function Fs(e,t){const n=rr(e);let r=n[0];for(let a=1,o=n.length;a<o;a++){const i=n[a];t>e[i]&&(r=i)}return r}function Gs(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function qs(e,t,n,r,a,o){if(e[n])return(0,Jt.cloneLayout)(e[n]);let i=e[r];const u=rr(t),l=u.slice(u.indexOf(n));for(let c=0,d=l.length;c<d;c++){const p=l[c];if(e[p]){i=e[p];break}}return i=(0,Jt.cloneLayout)(i||[]),(0,Jt.compact)((0,Jt.correctBounds)(i,{cols:a}),o,a)}function rr(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.default=void 0;var Ca=Ys(_),Se=wa($e),ar=In,ft=B,Qe=Je,Xs=wa(Tt);function wa(e){return e&&e.__esModule?e:{default:e}}function _a(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(_a=function(r){return r?n:t})(e)}function Ys(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=_a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function or(){return or=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},or.apply(this,arguments)}function Qt(e,t,n){return t=Ks(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ks(e){var t=Zs(e,"string");return typeof t=="symbol"?t:String(t)}function Zs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Ia=e=>Object.prototype.toString.call(e);function en(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class ir extends Ca.Component{constructor(){super(...arguments),Qt(this,"state",this.generateInitialState()),Qt(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:a}=this.props,o=(0,Qe.getBreakpointFromWidth)(n,t),i=(0,Qe.getColsFromBreakpoint)(o,a),u=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Qe.findOrGenerateResponsiveLayout)(r,n,o,o,i,u),breakpoint:o,cols:i}}static getDerivedStateFromProps(t,n){if(!(0,ar.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:a}=n;return{layout:(0,Qe.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,a,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,ar.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,ar.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:a,compactType:o}=this.props,i=this.props.breakpoint||(0,Qe.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),u=this.state.breakpoint,l=(0,Qe.getColsFromBreakpoint)(i,r),c={...a};if(u!==i||t.breakpoints!==n||t.cols!==r){u in c||(c[u]=(0,ft.cloneLayout)(this.state.layout));let h=(0,Qe.findOrGenerateResponsiveLayout)(c,n,i,u,l,o);h=(0,ft.synchronizeLayoutWithChildren)(h,this.props.children,l,o,this.props.allowOverlap),c[i]=h,this.props.onLayoutChange(h,c),this.props.onBreakpointChange(i,l),this.setState({breakpoint:i,layout:h,cols:l})}const d=en(this.props.margin,i),p=en(this.props.containerPadding,i);this.props.onWidthChange(this.props.width,d,l,p)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:a,margin:o,containerPadding:i,onBreakpointChange:u,onLayoutChange:l,onWidthChange:c,...d}=this.props;return Ca.createElement(Xs.default,or({},d,{margin:en(o,this.state.breakpoint),containerPadding:en(i,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Zt.default=ir,Qt(ir,"propTypes",{breakpoint:Se.default.string,breakpoints:Se.default.object,allowOverlap:Se.default.bool,cols:Se.default.object,margin:Se.default.oneOfType([Se.default.array,Se.default.object]),containerPadding:Se.default.oneOfType([Se.default.array,Se.default.object]),layouts(e,t){if(Ia(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+Ia(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,ft.validateLayout)(e.layouts[n],"layouts."+n)})},width:Se.default.number.isRequired,onBreakpointChange:Se.default.func,onLayoutChange:Se.default.func,onWidthChange:Se.default.func}),Qt(ir,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:ft.noop,onLayoutChange:ft.noop,onWidthChange:ft.noop});var sr={},xa=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(a,o){return a[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},t.prototype.set=function(n,r){var a=e(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,a=e(r,n);~a&&r.splice(a,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,o=this.__entries__;a<o.length;a++){var i=o[a];n.call(r,i[1],i[0])}},t}()}(),lr=typeof window<"u"&&typeof document<"u"&&window.document===document,tn=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Js=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(tn):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Qs=2;function el(e,t){var n=!1,r=!1,a=0;function o(){n&&(n=!1,e()),r&&u()}function i(){Js(o)}function u(){var l=Date.now();if(n){if(l-a<Qs)return;r=!0}else n=!0,r=!1,setTimeout(i,t);a=l}return u}var tl=20,nl=["top","right","bottom","left","width","height","size","weight"],rl=typeof MutationObserver<"u",al=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=el(this.refresh.bind(this),tl)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!lr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),rl?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!lr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,a=nl.some(function(o){return!!~r.indexOf(o)});a&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Ea=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var a=r[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},pt=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||tn},Oa=rn(0,0,0,0);function nn(e){return parseFloat(e)||0}function Da(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,a){var o=e["border-"+a+"-width"];return r+nn(o)},0)}function ol(e){for(var t=["top","right","bottom","left"],n={},r=0,a=t;r<a.length;r++){var o=a[r],i=e["padding-"+o];n[o]=nn(i)}return n}function il(e){var t=e.getBBox();return rn(0,0,t.width,t.height)}function sl(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Oa;var r=pt(e).getComputedStyle(e),a=ol(r),o=a.left+a.right,i=a.top+a.bottom,u=nn(r.width),l=nn(r.height);if(r.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=Da(r,"left","right")+o),Math.round(l+i)!==n&&(l-=Da(r,"top","bottom")+i)),!ul(e)){var c=Math.round(u+o)-t,d=Math.round(l+i)-n;Math.abs(c)!==1&&(u-=c),Math.abs(d)!==1&&(l-=d)}return rn(a.left,a.top,u,l)}var ll=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof pt(e).SVGGraphicsElement}:function(e){return e instanceof pt(e).SVGElement&&typeof e.getBBox=="function"}}();function ul(e){return e===pt(e).document.documentElement}function cl(e){return lr?ll(e)?il(e):sl(e):Oa}function dl(e){var t=e.x,n=e.y,r=e.width,a=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(o.prototype);return Ea(i,{x:t,y:n,width:r,height:a,top:n,right:t+r,bottom:a+n,left:t}),i}function rn(e,t,n,r){return{x:e,y:t,width:n,height:r}}var fl=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=rn(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=cl(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),pl=function(){function e(t,n){var r=dl(n);Ea(this,{target:t,contentRect:r})}return e}(),hl=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new xa,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof pt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new fl(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof pt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new pl(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Ma=typeof WeakMap<"u"?new WeakMap:new xa,Pa=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=al.getInstance(),r=new hl(t,n,this);Ma.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Pa.prototype[e]=function(){var t;return(t=Ma.get(this))[e].apply(t,arguments)}});var ml=function(){return typeof tn.ResizeObserver<"u"?tn.ResizeObserver:Pa}();const gl=jo(Object.freeze(Object.defineProperty({__proto__:null,default:ml},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(sr,"__esModule",{value:!0}),sr.default=wl;var an=bl(_),vl=ur($e),yl=ur(gl),Sl=ur(He);function ur(e){return e&&e.__esModule?e:{default:e}}function Na(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Na=function(r){return r?n:t})(e)}function bl(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Na(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function cr(){return cr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cr.apply(this,arguments)}function ht(e,t,n){return t=Tl(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tl(e){var t=Rl(e,"string");return typeof t=="symbol"?t:String(t)}function Rl(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Cl="react-grid-layout";function wl(e){var t;return t=class extends an.Component{constructor(){super(...arguments),ht(this,"state",{width:1280}),ht(this,"elementRef",an.createRef()),ht(this,"mounted",!1),ht(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new yl.default(a=>{if(this.elementRef.current instanceof HTMLElement){const i=a[0].contentRect.width;this.setState({width:i})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...a}=this.props;return r&&!this.mounted?an.createElement("div",{className:(0,Sl.default)(this.props.className,Cl),style:this.props.style,ref:this.elementRef}):an.createElement(e,cr({innerRef:this.elementRef},a,this.state))}},ht(t,"defaultProps",{measureBeforeMount:!1}),ht(t,"propTypes",{measureBeforeMount:vl.default.bool}),t}(function(e){e.exports=Tt.default,e.exports.utils=B,e.exports.calculateUtils=Me,e.exports.Responsive=Zt.default,e.exports.Responsive.utils=Je,e.exports.WidthProvider=sr.default})(Ur);var _l=Ur.exports;const Il=Rn(_l),dr={type:m.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=k.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:i,subUnitId:u}=o,l={unitId:i,subUnitId:u,cfId:t.cfId},c=s.DeleteConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.DeleteConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:s.DeleteConditionalRuleMutation.id,params:l}]}),d}},ja={type:m.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=e.get(s.ConditionalFormattingRuleModel),i=k.getSheetCommandTarget(a,t);if(!i)return!1;const{unitId:u,subUnitId:l}=i,c=s.transformSupportSymmetryAnchor(t.start,t.end,o.getSubunitRules(u,l)||[],T=>T.cfId);if(!c)return!1;const[d,p]=c,h={unitId:u,subUnitId:l,start:d,end:p},v=s.MoveConditionalRuleMutationUndoFactory(h),y=r.syncExecuteCommand(s.MoveConditionalRuleMutation.id,h);return y&&n.pushUndoRedo({unitID:u,redoMutations:[{id:s.MoveConditionalRuleMutation.id,params:h}],undoMutations:v}),y}},on={cfPreview:"univer-cf-preview"},mt=e=>{var a,o;const t=e.rule;if(!t)return null;const n=_.useMemo(()=>{if(t.type===s.CFRuleType.colorScale){const i=t.config.map((c,d)=>({color:new m.ColorKit(c.color),value:d})),u=i.length-1;return new Array(5).fill("").map((c,d,p)=>d*u/(p.length-1)).map(c=>s.getColorScaleFromValue(i,c))}return null},[t]),r=_.useMemo(()=>{if(t.type===s.CFRuleType.iconSet)return t.config.map(i=>{const u=s.iconMap[i.iconType];return u&&u[Number(i.iconId)]})},[t]);switch(t.type){case s.CFRuleType.dataBar:{const{isGradient:i}=t.config,u={width:"50%",height:"100%"},l=i?`linear-gradient(to right, ${t.config.positiveColor}, rgb(255 255 255))`:t.config.positiveColor,c=i?`linear-gradient(to right, rgb(255 255 255),${t.config.nativeColor})`:t.config.nativeColor;return f.jsxs("div",{className:on.cfPreview,children:[f.jsx("div",{style:{...u,background:c,border:`1px solid ${t.config.nativeColor}`}}),f.jsx("div",{style:{...u,background:l,border:`1px solid ${t.config.positiveColor}`}})]})}case s.CFRuleType.colorScale:return n&&f.jsx("div",{className:on.cfPreview,children:n.map((i,u)=>f.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:i}},u))});case s.CFRuleType.iconSet:return r&&f.jsx("div",{className:on.cfPreview,children:r.map((i,u)=>i?f.jsx("img",{style:{height:"100%"},src:i},u):f.jsx(zt,{},u))});case s.CFRuleType.highlightCell:{const{ul:i,st:u,it:l,bl:c,bg:d,cl:p}=t.style,h=(i==null?void 0:i.s)===m.BooleanNumber.TRUE,v=(u==null?void 0:u.s)===m.BooleanNumber.TRUE,y=l===m.BooleanNumber.TRUE,T=c===m.BooleanNumber.TRUE,x=(a=d==null?void 0:d.rgb)!=null?a:s.DEFAULT_BG_COLOR,w=(o=p==null?void 0:p.rgb)!=null?o:s.DEFAULT_FONT_COLOR,b={fontWeight:T?"bold":void 0,fontStyle:y?"italic":void 0,textDecoration:`${h?"underline":""} ${v?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:x,color:w};return f.jsx("div",{style:b,className:on.cfPreview,children:"123"})}}return null},xl={sheet:{cf:{title:"Conditional Formatting",menu:{manageConditionalFormatting:"Manage Conditional Formatting",createConditionalFormatting:"Create Conditional Formatting",clearRangeRules:"Clear Rules for Selected Range",clearWorkSheetRules:"Clear Rules for Entire Sheet"},form:{lessThan:"The value must be less than {0}",lessThanOrEqual:"The value must be less than or equal to {0}",greaterThan:"The value must be greater than {0}",greaterThanOrEqual:"The value must be greater than or equal to {0}",rangeSelector:"Select Range or Enter Value"},iconSet:{direction:"Direction",shape:"Shape",mark:"Mark",rank:"Rank",rule:"Rule",icon:"Icon",type:"Type",value:"Value",reverseIconOrder:"Reverse Icon Order",and:"And",when:"When",onlyShowIcon:"Only Show Icon"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"Create Rule",clear:"Clear All Rules",range:"Apply Range",styleType:"Style Type",submit:"Submit",cancel:"Cancel",rankAndAverage:"Top/Bottom/Average",styleRule:"Style Rule",isNotBottom:"Top",isBottom:"Bottom",greaterThanAverage:"Greater Than Average",lessThanAverage:"Less Than Average",medianValue:"Median Value",fillType:"Fill Type",pureColor:"Solid Color",gradient:"Gradient",colorSet:"Color Set",positive:"Positive",native:"Negative",workSheet:"Entire Sheet",selectedRange:"Selected Range",managerRuleSelect:"Manage {0} Rules",onlyShowDataBar:"Only Show Data Bars"},preview:{describe:{beginsWith:"Begins with {0}",endsWith:"Ends with {0}",containsText:"Text contains {0}",notContainsText:"Text does not contain {0}",equal:"Equal to {0}",notEqual:"Not equal to {0}",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than {0}",greaterThanOrEqual:"Greater than or equal to {0}",lessThan:"Less than {0}",lessThanOrEqual:"Less than or equal to {0}",notBetween:"Not between {0} and {1}",between:"Between {0} and {1}",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today",topN:"Top {0}",bottomN:"Bottom {0}",topNPercent:"Top {0}%",bottomNPercent:"Bottom {0}%"}},operator:{beginsWith:"Begins with",endsWith:"Ends with",containsText:"Text contains",notContainsText:"Text does not contain",equal:"Equal to",notEqual:"Not equal to",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than",greaterThanOrEqual:"Greater than or equal to",lessThan:"Less than",lessThanOrEqual:"Less than or equal to",notBetween:"Not between",between:"Between",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today"},ruleType:{highlightCell:"Highlight Cell",dataBar:"Data Bar",colorScale:"Color Scale",formula:"Custom Formula",iconSet:"Icon Set",duplicateValues:"Duplicate Values",uniqueValues:"Unique Values"},subRuleType:{uniqueValues:"Unique Values",duplicateValues:"Duplicate Values",rank:"Rank",text:"Text",timePeriod:"Time Period",number:"Number",average:"Average"},valueType:{num:"Number",min:"Minimum",max:"Maximum",percent:"Percentage",percentile:"Percentile",formula:"Formula",none:"None"}}}},La={sheet:{cf:{title:"条件格式",menu:{manageConditionalFormatting:"管理条件格式",createConditionalFormatting:"新建条件格式",clearRangeRules:"清除所选区域的规则",clearWorkSheetRules:"清除整个工作表的规则"},form:{lessThan:"该值必须小于 {0}",lessThanOrEqual:"该值必须小于等于 {0}",greaterThan:"该值必大于 {0}",greaterThanOrEqual:"该值必大于等于 {0}",rangeSelector:"选择范围或者输入值"},iconSet:{direction:"方向",shape:"形状",mark:"标记",rank:"等级",rule:"规则",icon:"图标",type:"类型",value:"值",reverseIconOrder:"反转图标次序",and:"且",when:"当值",onlyShowIcon:"仅显示图标"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"新增规则",clear:"清空所有规则",range:"应用范围",styleType:"样式类型",submit:"确认",cancel:"取消",rankAndAverage:"最前/最后/平均值",styleRule:"样式规则",isNotBottom:"最前",isBottom:"最后",greaterThanAverage:"大于平均值",lessThanAverage:"小于平均值",medianValue:"中间值",fillType:"填充方式",pureColor:"纯色",gradient:"渐变",colorSet:"颜色设置",positive:"正值",native:"负值",workSheet:"整张工作表",selectedRange:"所选单元格",managerRuleSelect:"管理 {0} 的规则",onlyShowDataBar:"仅显示数据条"},preview:{describe:{beginsWith:"开头为{0}",endsWith:"结尾为{0}",containsText:"文本包含{0}",notContainsText:"文本不包含{0}",equal:"等于{0}",notEqual:"不等于{0}",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于{0}",greaterThanOrEqual:"大于等于{0}",lessThan:"小于{0}",lessThanOrEqual:"小于等于{0}",notBetween:"不介于{0}和{1}之间",between:"介于{0}和{1}之间",yesterday:"昨日",tomorrow:"明日",last7Days:"最近7天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日",topN:"前{0}项",bottomN:"后{0}项",topNPercent:"前{0}%",bottomNPercent:"后{0}%"}},operator:{beginsWith:"开头为",endsWith:"结尾为",containsText:"文本包含",notContainsText:"文本不包含",equal:"等于",notEqual:"不等于",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于",greaterThanOrEqual:"大于等于",lessThan:"小于",lessThanOrEqual:"小于等于",notBetween:"不介于",between:"介于",yesterday:"昨日",tomorrow:"明日",last7Days:"最近 7 天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日"},ruleType:{highlightCell:"突出显示单元格",dataBar:"数据条",colorScale:"色阶",formula:"自定义公式",iconSet:"图标集",duplicateValues:"重复值",uniqueValues:"唯一值"},subRuleType:{uniqueValues:"唯一值",duplicateValues:"重复值",rank:"最前最后",text:"文本",timePeriod:"时间日期",number:"数值",average:"平均值"},valueType:{num:"数值",min:"最小值",max:"最大值",percent:"百分比",percentile:"百分点",formula:"公式",none:"无"}}}},El={sheet:{cf:{title:"Условное форматирование",menu:{manageConditionalFormatting:"Управление условным форматированием",createConditionalFormatting:"Создание условного форматирования",clearRangeRules:"Очистить правила для выбранного диапазона",clearWorkSheetRules:"Очистить правила для всего листа"},form:{lessThan:"Значение должно быть меньше {0}",lessThanOrEqual:"Значение должно быть меньше или равно {0}",greaterThan:"Значение должно быть больше {0}",greaterThanOrEqual:"Значение должно быть больше или равно {0}",rangeSelector:"Выберите диапазон или введите значение"},iconSet:{direction:"Направление",shape:"Форма",mark:"Знак",rank:"Ранг",rule:"Правило",icon:"Иконка",type:"Тип",value:"Значение",reverseIconOrder:"Обратный порядок иконок",and:"И",when:"Когда",onlyShowIcon:"Показывать только иконку"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"Создать правило",clear:"Очистить все правила",range:"Применить диапазон",styleType:"Тип стиля",submit:"Подтвердить",cancel:"Отменить",rankAndAverage:"Верх/Низ/Среднее",styleRule:"Правило стиля",isNotBottom:"Верх",isBottom:"Низ",greaterThanAverage:"Больше среднего",lessThanAverage:"Меньше среднего",medianValue:"Медианное значение",fillType:"Тип заполнения",pureColor:"Сплошной цвет",gradient:"Градиент",colorSet:"Набор цветов",positive:"Положительный",native:"Отрицательный",workSheet:"Весь лист",selectedRange:"Выбранный диапазон",managerRuleSelect:"Управление правилами {0}",onlyShowDataBar:"Показывать только гистограммы данных"},preview:{describe:{beginsWith:"Начинается с {0}",endsWith:"Заканчивается на {0}",containsText:"Содержит текст {0}",notContainsText:"Не содержит текст {0}",equal:"Равно {0}",notEqual:"Не равно {0}",containsBlanks:"Содержит пустые ячейки",notContainsBlanks:"Не содержит пустых ячеек",containsErrors:"Содержит ошибки",notContainsErrors:"Не содержит ошибок",greaterThan:"Больше чем {0}",greaterThanOrEqual:"Больше или равно {0}",lessThan:"Меньше чем {0}",lessThanOrEqual:"Меньше или равно {0}",notBetween:"Не между {0} и {1}",between:"Между {0} и {1}",yesterday:"Вчера",tomorrow:"Завтра",last7Days:"Последние 7 дней",thisMonth:"Этот месяц",lastMonth:"Прошлый месяц",nextMonth:"Следующий месяц",thisWeek:"Эта неделя",lastWeek:"Прошлая неделя",nextWeek:"Следующая неделя",today:"Сегодня",topN:"Топ {0}",bottomN:"Низ {0}",topNPercent:"Топ {0}%",bottomNPercent:"Низ {0}%"}},operator:{beginsWith:"Начинается с",endsWith:"Заканчивается на",containsText:"Содержит текст",notContainsText:"Не содержит текст",equal:"Равно",notEqual:"Не равно",containsBlanks:"Содержит пустые ячейки",notContainsBlanks:"Не содержит пустых ячеек",containsErrors:"Содержит ошибки",notContainsErrors:"Не содержит ошибок",greaterThan:"Больше чем",greaterThanOrEqual:"Больше или равно",lessThan:"Меньше чем",lessThanOrEqual:"Меньше или равно",notBetween:"Не между",between:"Между",yesterday:"Вчера",tomorrow:"Завтра",last7Days:"Последние 7 дней",thisMonth:"Этот месяц",lastMonth:"Прошлый месяц",nextMonth:"Следующий месяц",thisWeek:"Эта неделя",lastWeek:"Прошлая неделя",nextWeek:"Следующая неделя",today:"Сегодня"},ruleType:{highlightCell:"Выделение ячеек",dataBar:"Гистограмма данных",colorScale:"Цветовая шкала",formula:"Пользовательская формула",iconSet:"Набор иконок",duplicateValues:"Дублирующиеся значения",uniqueValues:"Уникальные значения"},subRuleType:{uniqueValues:"Уникальные значения",duplicateValues:"Дублирующиеся значения",rank:"Ранг",text:"Текст",timePeriod:"Период времени",number:"Число",average:"Среднее"},valueType:{num:"Число",min:"Минимум",max:"Максимум",percent:"Процент",percentile:"Процентиль",formula:"Формула",none:"Нет"}}}};var Ol=Object.defineProperty,Dl=Object.getOwnPropertyDescriptor,Ml=(e,t,n,r)=>{for(var a=r>1?void 0:r?Dl(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Ol(t,n,a),a},Pl=(e,t)=>(n,r)=>t(n,r,e);let Et=class extends m.Disposable{constructor(t){super();Ge(this,"_initLocal",()=>{this._localeService.load({zhCN:La})});Ge(this,"_findReplaceIndex",t=>{const n=/\{([^}]+)?\}/g,r=[];let a=n.exec(t);for(;a;)r.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=n.exec(t);return r});this._localeService=t,this._initLocal()}tWithReactNode(t,...n){const r=this._localeService.getLocales(),a=t.split("."),o=r&&this._localeService.resolveKeyPath(r,a);if(typeof o=="string"){const i=[];return this._findReplaceIndex(o).forEach((u,l,c)=>{const d=c[l-1]||{startIndex:0,endIndex:-1};if(d.endIndex+1<u.startIndex){const p=o.slice(d.endIndex+1,u.startIndex);p&&i.push(p)}if(n[u.key]&&i.push(n[u.key]),l===c.length-1){const p=o.slice(u.endIndex+1);p&&i.push(p)}}),i}return[]}};Et=Ml([m.OnLifecycle(m.LifecycleStages.Rendered,Et),Pl(0,U.Inject(m.LocaleService))],Et);const Nl=(e=[])=>{const t=te.useDependency(le.IMarkSelectionService);_.useEffect(()=>{const n=e.map(r=>t.addShape({range:r,style:{hasAutoFill:!1,fill:"rgba(73, 184, 17, 0.05)",strokeWidth:1,stroke:"#49B811",widgets:{}},primary:{startColumn:r.startColumn,endColumn:r.endColumn,startRow:r.startRow,endRow:r.endRow,actualRow:r.startRow,actualColumn:r.startColumn,isMerged:!1,isMergedMainCell:!1}}));return()=>{n.forEach(r=>{r&&t.removeShape(r)})}},[e])},ue={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",selectSelector:"univer-select-selector",selectSelectionItem:"univer-select-selection-item",selectSelectionSearchInput:"univer-select-selection-search-input",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap",reactGridItem:"univer-react-grid-item"},jl=(e,t)=>{const n=e.rule;switch(n.type){case s.CFRuleType.colorScale:return t.t("sheet.cf.ruleType.colorScale");case s.CFRuleType.dataBar:return t.t("sheet.cf.ruleType.dataBar");case s.CFRuleType.iconSet:return t.t("sheet.cf.ruleType.iconSet");case s.CFRuleType.highlightCell:switch(n.subType){case s.CFSubRuleType.average:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,t.t("sheet.cf.subRuleType.average"))}case s.CFSubRuleType.duplicateValues:return t.t("sheet.cf.subRuleType.duplicateValues");case s.CFSubRuleType.uniqueValues:return t.t("sheet.cf.subRuleType.uniqueValues");case s.CFSubRuleType.number:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(a=>String(a)):[String(n.value||"")])}case s.CFSubRuleType.text:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case s.CFSubRuleType.timePeriod:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`)}case s.CFSubRuleType.rank:return n.isPercent?n.isBottom?t.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):t.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?t.t("sheet.cf.preview.describe.bottomN",String(n.value)):t.t("sheet.cf.preview.describe.topN",String(n.value));case s.CFSubRuleType.formula:return t.t("sheet.cf.ruleType.formula")}}};let Ua=0;const Ll=e=>{const{onClick:t}=e,n=te.useDependency(s.ConditionalFormattingRuleModel),r=te.useDependency(m.IUniverInstanceService),a=te.useDependency(k.SelectionManagerService),o=te.useDependency(m.ICommandService),i=te.useDependency(m.LocaleService),u=te.useDependency(Et),l=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),c=l.getUnitId(),p=l.getActiveSheet().getSheetId(),[h,v]=_.useState([]),[y,T]=_.useState("2"),[x,w]=_.useState(0),[b,S]=_.useState(-1),[C,g]=_.useState(Ua),E=_.useRef(null),D=[{label:i.t("sheet.cf.panel.workSheet"),value:"2"},{label:i.t("sheet.cf.panel.selectedRange"),value:"1"}],I=()=>{const z=n.getSubunitRules(c,p);if(!z||!z.length)return[];if(y==="1"){const q=a.getLast();if(!q)return[];const ne=q.range;return z.filter(me=>me.ranges.some(Te=>m.Rectangle.intersects(Te,ne)))}else if(y==="2")return z;return[]},[j,L]=_.useState(I);Nl(h),_.useEffect(()=>{const z=o.onCommandExecuted(q=>{q.id===k.SetWorksheetActiveOperation.id&&w(Math.random())});return()=>z.dispose()}),_.useEffect(()=>{L(I)},[y,x,c,p]),_.useEffect(()=>{if(y==="2")return;const z=new Ce.Observable(q=>{const ne=[k.SetSelectionsOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],ce=o.onCommandExecuted(me=>{const{id:Te,params:Re}=me,Le=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(Te)&&Re.unitId===Le&&q.next(null)});return()=>ce.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{L(I)});return()=>{z.unsubscribe()}},[r,y,c,p]),_.useEffect(()=>{const z=n.$ruleChange.subscribe(()=>{w(Math.random())});return()=>z.unsubscribe()},[n]),_.useEffect(()=>{const z=()=>{var me;const ce=Math.max(0,(((me=E.current)==null?void 0:me.getBoundingClientRect().width)||0)-8);return Ua=ce,ce},ne=new Ce.Observable(ce=>{const me=document.querySelector(".univer-sidebar");if(me){let Te=setTimeout(()=>{ce.next()},150);const Re=()=>{Te&&clearTimeout(Te),Te=null},Le=st=>{st.propertyName==="width"&&(Re(),ce.next())};return me.addEventListener("transitionend",Le),()=>{Re(),me.removeEventListener("transitionend",Le)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{g(z())});return()=>{ne.unsubscribe()}},[]);const V=z=>{const q=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId();o.executeCommand(dr.id,{unitId:q,subUnitId:ne,cfId:z.cfId})},F=(z,q)=>{S(q.y)},R=(z,q,ne)=>{S(-1);const ce=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),me=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),Te=st=>{const Ut=j.length;return Math.min(Ut-1,Math.max(0,st))},Re=j[Te(q.y)].cfId,Le=j[Te(ne.y)].cfId;Re!==Le&&o.executeCommand(ja.id,{unitId:ce,subUnitId:me,start:{id:Re,type:"self"},end:{id:Le,type:ne.y>q.y?"after":"before"}})},O=()=>{e.onCreate()},J=()=>{y==="2"?o.executeCommand(Tn.id):y==="1"&&j.map(q=>({unitId:c,subUnitId:p,cfId:q.cfId})).forEach(q=>{o.executeCommand(dr.id,q)})},be=j.map((z,q)=>({i:z.cfId,x:0,w:12,y:q,h:1,isResizable:!1}));return f.jsxs("div",{className:ue.cfRuleList,children:[f.jsxs("div",{className:ue.ruleSelector,children:[f.jsx("div",{children:u.tWithReactNode("sheet.cf.panel.managerRuleSelect",f.jsx(G.Select,{className:ue.select,options:D,value:y,onChange:z=>{T(z)}})).map((z,q)=>f.jsx("span",{children:z},q))}),f.jsxs("div",{className:ue.btnList,children:[f.jsx(G.Tooltip,{title:i.t("sheet.cf.panel.createRule"),placement:"bottom",children:f.jsx("div",{className:`${ue.icon}`,onClick:O,children:f.jsx(qo,{})})}),j.length?f.jsx(G.Tooltip,{title:i.t("sheet.cf.panel.clear"),placement:"bottom",children:f.jsx("div",{className:`${ue.gap} ${ue.icon}`,onClick:J,children:f.jsx(Cn,{})})}):f.jsx("div",{className:`${ue.gap} ${ue.disabled}`,children:f.jsx(Cn,{})})]})]}),f.jsx("div",{ref:E,className:ue.gridLayoutWrap,children:C?f.jsx(Il,{onDragStop:R,onDragStart:F,layout:be,cols:12,rowHeight:60,width:C,margin:[0,10],draggableHandle:".draggableHandle",children:j.map((z,q)=>f.jsx("div",{children:f.jsxs("div",{onMouseMove:()=>{z.ranges!==h&&v(z.ranges)},onMouseLeave:()=>v([]),onClick:()=>t(z),className:`${ue.ruleItem} ${b===q?ue.active:""}`,children:[f.jsx("div",{className:`${ue.draggableHandle} draggableHandle`,onClick:ne=>ne.stopPropagation(),children:f.jsx(Ko,{})}),f.jsxs("div",{className:ue.ruleDescribe,children:[f.jsx("div",{className:ue.ruleType,children:jl(z,i)}),f.jsx("div",{className:ue.ruleRange,children:z.ranges.map(ne=>wr.serializeRange(ne)).join(",")})]}),f.jsx("div",{className:ue.preview,children:f.jsx(mt,{rule:z.rule})}),f.jsx("div",{className:`${ue.deleteItem} ${b===q?ue.active:""}`,onClick:ne=>{ne.stopPropagation(),V(z)},children:f.jsx(Cn,{})})]})},`${z.cfId}`))}):null})]})},Va={type:m.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(e,t){if(!t)return!1;const{rule:n}=t,r=e.get(m.IUndoRedoService),a=e.get(m.ICommandService),o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.IUniverInstanceService),u=k.getSheetCommandTarget(i);if(!u)return!1;const{unitId:l,subUnitId:c}=u,d=o.createCfId(l,c),p={unitId:l,subUnitId:c,rule:{...n,cfId:n.cfId||d}},h=s.AddConditionalRuleMutationUndoFactory(e,p),v=a.syncExecuteCommand(s.AddConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:l,redoMutations:[{id:s.AddConditionalRuleMutation.id,params:p}],undoMutations:[h]}),v}},za={type:m.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=k.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:i,subUnitId:u}=o,l={unitId:i,subUnitId:u,rule:t.rule},c=s.setConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.SetConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:s.SetConditionalRuleMutation.id,params:l}]}),d}},Ul=m.createInterceptorKey("beforeSubmit"),Vl=m.createInterceptorKey("submit"),fr={cfColorPicker:"univer-cf-color-picker",cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},et=e=>{const{color:t,onChange:n,disable:r=!1,iconId:a="PaintBucket",className:o,isNeedDropdownIcon:i=!0}=e,u=te.useDependency(ve.ComponentManager),l=_.useMemo(()=>new m.ColorKit(t),[t]),c=u.get(a);return c&&(r?f.jsx(c,{className:o,extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}):f.jsx(G.Dropdown,{overlay:f.jsx("div",{className:`${fr.cfColorPicker} `,children:f.jsx(G.ColorPicker,{color:t,onChange:n})}),children:f.jsxs("span",{className:`${fr.cfColorPickerIcon} ${o}`,children:[f.jsx(c,{extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}),i&&f.jsx(wn,{className:fr.iconDropdown})]})}))},P={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},tt=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),pr=e=>{const{type:t,className:n,onChange:r,id:a,value:o}=e,i=te.useDependency(m.IUniverInstanceService),u=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),l=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),c=_.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),d=_.useMemo(()=>[s.CFValueType.max,s.CFValueType.min,"none"].includes(t)?{disabled:!0}:[s.CFValueType.percent,s.CFValueType.percentile].includes(t)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[t]);return t===s.CFValueType.formula?f.jsx(ve.TextEditor,{openForSheetSubUnitId:l,openForSheetUnitId:u,id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_colo_scale_${a}`),value:c,style:{maxWidth:"50%",marginLeft:4},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(p="")=>{r(p||"")}}):f.jsx(G.InputNumber,{className:n,value:Number(e.value)||0,onChange:p=>e.onChange(p||0),...d})},zl=e=>{var F;const{interceptorManager:t}=e,n=te.useDependency(m.LocaleService),r=((F=e.rule)==null?void 0:F.type)===s.CFRuleType.colorScale?e.rule:void 0,a=[tt(s.CFValueType.num,n),tt(s.CFValueType.percent,n),tt(s.CFValueType.percentile,n),tt(s.CFValueType.formula,n)],o=[tt(s.CFValueType.min,n),...a],i=[tt("none",n),...a],u=[tt(s.CFValueType.max,n),...a],[l,c]=_.useState(()=>{var O;const R=s.CFValueType.min;return r&&((O=r.config[0])==null?void 0:O.value.type)||R}),[d,p]=_.useState(()=>{var O;const R="none";return!r||r.config.length!==3?R:((O=r.config[1])==null?void 0:O.value.type)||R}),[h,v]=_.useState(()=>{var O;const R=s.CFValueType.max;return r&&((O=r.config[r.config.length-1])==null?void 0:O.value.type)||R}),[y,T]=_.useState(()=>{if(!r)return 10;const O=r.config[0];return(O==null?void 0:O.value.value)===void 0?10:O==null?void 0:O.value.value}),[x,w]=_.useState(()=>{var J;if(!r||r.config.length!==3)return 50;const O=(J=r.config[1])==null?void 0:J.value.value;return O===void 0?50:O}),[b,S]=_.useState(()=>{var J;if(!r)return 90;const O=(J=r.config[r.config.length-1])==null?void 0:J.value.value;return O===void 0?90:O}),[C,g]=_.useState(()=>{var O;const R="#d0d9fb";return r&&((O=r.config[0])==null?void 0:O.color)||R}),[E,D]=_.useState(()=>{var O;const R="#7790f3";return!r||r.config.length!==3?R:((O=r.config[1])==null?void 0:O.color)||R}),[I,j]=_.useState(()=>{var O;const R="#2e55ef";return r&&((O=r.config[r.config.length-1])==null?void 0:O.color)||R}),L=_.useMemo(()=>R=>{const{minType:O,medianType:J,maxType:be,minValue:z,medianValue:q,maxValue:ne,minColor:ce,medianColor:me,maxColor:Te}=R,Re=[];return Re.push({color:ce,value:{type:O,value:z}}),J!=="none"&&Re.push({color:me,value:{type:J,value:q}}),Re.push({color:Te,value:{type:be,value:ne}}),{config:Re.map((st,Ut)=>({...st,index:Ut})),type:s.CFRuleType.colorScale}},[]);_.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return L({minType:l,medianType:d,maxType:h,minValue:y,medianValue:x,maxValue:b,minColor:C,medianColor:E,maxColor:I})}}),[L,l,d,h,y,x,b,C,E,I,t]);const V=R=>{e.onChange(L(R))};return f.jsxs("div",{children:[f.jsx("div",{className:M.title,children:n.t("sheet.cf.panel.styleRule")}),f.jsx("div",{className:`${P.cfPreviewWrap}`,children:f.jsx(mt,{rule:L({minType:l,medianType:d,maxType:h,minValue:y,medianValue:x,maxValue:b,minColor:C,medianColor:E,maxColor:I})})}),f.jsx("div",{className:M.label,children:n.t("sheet.cf.valueType.min")}),f.jsxs("div",{className:`${M.labelContainer} ${M.mTSm}`,children:[f.jsx(G.Select,{options:o,value:l,onChange:R=>{c(R);const O=s.createDefaultValueByValueType(R,10);T(O),V({minType:R,medianType:d,maxType:h,minValue:O,medianValue:x,maxValue:b,minColor:C,medianColor:E,maxColor:I})}}),f.jsx(pr,{id:"min",className:`${M.mLXxs}`,value:y,type:l,onChange:R=>{T(R),V({minType:l,medianType:d,maxType:h,minValue:R,medianValue:x,maxValue:b,minColor:C,medianColor:E,maxColor:I})}}),f.jsx(et,{className:M.mLXxs,color:C,onChange:R=>{g(R),V({minType:l,medianType:d,maxType:h,minValue:y,medianValue:x,maxValue:b,minColor:R,medianColor:E,maxColor:I})}})]}),f.jsx("div",{className:M.label,children:n.t("sheet.cf.panel.medianValue")}),f.jsxs("div",{className:`${M.labelContainer} ${M.mTSm}`,children:[f.jsx(G.Select,{options:i,value:d,onChange:R=>{p(R);const O=s.createDefaultValueByValueType(R,50);w(O),V({minType:l,medianType:R,maxType:h,minValue:y,medianValue:O,maxValue:b,minColor:C,medianColor:E,maxColor:I})}}),f.jsx(pr,{id:"median",className:` ${M.mLXxs}`,value:x,type:d,onChange:R=>{w(R),V({minType:l,medianType:d,maxType:h,minValue:y,medianValue:R,maxValue:b,minColor:C,medianColor:E,maxColor:I})}}),d!=="none"&&f.jsx(et,{className:M.mLXxs,color:E,onChange:R=>{D(R),V({minType:l,medianType:d,maxType:h,minValue:y,medianValue:x,maxValue:b,minColor:C,medianColor:R,maxColor:I})}})]}),f.jsx("div",{className:M.label,children:n.t("sheet.cf.valueType.max")}),f.jsxs("div",{className:`${M.labelContainer} ${M.mTSm}`,children:[f.jsx(G.Select,{options:u,value:h,onChange:R=>{v(R);const O=s.createDefaultValueByValueType(R,90);S(O),V({minType:l,medianType:d,maxType:R,minValue:y,medianValue:x,maxValue:O,minColor:C,medianColor:E,maxColor:I})}}),f.jsx(pr,{id:"max",className:`${M.mLXxs}`,value:b,type:h,onChange:R=>{S(R),V({minType:l,medianType:d,maxType:h,minValue:y,medianValue:x,maxValue:R,minColor:C,medianColor:E,maxColor:I})}}),f.jsx(et,{className:M.mLXxs,color:I,onChange:R=>{j(R),V({minType:l,medianType:d,maxType:h,minValue:y,medianValue:x,maxValue:b,minColor:C,medianColor:E,maxColor:R})}})]})]})},gt=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),Aa=e=>{const{onChange:t,className:n,value:r,type:a,id:o,disabled:i=!1}=e,u=te.useDependency(m.IUniverInstanceService),l=u.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),c=u.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),d=_.useRef(r),p=_.useMemo(()=>[s.CFValueType.percentile,s.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===s.CFValueType.formula){const h=String(d.current).startsWith("=")?String(d.current)||"":"=";return f.jsx(ve.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_data_bar_${o}`),value:h,openForSheetSubUnitId:c,openForSheetUnitId:l,style:{width:"47%",marginLeft:14},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(v="")=>{t(v||"")}})}return f.jsx(G.InputNumber,{className:n,value:Number(r)||0,disabled:i,onChange:h=>{t(h||0)},...p})},Al=e=>{var F;const{interceptorManager:t}=e,n=te.useDependency(m.LocaleService),r=((F=e.rule)==null?void 0:F.type)===s.CFRuleType.dataBar?e.rule:void 0,[a,o]=_.useState(()=>{var O;const R="0";return r?(O=r.config)!=null&&O.isGradient?"1":"0":R}),[i,u]=_.useState(()=>{var O;const R="#abd91a";return r&&((O=r.config)==null?void 0:O.positiveColor)||R}),[l,c]=_.useState(()=>{var O;const R="#ffbe38";return r&&((O=r.config)==null?void 0:O.nativeColor)||R}),d=[gt(s.CFValueType.num,n),gt(s.CFValueType.percent,n),gt(s.CFValueType.percentile,n),gt(s.CFValueType.formula,n)],p=[gt(s.CFValueType.min,n),...d],h=[gt(s.CFValueType.max,n),...d],[v,y]=_.useState(()=>{var O;const R=p[0].value;return r&&((O=r.config)==null?void 0:O.min.type)||R}),[T,x]=_.useState(()=>{var O;const R=h[0].value;return r&&((O=r.config)==null?void 0:O.max.type)||R}),[w,b]=_.useState(()=>{var J;if(!r)return 0;const O=((J=r.config)==null?void 0:J.min)||{};return O.type===s.CFValueType.formula?O.value||"=":O.value||0}),[S,C]=_.useState(()=>{var J;if(!r)return 100;const O=((J=r.config)==null?void 0:J.max)||{};return O.type===s.CFValueType.formula?O.value||"=":O.value===void 0?100:O.value}),[g,E]=_.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),D=R=>({config:{min:{type:R.minValueType,value:R.minValue},max:{type:R.maxValueType,value:R.maxValue},isGradient:R.isGradient==="1",positiveColor:R.positiveColor,nativeColor:R.nativeColor},type:s.CFRuleType.dataBar,isShowValue:R.isShowValue});_.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return D({isGradient:a,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})}}),[a,w,v,S,T,i,l,t,g]);const I=R=>{e.onChange(D(R))},j=R=>{u(R),I({isGradient:a,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:R,nativeColor:l,isShowValue:g})},L=R=>{c(R),I({isGradient:a,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:R,isShowValue:g})},V=R=>d.map(O=>O.value).includes(R);return f.jsxs("div",{children:[f.jsx("div",{className:M.title,children:n.t("sheet.cf.panel.styleRule")}),f.jsx("div",{className:`${P.cfPreviewWrap}`,children:f.jsx(mt,{rule:D({isGradient:a,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})})}),f.jsxs("div",{children:[f.jsx("div",{className:M.label,children:n.t("sheet.cf.panel.fillType")}),f.jsxs("div",{className:`${M.mTSm} ${M.mLXxs} ${M.labelContainer} `,children:[f.jsxs(G.RadioGroup,{value:a,onChange:R=>{o(R),I({isGradient:R,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})},children:[f.jsx(G.Radio,{value:"0",children:f.jsx("span",{className:P.text,children:n.t("sheet.cf.panel.pureColor")})}),f.jsx(G.Radio,{value:"1",children:f.jsx("span",{className:P.text,children:n.t("sheet.cf.panel.gradient")})})]}),f.jsxs("div",{className:`${P.utilItem} ${M.mLXl}`,children:[f.jsx(G.Checkbox,{checked:!g,onChange:R=>{E(!R),I({isGradient:R,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:!R})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),f.jsxs("div",{children:[f.jsx("div",{className:M.label,children:n.t("sheet.cf.panel.colorSet")}),f.jsxs("div",{className:`${M.labelContainer} ${M.mTSm} ${M.mLXxs}`,children:[f.jsxs("div",{className:`${M.labelContainer}`,children:[f.jsx("div",{className:`${P.text}`,children:n.t("sheet.cf.panel.native")}),f.jsx(et,{color:l,onChange:L})]}),f.jsxs("div",{className:`${M.labelContainer} ${M.mLSm} `,children:[f.jsx("div",{className:`${P.text} `,children:n.t("sheet.cf.panel.positive")}),f.jsx(et,{color:i,onChange:j})]})]})]}),f.jsxs("div",{children:[f.jsx("div",{className:M.label,children:n.t("sheet.cf.valueType.min")}),f.jsxs("div",{className:`${M.mTSm} ${M.labelContainer}`,children:[f.jsx(G.Select,{options:p,value:v,onChange:R=>{y(R);const O=s.createDefaultValueByValueType(R,10);b(O),I({isGradient:a,minValue:O,minValueType:R,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})}}),f.jsx(Aa,{disabled:!V(v),id:"min",type:v,className:M.mLSm,value:w,onChange:R=>{b(R||0),I({isGradient:a,minValue:R||0,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})}})]}),f.jsx("div",{className:M.label,children:n.t("sheet.cf.valueType.max")}),f.jsxs("div",{className:`${M.mTSm} ${M.labelContainer}`,children:[f.jsx(G.Select,{options:h,value:T,onChange:R=>{x(R);const O=s.createDefaultValueByValueType(R,90);C(O),I({isGradient:a,minValue:w,minValueType:v,maxValue:O,maxValueType:R,positiveColor:i,nativeColor:l,isShowValue:g})}}),f.jsx(Aa,{disabled:!V(T),id:"max",type:T,className:M.mLSm,value:S,onChange:R=>{C(R||0),I({isGradient:a,minValue:w,minValueType:v,maxValue:R||0,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})}})]})]})]})},ke={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},sn=e=>[m.BooleanNumber.FALSE,void 0].includes(e)?m.BooleanNumber.TRUE:m.BooleanNumber.FALSE,ln=e=>e!==m.BooleanNumber.FALSE,hr=e=>{const{style:t,onChange:n,className:r}=e,a=te.useDependency(ve.ComponentManager),[o,i]=_.useState(()=>{if(t!=null&&t.bl)return t.bl}),[u,l]=_.useState(()=>{if(t!=null&&t.it)return t.it}),[c,d]=_.useState(()=>{if(t!=null&&t.ul)return t.ul.s}),[p,h]=_.useState(()=>{if(t!=null&&t.st)return t.st.s}),[v,y]=_.useState(()=>{var E;const g="#2f56ef";return(E=t==null?void 0:t.cl)!=null&&E.rgb?t.cl.rgb:g}),[T,x]=_.useState(()=>{var E;const g="#e8ecfc";return(E=t==null?void 0:t.bg)!=null&&E.rgb?t.bg.rgb:g}),w=a.get("BoldSingle"),b=a.get("ItalicSingle"),S=a.get("UnderlineSingle"),C=a.get("StrikethroughSingle");return _.useEffect(()=>{const g={bl:o,it:u};v!==void 0&&(g.cl={rgb:v}),T!==void 0&&(g.bg={rgb:T}),p!==void 0&&(g.st={s:p}),c!==void 0&&(g.ul={s:c}),n(s.removeUndefinedAttr(g))},[o,u,c,p,v,T]),f.jsxs("div",{className:`${ke.cfStyleEdit} ${r}`,children:[w&&f.jsx("div",{className:He({[ke.isActive]:ln(o||m.BooleanNumber.FALSE)},ke.buttonItem),onClick:()=>i(sn(o)),children:f.jsx(w,{})}),b&&f.jsx("div",{className:He({[ke.isActive]:ln(u||m.BooleanNumber.FALSE)},ke.buttonItem),onClick:()=>l(sn(u)),children:f.jsx(b,{})}),S&&f.jsx("div",{className:He({[ke.isActive]:ln(c||m.BooleanNumber.FALSE)},ke.buttonItem),onClick:()=>d(sn(c)),children:f.jsx(S,{})}),C&&f.jsx("div",{className:He({[ke.isActive]:ln(p||m.BooleanNumber.FALSE)},ke.buttonItem),onClick:()=>h(sn(p)),children:f.jsx(C,{})}),f.jsx(et,{color:v,onChange:y,iconId:"FontColor"}),f.jsx(et,{color:T,onChange:x,iconId:"PaintBucket"})]})},Wl=e=>{var x;const{onChange:t,interceptorManager:n}=e,r=te.useDependency(m.LocaleService),a=((x=e.rule)==null?void 0:x.type)===s.CFRuleType.highlightCell?e.rule:void 0,o=[{label:r.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:r.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:r.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:r.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[i,u]=_.useState(()=>{const w=o[0].value,b=a==null?void 0:a.type;if(!a)return w;switch(b){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.average:return[s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":w;case s.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return w}),[l,c]=_.useState(()=>{const b=a==null?void 0:a.type;if(!a)return 10;switch(b){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.rank:return a.value||10}}return 10}),[d,p]=_.useState(()=>{const b=a==null?void 0:a.type;if(!a)return!1;switch(b){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[h,v]=_.useState({}),y=w=>{const{type:b,isPercent:S,value:C,style:g}=w;if(b==="isNotBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:S,isBottom:!1,value:C,style:g};if(b==="isBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:S,isBottom:!0,value:C,style:g};if(b==="greaterThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.greaterThan,style:g};if(b==="lessThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.lessThan,style:g}};_.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return y({type:i,isPercent:d,value:l,style:h})}}),[i,d,l,h,n]);const T=w=>{t(y(w))};return f.jsxs("div",{children:[f.jsx("div",{className:`${M.title} ${M.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),f.jsx(G.Select,{className:`${P.width100} ${M.mTSm}`,value:i,options:o,onChange:w=>{u(w),T({type:w,isPercent:d,value:l,style:h})}}),["isNotBottom","isBottom"].includes(i)&&f.jsxs("div",{className:`${M.labelContainer} ${M.mTSm}`,children:[f.jsx(G.InputNumber,{min:1,max:1e3,value:l,onChange:w=>{const b=w||0;c(b),T({type:i,isPercent:d,value:b,style:h})}}),f.jsxs("div",{className:`${M.mLSm} ${M.labelContainer} ${P.text}`,children:[f.jsx(G.Checkbox,{checked:d,onChange:w=>{p(!!w),T({type:i,isPercent:!!w,value:l,style:h})}}),r.t("sheet.cf.valueType.percent")]})]}),f.jsx("div",{className:`${P.cfPreviewWrap} `,children:f.jsx(mt,{rule:y({type:i,isPercent:d,value:l,style:h})})}),f.jsx(hr,{style:a==null?void 0:a.style,className:`${M.mTSm} `,onChange:w=>{v(w),T({type:i,isPercent:d,value:l,style:w})}})]})},Q=(e,t)=>({label:t.t(`sheet.cf.operator.${e}`),value:e}),kl=e=>{const{type:t,operator:n,onChange:r,value:a}=e,[o,i]=_.useState(()=>typeof a=="number"?a:0),[u,l]=_.useState(()=>typeof a=="string"?a:""),[c,d]=_.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[p,h]=_.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100);switch(_.useEffect(()=>{switch(t){case s.CFSubRuleType.text:{[s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)&&r(u);break}case s.CFSubRuleType.number:{[s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)&&r(o),[s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)&&r([c,p]);break}}},[t]),t){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)){const v=y=>{l(y),r(y)};return f.jsx("div",{className:`${M.mTSm}`,children:f.jsx(G.Input,{className:P.width100,value:u,onChange:v})})}break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)){const v=y=>{i(y||0),r(y||0)};return f.jsx("div",{className:`${M.mTSm}`,children:f.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:P.width100,value:o,onChange:v})})}if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)){const v=T=>{d(T||0),r([T||0,p])},y=T=>{h(T||0),r([c,T||0])};return f.jsxs("div",{className:`${M.mTSm} ${M.labelContainer} `,children:[f.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:c,onChange:v}),f.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`${M.mLSm}`,value:p,onChange:y})]})}}}return null},Wa=(e,t)=>{switch(e){case s.CFSubRuleType.text:return[Q(s.CFTextOperator.containsText,t),Q(s.CFTextOperator.notContainsText,t),Q(s.CFTextOperator.beginsWith,t),Q(s.CFTextOperator.endsWith,t),Q(s.CFTextOperator.equal,t),Q(s.CFTextOperator.notEqual,t),Q(s.CFTextOperator.containsBlanks,t),Q(s.CFTextOperator.notContainsBlanks,t),Q(s.CFTextOperator.containsErrors,t),Q(s.CFTextOperator.notContainsErrors,t)];case s.CFSubRuleType.number:return[Q(s.CFNumberOperator.between,t),Q(s.CFNumberOperator.notBetween,t),Q(s.CFNumberOperator.equal,t),Q(s.CFNumberOperator.notEqual,t),Q(s.CFNumberOperator.greaterThan,t),Q(s.CFNumberOperator.greaterThanOrEqual,t),Q(s.CFNumberOperator.lessThan,t),Q(s.CFNumberOperator.lessThanOrEqual,t)];case s.CFSubRuleType.timePeriod:return[Q(s.CFTimePeriodOperator.yesterday,t),Q(s.CFTimePeriodOperator.today,t),Q(s.CFTimePeriodOperator.tomorrow,t),Q(s.CFTimePeriodOperator.last7Days,t),Q(s.CFTimePeriodOperator.lastWeek,t),Q(s.CFTimePeriodOperator.thisWeek,t),Q(s.CFTimePeriodOperator.nextWeek,t),Q(s.CFTimePeriodOperator.lastMonth,t),Q(s.CFTimePeriodOperator.thisMonth,t),Q(s.CFTimePeriodOperator.nextMonth,t)]}},ka=e=>{var C;const{interceptorManager:t,onChange:n}=e,r=te.useDependency(m.LocaleService),a=((C=e.rule)==null?void 0:C.type)===s.CFRuleType.highlightCell?e.rule:void 0,[o,i]=_.useState(()=>{const g=s.CFSubRuleType.text;return a&&a.subType||g}),u=[{value:s.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:s.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:s.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:s.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:s.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],l=_.useMemo(()=>Wa(o,r),[o]),[c,d]=_.useState(()=>{const g=l?l[0].value:void 0;return a&&a.operator||g}),[p,h]=_.useState(()=>{var D;const g="";return a?(D=a.value)!=null?D:s.createDefaultValue(a.subType,a.operator):g}),[v,y]=_.useState({}),T=_.useMemo(()=>g=>{var E,D,I,j,L,V,F,R,O,J,be,z,q,ne,ce;switch(g.subType||o){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(c))return{type:s.CFRuleType.highlightCell,subType:(E=g.subType)!=null?E:o,operator:(D=g.operator)!=null?D:c,style:(I=g.style)!=null?I:v,value:(j=g.value)!=null?j:p};break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(c))return{type:s.CFRuleType.highlightCell,subType:(L=g.subType)!=null?L:o,operator:(V=g.operator)!=null?V:c,style:(F=g.style)!=null?F:v,value:(R=g.value)!=null?R:p};if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(c))return{type:s.CFRuleType.highlightCell,subType:(O=g.subType)!=null?O:o,operator:(J=g.operator)!=null?J:c,style:(be=g.style)!=null?be:v,value:(z=g.value)!=null?z:p};break}}return{type:s.CFRuleType.highlightCell,subType:(q=g.subType)!=null?q:o,operator:(ne=g.operator)!=null?ne:c,style:(ce=g.style)!=null?ce:v}},[o,c,p,v]);_.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return T({})}}),[T,t]),_.useEffect(()=>{u.some(g=>g.value===o)||i(u[0].value)},[u]);const x=g=>{const E=g,D=Wa(E,r),I=D&&D[0].value;i(E),d(I),I&&h(s.createDefaultValue(E,I)),n(T({subType:E,operator:I}))},w=g=>{const E=g;d(E),n(T({operator:E}))},b=g=>{h(g),n(T({value:g}))},S=_.useMemo(()=>`${o}_${c}_${Math.random()}`,[o,c]);return f.jsxs("div",{children:[f.jsx("div",{className:`${M.title} ${M.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),f.jsx(G.Select,{className:`${M.mTSm} ${P.width100}`,onChange:x,value:o,options:u}),(l==null?void 0:l.length)&&f.jsx(G.Select,{className:`${M.mTSm} ${P.width100}`,onChange:w,value:c||"",options:l}),f.jsx(kl,{value:p,interceptorManager:t,type:o,operator:c,rule:a,onChange:b},S),f.jsx("div",{className:`${P.cfPreviewWrap}`,children:f.jsx(mt,{rule:T({})})}),f.jsx(hr,{style:a==null?void 0:a.style,className:`${M.mLXxs}`,onChange:g=>{y(g),n(T({style:g}))}})]})},Hl=e=>{var y;const{onChange:t,interceptorManager:n}=e,r=te.useDependency(m.LocaleService),o=te.useDependency(m.IUniverInstanceService).getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),i=o.getActiveSheet(),u=((y=e.rule)==null?void 0:y.type)===s.CFRuleType.highlightCell?e.rule:void 0,[l,c]=_.useState({}),[d,p]=_.useState(()=>(u==null?void 0:u.subType)===s.CFSubRuleType.formula?u.value:"="),h=T=>({style:T.style,value:d,type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula});_.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return h({style:l,formula:d})}}),[l,d,n]);const v=T=>{t(h(T))};return f.jsxs("div",{children:[f.jsx("div",{className:`${M.title} ${M.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),f.jsx("div",{className:`${M.mTSm}`,children:f.jsx(ve.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_formula`),openForSheetSubUnitId:i.getSheetId(),openForSheetUnitId:o.getUnitId(),value:d,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(T="")=>{const x=T||"";p(x),v({style:l,formula:x})}})}),f.jsx("div",{className:`${P.cfPreviewWrap} `,children:f.jsx(mt,{rule:h({style:l,formula:d})})}),f.jsx(hr,{style:u==null?void 0:u.style,className:`${M.mTSm} `,onChange:T=>{c(T),v({style:T,formula:d})}})]})};var $l="Expected a function",Ha="__lodash_hash_undefined__",$a=1/0,Bl=9007199254740991,Fl="[object Function]",Gl="[object GeneratorFunction]",ql="[object Symbol]",Xl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yl=/^\w*$/,Kl=/^\./,Zl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jl=/[\\^$.*+?()[\]{}|]/g,Ql=/\\(\\)?/g,eu=/^\[object .+?Constructor\]$/,tu=/^(?:0|[1-9]\d*)$/,nu=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,ru=typeof self=="object"&&self&&self.Object===Object&&self,mr=nu||ru||Function("return this")();function au(e,t){return e==null?void 0:e[t]}function ou(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var iu=Array.prototype,su=Function.prototype,Ba=Object.prototype,gr=mr["__core-js_shared__"],Fa=function(){var e=/[^.]+$/.exec(gr&&gr.keys&&gr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ga=su.toString,un=Ba.hasOwnProperty,qa=Ba.toString,lu=RegExp("^"+Ga.call(un).replace(Jl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xa=mr.Symbol,uu=iu.splice,cu=Za(mr,"Map"),Ot=Za(Object,"create"),Ya=Xa?Xa.prototype:void 0,Ka=Ya?Ya.toString:void 0;function nt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function du(){this.__data__=Ot?Ot(null):{}}function fu(e){return this.has(e)&&delete this.__data__[e]}function pu(e){var t=this.__data__;if(Ot){var n=t[e];return n===Ha?void 0:n}return un.call(t,e)?t[e]:void 0}function hu(e){var t=this.__data__;return Ot?t[e]!==void 0:un.call(t,e)}function mu(e,t){var n=this.__data__;return n[e]=Ot&&t===void 0?Ha:t,this}nt.prototype.clear=du,nt.prototype.delete=fu,nt.prototype.get=pu,nt.prototype.has=hu,nt.prototype.set=mu;function vt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function gu(){this.__data__=[]}function vu(e){var t=this.__data__,n=cn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():uu.call(t,n,1),!0}function yu(e){var t=this.__data__,n=cn(t,e);return n<0?void 0:t[n][1]}function Su(e){return cn(this.__data__,e)>-1}function bu(e,t){var n=this.__data__,r=cn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}vt.prototype.clear=gu,vt.prototype.delete=vu,vt.prototype.get=yu,vt.prototype.has=Su,vt.prototype.set=bu;function rt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Tu(){this.__data__={hash:new nt,map:new(cu||vt),string:new nt}}function Ru(e){return dn(this,e).delete(e)}function Cu(e){return dn(this,e).get(e)}function wu(e){return dn(this,e).has(e)}function _u(e,t){return dn(this,e).set(e,t),this}rt.prototype.clear=Tu,rt.prototype.delete=Ru,rt.prototype.get=Cu,rt.prototype.has=wu,rt.prototype.set=_u;function Iu(e,t,n){var r=e[t];(!(un.call(e,t)&&Ja(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function cn(e,t){for(var n=e.length;n--;)if(Ja(e[n][0],t))return n;return-1}function xu(e){if(!fn(e)||ju(e))return!1;var t=zu(e)||ou(e)?lu:eu;return t.test(Vu(e))}function Eu(e,t,n,r){if(!fn(e))return e;t=Pu(t,e)?[t]:Du(t);for(var a=-1,o=t.length,i=o-1,u=e;u!=null&&++a<o;){var l=Uu(t[a]),c=n;if(a!=i){var d=u[l];c=r?r(d,l,u):void 0,c===void 0&&(c=fn(d)?d:Mu(t[a+1])?[]:{})}Iu(u,l,c),u=u[l]}return e}function Ou(e){if(typeof e=="string")return e;if(yr(e))return Ka?Ka.call(e):"";var t=e+"";return t=="0"&&1/e==-$a?"-0":t}function Du(e){return Qa(e)?e:Lu(e)}function dn(e,t){var n=e.__data__;return Nu(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Za(e,t){var n=au(e,t);return xu(n)?n:void 0}function Mu(e,t){return t=t==null?Bl:t,!!t&&(typeof e=="number"||tu.test(e))&&e>-1&&e%1==0&&e<t}function Pu(e,t){if(Qa(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||yr(e)?!0:Yl.test(e)||!Xl.test(e)||t!=null&&e in Object(t)}function Nu(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ju(e){return!!Fa&&Fa in e}var Lu=vr(function(e){e=Wu(e);var t=[];return Kl.test(e)&&t.push(""),e.replace(Zl,function(n,r,a,o){t.push(a?o.replace(Ql,"$1"):r||n)}),t});function Uu(e){if(typeof e=="string"||yr(e))return e;var t=e+"";return t=="0"&&1/e==-$a?"-0":t}function Vu(e){if(e!=null){try{return Ga.call(e)}catch{}try{return e+""}catch{}}return""}function vr(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError($l);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i),i};return n.cache=new(vr.Cache||rt),n}vr.Cache=rt;function Ja(e,t){return e===t||e!==e&&t!==t}var Qa=Array.isArray;function zu(e){var t=fn(e)?qa.call(e):"";return t==Fl||t==Gl}function fn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Au(e){return!!e&&typeof e=="object"}function yr(e){return typeof e=="symbol"||Au(e)&&qa.call(e)==ql}function Wu(e){return e==null?"":Ou(e)}function ku(e,t,n){return e==null?e:Eu(e,t,n)}var Hu=ku;const $u=Rn(Hu);var Bu="Expected a function",eo="__lodash_hash_undefined__",to=1/0,Fu="[object Function]",Gu="[object GeneratorFunction]",qu="[object Symbol]",Xu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yu=/^\w*$/,Ku=/^\./,Zu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ju=/[\\^$.*+?()[\]{}|]/g,Qu=/\\(\\)?/g,ec=/^\[object .+?Constructor\]$/,tc=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,nc=typeof self=="object"&&self&&self.Object===Object&&self,Sr=tc||nc||Function("return this")();function rc(e,t){return e==null?void 0:e[t]}function ac(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var oc=Array.prototype,ic=Function.prototype,no=Object.prototype,br=Sr["__core-js_shared__"],ro=function(){var e=/[^.]+$/.exec(br&&br.keys&&br.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ao=ic.toString,Tr=no.hasOwnProperty,oo=no.toString,sc=RegExp("^"+ao.call(Tr).replace(Ju,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),io=Sr.Symbol,lc=oc.splice,uc=uo(Sr,"Map"),Dt=uo(Object,"create"),so=io?io.prototype:void 0,lo=so?so.toString:void 0;function at(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function cc(){this.__data__=Dt?Dt(null):{}}function dc(e){return this.has(e)&&delete this.__data__[e]}function fc(e){var t=this.__data__;if(Dt){var n=t[e];return n===eo?void 0:n}return Tr.call(t,e)?t[e]:void 0}function pc(e){var t=this.__data__;return Dt?t[e]!==void 0:Tr.call(t,e)}function hc(e,t){var n=this.__data__;return n[e]=Dt&&t===void 0?eo:t,this}at.prototype.clear=cc,at.prototype.delete=dc,at.prototype.get=fc,at.prototype.has=pc,at.prototype.set=hc;function yt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function mc(){this.__data__=[]}function gc(e){var t=this.__data__,n=pn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():lc.call(t,n,1),!0}function vc(e){var t=this.__data__,n=pn(t,e);return n<0?void 0:t[n][1]}function yc(e){return pn(this.__data__,e)>-1}function Sc(e,t){var n=this.__data__,r=pn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}yt.prototype.clear=mc,yt.prototype.delete=gc,yt.prototype.get=vc,yt.prototype.has=yc,yt.prototype.set=Sc;function ot(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function bc(){this.__data__={hash:new at,map:new(uc||yt),string:new at}}function Tc(e){return hn(this,e).delete(e)}function Rc(e){return hn(this,e).get(e)}function Cc(e){return hn(this,e).has(e)}function wc(e,t){return hn(this,e).set(e,t),this}ot.prototype.clear=bc,ot.prototype.delete=Tc,ot.prototype.get=Rc,ot.prototype.has=Cc,ot.prototype.set=wc;function pn(e,t){for(var n=e.length;n--;)if(Lc(e[n][0],t))return n;return-1}function _c(e,t){t=Oc(t,e)?[t]:Ec(t);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Nc(t[n++])];return n&&n==r?e:void 0}function Ic(e){if(!fo(e)||Mc(e))return!1;var t=Uc(e)||ac(e)?sc:ec;return t.test(jc(e))}function xc(e){if(typeof e=="string")return e;if(Cr(e))return lo?lo.call(e):"";var t=e+"";return t=="0"&&1/e==-to?"-0":t}function Ec(e){return co(e)?e:Pc(e)}function hn(e,t){var n=e.__data__;return Dc(t)?n[typeof t=="string"?"string":"hash"]:n.map}function uo(e,t){var n=rc(e,t);return Ic(n)?n:void 0}function Oc(e,t){if(co(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Cr(e)?!0:Yu.test(e)||!Xu.test(e)||t!=null&&e in Object(t)}function Dc(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Mc(e){return!!ro&&ro in e}var Pc=Rr(function(e){e=zc(e);var t=[];return Ku.test(e)&&t.push(""),e.replace(Zu,function(n,r,a,o){t.push(a?o.replace(Qu,"$1"):r||n)}),t});function Nc(e){if(typeof e=="string"||Cr(e))return e;var t=e+"";return t=="0"&&1/e==-to?"-0":t}function jc(e){if(e!=null){try{return ao.call(e)}catch{}try{return e+""}catch{}}return""}function Rr(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(Bu);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i),i};return n.cache=new(Rr.Cache||ot),n}Rr.Cache=ot;function Lc(e,t){return e===t||e!==e&&t!==t}var co=Array.isArray;function Uc(e){var t=fo(e)?oo.call(e):"";return t==Fu||t==Gu}function fo(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Vc(e){return!!e&&typeof e=="object"}function Cr(e){return typeof e=="symbol"||Vc(e)&&oo.call(e)==qu}function zc(e){return e==null?"":xc(e)}function Ac(e,t,n){var r=e==null?void 0:_c(e,t);return r===void 0?n:r}var Wc=Ac;const kc=Rn(Wc),po=(e,t)=>(s.iconMap[e]||[])[Number(t)]||"",Hc=e=>{const t=te.useDependency(m.IUniverInstanceService),n=t.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=t.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),a=_.useMemo(()=>e.error?P.errorInput:"",[e.error]);return f.jsx("div",{className:P.positionRelative,children:e.type!==s.CFValueType.formula?f.jsxs(f.Fragment,{children:[f.jsx(G.InputNumber,{className:a,value:Number(e.value)||0,onChange:o=>e.onChange(o!=null?o:0)}),e.error&&f.jsx("div",{className:P.errorText,children:e.error})]}):f.jsx(ve.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_icon_set_${e.id}`),value:String(e.value).startsWith("=")?String(e.value):"=",openForSheetSubUnitId:r,openForSheetUnitId:n,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(o="")=>{const i=o||"";e.onChange(i)}})})},ho=(e,t,n)=>({operator:s.CFNumberOperator.greaterThan,value:{type:s.CFValueType.num,value:(n.length-1-t)*10},iconType:e,iconId:String(t)}),$c=e=>{const t=te.useDependency(m.LocaleService),n=r=>{e.onClick(r)};return f.jsx("div",{className:P.iconGroupList,children:s.iconGroup.map((r,a)=>f.jsxs("div",{className:P.group,children:[f.jsx("div",{className:P.title,children:t.t(r.title)}),f.jsx("div",{className:P.itemContent,children:r.group.map(o=>f.jsx("div",{className:P.itemWrap,onClick:()=>{n(o.name)},children:f.jsx("div",{className:P.item,children:o.list.map((i,u)=>f.jsx("img",{className:P.icon,src:i},u))})},o.name))})]},a))})},Bc=e=>{const t=_.useMemo(()=>{const r=[];for(const a in s.iconMap){const o=s.iconMap[a],i=a;o.forEach((u,l)=>{r.push({iconType:i,base64:u,iconId:String(l)})})}return r},[]),n=r=>{e.onClick(r.iconType,r.iconId)};return f.jsxs("div",{className:P.iconItemListWrap,children:[f.jsxs("div",{className:P.none,onClick:()=>n({iconType:s.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[f.jsx(zt,{className:P.icon}),f.jsx("span",{children:"无单元格图标"})]}),f.jsx("div",{className:P.iconItemList,children:t.map(r=>f.jsx("div",{className:P.item,children:f.jsx("img",{onClick:()=>n(r),className:`${P.icon}`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Fc=e=>{const{onChange:t,configList:n,errorMap:r={}}=e,a=te.useDependency(m.LocaleService),o=[{label:a.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThan}`),value:s.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThanOrEqual}`),value:s.CFNumberOperator.greaterThanOrEqual}],i=[{label:a.t(`sheet.cf.valueType.${s.CFValueType.num}`),value:s.CFValueType.num},{label:a.t(`sheet.cf.valueType.${s.CFValueType.percent}`),value:s.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${s.CFValueType.percentile}`),value:s.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${s.CFValueType.formula}`),value:s.CFValueType.formula}],u=(p,h)=>{t([String(h),"value","value"],p)},l=(p,h)=>{t([String(h),"operator"],p);const v=s.createDefaultValue(s.CFSubRuleType.number,p);u(v,h)},c=(p,h)=>{t([String(h),"value","type"],p)};return _.useMemo(()=>n.map((p,h)=>{const v=r[h],y=po(p.iconType,p.iconId),T=h===n.length-1,x=h===0,w=n[h-1],b=(w==null?void 0:w.value.type)===s.CFValueType.formula?a.t("sheet.cf.valueType.formula"):w==null?void 0:w.value.value,S=(C,g)=>{const E={...p,iconId:g,iconType:C};t([String(h)],E)};return f.jsxs("div",{className:`${h?M.mTXl:M.mTSm}`,children:[f.jsxs("div",{className:`${M.label} ${P.flex}`,children:[f.jsxs("div",{className:`${P.width45}`,children:[a.t("sheet.cf.iconSet.icon"),h+1]}),f.jsx("div",{className:`${P.width45}`,children:f.jsxs(f.Fragment,{children:[!x&&!T&&a.t("sheet.cf.iconSet.rule"),!x&&!T&&f.jsxs("span",{className:P.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${s.getOppositeOperator(w.operator)}`),b,T?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),f.jsxs("div",{className:`${P.flex} ${M.mTSm}`,children:[f.jsx("div",{className:`${P.iconWrap} ${P.width45}`,children:f.jsx(G.Dropdown,{overlay:f.jsx(Bc,{onClick:S,iconId:p.iconId,iconType:p.iconType}),children:f.jsxs("div",{className:P.dropdownIcon,children:[y?f.jsx("img",{src:y,className:P.icon}):f.jsx(zt,{className:P.icon}),f.jsx(wn,{})]})})}),T?f.jsxs("div",{className:`${P.width45} ${M.label}`,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),f.jsxs("span",{className:P.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${s.getOppositeOperator(w.operator)}`),b,T?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]}):f.jsx(G.Select,{className:`${M.mL0} ${P.width45} ${M.mR0}`,options:o,value:p.operator,onChange:C=>{l(C,h)}})]}),T?f.jsx("div",{}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:`${M.mTSm} ${M.label} ${P.flex}`,children:[f.jsx("div",{className:`${P.width45}`,children:a.t("sheet.cf.iconSet.type")}),f.jsx("div",{className:`${P.width45}`,children:a.t("sheet.cf.iconSet.value")})]}),f.jsxs("div",{className:`${M.mTSm} ${P.flex}`,children:[f.jsx(G.Select,{className:`${P.width45} ${M.mL0}`,options:i,value:p.value.type,onChange:C=>{c(C,h)}}),f.jsx("div",{className:`${M.mL0} ${P.width45}`,children:f.jsx(Hc,{id:h,type:p.value.type,error:v,value:p.value.value||"",onChange:C=>u(C,h)})})]})]})]},h)}),[n,r])},Gc=e=>{var w;const{interceptorManager:t}=e,n=((w=e.rule)==null?void 0:w.type)===s.CFRuleType.iconSet?e.rule:void 0,r=te.useDependency(m.LocaleService),[a,o]=_.useState({}),[i,u]=_.useState(()=>{const b=Object.keys(s.iconMap)[0];if(n&&n.config.length){const S=n.config[0].iconType;if(!n.config.some(g=>g.iconType!==S))return S}return b}),[l,c]=_.useState(()=>{if(n&&n.config.length)return m.Tools.deepClone(n==null?void 0:n.config);const b=s.iconMap[i]||[];return new Array(b.length).fill("").map((S,C,g)=>C===g.length-1?{operator:s.CFNumberOperator.lessThanOrEqual,value:{type:s.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:i,iconId:String(C)}:ho(i,C,g))}),[d,p]=_.useState(()=>n?!!n.isShowValue:!0),h=_.useMemo(()=>{const b=l.map(S=>po(S.iconType,S.iconId));return f.jsx("div",{className:P.iconWrap,children:b.map((S,C)=>S?f.jsx("img",{className:P.icon,src:S},C):f.jsx(zt,{className:P.icon},C))})},[l]),v=b=>{if(b.reduce((C,g,E)=>C.preType&&!C.result||b.length-1===E?C:g.value.type===s.CFValueType.formula?{preType:s.CFValueType.formula,result:!1}:C.preType?{result:C.preType===g.value.type,preType:g.value.type}:{result:!0,preType:g.value.type},{result:!0,preType:""}).result&&[s.CFValueType.num,s.CFValueType.percent,s.CFValueType.percentile].includes(b[0].value.type)){const C={};return b.forEach((g,E,D)=>{if(E-1<0||E===D.length-1)return;const j=b[E-1],L=s.getOppositeOperator(j.operator);s.compareWithNumber({operator:L,value:j.value.value},g.value.value)||(C[E]=`${r.t(`sheet.cf.form.${L}`,String(j.value.value))} `)}),C}return{}},y=(b,S)=>{kc(l,b)!==S&&($u(l,b,S),c([...l]),o(v(l)))},T=b=>{u(b);const S=s.iconMap[b]||[],C=new Array(S.length).fill("").map((g,E,D)=>ho(b,E,D));c(C),o(v(C))};_.useEffect(()=>{const b=t.intercept(t.getInterceptPoints().submit,{handler(){return{type:s.CFRuleType.iconSet,isShowValue:d,config:l}}});return()=>{b()}},[d,l,t]),_.useEffect(()=>{const b=t.intercept(t.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{b()}},[d,l,t,a]);const x=()=>{const b=l.map(S=>({...S}));l.forEach((S,C)=>{const g=l.length-1-C,E=b[g];S.iconId=E.iconId,S.iconType=E.iconType}),c([...l])};return f.jsxs("div",{className:P.iconSet,children:[f.jsx("div",{className:M.title,children:r.t("sheet.cf.panel.styleRule")}),f.jsx("div",{className:`${M.mTSm}`,children:f.jsx(G.Dropdown,{overlay:f.jsx($c,{iconType:i,onClick:T}),children:f.jsxs("div",{className:P.dropdownIcon,style:{width:"unset"},children:[h,f.jsx(wn,{})]})})}),f.jsxs("div",{className:`${M.mTSm} ${P.renderConfig}`,children:[f.jsxs("div",{className:P.utilItem,children:[f.jsx(G.Checkbox,{onChange:x}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),f.jsxs("div",{className:`${P.utilItem} ${M.mLXl}`,children:[f.jsx(G.Checkbox,{checked:!d,onChange:b=>{p(!b)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),f.jsx(Fc,{errorMap:a,onChange:y,configList:l})]})},mo=e=>e.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),go=e=>e.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),qc=e=>{var C,g,E,D;const t=te.useDependency(m.LocaleService),n=te.useDependency(m.ICommandService),r=te.useDependency(m.IUniverInstanceService),a=te.useDependency(s.ConditionalFormattingRuleModel),o=te.useDependency(k.SelectionManagerService),i=mo(r),u=go(r),l=_.useRef((g=(C=e.rule)==null?void 0:C.ranges)!=null?g:[]),c=_.useMemo(()=>{var j,L;let I=(j=e.rule)==null?void 0:j.ranges;return I!=null&&I.length||(I=(L=o.getSelectionRanges())!=null?L:[]),l.current=I,I!=null&&I.length?I.map(V=>{const F=wr.serializeRange(V);return F==="NaN"?"":F}).filter(V=>!!V).join(","):""},[e.rule]),d=[{label:t.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:t.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:t.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:t.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:t.t("sheet.cf.ruleType.formula"),value:"5"},{label:t.t("sheet.cf.ruleType.iconSet"),value:"6"}],[p,h]=_.useState(()=>{var L,V;const I=(L=e.rule)==null?void 0:L.rule.type,j=d[0].value;if(!I)return j;switch(I){case s.CFRuleType.highlightCell:{switch((V=e.rule)==null?void 0:V.rule.subType){case s.CFSubRuleType.number:case s.CFSubRuleType.text:case s.CFSubRuleType.duplicateValues:case s.CFSubRuleType.uniqueValues:case s.CFSubRuleType.timePeriod:return"1";case s.CFSubRuleType.average:case s.CFSubRuleType.rank:return"2";case s.CFSubRuleType.formula:return"5"}break}case s.CFRuleType.dataBar:return"3";case s.CFRuleType.colorScale:return"4";case s.CFRuleType.iconSet:return"6"}return j}),v=_.useRef(),y=_.useMemo(()=>new m.InterceptorManager({beforeSubmit:Ul,submit:Vl}),[]),T=_.useMemo(()=>{switch(p){case"1":return ka;case"2":return Wl;case"3":return Al;case"4":return zl;case"5":return Hl;case"6":return Gc;default:return ka}},[p]);_.useEffect(()=>{var I;if(((I=e.rule)==null?void 0:I.cfId)!==void 0){const j=n.onCommandExecuted(L=>{if(L.id===k.RemoveSheetMutation.id){const V=L.params;V.subUnitId===u&&V.unitId===i&&e.onCancel()}L.id===k.SetWorksheetActiveOperation.id&&e.onCancel()});return()=>j.dispose()}},[(E=e.rule)==null?void 0:E.cfId]);const x=I=>{v.current=I},w=I=>{l.current=I.map(j=>j.range)},b=()=>{const I=y.fetchThroughInterceptors(y.getInterceptPoints().beforeSubmit)(!0,null),j=()=>{const L=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet();return l.current.map(R=>k.setEndForRange(R,L.getRowCount(),L.getColumnCount())).filter(R=>!(Number.isNaN(R.startRow)||Number.isNaN(R.startColumn)))};if(I){const L=y.fetchThroughInterceptors(y.getInterceptPoints().submit)(null,null),V=j();if(L&&V.length){const F=mo(r),R=go(r);let O={};e.rule&&e.rule.cfId?(O={...e.rule,ranges:V,rule:L},n.executeCommand(za.id,{unitId:F,subUnitId:R,rule:O}),e.onCancel()):(O={cfId:a.createCfId(F,R),ranges:V,rule:L,stopIfTrue:!1},n.executeCommand(Va.id,{unitId:F,subUnitId:R,rule:O}),e.onCancel())}}},S=()=>{e.onCancel()};return f.jsxs("div",{className:P.cfRuleStyleEditor,children:[f.jsx("div",{className:M.title,children:t.t("sheet.cf.panel.range")}),f.jsx("div",{className:`${M.mTBase}`,children:f.jsx(ve.RangeSelector,{placeholder:t.t("sheet.cf.form.rangeSelector"),width:"100%",openForSheetSubUnitId:u,openForSheetUnitId:i,value:c,id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_rangeSelector`),onChange:w})}),f.jsx("div",{className:M.title,children:t.t("sheet.cf.panel.styleType")}),f.jsx("div",{className:M.mTBase,children:f.jsx(G.Select,{className:P.width100,value:p,options:d,onChange:I=>h(I)})}),f.jsx(T,{interceptorManager:y,rule:(D=e.rule)==null?void 0:D.rule,onChange:x}),f.jsxs("div",{className:`${M.mTBase} ${P.btnList}`,children:[f.jsx(G.Button,{size:"small",onClick:S,children:t.t("sheet.cf.panel.cancel")}),f.jsx(G.Button,{className:M.mLSm,size:"small",type:"primary",onClick:b,children:t.t("sheet.cf.panel.submit")})]})]})},Xc=e=>{const[t,n]=_.useState(e.rule),[r,a]=_.useState(!!e.rule),o=()=>{a(!0)},i=()=>{a(!1),n(void 0)},u=l=>{n(l),a(!0)};return f.jsx("div",{className:M.conditionalFormattingWrap,children:r?f.jsx(qc,{onCancel:i,rule:t}):f.jsx(Ll,{onClick:u,onCreate:o})})};var Yc=Object.defineProperty,Kc=Object.getOwnPropertyDescriptor,Zc=(e,t,n,r)=>{for(var a=r>1?void 0:r?Kc(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Yc(t,n,a),a},St=(e,t)=>(n,r)=>t(n,r,e);const Jc={},vo="sheet.conditional.formatting.panel";let bt=class extends m.Disposable{constructor(t,n,r,a,o,i,u){super();Ge(this,"_sidebarDisposable",null);this._config=t,this._univerInstanceService=n,this._injector=r,this._componentManager=a,this._menuService=o,this._sidebarService=i,this._localeService=u,this._initMenu(),this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(m.UniverInstanceType.UNIVER_SHEET).subscribe(l=>{var c;l||(c=this._sidebarDisposable)==null||c.dispose()}))}openPanel(t){const n={header:{title:this._localeService.t("sheet.cf.title")},children:{label:vo,rule:t},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initMenu(){const{menu:t={}}=this._config;this._menuService.addMenuItem(No(this._injector),t)}_initPanel(){this._componentManager.register(vo,Xc)}};bt=Zc([m.OnLifecycle(m.LifecycleStages.Ready,bt),St(1,m.IUniverInstanceService),St(2,U.Inject(U.Injector)),St(3,U.Inject(ve.ComponentManager)),St(4,U.Inject(ve.IMenuService)),St(5,U.Inject(ve.ISidebarService)),St(6,U.Inject(m.LocaleService))],bt);var Ie=(e=>(e[e.createRule=1]="createRule",e[e.viewRule=2]="viewRule",e[e.highlightCell=3]="highlightCell",e[e.rank=4]="rank",e[e.formula=5]="formula",e[e.colorScale=6]="colorScale",e[e.dataBar=7]="dataBar",e[e.icon=8]="icon",e[e.clearRangeRules=9]="clearRangeRules",e[e.clearWorkSheetRules=10]="clearWorkSheetRules",e))(Ie||{});const yo={id:"sheet.operation.open.conditional.formatting.panel",type:m.CommandType.OPERATION,handler:(e,t)=>{const n=e.get(bt),r=e.get(k.SelectionManagerService),a=e.get(m.ICommandService),o=r.getSelectionRanges()||[];switch(t.value){case 3:{n.openPanel({...s.createDefaultRule(),ranges:o});break}case 4:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank}};n.openPanel(u);break}case 5:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula,value:"="}};n.openPanel(u);break}case 6:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.colorScale,config:[]}};n.openPanel(u);break}case 7:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(u);break}case 8:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(u);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...s.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(Ir.id,{ranges:o});break}case 10:{a.executeCommand(Tn.id);break}}return!0}};var Qc=Object.defineProperty,ed=Object.getOwnPropertyDescriptor,td=(e,t,n,r)=>{for(var a=r>1?void 0:r?ed(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Qc(t,n,a),a},it=(e,t)=>(n,r)=>t(n,r,e);let mn=class extends m.Disposable{constructor(e,t,n,r,a,o,i){super(),this._sheetInterceptorService=e,this._conditionalFormattingService=t,this._univerInstanceService=n,this._renderManagerService=r,this._conditionalFormattingViewModel=a,this._conditionalFormattingRuleModel=o,this._sheetSkeletonManagerService=i,this._initViewModelInterceptor(),this._initSkeleton(),this._initRender()}_initRender(){const e=[[s.dataBarUKey,s.DataBar],[s.IconUKey,s.ConditionalFormattingIcon]],t=r=>{const a=r&&this._renderManagerService.getRenderById(r),o=a&&a.mainComponent;o&&e.forEach(([i,u])=>{o.getExtensionByKey(i)||o.register(new u)})};this.disposeWithMe(this._renderManagerService.currentRender$.subscribe(r=>{r&&t(r)}));const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);n&&t(n.getUnitId())}_initSkeleton(){const e=()=>{var n,r;this._sheetSkeletonManagerService.reCalculate();const t=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=(n=this._renderManagerService.getRenderById(t))==null?void 0:n.mainComponent)==null||r.makeDirty()};this.disposeWithMe(this._conditionalFormattingViewModel.markDirty$.pipe(Oe.bufferTime(16),Oe.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(Oe.bufferTime(16),Oe.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>["sort","delete"].includes(a.type)&&a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingService.ruleComputeStatus$.pipe(Oe.bufferTime(16),Oe.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(k.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(!r)return n(e);const a=t.workbook.getStyles(),i={...(typeof(e==null?void 0:e.s)=="string"?a.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},u={...e,s:i};return r.style&&Object.assign(i,r.style),u.fontRenderExtension||(u.fontRenderExtension={},r.isShowValue!==void 0&&(u.fontRenderExtension.isSkip=!r.isShowValue)),r.dataBar&&(u.dataBar=r.dataBar),r.iconSet&&(u.iconSet=r.iconSet,u.fontRenderExtension.leftOffset=s.DEFAULT_PADDING+s.DEFAULT_WIDTH),n(u)}}))}};mn=td([m.OnLifecycle(m.LifecycleStages.Rendered,mn),it(0,U.Inject(k.SheetInterceptorService)),it(1,U.Inject(s.ConditionalFormattingService)),it(2,U.Inject(m.IUniverInstanceService)),it(3,U.Inject(Co.IRenderManagerService)),it(4,U.Inject(s.ConditionalFormattingViewModel)),it(5,U.Inject(s.ConditionalFormattingRuleModel)),it(6,U.Inject(le.SheetSkeletonManagerService))],mn);var nd=Object.defineProperty,rd=Object.getOwnPropertyDescriptor,ad=(e,t,n,r)=>{for(var a=r>1?void 0:r?rd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&nd(t,n,a),a},Mt=(e,t)=>(n,r)=>t(n,r,e);let gn=class extends m.Disposable{constructor(t,n,r,a,o){super();Ge(this,"_copyInfo");this._sheetClipboardService=t,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(t,n,r)=>this._collectConditionalRule(t,n,r),onPasteCells:(t,n,r,a)=>{const{copyType:o=le.COPY_TYPE.COPY,pasteType:i}=a,{range:u}=t||{},{range:l}=n;return this._generateConditionalFormattingMutations(l,{copyType:o,pasteType:i,copyRange:u})}}))}_collectConditionalRule(t,n,r){const a=new m.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:t,subUnitId:n,cfMap:o}};const i=this._conditionalFormattingViewModel.getMatrix(t,n);if(!i)return;const u={get:this._injector.get.bind(this._injector)},l=le.rangeToDiscreteRange(r,u,t,n);if(!l)return;const{rows:c,cols:d}=l,p=new Set;c.forEach((h,v)=>{d.forEach((y,T)=>{const x=this._conditionalFormattingViewModel.getCellCf(t,n,h,y,i);x&&(x.cfList.forEach(w=>p.add(w.cfId)),a.setValue(v,T,x.cfList.map(w=>w.cfId)))})}),p.forEach(h=>{const v=this._conditionalFormattingRuleModel.getRule(t,n,h);v&&(o[h]=v.rule)})}_generateConditionalFormattingMutations(t,n){const r=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),a=r.getActiveSheet(),o=r.getUnitId(),i=a.getSheetId();if(n.copyType===le.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![le.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,le.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,le.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[u,l],mapFunc:c}=le.virtualizeDiscreteRanges([n.copyRange,t]),d=le.getRepeatRange(u,l,!0),p=this._conditionalFormattingViewModel.getMatrix(o,i),h={};m.Range.foreach(l,(g,E)=>{const{row:D,col:I}=c(g,E),j=this._conditionalFormattingViewModel.getCellCf(o,i,D,I,p);j&&j.cfList.forEach(L=>{if(!h[L.cfId]){const V=new m.ObjectMatrix;h[L.cfId]=V;const F=this._conditionalFormattingRuleModel.getRule(o,i,L.cfId);F==null||F.ranges.forEach(R=>{m.Range.foreach(R,(O,J)=>{V.setValue(O,J,1)})})}h[L.cfId].realDeleteValue(D,I)})});const{matrix:v,info:y}=this._copyInfo,T=[];let x=this._conditionalFormattingRuleModel.createCfId(o,i);const w={},b=g=>{if(w[g])return w[g];const E=y==null?void 0:y.cfMap[g],D=[...this._conditionalFormattingRuleModel.getSubunitRules(o,i)||[],...T].find(I=>m.Tools.diffValue(I.rule,E));if(D)return w[g]=D,D;{const I={rule:E,cfId:x,ranges:[],stopIfTrue:!1};return w[g]=I,T.push(I),x=`${Number(x)+1}`,I}};d.forEach(g=>{v&&v.forValue((E,D,I)=>{const j=m.Rectangle.getPositionRange({startRow:E,endRow:E,startColumn:D,endColumn:D},g.startRange),{row:L,col:V}=c(j.startRow,j.startColumn);I.forEach(F=>{if(!h[F]){const R=b(F),O=new m.ObjectMatrix;h[F]=O,R.ranges.forEach(J=>{m.Range.foreach(J,(be,z)=>{O.setValue(be,z,1)})})}h[F].setValue(L,V,1)})})});const S=[],C=[];for(const g in h){const E=h[g],D=k.findAllRectangle(k.createTopMatrixFromMatrix(E));if(!D.length){const I={unitId:o,subUnitId:i,cfId:g};S.push({id:s.DeleteConditionalRuleMutation.id,params:I}),C.push(...s.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}if(T.some(I=>I.cfId===g)){const I=b(g),j={unitId:o,subUnitId:i,rule:{...I,ranges:D}};S.push({id:s.AddConditionalRuleMutation.id,params:j}),C.push(s.AddConditionalRuleMutationUndoFactory(this._injector,j))}else{const I=this._conditionalFormattingRuleModel.getRule(o,i,g);if(!I)continue;const j={unitId:o,subUnitId:i,rule:{...I,ranges:D}};S.push({id:s.SetConditionalRuleMutation.id,params:j}),C.push(...s.setConditionalRuleMutationUndoFactory(this._injector,j))}}return{redos:S,undos:C}}};gn=ad([m.OnLifecycle(m.LifecycleStages.Rendered,gn),Mt(0,U.Inject(le.ISheetClipboardService)),Mt(1,U.Inject(s.ConditionalFormattingRuleModel)),Mt(2,U.Inject(U.Injector)),Mt(3,U.Inject(s.ConditionalFormattingViewModel)),Mt(4,U.Inject(m.IUniverInstanceService))],gn);var od=Object.defineProperty,id=Object.getOwnPropertyDescriptor,sd=(e,t,n,r)=>{for(var a=r>1?void 0:r?id(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&od(t,n,a),a},Pt=(e,t)=>(n,r)=>t(n,r,e);let vn=class extends m.Disposable{constructor(e,t,n,r,a){super(),this._injector=e,this._univerInstanceService=t,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const e=()=>({redos:[],undos:[]}),t=(a,o,i,u,l)=>{const c=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),d=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),p={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},h={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};m.Range.foreach(i,(v,y)=>{const T=m.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},p),x=m.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},h),{row:w,col:b}=l(T.startRow,T.startColumn),S=this._conditionalFormattingViewModel.getCellCf(c,d,w,b),{row:C,col:g}=l(x.startRow,x.startColumn),E=this._conditionalFormattingViewModel.getCellCf(c,d,C,g);E&&E.cfList.forEach(D=>{let I=u.get(D.cfId);if(!u.get(D.cfId)){const j=this._conditionalFormattingRuleModel.getRule(c,d,D.cfId);if(!j)return;I=new m.ObjectMatrix,j.ranges.forEach(L=>{m.Range.foreach(L,(V,F)=>{I.setValue(V,F,1)})}),u.set(D.cfId,I)}I.realDeleteValue(C,g)}),S&&S.cfList.forEach(D=>{let I=u.get(D.cfId);if(!u.get(D.cfId)){const j=this._conditionalFormattingRuleModel.getRule(c,d,D.cfId);if(!j)return;I=new m.ObjectMatrix,j.ranges.forEach(L=>{m.Range.foreach(L,(V,F)=>{I.setValue(V,F,1)})}),u.set(D.cfId,I)}I.setValue(C,g,1)})})},n=(a,o)=>{var w,b;const i=(w=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId(),u=(b=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:b.getActiveSheet().getSheetId(),l=new Map,c=[],d=[];if(!i||!u)return e();const p=le.virtualizeDiscreteRanges([a,o]),[h,v]=p.ranges,{mapFunc:y}=p,T={row:h.startRow,col:h.startColumn};return le.getAutoFillRepeatRange(h,v).forEach(S=>{t(T,S.repeatStartCell,S.relativeRange,l,y)}),l.forEach((S,C)=>{const g=this._conditionalFormattingRuleModel.getRule(i,u,C);if(!g)return;const E=k.findAllRectangle(k.createTopMatrixFromMatrix(S)),D={unitId:i,subUnitId:u,rule:{...g,ranges:E}};c.push({id:s.SetConditionalRuleMutation.id,params:D}),d.push(...s.setConditionalRuleMutationUndoFactory(this._injector,D))}),{undos:d,redos:c}},r={id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,i)=>{if(i===le.APPLY_TYPE.COPY||i===le.APPLY_TYPE.ONLY_FORMAT||i===le.APPLY_TYPE.SERIES){const{source:u,target:l}=a;return n(u,l)}return e()}};this.disposeWithMe(this._autoFillService.addHook(r))}};vn=sd([m.OnLifecycle(m.LifecycleStages.Rendered,vn),Pt(0,U.Inject(U.Injector)),Pt(1,U.Inject(m.IUniverInstanceService)),Pt(2,U.Inject(le.IAutoFillService)),Pt(3,U.Inject(s.ConditionalFormattingRuleModel)),Pt(4,U.Inject(s.ConditionalFormattingViewModel))],vn);var ld=Object.defineProperty,ud=Object.getOwnPropertyDescriptor,cd=(e,t,n,r)=>{for(var a=r>1?void 0:r?ud(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&ld(t,n,a),a},Nt=(e,t)=>(n,r)=>t(n,r,e);let yn=class extends m.Disposable{constructor(e,t,n,r,a){super(),this._conditionalFormattingRuleModel=e,this._univerInstanceService=t,this._injector=n,this._sheetSkeletonManagerService=r,this._refRangeService=a,this._initRefRange()}_initRefRange(){const e=new Map,t=(r,a,o)=>`${r}_${a}_${o}`,n=(r,a,o)=>{const i=l=>{const c=[...o.ranges],d=c.map(h=>k.handleDefaultRangeChangeWithEffectRefCommands(h,l)).filter(h=>!!h);if(s.isRangesEqual(d,c))return{redos:[],undos:[]};if(d.length){const h={unitId:r,subUnitId:a,rule:{...o,ranges:d}},v=[{id:s.SetConditionalRuleMutation.id,params:h}],y=s.setConditionalRuleMutationUndoFactory(this._injector,h);return{redos:v,undos:y}}else{const h={unitId:r,subUnitId:a,cfId:o.cfId},v=[{id:s.DeleteConditionalRuleMutation.id,params:h}],y=s.DeleteConditionalRuleMutationUndoFactory(this._injector,h);return{redos:v,undos:y}}},u=[];o.ranges.forEach(l=>{const c=this._refRangeService.registerRefRange(l,i);u.push(()=>c.dispose())}),e.set(t(r,a,o.cfId),()=>u.forEach(l=>l()))};this.disposeWithMe(Ce.merge(this._sheetSkeletonManagerService.currentSkeleton$.pipe(Oe.map(r=>r==null?void 0:r.sheetId),Oe.distinctUntilChanged())).pipe(Oe.switchMap(()=>new Ce.Observable(r=>{const a=new m.DisposableCollection;return r.next(a),()=>{a.dispose()}}))).subscribe(r=>{r.add(m.toDisposable(this._conditionalFormattingRuleModel.$ruleChange.subscribe(a=>{const{unitId:o,subUnitId:i,rule:u}=a,l=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),c=l.getActiveSheet();if(!(a.unitId!==l.getUnitId()||a.subUnitId!==c.getSheetId()))switch(a.type){case"add":{n(a.unitId,a.subUnitId,a.rule);break}case"delete":{const d=e.get(t(o,i,u.cfId));d&&d();break}case"set":{const d=e.get(t(o,i,u.cfId));d&&d(),n(a.unitId,a.subUnitId,a.rule)}}})))})),this.disposeWithMe(m.toDisposable(()=>{e.forEach(r=>{r()}),e.clear()}))}};yn=cd([m.OnLifecycle(m.LifecycleStages.Rendered,yn),Nt(0,U.Inject(s.ConditionalFormattingRuleModel)),Nt(1,U.Inject(m.IUniverInstanceService)),Nt(2,U.Inject(U.Injector)),Nt(3,U.Inject(le.SheetSkeletonManagerService)),Nt(4,U.Inject(k.RefRangeService))],yn);var dd=Object.defineProperty,fd=Object.getOwnPropertyDescriptor,pd=(e,t,n,r)=>{for(var a=r>1?void 0:r?fd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&dd(t,n,a),a},So=(e,t)=>(n,r)=>t(n,r,e);let Sn=class extends m.Disposable{constructor(e,t){super(),this._editorBridgeService=e,this._conditionalFormattingService=t,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(m.toDisposable(this._editorBridgeService.interceptor.intercept(this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(r!=null&&r.style&&(e!=null&&e.p)){const a=Object.keys(r==null?void 0:r.style);if(a.length>0){const o=s.getStringFromDataStream(e.p),i={...(typeof e.s=="string"?t.workbook.getStyles().get(e.s):e.s)||{}};a.forEach(l=>{delete i[l]});const u={...e,s:{...i},v:o};return delete u.p,n(u)}}return n(e)}})))}};Sn=pd([m.OnLifecycle(m.LifecycleStages.Rendered,Sn),So(0,U.Inject(le.IEditorBridgeService)),So(1,U.Inject(s.ConditionalFormattingService))],Sn);var hd=Object.defineProperty,md=Object.getOwnPropertyDescriptor,gd=(e,t,n,r)=>{for(var a=r>1?void 0:r?md(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&hd(t,n,a),a},jt=(e,t)=>(n,r)=>t(n,r,e);let bn=class extends m.Disposable{constructor(e,t,n,r,a){super(),this._injector=e,this._univerInstanceService=t,this._sheetInterceptorService=n,this._selectionManagerService=r,this._conditionalFormattingRuleModel=a,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{const t=[],n=[],r={redos:t,undos:n};if([k.ClearSelectionFormatCommand.id,k.ClearSelectionAllCommand.id].includes(e.id)){const a=this._selectionManagerService.getSelectionRanges();if(!a)return r;const o=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),i=o.getActiveSheet(),u=this._conditionalFormattingRuleModel.getSubunitRules(o.getUnitId(),i.getSheetId());if(!u||!u.length)return r;u.filter(l=>a.some(c=>l.ranges.some(d=>m.Rectangle.getIntersects(d,c)))).forEach(l=>{const d=new k.RangeMergeUtil().add(...l.ranges).subtract(...a).merge();if(d.length){const p={id:s.SetConditionalRuleMutation.id,params:{unitId:o.getUnitId(),subUnitId:i.getSheetId(),rule:{...l,ranges:d}}},h=s.setConditionalRuleMutationUndoFactory(this._injector,p.params);t.push(p),n.push(...h)}else{const p={id:s.DeleteConditionalRuleMutation.id,params:{unitId:o.getUnitId(),subUnitId:i.getSheetId(),cfId:l.cfId}},h=s.DeleteConditionalRuleMutationUndoFactory(this._injector,p.params);t.push(p),n.push(...h)}})}return r}}))}};bn=gd([m.OnLifecycle(m.LifecycleStages.Rendered,bn),jt(0,U.Inject(U.Injector)),jt(1,U.Inject(m.IUniverInstanceService)),jt(2,U.Inject(k.SheetInterceptorService)),jt(3,U.Inject(k.SelectionManagerService)),jt(4,U.Inject(s.ConditionalFormattingRuleModel))],bn);var vd=Object.defineProperty,yd=Object.getOwnPropertyDescriptor,Sd=(e,t,n,r)=>{for(var a=r>1?void 0:r?yd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&vd(t,n,a),a},bo=(e,t)=>(n,r)=>t(n,r,e);X.UniverSheetsConditionalFormattingUIPlugin=(Lt=class extends m.Plugin{constructor(t={},n,r){super(),this._config=t,this._injector=n,this._commandService=r,this._config=m.Tools.deepMerge({},Jc,this._config),this._initCommand(),s.SheetsConditionalFormattingPlugin.dependencyList.forEach(a=>{this._injector.add(a)}),this._injector.add([mn]),this._injector.add([yn]),this._injector.add([gn]),this._injector.add([vn]),this._injector.add([bt,{useFactory:()=>this._injector.createInstance(bt,this._config)}]),this._injector.add([Et]),this._injector.add([Sn]),this._injector.add([bn])}_initCommand(){[...s.SheetsConditionalFormattingPlugin.mutationList,...X.UniverSheetsConditionalFormattingUIPlugin.commandList].forEach(t=>{this._commandService.registerCommand(t)})}},Ge(Lt,"pluginName",s.SHEET_CONDITIONAL_FORMATTING_PLUGIN),Ge(Lt,"type",m.UniverInstanceType.UNIVER_SHEET),Ge(Lt,"commandList",[wo,_o,Io,xo,Eo,Oo,Do,Mo,Po,yo,dr,za,ja,Va,Ir,Tn]),Lt),X.UniverSheetsConditionalFormattingUIPlugin=Sd([bo(1,U.Inject(U.Injector)),bo(2,U.Inject(m.ICommandService))],X.UniverSheetsConditionalFormattingUIPlugin),X.enUS=xl,X.ruRU=El,X.zhCN=La,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});
11
+ `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&la(e.body,"react-draggable-transparent-selection")}function $i(e){if(e)try{if(e.body&&ua(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function la(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function ua(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var ke={};Object.defineProperty(ke,"__esModule",{value:!0}),ke.canDragX=Gi,ke.canDragY=qi,ke.createCoreData=Yi,ke.createDraggableData=Ki,ke.getBoundPosition=Bi,ke.getControlPosition=Xi,ke.snapToGrid=Fi;var xe=Ue,ft=oe;function Bi(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:Zi(r);const a=Bn(e);if(typeof r=="string"){const{ownerDocument:o}=a,i=o.defaultView;let u;if(r==="parent"?u=a.parentNode:u=o.querySelector(r),!(u instanceof i.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=u,c=i.getComputedStyle(a),d=i.getComputedStyle(l);r={left:-a.offsetLeft+(0,xe.int)(d.paddingLeft)+(0,xe.int)(c.marginLeft),top:-a.offsetTop+(0,xe.int)(d.paddingTop)+(0,xe.int)(c.marginTop),right:(0,ft.innerWidth)(l)-(0,ft.outerWidth)(a)-a.offsetLeft+(0,xe.int)(d.paddingRight)-(0,xe.int)(c.marginRight),bottom:(0,ft.innerHeight)(l)-(0,ft.outerHeight)(a)-a.offsetTop+(0,xe.int)(d.paddingBottom)-(0,xe.int)(c.marginBottom)}}return(0,xe.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,xe.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,xe.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,xe.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Fi(e,t,n){const r=Math.round(t/e[0])*e[0],a=Math.round(n/e[1])*e[1];return[r,a]}function Gi(e){return e.props.axis==="both"||e.props.axis==="x"}function qi(e){return e.props.axis==="both"||e.props.axis==="y"}function Xi(e,t,n){const r=typeof t=="number"?(0,ft.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const a=Bn(n),o=n.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,ft.offsetXYFromParent)(r||e,o,n.props.scale)}function Yi(e,t,n){const r=!(0,xe.isNum)(e.lastX),a=Bn(e);return r?{node:a,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:a,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function Ki(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Zi(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Bn(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Gt={},qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.default=Ji;function Ji(){}Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.default=void 0;var Fn=es(I),Re=qn(Xe),Qi=qn(Er),me=oe,Ye=ke,Gn=Ue,xt=qn(qt);function qn(e){return e&&e.__esModule?e:{default:e}}function ca(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ca=function(r){return r?n:t})(e)}function es(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ca(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function be(e,t,n){return t=ts(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ts(e){var t=ns(e,"string");return typeof t=="symbol"?t:String(t)}function ns(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Me={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Ke=Me.mouse,Xt=class extends Fn.Component{constructor(){super(...arguments),be(this,"dragging",!1),be(this,"lastX",NaN),be(this,"lastY",NaN),be(this,"touchIdentifier",null),be(this,"mounted",!1),be(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,me.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,me.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const a=(0,me.getTouchIdentifier)(t);this.touchIdentifier=a;const o=(0,Ye.getControlPosition)(t,a,this);if(o==null)return;const{x:i,y:u}=o,l=(0,Ye.createCoreData)(this,i,u);(0,xt.default)("DraggableCore: handleDragStart: %j",l),(0,xt.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,me.addUserSelectStyles)(r),this.dragging=!0,this.lastX=i,this.lastY=u,(0,me.addEvent)(r,Ke.move,this.handleDrag),(0,me.addEvent)(r,Ke.stop,this.handleDragStop))}),be(this,"handleDrag",t=>{const n=(0,Ye.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:a}=n;if(Array.isArray(this.props.grid)){let u=r-this.lastX,l=a-this.lastY;if([u,l]=(0,Ye.snapToGrid)(this.props.grid,u,l),!u&&!l)return;r=this.lastX+u,a=this.lastY+l}const o=(0,Ye.createCoreData)(this,r,a);if((0,xt.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=a}),be(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Ye.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:a}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=a-this.lastY||0;[l,c]=(0,Ye.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,a=this.lastY+c}const o=(0,Ye.createCoreData)(this,r,a);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const u=this.findDOMNode();u&&this.props.enableUserSelectHack&&(0,me.removeUserSelectStyles)(u.ownerDocument),(0,xt.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,u&&((0,xt.default)("DraggableCore: Removing handlers"),(0,me.removeEvent)(u.ownerDocument,Ke.move,this.handleDrag),(0,me.removeEvent)(u.ownerDocument,Ke.stop,this.handleDragStop))}),be(this,"onMouseDown",t=>(Ke=Me.mouse,this.handleDragStart(t))),be(this,"onMouseUp",t=>(Ke=Me.mouse,this.handleDragStop(t))),be(this,"onTouchStart",t=>(Ke=Me.touch,this.handleDragStart(t))),be(this,"onTouchEnd",t=>(Ke=Me.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,me.addEvent)(t,Me.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,me.removeEvent)(n,Me.mouse.move,this.handleDrag),(0,me.removeEvent)(n,Me.touch.move,this.handleDrag),(0,me.removeEvent)(n,Me.mouse.stop,this.handleDragStop),(0,me.removeEvent)(n,Me.touch.stop,this.handleDragStop),(0,me.removeEvent)(t,Me.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,me.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:Qi.default.findDOMNode(this)}render(){return Fn.cloneElement(Fn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Gt.default=Xt,be(Xt,"displayName","DraggableCore"),be(Xt,"propTypes",{allowAnyClick:Re.default.bool,children:Re.default.node.isRequired,disabled:Re.default.bool,enableUserSelectHack:Re.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Re.default.arrayOf(Re.default.number),handle:Re.default.string,cancel:Re.default.string,nodeRef:Re.default.object,onStart:Re.default.func,onDrag:Re.default.func,onStop:Re.default.func,onMouseDown:Re.default.func,scale:Re.default.number,className:Gn.dontSetMe,style:Gn.dontSetMe,transform:Gn.dontSetMe}),be(Xt,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(I),n=d(Xe),r=d(Er),a=d(qe),o=oe,i=ke,u=Ue,l=d(Gt),c=d(qt);function d(T){return T&&T.__esModule?T:{default:T}}function p(T){if(typeof WeakMap!="function")return null;var S=new WeakMap,R=new WeakMap;return(p=function(g){return g?R:S})(T)}function f(T,S){if(!S&&T&&T.__esModule)return T;if(T===null||typeof T!="object"&&typeof T!="function")return{default:T};var R=p(S);if(R&&R.has(T))return R.get(T);var g={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in T)if(E!=="default"&&Object.prototype.hasOwnProperty.call(T,E)){var w=O?Object.getOwnPropertyDescriptor(T,E):null;w&&(w.get||w.set)?Object.defineProperty(g,E,w):g[E]=T[E]}return g.default=T,R&&R.set(T,g),g}function v(){return v=Object.assign?Object.assign.bind():function(T){for(var S=1;S<arguments.length;S++){var R=arguments[S];for(var g in R)Object.prototype.hasOwnProperty.call(R,g)&&(T[g]=R[g])}return T},v.apply(this,arguments)}function y(T,S,R){return S=b(S),S in T?Object.defineProperty(T,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[S]=R,T}function b(T){var S=x(T,"string");return typeof S=="symbol"?S:String(S)}function x(T,S){if(typeof T!="object"||T===null)return T;var R=T[Symbol.toPrimitive];if(R!==void 0){var g=R.call(T,S||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(T)}class _ extends t.Component{static getDerivedStateFromProps(S,R){let{position:g}=S,{prevPropsPosition:O}=R;return g&&(!O||g.x!==O.x||g.y!==O.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:g,prevPropsPosition:O}),{x:g.x,y:g.y,prevPropsPosition:{...g}}):null}constructor(S){super(S),y(this,"onDragStart",(R,g)=>{if((0,c.default)("Draggable: onDragStart: %j",g),this.props.onStart(R,(0,i.createDraggableData)(this,g))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),y(this,"onDrag",(R,g)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",g);const O=(0,i.createDraggableData)(this,g),E={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:L}=E;E.x+=this.state.slackX,E.y+=this.state.slackY;const[k,G]=(0,i.getBoundPosition)(this,E.x,E.y);E.x=k,E.y=G,E.slackX=this.state.slackX+(j-E.x),E.slackY=this.state.slackY+(L-E.y),O.x=E.x,O.y=E.y,O.deltaX=E.x-this.state.x,O.deltaY=E.y-this.state.y}if(this.props.onDrag(R,O)===!1)return!1;this.setState(E)}),y(this,"onDragStop",(R,g)=>{if(!this.state.dragging||this.props.onStop(R,(0,i.createDraggableData)(this,g))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",g);const E={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:j,y:L}=this.props.position;E.x=j,E.y=L}this.setState(E)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var S,R;return(S=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:R,children:g,defaultPosition:O,defaultClassName:E,defaultClassNameDragging:w,defaultClassNameDragged:j,position:L,positionOffset:k,scale:G,...C}=this.props;let P={},Q=null;const ve=!!!L||this.state.dragging,ye=L||O,je={x:(0,i.canDragX)(this)&&ve?this.state.x:ye.x,y:(0,i.canDragY)(this)&&ve?this.state.y:ye.y};this.state.isElementSVG?Q=(0,o.createSVGTransform)(je,k):P=(0,o.createCSSTransform)(je,k);const z=(0,a.default)(g.props.className||"",E,{[w]:this.state.dragging,[j]:this.state.dragged});return t.createElement(l.default,v({},C,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(g),{className:z,style:{...g.props.style,...P},transform:Q}))}}e.default=_,y(_,"displayName","Draggable"),y(_,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),y(_,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(na);const{default:da,DraggableCore:rs}=na;Bt.exports=da,Bt.exports.default=da,Bt.exports.DraggableCore=rs;var fa=Bt.exports,Yt={exports:{}},Ot={},Xn={};Xn.__esModule=!0,Xn.cloneElement=us;var as=os(I);function os(e){return e&&e.__esModule?e:{default:e}}function pa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ha(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pa(Object(n),!0).forEach(function(r){is(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pa(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function is(e,t,n){return t=ss(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ss(e){var t=ls(e,"string");return typeof t=="symbol"?t:String(t)}function ls(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function us(e,t){return t.style&&e.props.style&&(t.style=ha(ha({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),as.default.cloneElement(e,t)}var Et={};Et.__esModule=!0,Et.resizableProps=void 0;var H=cs(Xe);function cs(e){return e&&e.__esModule?e:{default:e}}var ds={axis:H.default.oneOf(["both","x","y","none"]),className:H.default.string,children:H.default.element.isRequired,draggableOpts:H.default.shape({allowAnyClick:H.default.bool,cancel:H.default.string,children:H.default.node,disabled:H.default.bool,enableUserSelectHack:H.default.bool,offsetParent:H.default.node,grid:H.default.arrayOf(H.default.number),handle:H.default.string,nodeRef:H.default.object,onStart:H.default.func,onDrag:H.default.func,onStop:H.default.func,onMouseDown:H.default.func,scale:H.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(a.axis==="both"||a.axis==="y"){var o;return(o=H.default.number).isRequired.apply(o,n)}return H.default.number.apply(H.default,n)},handle:H.default.oneOfType([H.default.node,H.default.func]),handleSize:H.default.arrayOf(H.default.number),lockAspectRatio:H.default.bool,maxConstraints:H.default.arrayOf(H.default.number),minConstraints:H.default.arrayOf(H.default.number),onResizeStop:H.default.func,onResizeStart:H.default.func,onResize:H.default.func,resizeHandles:H.default.arrayOf(H.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:H.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(a.axis==="both"||a.axis==="x"){var o;return(o=H.default.number).isRequired.apply(o,n)}return H.default.number.apply(H.default,n)}};Et.resizableProps=ds,Ot.__esModule=!0,Ot.default=void 0;var Pt=gs(I),fs=fa,ps=Xn,hs=Et,ms=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function ma(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ma=function(a){return a?n:t})(e)}function gs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ma(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Yn(){return Yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yn.apply(this,arguments)}function vs(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function ga(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ga(Object(n),!0).forEach(function(r){ys(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ga(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ys(e,t,n){return t=Ss(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ss(e){var t=bs(e,"string");return typeof t=="symbol"?t:String(t)}function bs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ts(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Zn(e,t)}function Zn(e,t){return Zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Zn(e,t)}var Jn=function(e){Ts(t,e);function t(){for(var r,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return r=e.call.apply(e,[this].concat(o))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(a,o){var i=this.props,u=i.minConstraints,l=i.maxConstraints,c=i.lockAspectRatio;if(!u&&!l&&!c)return[a,o];if(c){var d=this.props.width/this.props.height,p=a-this.props.width,f=o-this.props.height;Math.abs(p)>Math.abs(f*d)?o=a/d:a=o*d}var v=a,y=o,b=this.slack||[0,0],x=b[0],_=b[1];return a+=x,o+=_,u&&(a=Math.max(u[0],a),o=Math.max(u[1],o)),l&&(a=Math.min(l[0],a),o=Math.min(l[1],o)),this.slack=[x+(v-a),_+(y-o)],[a,o]},n.resizeHandler=function(a,o){var i=this;return function(u,l){var c=l.node,d=l.deltaX,p=l.deltaY;a==="onResizeStart"&&i.resetData();var f=(i.props.axis==="both"||i.props.axis==="x")&&o!=="n"&&o!=="s",v=(i.props.axis==="both"||i.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!f&&!v)){var y=o[0],b=o[o.length-1],x=c.getBoundingClientRect();if(i.lastHandleRect!=null){if(b==="w"){var _=x.left-i.lastHandleRect.left;d+=_}if(y==="n"){var T=x.top-i.lastHandleRect.top;p+=T}}i.lastHandleRect=x,b==="w"&&(d=-d),y==="n"&&(p=-p);var S=i.props.width+(f?d/i.props.transformScale:0),R=i.props.height+(v?p/i.props.transformScale:0),g=i.runConstraints(S,R);S=g[0],R=g[1];var O=S!==i.props.width||R!==i.props.height,E=typeof i.props[a]=="function"?i.props[a]:null,w=a==="onResize"&&!O;E&&!w&&(u.persist==null||u.persist(),E(u,{node:c,size:{width:S,height:R},handle:o})),a==="onResizeStop"&&i.resetData()}}},n.renderResizeHandle=function(a,o){var i=this.props.handle;if(!i)return Pt.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+a,ref:o});if(typeof i=="function")return i(a,o);var u=typeof i.type=="string",l=Kn({ref:o},u?{}:{handleAxis:a});return Pt.cloneElement(i,l)},n.render=function(){var a=this,o=this.props,i=o.children,u=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var d=vs(o,ms);return(0,ps.cloneElement)(i,Kn(Kn({},d),{},{className:(u?u+" ":"")+"react-resizable",children:[].concat(i.props.children,c.map(function(p){var f,v=(f=a.handleRefs[p])!=null?f:a.handleRefs[p]=Pt.createRef();return Pt.createElement(fs.DraggableCore,Yn({},l,{nodeRef:v,key:"resizableHandle-"+p,onStop:a.resizeHandler("onResizeStop",p),onStart:a.resizeHandler("onResizeStart",p),onDrag:a.resizeHandler("onResize",p)}),a.renderResizeHandle(p,v))}))}))},t}(Pt.Component);Ot.default=Jn,Jn.propTypes=hs.resizableProps,Jn.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Kt={};Kt.__esModule=!0,Kt.default=void 0;var Qn=Is(I),Rs=va(Xe),Cs=va(Ot),_s=Et,ws=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function va(e){return e&&e.__esModule?e:{default:e}}function ya(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ya=function(a){return a?n:t})(e)}function Is(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ya(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function er(){return er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},er.apply(this,arguments)}function Sa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Zt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sa(Object(n),!0).forEach(function(r){xs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sa(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xs(e,t,n){return t=Os(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Os(e){var t=Es(e,"string");return typeof t=="symbol"?t:String(t)}function Es(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ps(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Ds(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,tr(e,t)}function tr(e,t){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},tr(e,t)}var ba=function(e){Ds(t,e);function t(){for(var r,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return r=e.call.apply(e,[this].concat(o))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(u,l){var c=l.size;r.props.onResize?(u.persist==null||u.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(u,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(a,o){return o.propsWidth!==a.width||o.propsHeight!==a.height?{width:a.width,height:a.height,propsWidth:a.width,propsHeight:a.height}:null};var n=t.prototype;return n.render=function(){var a=this.props,o=a.handle,i=a.handleSize;a.onResize;var u=a.onResizeStart,l=a.onResizeStop,c=a.draggableOpts,d=a.minConstraints,p=a.maxConstraints,f=a.lockAspectRatio,v=a.axis;a.width,a.height;var y=a.resizeHandles,b=a.style,x=a.transformScale,_=Ps(a,ws);return Qn.createElement(Cs.default,{axis:v,draggableOpts:c,handle:o,handleSize:i,height:this.state.height,lockAspectRatio:f,maxConstraints:p,minConstraints:d,onResizeStart:u,onResize:this.onResize,onResizeStop:l,resizeHandles:y,transformScale:x,width:this.state.width},Qn.createElement("div",er({},_,{style:Zt(Zt({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Qn.Component);Kt.default=ba,ba.propTypes=Zt(Zt({},_s.resizableProps),{},{children:Rs.default.element}),Yt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Yt.exports.Resizable=Ot.default,Yt.exports.ResizableBox=Kt.default;var Ms=Yt.exports,Fe={};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.resizeHandleType=Fe.resizeHandleAxesType=Fe.default=void 0;var $=Ta(Xe),Ns=Ta(I);function Ta(e){return e&&e.__esModule?e:{default:e}}const js=Fe.resizeHandleAxesType=$.default.arrayOf($.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),Ls=Fe.resizeHandleType=$.default.oneOfType([$.default.node,$.default.func]);Fe.default={className:$.default.string,style:$.default.object,width:$.default.number,autoSize:$.default.bool,cols:$.default.number,draggableCancel:$.default.string,draggableHandle:$.default.string,verticalCompact:function(e){e.verticalCompact},compactType:$.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&F.validateLayout(t,"layout")},margin:$.default.arrayOf($.default.number),containerPadding:$.default.arrayOf($.default.number),rowHeight:$.default.number,maxRows:$.default.number,isBounded:$.default.bool,isDraggable:$.default.bool,isResizable:$.default.bool,allowOverlap:$.default.bool,preventCollision:$.default.bool,useCSSTransforms:$.default.bool,transformScale:$.default.number,isDroppable:$.default.bool,resizeHandles:js,resizeHandle:Ls,onLayoutChange:$.default.func,onDragStart:$.default.func,onDrag:$.default.func,onDragStop:$.default.func,onResizeStart:$.default.func,onResize:$.default.func,onResizeStop:$.default.func,onDrop:$.default.func,droppingItem:$.default.shape({i:$.default.string.isRequired,w:$.default.number.isRequired,h:$.default.number.isRequired}),children:function(e,t){const n=e[t],r={};Ns.default.Children.forEach(n,function(a){if((a==null?void 0:a.key)!=null){if(r[a.key])throw new Error('Duplicate child key "'+a.key+'" found! This will cause problems in ReactGridLayout.');r[a.key]=!0}})},innerRef:$.default.any},Object.defineProperty($t,"__esModule",{value:!0}),$t.default=void 0;var pt=nr(I),K=nr(Xe),Vs=fa,Us=Ms,ht=F,he=Ve,Ra=Fe,ks=nr(qe);function nr(e){return e&&e.__esModule?e:{default:e}}function We(e,t,n){return t=Ws(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ws(e){var t=zs(e,"string");return typeof t=="symbol"?t:String(t)}function zs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class rr extends pt.default.Component{constructor(){super(...arguments),We(this,"state",{resizing:null,dragging:null,className:""}),We(this,"elementRef",pt.default.createRef()),We(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:a,transformScale:o}=this.props;if(!a)return;const i={top:0,left:0},{offsetParent:u}=r;if(!u)return;const l=u.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.left/o,p=l.left/o,f=c.top/o,v=l.top/o;i.left=d-p+u.scrollLeft,i.top=f-v+u.scrollTop,this.setState({dragging:i});const{x:y,y:b}=(0,he.calcXY)(this.getPositionParams(),i.top,i.left,this.props.w,this.props.h);return a.call(this,this.props.i,y,b,{e:t,node:r,newPosition:i})}),We(this,"onDrag",(t,n)=>{let{node:r,deltaX:a,deltaY:o}=n;const{onDrag:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let u=this.state.dragging.top+o,l=this.state.dragging.left+a;const{isBounded:c,i:d,w:p,h:f,containerWidth:v}=this.props,y=this.getPositionParams();if(c){const{offsetParent:S}=r;if(S){const{margin:R,rowHeight:g,containerPadding:O}=this.props,E=S.clientHeight-(0,he.calcGridItemWHPx)(f,g,R[1]);u=(0,he.clamp)(u-O[1],0,E);const w=(0,he.calcGridColWidth)(y),j=v-(0,he.calcGridItemWHPx)(p,w,R[0]);l=(0,he.clamp)(l-O[0],0,j)}}const b={top:u,left:l};this.setState({dragging:b});const{containerPadding:x}=this.props,{x:_,y:T}=(0,he.calcXY)(y,u-x[1],l-x[0],p,f);return i.call(this,d,_,T,{e:t,node:r,newPosition:b})}),We(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:i,i:u,containerPadding:l}=this.props,{left:c,top:d}=this.state.dragging,p={top:d,left:c};this.setState({dragging:null});const{x:f,y:v}=(0,he.calcXY)(this.getPositionParams(),d-l[1],c-l[0],o,i);return a.call(this,u,f,v,{e:t,node:r,newPosition:p})}),We(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),We(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),We(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,he.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),a=(0,he.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,ht.fastPositionEqual)(r,a)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const a=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,i=o&&n.left!==a.left||n.top!==a.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(i){const u=n.left-o.left,l=n.top-o.top;this.onDrag(n.e,{node:r,deltaX:u,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:a}=this.props;let o;return a?o=(0,ht.setTransform)(t):(o=(0,ht.setTopLeft)(t),n&&(o.left=(0,ht.perc)(t.left/r),o.width=(0,ht.perc)(t.width/r))),o}mixinDraggable(t,n){return pt.default.createElement(Vs.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,a)=>n(r,a,t)}mixinResizable(t,n,r){const{cols:a,minW:o,minH:i,maxW:u,maxH:l,transformScale:c,resizeHandles:d,resizeHandle:p}=this.props,f=this.getPositionParams(),v=(0,he.calcGridItemPosition)(f,0,0,a,0).width,y=(0,he.calcGridItemPosition)(f,0,0,o,i),b=(0,he.calcGridItemPosition)(f,0,0,u,l),x=[y.width,y.height],_=[Math.min(b.width,v),Math.min(b.height,1/0)];return pt.default.createElement(Us.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:_,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:d,handle:p},t)}onResizeHandler(t,n,r,a){let{node:o,size:i,handle:u}=n;const l=this.props[a];if(!l)return;const{x:c,y:d,i:p,maxH:f,minH:v,containerWidth:y}=this.props,{minW:b,maxW:x}=this.props;let _=i;o&&(_=(0,ht.resizeItemInDirection)(u,r,i,y),this.setState({resizing:a==="onResizeStop"?null:_}));let{w:T,h:S}=(0,he.calcWH)(this.getPositionParams(),_.width,_.height,c,d,u);T=(0,he.clamp)(T,Math.max(b,1),x),S=(0,he.clamp)(S,v,f),l.call(this,p,T,S,{e:t,node:o,size:_,handle:u})}render(){const{x:t,y:n,w:r,h:a,isDraggable:o,isResizable:i,droppingPosition:u,useCSSTransforms:l}=this.props,c=(0,he.calcGridItemPosition)(this.getPositionParams(),t,n,r,a,this.state),d=pt.default.Children.only(this.props.children);let p=pt.default.cloneElement(d,{ref:this.elementRef,className:(0,ks.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!u,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(c)}});return p=this.mixinResizable(p,c,i),p=this.mixinDraggable(p,o),p}}$t.default=rr,We(rr,"propTypes",{children:K.default.element,cols:K.default.number.isRequired,containerWidth:K.default.number.isRequired,rowHeight:K.default.number.isRequired,margin:K.default.array.isRequired,maxRows:K.default.number.isRequired,containerPadding:K.default.array.isRequired,x:K.default.number.isRequired,y:K.default.number.isRequired,w:K.default.number.isRequired,h:K.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:K.default.string.isRequired,resizeHandles:Ra.resizeHandleAxesType,resizeHandle:Ra.resizeHandleType,onDragStop:K.default.func,onDragStart:K.default.func,onDrag:K.default.func,onResizeStop:K.default.func,onResizeStart:K.default.func,onResize:K.default.func,isDraggable:K.default.bool.isRequired,isResizable:K.default.bool.isRequired,isBounded:K.default.bool.isRequired,static:K.default.bool,useCSSTransforms:K.default.bool.isRequired,transformScale:K.default.number,className:K.default.string,handle:K.default.string,cancel:K.default.string,droppingPosition:K.default.shape({e:K.default.object.isRequired,left:K.default.number.isRequired,top:K.default.number.isRequired})}),We(rr,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(_t,"__esModule",{value:!0}),_t.default=void 0;var nt=Bs(I),ar=En,As=or(qe),A=F,Hs=Ve,Ca=or($t),$s=or(Fe);function or(e){return e&&e.__esModule?e:{default:e}}function _a(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(_a=function(r){return r?n:t})(e)}function Bs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=_a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function ge(e,t,n){return t=Fs(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fs(e){var t=Gs(e,"string");return typeof t=="symbol"?t:String(t)}function Gs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const wa="react-grid-layout";let Ia=!1;try{Ia=/firefox/i.test(navigator.userAgent)}catch{}class Jt extends nt.Component{constructor(){super(...arguments),ge(this,"state",{activeDrag:null,layout:(0,A.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,A.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),ge(this,"dragEnterCounter",0),ge(this,"onDragStart",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u}=this.state,l=(0,A.getLayoutItem)(u,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,A.cloneLayoutItem)(l),oldLayout:u,activeDrag:c}),this.props.onDragStart(u,l,l,null,o,i)}),ge(this,"onDrag",(t,n,r,a)=>{let{e:o,node:i}=a;const{oldDragItem:u}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:d,preventCollision:p}=this.props,f=(0,A.getLayoutItem)(l,t);if(!f)return;const v={w:f.w,h:f.h,x:f.x,y:f.y,placeholder:!0,i:t};l=(0,A.moveElement)(l,f,n,r,!0,p,(0,A.compactType)(this.props),c,d),this.props.onDrag(l,u,f,v,o,i),this.setState({layout:d?l:(0,A.compact)(l,(0,A.compactType)(this.props),c),activeDrag:v})}),ge(this,"onDragStop",(t,n,r,a)=>{let{e:o,node:i}=a;if(!this.state.activeDrag)return;const{oldDragItem:u}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:d,allowOverlap:p}=this.props,f=(0,A.getLayoutItem)(l,t);if(!f)return;l=(0,A.moveElement)(l,f,n,r,!0,d,(0,A.compactType)(this.props),c,p);const y=p?l:(0,A.compact)(l,(0,A.compactType)(this.props),c);this.props.onDragStop(y,u,f,null,o,i);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:y,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(y,b)}),ge(this,"onResizeStart",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u}=this.state,l=(0,A.getLayoutItem)(u,t);l&&(this.setState({oldResizeItem:(0,A.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(u,l,l,null,o,i))}),ge(this,"onResize",(t,n,r,a)=>{let{e:o,node:i,size:u,handle:l}=a;const{oldResizeItem:c}=this.state,{layout:d}=this.state,{cols:p,preventCollision:f,allowOverlap:v}=this.props;let y=!1,b,x,_;const[T,S]=(0,A.withLayoutItem)(d,t,g=>{let O;return x=g.x,_=g.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=g.x+(g.w-n),n=g.x!==x&&x<0?g.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(_=g.y+(g.h-r),r=g.y!==_&&_<0?g.h:r,_=_<0?0:_),y=!0),f&&!v&&(O=(0,A.getAllCollisions)(d,{...g,w:n,h:r,x,y:_}).filter(w=>w.i!==g.i).length>0,O&&(_=g.y,r=g.h,x=g.x,n=g.w,y=!1)),g.w=n,g.h=r,g});if(!S)return;b=T,y&&(b=(0,A.moveElement)(T,S,x,_,!0,this.props.preventCollision,(0,A.compactType)(this.props),p,v));const R={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(b,c,S,R,o,i),this.setState({layout:v?b:(0,A.compact)(b,(0,A.compactType)(this.props),p),activeDrag:R})}),ge(this,"onResizeStop",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u,oldResizeItem:l}=this.state,{cols:c,allowOverlap:d}=this.props,p=(0,A.getLayoutItem)(u,t),f=d?u:(0,A.compact)(u,(0,A.compactType)(this.props),c);this.props.onResizeStop(f,l,p,null,o,i);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:f,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(f,v)}),ge(this,"onDragOver",t=>{var T;if(t.preventDefault(),t.stopPropagation(),Ia&&!((T=t.nativeEvent.target)!=null&&T.classList.contains(wa)))return!1;const{droppingItem:n,onDropDragOver:r,margin:a,cols:o,rowHeight:i,maxRows:u,width:l,containerPadding:c,transformScale:d}=this.props,p=r==null?void 0:r(t);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const f={...n,...p},{layout:v}=this.state,y=t.currentTarget.getBoundingClientRect(),b=t.clientX-y.left,x=t.clientY-y.top,_={left:b/d,top:x/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:S,top:R}=this.state.droppingPosition;(S!=b||R!=x)&&this.setState({droppingPosition:_})}}else{const S={cols:o,margin:a,maxRows:u,rowHeight:i,containerWidth:l,containerPadding:c||a},R=(0,Hs.calcXY)(S,x,b,f.w,f.h);this.setState({droppingDOMNode:nt.createElement("div",{key:f.i}),droppingPosition:_,layout:[...v,{...f,x:R.x,y:R.y,static:!1,isDraggable:!0}]})}}),ge(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,a=(0,A.compact)(r.filter(o=>o.i!==t.i),(0,A.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:a,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ge(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ge(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),ge(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,a=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,a,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,ar.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,A.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,A.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,A.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,A.fastRGLPropsEqual)(this.props,t,ar.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,a=n.layout;this.onLayoutMaybeChanged(r,a)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,A.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,ar.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:a,containerPadding:o,rowHeight:i,maxRows:u,useCSSTransforms:l,transformScale:c}=this.props;return nt.createElement(Ca.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:a,containerPadding:o||a,maxRows:u,rowHeight:i,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},nt.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,A.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:a,cols:o,margin:i,containerPadding:u,rowHeight:l,maxRows:c,isDraggable:d,isResizable:p,isBounded:f,useCSSTransforms:v,transformScale:y,draggableCancel:b,draggableHandle:x,resizeHandles:_,resizeHandle:T}=this.props,{mounted:S,droppingPosition:R}=this.state,g=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,O=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&p,E=r.resizeHandles||_,w=g&&f&&r.isBounded!==!1;return nt.createElement(Ca.default,{containerWidth:a,cols:o,margin:i,containerPadding:u||i,maxRows:c,rowHeight:l,cancel:b,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:g,isResizable:O,isBounded:w,useCSSTransforms:v&&S,usePercentages:!S,transformScale:y,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?R:void 0,resizeHandles:E,resizeHandle:T},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:a}=this.props,o=(0,As.default)(wa,t),i={height:this.containerHeight(),...n};return nt.createElement("div",{ref:a,className:o,style:i,onDrop:r?this.onDrop:A.noop,onDragLeave:r?this.onDragLeave:A.noop,onDragEnter:r?this.onDragEnter:A.noop,onDragOver:r?this.onDragOver:A.noop},nt.Children.map(this.props.children,u=>this.processGridItem(u)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}_t.default=Jt,ge(Jt,"displayName","ReactGridLayout"),ge(Jt,"propTypes",$s.default),ge(Jt,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:A.noop,onDragStart:A.noop,onDrag:A.noop,onDragStop:A.noop,onResizeStart:A.noop,onResize:A.noop,onResizeStop:A.noop,onDrop:A.noop,onDropDragOver:A.noop});var Qt={},rt={};Object.defineProperty(rt,"__esModule",{value:!0}),rt.findOrGenerateResponsiveLayout=Ys,rt.getBreakpointFromWidth=qs,rt.getColsFromBreakpoint=Xs,rt.sortBreakpoints=ir;var en=F;function qs(e,t){const n=ir(e);let r=n[0];for(let a=1,o=n.length;a<o;a++){const i=n[a];t>e[i]&&(r=i)}return r}function Xs(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function Ys(e,t,n,r,a,o){if(e[n])return(0,en.cloneLayout)(e[n]);let i=e[r];const u=ir(t),l=u.slice(u.indexOf(n));for(let c=0,d=l.length;c<d;c++){const p=l[c];if(e[p]){i=e[p];break}}return i=(0,en.cloneLayout)(i||[]),(0,en.compact)((0,en.correctBounds)(i,{cols:a}),o,a)}function ir(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.default=void 0;var xa=Zs(I),Ce=Oa(Xe),sr=En,mt=F,at=rt,Ks=Oa(_t);function Oa(e){return e&&e.__esModule?e:{default:e}}function Ea(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Ea=function(r){return r?n:t})(e)}function Zs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Ea(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function lr(){return lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lr.apply(this,arguments)}function tn(e,t,n){return t=Js(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Js(e){var t=Qs(e,"string");return typeof t=="symbol"?t:String(t)}function Qs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Pa=e=>Object.prototype.toString.call(e);function nn(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class ur extends xa.Component{constructor(){super(...arguments),tn(this,"state",this.generateInitialState()),tn(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:a}=this.props,o=(0,at.getBreakpointFromWidth)(n,t),i=(0,at.getColsFromBreakpoint)(o,a),u=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,at.findOrGenerateResponsiveLayout)(r,n,o,o,i,u),breakpoint:o,cols:i}}static getDerivedStateFromProps(t,n){if(!(0,sr.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:a}=n;return{layout:(0,at.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,a,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,sr.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,sr.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:a,compactType:o}=this.props,i=this.props.breakpoint||(0,at.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),u=this.state.breakpoint,l=(0,at.getColsFromBreakpoint)(i,r),c={...a};if(u!==i||t.breakpoints!==n||t.cols!==r){u in c||(c[u]=(0,mt.cloneLayout)(this.state.layout));let f=(0,at.findOrGenerateResponsiveLayout)(c,n,i,u,l,o);f=(0,mt.synchronizeLayoutWithChildren)(f,this.props.children,l,o,this.props.allowOverlap),c[i]=f,this.props.onLayoutChange(f,c),this.props.onBreakpointChange(i,l),this.setState({breakpoint:i,layout:f,cols:l})}const d=nn(this.props.margin,i),p=nn(this.props.containerPadding,i);this.props.onWidthChange(this.props.width,d,l,p)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:a,margin:o,containerPadding:i,onBreakpointChange:u,onLayoutChange:l,onWidthChange:c,...d}=this.props;return xa.createElement(Ks.default,lr({},d,{margin:nn(o,this.state.breakpoint),containerPadding:nn(i,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Qt.default=ur,tn(ur,"propTypes",{breakpoint:Ce.default.string,breakpoints:Ce.default.object,allowOverlap:Ce.default.bool,cols:Ce.default.object,margin:Ce.default.oneOfType([Ce.default.array,Ce.default.object]),containerPadding:Ce.default.oneOfType([Ce.default.array,Ce.default.object]),layouts(e,t){if(Pa(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+Pa(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,mt.validateLayout)(e.layouts[n],"layouts."+n)})},width:Ce.default.number.isRequired,onBreakpointChange:Ce.default.func,onLayoutChange:Ce.default.func,onWidthChange:Ce.default.func}),tn(ur,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:mt.noop,onLayoutChange:mt.noop,onWidthChange:mt.noop});var cr={},Da=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(a,o){return a[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},t.prototype.set=function(n,r){var a=e(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,a=e(r,n);~a&&r.splice(a,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,o=this.__entries__;a<o.length;a++){var i=o[a];n.call(r,i[1],i[0])}},t}()}(),dr=typeof window<"u"&&typeof document<"u"&&window.document===document,rn=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),el=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(rn):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),tl=2;function nl(e,t){var n=!1,r=!1,a=0;function o(){n&&(n=!1,e()),r&&u()}function i(){el(o)}function u(){var l=Date.now();if(n){if(l-a<tl)return;r=!0}else n=!0,r=!1,setTimeout(i,t);a=l}return u}var rl=20,al=["top","right","bottom","left","width","height","size","weight"],ol=typeof MutationObserver<"u",il=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=nl(this.refresh.bind(this),rl)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!dr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ol?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!dr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,a=al.some(function(o){return!!~r.indexOf(o)});a&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Ma=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var a=r[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},gt=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||rn},Na=on(0,0,0,0);function an(e){return parseFloat(e)||0}function ja(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,a){var o=e["border-"+a+"-width"];return r+an(o)},0)}function sl(e){for(var t=["top","right","bottom","left"],n={},r=0,a=t;r<a.length;r++){var o=a[r],i=e["padding-"+o];n[o]=an(i)}return n}function ll(e){var t=e.getBBox();return on(0,0,t.width,t.height)}function ul(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Na;var r=gt(e).getComputedStyle(e),a=sl(r),o=a.left+a.right,i=a.top+a.bottom,u=an(r.width),l=an(r.height);if(r.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=ja(r,"left","right")+o),Math.round(l+i)!==n&&(l-=ja(r,"top","bottom")+i)),!dl(e)){var c=Math.round(u+o)-t,d=Math.round(l+i)-n;Math.abs(c)!==1&&(u-=c),Math.abs(d)!==1&&(l-=d)}return on(a.left,a.top,u,l)}var cl=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof gt(e).SVGGraphicsElement}:function(e){return e instanceof gt(e).SVGElement&&typeof e.getBBox=="function"}}();function dl(e){return e===gt(e).document.documentElement}function fl(e){return dr?cl(e)?ll(e):ul(e):Na}function pl(e){var t=e.x,n=e.y,r=e.width,a=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(o.prototype);return Ma(i,{x:t,y:n,width:r,height:a,top:n,right:t+r,bottom:a+n,left:t}),i}function on(e,t,n,r){return{x:e,y:t,width:n,height:r}}var hl=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=on(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=fl(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),ml=function(){function e(t,n){var r=pl(n);Ma(this,{target:t,contentRect:r})}return e}(),gl=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Da,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof gt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new hl(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof gt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new ml(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),La=typeof WeakMap<"u"?new WeakMap:new Da,Va=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=il.getInstance(),r=new gl(t,n,this);La.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Va.prototype[e]=function(){var t;return(t=La.get(this))[e].apply(t,arguments)}});var vl=function(){return typeof rn.ResizeObserver<"u"?rn.ResizeObserver:Va}();const yl=Vo(Object.freeze(Object.defineProperty({__proto__:null,default:vl},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(cr,"__esModule",{value:!0}),cr.default=Il;var sn=Rl(I),Sl=fr(Xe),bl=fr(yl),Tl=fr(qe);function fr(e){return e&&e.__esModule?e:{default:e}}function Ua(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Ua=function(r){return r?n:t})(e)}function Rl(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Ua(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function pr(){return pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pr.apply(this,arguments)}function vt(e,t,n){return t=Cl(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cl(e){var t=_l(e,"string");return typeof t=="symbol"?t:String(t)}function _l(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const wl="react-grid-layout";function Il(e){var t;return t=class extends sn.Component{constructor(){super(...arguments),vt(this,"state",{width:1280}),vt(this,"elementRef",sn.createRef()),vt(this,"mounted",!1),vt(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new bl.default(a=>{if(this.elementRef.current instanceof HTMLElement){const i=a[0].contentRect.width;this.setState({width:i})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...a}=this.props;return r&&!this.mounted?sn.createElement("div",{className:(0,Tl.default)(this.props.className,wl),style:this.props.style,ref:this.elementRef}):sn.createElement(e,pr({innerRef:this.elementRef},a,this.state))}},vt(t,"defaultProps",{measureBeforeMount:!1}),vt(t,"propTypes",{measureBeforeMount:Sl.default.bool}),t}(function(e){e.exports=_t.default,e.exports.utils=F,e.exports.calculateUtils=Ve,e.exports.Responsive=Qt.default,e.exports.Responsive.utils=rt,e.exports.WidthProvider=cr.default})(zr);var xl=zr.exports;const Ol=wn(xl),hr={type:m.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=V.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:i,subUnitId:u}=o,l={unitId:i,subUnitId:u,cfId:t.cfId},c=s.DeleteConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.DeleteConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:s.DeleteConditionalRuleMutation.id,params:l}]}),d}},ka={type:m.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=e.get(s.ConditionalFormattingRuleModel),i=V.getSheetCommandTarget(a,t);if(!i)return!1;const{unitId:u,subUnitId:l}=i,c=s.transformSupportSymmetryAnchor(t.start,t.end,o.getSubunitRules(u,l)||[],b=>b.cfId);if(!c)return!1;const[d,p]=c,f={unitId:u,subUnitId:l,start:d,end:p},v=s.MoveConditionalRuleMutationUndoFactory(f),y=r.syncExecuteCommand(s.MoveConditionalRuleMutation.id,f);return y&&n.pushUndoRedo({unitID:u,redoMutations:[{id:s.MoveConditionalRuleMutation.id,params:f}],undoMutations:v}),y}},ln={cfPreview:"univer-cf-preview"},yt=e=>{var a,o;const t=e.rule;if(!t)return null;const n=I.useMemo(()=>{if(t.type===s.CFRuleType.colorScale){const i=t.config.map((c,d)=>({color:new m.ColorKit(c.color),value:d})),u=i.length-1;return new Array(5).fill("").map((c,d,p)=>d*u/(p.length-1)).map(c=>s.getColorScaleFromValue(i,c))}return null},[t]),r=I.useMemo(()=>{if(t.type===s.CFRuleType.iconSet)return t.config.map(i=>{const u=s.iconMap[i.iconType];return u&&u[Number(i.iconId)]})},[t]);switch(t.type){case s.CFRuleType.dataBar:{const{isGradient:i}=t.config,u={width:"50%",height:"100%"},l=i?`linear-gradient(to right, ${t.config.positiveColor}, rgb(255 255 255))`:t.config.positiveColor,c=i?`linear-gradient(to right, rgb(255 255 255),${t.config.nativeColor})`:t.config.nativeColor;return h.jsxs("div",{className:ln.cfPreview,children:[h.jsx("div",{style:{...u,background:c,border:`1px solid ${t.config.nativeColor}`}}),h.jsx("div",{style:{...u,background:l,border:`1px solid ${t.config.positiveColor}`}})]})}case s.CFRuleType.colorScale:return n&&h.jsx("div",{className:ln.cfPreview,children:n.map((i,u)=>h.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:i}},u))});case s.CFRuleType.iconSet:return r&&h.jsx("div",{className:ln.cfPreview,children:r.map((i,u)=>i?h.jsx("img",{style:{height:"100%"},src:i},u):h.jsx(zt,{},u))});case s.CFRuleType.highlightCell:{const{ul:i,st:u,it:l,bl:c,bg:d,cl:p}=t.style,f=(i==null?void 0:i.s)===m.BooleanNumber.TRUE,v=(u==null?void 0:u.s)===m.BooleanNumber.TRUE,y=l===m.BooleanNumber.TRUE,b=c===m.BooleanNumber.TRUE,x=(a=d==null?void 0:d.rgb)!=null?a:s.DEFAULT_BG_COLOR,_=(o=p==null?void 0:p.rgb)!=null?o:s.DEFAULT_FONT_COLOR,T={fontWeight:b?"bold":void 0,fontStyle:y?"italic":void 0,textDecoration:`${f?"underline":""} ${v?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:x,color:_};return h.jsx("div",{style:T,className:ln.cfPreview,children:"123"})}}return null};var El=Object.defineProperty,Pl=Object.getOwnPropertyDescriptor,Dl=(e,t,n,r)=>{for(var a=r>1?void 0:r?Pl(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&El(t,n,a),a},Ml=(e,t)=>(n,r)=>t(n,r,e);let Dt=class extends m.Disposable{constructor(t){super();Ze(this,"_initLocal",()=>{});Ze(this,"_findReplaceIndex",t=>{const n=/\{([^}]+)?\}/g,r=[];let a=n.exec(t);for(;a;)r.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=n.exec(t);return r});this._localeService=t,this._initLocal()}tWithReactNode(t,...n){const r=this._localeService.getLocales(),a=t.split("."),o=r&&this._localeService.resolveKeyPath(r,a);if(typeof o=="string"){const i=[];return this._findReplaceIndex(o).forEach((u,l,c)=>{const d=c[l-1]||{startIndex:0,endIndex:-1};if(d.endIndex+1<u.startIndex){const p=o.slice(d.endIndex+1,u.startIndex);p&&i.push(p)}if(n[u.key]&&i.push(n[u.key]),l===c.length-1){const p=o.slice(u.endIndex+1);p&&i.push(p)}}),i}return[]}};Dt=Dl([m.OnLifecycle(m.LifecycleStages.Rendered,Dt),Ml(0,U.Inject(m.LocaleService))],Dt);const ce={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",selectSelector:"univer-select-selector",selectSelectionItem:"univer-select-selection-item",selectSelectionSearchInput:"univer-select-selection-search-input",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap",reactGridItem:"univer-react-grid-item"},Nl=(e,t)=>{const n=e.rule;switch(n.type){case s.CFRuleType.colorScale:return t.t("sheet.cf.ruleType.colorScale");case s.CFRuleType.dataBar:return t.t("sheet.cf.ruleType.dataBar");case s.CFRuleType.iconSet:return t.t("sheet.cf.ruleType.iconSet");case s.CFRuleType.highlightCell:switch(n.subType){case s.CFSubRuleType.average:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,t.t("sheet.cf.subRuleType.average"))}case s.CFSubRuleType.duplicateValues:return t.t("sheet.cf.subRuleType.duplicateValues");case s.CFSubRuleType.uniqueValues:return t.t("sheet.cf.subRuleType.uniqueValues");case s.CFSubRuleType.number:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(a=>String(a)):[String(n.value||"")])}case s.CFSubRuleType.text:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case s.CFSubRuleType.timePeriod:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`)}case s.CFSubRuleType.rank:return n.isPercent?n.isBottom?t.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):t.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?t.t("sheet.cf.preview.describe.bottomN",String(n.value)):t.t("sheet.cf.preview.describe.topN",String(n.value));case s.CFSubRuleType.formula:return t.t("sheet.cf.ruleType.formula")}}};let Wa=0;const jl=e=>{const{onClick:t}=e,n=ne.useDependency(s.ConditionalFormattingRuleModel),r=ne.useDependency(m.IUniverInstanceService),a=ne.useDependency(V.SelectionManagerService),o=ne.useDependency(m.ICommandService),i=ne.useDependency(m.LocaleService),u=ne.useDependency(Dt),l=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),c=l.getUnitId(),p=l.getActiveSheet().getSheetId(),[f,v]=I.useState([]),[y,b]=I.useState("2"),[x,_]=I.useState(0),[T,S]=I.useState(-1),[R,g]=I.useState(Wa),O=I.useRef(null),E=[{label:i.t("sheet.cf.panel.workSheet"),value:"2"},{label:i.t("sheet.cf.panel.selectedRange"),value:"1"}],w=()=>{const z=n.getSubunitRules(c,p);if(!z||!z.length)return[];if(y==="1"){const Z=a.getLast();if(!Z)return[];const ie=Z.range;return z.filter(de=>de.ranges.some(pe=>m.Rectangle.intersects(pe,ie)))}else if(y==="2")return z;return[]},j=z=>{const ie=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet();return z.map(de=>{const pe=de.ranges;return(pe==null?void 0:pe.some(Le=>{var X,re;const{startRow:M,startColumn:W,endRow:J,endColumn:Y}=Le;for(let se=M;se<=J;se++)for(let Se=W;Se<=Y;Se++){const te=(re=(X=ie.getCell(se,Se))==null?void 0:X.selectionProtection)==null?void 0:re[0];if((te==null?void 0:te[$e.Edit])===!1||(te==null?void 0:te[$e.View])===!1)return!0}return!1}))?{...de,disable:!0}:{...de}})},[L,k]=I.useState(w);le.useHighlightRange(f),I.useEffect(()=>{const z=o.onCommandExecuted(Z=>{Z.id===V.SetWorksheetActiveOperation.id&&_(Math.random())});return()=>z.dispose()}),I.useEffect(()=>{k(w)},[y,x,c,p]),I.useEffect(()=>{if(y==="2")return;const z=new we.Observable(Z=>{const ie=[V.SetSelectionsOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],fe=o.onCommandExecuted(de=>{const{id:pe,params:Pe}=de,Le=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId();ie.includes(pe)&&Pe.unitId===Le&&Z.next(null)});return()=>fe.dispose()}).pipe(we.debounceTime(16)).subscribe(()=>{k(w)});return()=>{z.unsubscribe()}},[r,y,c,p]),I.useEffect(()=>{const z=n.$ruleChange.subscribe(()=>{_(Math.random())});return()=>z.unsubscribe()},[n]),I.useEffect(()=>{const z=()=>{var de;const fe=Math.max(0,(((de=O.current)==null?void 0:de.getBoundingClientRect().width)||0)-8);return Wa=fe,fe},ie=new we.Observable(fe=>{const de=document.querySelector(".univer-sidebar");if(de){let pe=setTimeout(()=>{fe.next()},150);const Pe=()=>{pe&&clearTimeout(pe),pe=null},Le=M=>{M.propertyName==="width"&&(Pe(),fe.next())};return de.addEventListener("transitionend",Le),()=>{Pe(),de.removeEventListener("transitionend",Le)}}}).pipe(we.debounceTime(16)).subscribe(()=>{g(z())});return()=>{ie.unsubscribe()}},[]);const G=z=>{const Z=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),ie=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId();o.executeCommand(hr.id,{unitId:Z,subUnitId:ie,cfId:z.cfId})},C=(z,Z)=>{S(Z.y)},P=(z,Z,ie)=>{S(-1);const fe=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),de=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),pe=M=>{const W=L.length;return Math.min(W-1,Math.max(0,M))},Pe=L[pe(Z.y)].cfId,Le=L[pe(ie.y)].cfId;Pe!==Le&&o.executeCommand(ka.id,{unitId:fe,subUnitId:de,start:{id:Pe,type:"self"},end:{id:Le,type:ie.y>Z.y?"after":"before"}})},Q=()=>{e.onCreate()},_e=()=>{y==="2"?o.executeCommand(_n.id):y==="1"&&L.map(Z=>({unitId:c,subUnitId:p,cfId:Z.cfId})).forEach(Z=>{o.executeCommand(hr.id,Z)})},ve=L.map((z,Z)=>({i:z.cfId,x:0,w:12,y:Z,h:1,isResizable:!1})),ye=j(L),je=ye==null?void 0:ye.some(z=>z.disable);return h.jsxs("div",{className:ce.cfRuleList,children:[h.jsxs("div",{className:ce.ruleSelector,children:[h.jsx("div",{children:u.tWithReactNode("sheet.cf.panel.managerRuleSelect",h.jsx(q.Select,{className:ce.select,options:E,value:y,onChange:z=>{b(z)}})).map((z,Z)=>h.jsx("span",{children:z},Z))}),h.jsxs("div",{className:ce.btnList,children:[h.jsx(q.Tooltip,{title:i.t("sheet.cf.panel.createRule"),placement:"bottom",children:h.jsx("div",{className:`${ce.icon}`,onClick:Q,children:h.jsx(Yo,{})})}),L.length&&!je?h.jsx(q.Tooltip,{title:i.t("sheet.cf.panel.clear"),placement:"bottom",children:h.jsx("div",{className:`${ce.gap} ${ce.icon}`,onClick:_e,children:h.jsx(In,{})})}):h.jsx("div",{className:`${ce.gap} ${ce.disabled}`,children:h.jsx(In,{})})]})]}),h.jsx("div",{ref:O,className:ce.gridLayoutWrap,children:R?h.jsx(Ol,{onDragStop:P,onDragStart:C,layout:ve,cols:12,rowHeight:60,width:R,margin:[0,10],draggableHandle:".draggableHandle",children:ye==null?void 0:ye.map((z,Z)=>h.jsx("div",{children:h.jsxs("div",{onMouseMove:()=>{z.ranges!==f&&v(z.ranges)},onMouseLeave:()=>v([]),onClick:()=>{z.disable||t(z)},className:`${ce.ruleItem} ${T===Z?ce.active:""}`,children:[h.jsx("div",{className:`${ce.draggableHandle} draggableHandle`,onClick:ie=>ie.stopPropagation(),children:h.jsx(Jo,{})}),h.jsxs("div",{className:ce.ruleDescribe,children:[h.jsx("div",{className:ce.ruleType,children:Nl(z,i)}),h.jsx("div",{className:ce.ruleRange,children:z.ranges.map(ie=>Or.serializeRange(ie)).join(",")})]}),h.jsx("div",{className:ce.preview,children:h.jsx(yt,{rule:z.rule})}),!z.disable&&h.jsx("div",{className:`${ce.deleteItem} ${T===Z?ce.active:""}`,onClick:ie=>{ie.stopPropagation(),G(z)},children:h.jsx(In,{})})]})},`${z.cfId}`))}):null})]})},un={type:m.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(e,t){if(!t)return!1;const{rule:n}=t,r=e.get(m.IUndoRedoService),a=e.get(m.ICommandService),o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.IUniverInstanceService),u=V.getSheetCommandTarget(i);if(!u)return!1;const{unitId:l,subUnitId:c}=u,d=o.createCfId(l,c),p={unitId:l,subUnitId:c,rule:{...n,cfId:n.cfId||d}},f=s.AddConditionalRuleMutationUndoFactory(e,p),v=a.syncExecuteCommand(s.AddConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:l,redoMutations:[{id:s.AddConditionalRuleMutation.id,params:p}],undoMutations:[f]}),v}},za={type:m.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=V.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:i,subUnitId:u}=o,l={unitId:i,subUnitId:u,rule:t.rule},c=s.setConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.SetConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:s.SetConditionalRuleMutation.id,params:l}]}),d}},Ll=m.createInterceptorKey("beforeSubmit"),Vl=m.createInterceptorKey("submit"),mr={cfColorPicker:"univer-cf-color-picker",cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},ot=e=>{const{color:t,onChange:n,disable:r=!1,iconId:a="PaintBucket",className:o,isNeedDropdownIcon:i=!0}=e,u=ne.useDependency(Te.ComponentManager),l=I.useMemo(()=>new m.ColorKit(t),[t]),c=u.get(a);return c&&(r?h.jsx(c,{className:o,extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}):h.jsx(q.Dropdown,{overlay:h.jsx("div",{className:`${mr.cfColorPicker} `,children:h.jsx(q.ColorPicker,{color:t,onChange:n})}),children:h.jsxs("span",{className:`${mr.cfColorPickerIcon} ${o}`,children:[h.jsx(c,{extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}),i&&h.jsx(xn,{className:mr.iconDropdown})]})}))},N={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},it=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),gr=e=>{const{type:t,className:n,onChange:r,id:a,value:o}=e,i=ne.useDependency(m.IUniverInstanceService),u=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),l=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),c=I.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),d=I.useMemo(()=>[s.CFValueType.max,s.CFValueType.min,"none"].includes(t)?{disabled:!0}:[s.CFValueType.percent,s.CFValueType.percentile].includes(t)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[t]);return t===s.CFValueType.formula?h.jsx(Te.TextEditor,{openForSheetSubUnitId:l,openForSheetUnitId:u,id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_colo_scale_${a}`),value:c,style:{maxWidth:"50%",marginLeft:4},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(p="")=>{r(p||"")}}):h.jsx(q.InputNumber,{className:n,value:Number(e.value)||0,onChange:p=>e.onChange(p||0),...d})},Ul=e=>{var G;const{interceptorManager:t}=e,n=ne.useDependency(m.LocaleService),r=((G=e.rule)==null?void 0:G.type)===s.CFRuleType.colorScale?e.rule:void 0,a=[it(s.CFValueType.num,n),it(s.CFValueType.percent,n),it(s.CFValueType.percentile,n),it(s.CFValueType.formula,n)],o=[it(s.CFValueType.min,n),...a],i=[it("none",n),...a],u=[it(s.CFValueType.max,n),...a],[l,c]=I.useState(()=>{var P;const C=s.CFValueType.min;return r&&((P=r.config[0])==null?void 0:P.value.type)||C}),[d,p]=I.useState(()=>{var P;const C="none";return!r||r.config.length!==3?C:((P=r.config[1])==null?void 0:P.value.type)||C}),[f,v]=I.useState(()=>{var P;const C=s.CFValueType.max;return r&&((P=r.config[r.config.length-1])==null?void 0:P.value.type)||C}),[y,b]=I.useState(()=>{if(!r)return 10;const P=r.config[0];return(P==null?void 0:P.value.value)===void 0?10:P==null?void 0:P.value.value}),[x,_]=I.useState(()=>{var Q;if(!r||r.config.length!==3)return 50;const P=(Q=r.config[1])==null?void 0:Q.value.value;return P===void 0?50:P}),[T,S]=I.useState(()=>{var Q;if(!r)return 90;const P=(Q=r.config[r.config.length-1])==null?void 0:Q.value.value;return P===void 0?90:P}),[R,g]=I.useState(()=>{var P;const C="#d0d9fb";return r&&((P=r.config[0])==null?void 0:P.color)||C}),[O,E]=I.useState(()=>{var P;const C="#7790f3";return!r||r.config.length!==3?C:((P=r.config[1])==null?void 0:P.color)||C}),[w,j]=I.useState(()=>{var P;const C="#2e55ef";return r&&((P=r.config[r.config.length-1])==null?void 0:P.color)||C}),L=I.useMemo(()=>C=>{const{minType:P,medianType:Q,maxType:_e,minValue:ve,medianValue:ye,maxValue:je,minColor:z,medianColor:Z,maxColor:ie}=C,fe=[];return fe.push({color:z,value:{type:P,value:ve}}),Q!=="none"&&fe.push({color:Z,value:{type:Q,value:ye}}),fe.push({color:ie,value:{type:_e,value:je}}),{config:fe.map((pe,Pe)=>({...pe,index:Pe})),type:s.CFRuleType.colorScale}},[]);I.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return L({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:w})}}),[L,l,d,f,y,x,T,R,O,w,t]);const k=C=>{e.onChange(L(C))};return h.jsxs("div",{children:[h.jsx("div",{className:D.title,children:n.t("sheet.cf.panel.styleRule")}),h.jsx("div",{className:`${N.cfPreviewWrap}`,children:h.jsx(yt,{rule:L({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:w})})}),h.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.min")}),h.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[h.jsx(q.Select,{options:o,value:l,onChange:C=>{c(C);const P=s.createDefaultValueByValueType(C,10);b(P),k({minType:C,medianType:d,maxType:f,minValue:P,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:w})}}),h.jsx(gr,{id:"min",className:`${D.mLXxs}`,value:y,type:l,onChange:C=>{b(C),k({minType:l,medianType:d,maxType:f,minValue:C,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:w})}}),h.jsx(ot,{className:D.mLXxs,color:R,onChange:C=>{g(C),k({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:C,medianColor:O,maxColor:w})}})]}),h.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.medianValue")}),h.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[h.jsx(q.Select,{options:i,value:d,onChange:C=>{p(C);const P=s.createDefaultValueByValueType(C,50);_(P),k({minType:l,medianType:C,maxType:f,minValue:y,medianValue:P,maxValue:T,minColor:R,medianColor:O,maxColor:w})}}),h.jsx(gr,{id:"median",className:` ${D.mLXxs}`,value:x,type:d,onChange:C=>{_(C),k({minType:l,medianType:d,maxType:f,minValue:y,medianValue:C,maxValue:T,minColor:R,medianColor:O,maxColor:w})}}),d!=="none"&&h.jsx(ot,{className:D.mLXxs,color:O,onChange:C=>{E(C),k({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:R,medianColor:C,maxColor:w})}})]}),h.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.max")}),h.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[h.jsx(q.Select,{options:u,value:f,onChange:C=>{v(C);const P=s.createDefaultValueByValueType(C,90);S(P),k({minType:l,medianType:d,maxType:C,minValue:y,medianValue:x,maxValue:P,minColor:R,medianColor:O,maxColor:w})}}),h.jsx(gr,{id:"max",className:`${D.mLXxs}`,value:T,type:f,onChange:C=>{S(C),k({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:C,minColor:R,medianColor:O,maxColor:w})}}),h.jsx(ot,{className:D.mLXxs,color:w,onChange:C=>{j(C),k({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:C})}})]})]})},St=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),Aa=e=>{const{onChange:t,className:n,value:r,type:a,id:o,disabled:i=!1}=e,u=ne.useDependency(m.IUniverInstanceService),l=u.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),c=u.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),d=I.useRef(r),p=I.useMemo(()=>[s.CFValueType.percentile,s.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===s.CFValueType.formula){const f=String(d.current).startsWith("=")?String(d.current)||"":"=";return h.jsx(Te.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_data_bar_${o}`),value:f,openForSheetSubUnitId:c,openForSheetUnitId:l,style:{width:"47%",marginLeft:14},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(v="")=>{t(v||"")}})}return h.jsx(q.InputNumber,{className:n,value:Number(r)||0,disabled:i,onChange:f=>{t(f||0)},...p})},kl=e=>{var G;const{interceptorManager:t}=e,n=ne.useDependency(m.LocaleService),r=((G=e.rule)==null?void 0:G.type)===s.CFRuleType.dataBar?e.rule:void 0,[a,o]=I.useState(()=>{var P;const C="0";return r?(P=r.config)!=null&&P.isGradient?"1":"0":C}),[i,u]=I.useState(()=>{var P;const C="#abd91a";return r&&((P=r.config)==null?void 0:P.positiveColor)||C}),[l,c]=I.useState(()=>{var P;const C="#ffbe38";return r&&((P=r.config)==null?void 0:P.nativeColor)||C}),d=[St(s.CFValueType.num,n),St(s.CFValueType.percent,n),St(s.CFValueType.percentile,n),St(s.CFValueType.formula,n)],p=[St(s.CFValueType.min,n),...d],f=[St(s.CFValueType.max,n),...d],[v,y]=I.useState(()=>{var P;const C=p[0].value;return r&&((P=r.config)==null?void 0:P.min.type)||C}),[b,x]=I.useState(()=>{var P;const C=f[0].value;return r&&((P=r.config)==null?void 0:P.max.type)||C}),[_,T]=I.useState(()=>{var Q;if(!r)return 0;const P=((Q=r.config)==null?void 0:Q.min)||{};return P.type===s.CFValueType.formula?P.value||"=":P.value||0}),[S,R]=I.useState(()=>{var Q;if(!r)return 100;const P=((Q=r.config)==null?void 0:Q.max)||{};return P.type===s.CFValueType.formula?P.value||"=":P.value===void 0?100:P.value}),[g,O]=I.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),E=C=>({config:{min:{type:C.minValueType,value:C.minValue},max:{type:C.maxValueType,value:C.maxValue},isGradient:C.isGradient==="1",positiveColor:C.positiveColor,nativeColor:C.nativeColor},type:s.CFRuleType.dataBar,isShowValue:C.isShowValue});I.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return E({isGradient:a,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})}}),[a,_,v,S,b,i,l,t,g]);const w=C=>{e.onChange(E(C))},j=C=>{u(C),w({isGradient:a,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:C,nativeColor:l,isShowValue:g})},L=C=>{c(C),w({isGradient:a,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:C,isShowValue:g})},k=C=>d.map(P=>P.value).includes(C);return h.jsxs("div",{children:[h.jsx("div",{className:D.title,children:n.t("sheet.cf.panel.styleRule")}),h.jsx("div",{className:`${N.cfPreviewWrap}`,children:h.jsx(yt,{rule:E({isGradient:a,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})})}),h.jsxs("div",{children:[h.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.fillType")}),h.jsxs("div",{className:`${D.mTSm} ${D.mLXxs} ${D.labelContainer} `,children:[h.jsxs(q.RadioGroup,{value:a,onChange:C=>{o(C),w({isGradient:C,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})},children:[h.jsx(q.Radio,{value:"0",children:h.jsx("span",{className:N.text,children:n.t("sheet.cf.panel.pureColor")})}),h.jsx(q.Radio,{value:"1",children:h.jsx("span",{className:N.text,children:n.t("sheet.cf.panel.gradient")})})]}),h.jsxs("div",{className:`${N.utilItem} ${D.mLXl}`,children:[h.jsx(q.Checkbox,{checked:!g,onChange:C=>{O(!C),w({isGradient:C,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:!C})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),h.jsxs("div",{children:[h.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.colorSet")}),h.jsxs("div",{className:`${D.labelContainer} ${D.mTSm} ${D.mLXxs}`,children:[h.jsxs("div",{className:`${D.labelContainer}`,children:[h.jsx("div",{className:`${N.text}`,children:n.t("sheet.cf.panel.native")}),h.jsx(ot,{color:l,onChange:L})]}),h.jsxs("div",{className:`${D.labelContainer} ${D.mLSm} `,children:[h.jsx("div",{className:`${N.text} `,children:n.t("sheet.cf.panel.positive")}),h.jsx(ot,{color:i,onChange:j})]})]})]}),h.jsxs("div",{children:[h.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.min")}),h.jsxs("div",{className:`${D.mTSm} ${D.labelContainer}`,children:[h.jsx(q.Select,{options:p,value:v,onChange:C=>{y(C);const P=s.createDefaultValueByValueType(C,10);T(P),w({isGradient:a,minValue:P,minValueType:C,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})}}),h.jsx(Aa,{disabled:!k(v),id:"min",type:v,className:D.mLSm,value:_,onChange:C=>{T(C||0),w({isGradient:a,minValue:C||0,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})}})]}),h.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.max")}),h.jsxs("div",{className:`${D.mTSm} ${D.labelContainer}`,children:[h.jsx(q.Select,{options:f,value:b,onChange:C=>{x(C);const P=s.createDefaultValueByValueType(C,90);R(P),w({isGradient:a,minValue:_,minValueType:v,maxValue:P,maxValueType:C,positiveColor:i,nativeColor:l,isShowValue:g})}}),h.jsx(Aa,{disabled:!k(b),id:"max",type:b,className:D.mLSm,value:S,onChange:C=>{R(C||0),w({isGradient:a,minValue:_,minValueType:v,maxValue:C||0,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})}})]})]})]})},Ge={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},cn=e=>[m.BooleanNumber.FALSE,void 0].includes(e)?m.BooleanNumber.TRUE:m.BooleanNumber.FALSE,dn=e=>e!==m.BooleanNumber.FALSE,vr=e=>{const{style:t,onChange:n,className:r}=e,a=ne.useDependency(Te.ComponentManager),[o,i]=I.useState(()=>{if(t!=null&&t.bl)return t.bl}),[u,l]=I.useState(()=>{if(t!=null&&t.it)return t.it}),[c,d]=I.useState(()=>{if(t!=null&&t.ul)return t.ul.s}),[p,f]=I.useState(()=>{if(t!=null&&t.st)return t.st.s}),[v,y]=I.useState(()=>{var O;const g="#2f56ef";return(O=t==null?void 0:t.cl)!=null&&O.rgb?t.cl.rgb:g}),[b,x]=I.useState(()=>{var O;const g="#e8ecfc";return(O=t==null?void 0:t.bg)!=null&&O.rgb?t.bg.rgb:g}),_=a.get("BoldSingle"),T=a.get("ItalicSingle"),S=a.get("UnderlineSingle"),R=a.get("StrikethroughSingle");return I.useEffect(()=>{const g={bl:o,it:u};v!==void 0&&(g.cl={rgb:v}),b!==void 0&&(g.bg={rgb:b}),p!==void 0&&(g.st={s:p}),c!==void 0&&(g.ul={s:c}),n(s.removeUndefinedAttr(g))},[o,u,c,p,v,b]),h.jsxs("div",{className:`${Ge.cfStyleEdit} ${r}`,children:[_&&h.jsx("div",{className:qe({[Ge.isActive]:dn(o||m.BooleanNumber.FALSE)},Ge.buttonItem),onClick:()=>i(cn(o)),children:h.jsx(_,{})}),T&&h.jsx("div",{className:qe({[Ge.isActive]:dn(u||m.BooleanNumber.FALSE)},Ge.buttonItem),onClick:()=>l(cn(u)),children:h.jsx(T,{})}),S&&h.jsx("div",{className:qe({[Ge.isActive]:dn(c||m.BooleanNumber.FALSE)},Ge.buttonItem),onClick:()=>d(cn(c)),children:h.jsx(S,{})}),R&&h.jsx("div",{className:qe({[Ge.isActive]:dn(p||m.BooleanNumber.FALSE)},Ge.buttonItem),onClick:()=>f(cn(p)),children:h.jsx(R,{})}),h.jsx(ot,{color:v,onChange:y,iconId:"FontColor"}),h.jsx(ot,{color:b,onChange:x,iconId:"PaintBucket"})]})},Wl=e=>{var x;const{onChange:t,interceptorManager:n}=e,r=ne.useDependency(m.LocaleService),a=((x=e.rule)==null?void 0:x.type)===s.CFRuleType.highlightCell?e.rule:void 0,o=[{label:r.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:r.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:r.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:r.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[i,u]=I.useState(()=>{const _=o[0].value,T=a==null?void 0:a.type;if(!a)return _;switch(T){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.average:return[s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":_;case s.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return _}),[l,c]=I.useState(()=>{const T=a==null?void 0:a.type;if(!a)return 10;switch(T){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.rank:return a.value||10}}return 10}),[d,p]=I.useState(()=>{const T=a==null?void 0:a.type;if(!a)return!1;switch(T){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[f,v]=I.useState({}),y=_=>{const{type:T,isPercent:S,value:R,style:g}=_;if(T==="isNotBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:S,isBottom:!1,value:R,style:g};if(T==="isBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:S,isBottom:!0,value:R,style:g};if(T==="greaterThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.greaterThan,style:g};if(T==="lessThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.lessThan,style:g}};I.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return y({type:i,isPercent:d,value:l,style:f})}}),[i,d,l,f,n]);const b=_=>{t(y(_))};return h.jsxs("div",{children:[h.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),h.jsx(q.Select,{className:`${N.width100} ${D.mTSm}`,value:i,options:o,onChange:_=>{u(_),b({type:_,isPercent:d,value:l,style:f})}}),["isNotBottom","isBottom"].includes(i)&&h.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[h.jsx(q.InputNumber,{min:1,max:1e3,value:l,onChange:_=>{const T=_||0;c(T),b({type:i,isPercent:d,value:T,style:f})}}),h.jsxs("div",{className:`${D.mLSm} ${D.labelContainer} ${N.text}`,children:[h.jsx(q.Checkbox,{checked:d,onChange:_=>{p(!!_),b({type:i,isPercent:!!_,value:l,style:f})}}),r.t("sheet.cf.valueType.percent")]})]}),h.jsx("div",{className:`${N.cfPreviewWrap} `,children:h.jsx(yt,{rule:y({type:i,isPercent:d,value:l,style:f})})}),h.jsx(vr,{style:a==null?void 0:a.style,className:`${D.mTSm} `,onChange:_=>{v(_),b({type:i,isPercent:d,value:l,style:_})}})]})},ee=(e,t)=>({label:t.t(`sheet.cf.operator.${e}`),value:e}),zl=e=>{const{type:t,operator:n,onChange:r,value:a}=e,[o,i]=I.useState(()=>typeof a=="number"?a:0),[u,l]=I.useState(()=>typeof a=="string"?a:""),[c,d]=I.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[p,f]=I.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100);switch(I.useEffect(()=>{switch(t){case s.CFSubRuleType.text:{[s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)&&r(u);break}case s.CFSubRuleType.number:{[s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)&&r(o),[s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)&&r([c,p]);break}}},[t]),t){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)){const v=y=>{l(y),r(y)};return h.jsx("div",{className:`${D.mTSm}`,children:h.jsx(q.Input,{className:N.width100,value:u,onChange:v})})}break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)){const v=y=>{i(y||0),r(y||0)};return h.jsx("div",{className:`${D.mTSm}`,children:h.jsx(q.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:N.width100,value:o,onChange:v})})}if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)){const v=b=>{d(b||0),r([b||0,p])},y=b=>{f(b||0),r([c,b||0])};return h.jsxs("div",{className:`${D.mTSm} ${D.labelContainer} `,children:[h.jsx(q.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:c,onChange:v}),h.jsx(q.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`${D.mLSm}`,value:p,onChange:y})]})}}}return null},Ha=(e,t)=>{switch(e){case s.CFSubRuleType.text:return[ee(s.CFTextOperator.containsText,t),ee(s.CFTextOperator.notContainsText,t),ee(s.CFTextOperator.beginsWith,t),ee(s.CFTextOperator.endsWith,t),ee(s.CFTextOperator.equal,t),ee(s.CFTextOperator.notEqual,t),ee(s.CFTextOperator.containsBlanks,t),ee(s.CFTextOperator.notContainsBlanks,t),ee(s.CFTextOperator.containsErrors,t),ee(s.CFTextOperator.notContainsErrors,t)];case s.CFSubRuleType.number:return[ee(s.CFNumberOperator.between,t),ee(s.CFNumberOperator.notBetween,t),ee(s.CFNumberOperator.equal,t),ee(s.CFNumberOperator.notEqual,t),ee(s.CFNumberOperator.greaterThan,t),ee(s.CFNumberOperator.greaterThanOrEqual,t),ee(s.CFNumberOperator.lessThan,t),ee(s.CFNumberOperator.lessThanOrEqual,t)];case s.CFSubRuleType.timePeriod:return[ee(s.CFTimePeriodOperator.yesterday,t),ee(s.CFTimePeriodOperator.today,t),ee(s.CFTimePeriodOperator.tomorrow,t),ee(s.CFTimePeriodOperator.last7Days,t),ee(s.CFTimePeriodOperator.lastWeek,t),ee(s.CFTimePeriodOperator.thisWeek,t),ee(s.CFTimePeriodOperator.nextWeek,t),ee(s.CFTimePeriodOperator.lastMonth,t),ee(s.CFTimePeriodOperator.thisMonth,t),ee(s.CFTimePeriodOperator.nextMonth,t)]}},$a=e=>{var R;const{interceptorManager:t,onChange:n}=e,r=ne.useDependency(m.LocaleService),a=((R=e.rule)==null?void 0:R.type)===s.CFRuleType.highlightCell?e.rule:void 0,[o,i]=I.useState(()=>{const g=s.CFSubRuleType.text;return a&&a.subType||g}),u=[{value:s.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:s.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:s.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:s.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:s.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],l=I.useMemo(()=>Ha(o,r),[o]),[c,d]=I.useState(()=>{const g=l?l[0].value:void 0;return a&&a.operator||g}),[p,f]=I.useState(()=>{var E;const g="";return a?(E=a.value)!=null?E:s.createDefaultValue(a.subType,a.operator):g}),[v,y]=I.useState({}),b=I.useMemo(()=>g=>{var O,E,w,j,L,k,G,C,P,Q,_e,ve,ye,je,z;switch(g.subType||o){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(c))return{type:s.CFRuleType.highlightCell,subType:(O=g.subType)!=null?O:o,operator:(E=g.operator)!=null?E:c,style:(w=g.style)!=null?w:v,value:(j=g.value)!=null?j:p};break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(c))return{type:s.CFRuleType.highlightCell,subType:(L=g.subType)!=null?L:o,operator:(k=g.operator)!=null?k:c,style:(G=g.style)!=null?G:v,value:(C=g.value)!=null?C:p};if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(c))return{type:s.CFRuleType.highlightCell,subType:(P=g.subType)!=null?P:o,operator:(Q=g.operator)!=null?Q:c,style:(_e=g.style)!=null?_e:v,value:(ve=g.value)!=null?ve:p};break}}return{type:s.CFRuleType.highlightCell,subType:(ye=g.subType)!=null?ye:o,operator:(je=g.operator)!=null?je:c,style:(z=g.style)!=null?z:v}},[o,c,p,v]);I.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return b({})}}),[b,t]),I.useEffect(()=>{u.some(g=>g.value===o)||i(u[0].value)},[u]);const x=g=>{const O=g,E=Ha(O,r),w=E&&E[0].value;i(O),d(w),w&&f(s.createDefaultValue(O,w)),n(b({subType:O,operator:w}))},_=g=>{const O=g;d(O),n(b({operator:O}))},T=g=>{f(g),n(b({value:g}))},S=I.useMemo(()=>`${o}_${c}_${Math.random()}`,[o,c]);return h.jsxs("div",{children:[h.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),h.jsx(q.Select,{className:`${D.mTSm} ${N.width100}`,onChange:x,value:o,options:u}),(l==null?void 0:l.length)&&h.jsx(q.Select,{className:`${D.mTSm} ${N.width100}`,onChange:_,value:c||"",options:l}),h.jsx(zl,{value:p,interceptorManager:t,type:o,operator:c,rule:a,onChange:T},S),h.jsx("div",{className:`${N.cfPreviewWrap}`,children:h.jsx(yt,{rule:b({})})}),h.jsx(vr,{style:a==null?void 0:a.style,className:`${D.mLXxs}`,onChange:g=>{y(g),n(b({style:g}))}})]})},Al=e=>{var y;const{onChange:t,interceptorManager:n}=e,r=ne.useDependency(m.LocaleService),o=ne.useDependency(m.IUniverInstanceService).getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),i=o.getActiveSheet(),u=((y=e.rule)==null?void 0:y.type)===s.CFRuleType.highlightCell?e.rule:void 0,[l,c]=I.useState({}),[d,p]=I.useState(()=>(u==null?void 0:u.subType)===s.CFSubRuleType.formula?u.value:"="),f=b=>({style:b.style,value:d,type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula});I.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return f({style:l,formula:d})}}),[l,d,n]);const v=b=>{t(f(b))};return h.jsxs("div",{children:[h.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),h.jsx("div",{className:`${D.mTSm}`,children:h.jsx(Te.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_formula`),openForSheetSubUnitId:i.getSheetId(),openForSheetUnitId:o.getUnitId(),value:d,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(b="")=>{const x=b||"";p(x),v({style:l,formula:x})}})}),h.jsx("div",{className:`${N.cfPreviewWrap} `,children:h.jsx(yt,{rule:f({style:l,formula:d})})}),h.jsx(vr,{style:u==null?void 0:u.style,className:`${D.mTSm} `,onChange:b=>{c(b),v({style:b,formula:d})}})]})};var Hl="Expected a function",Ba="__lodash_hash_undefined__",Fa=1/0,$l=9007199254740991,Bl="[object Function]",Fl="[object GeneratorFunction]",Gl="[object Symbol]",ql=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xl=/^\w*$/,Yl=/^\./,Kl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zl=/[\\^$.*+?()[\]{}|]/g,Jl=/\\(\\)?/g,Ql=/^\[object .+?Constructor\]$/,eu=/^(?:0|[1-9]\d*)$/,tu=typeof Be=="object"&&Be&&Be.Object===Object&&Be,nu=typeof self=="object"&&self&&self.Object===Object&&self,yr=tu||nu||Function("return this")();function ru(e,t){return e==null?void 0:e[t]}function au(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var ou=Array.prototype,iu=Function.prototype,Ga=Object.prototype,Sr=yr["__core-js_shared__"],qa=function(){var e=/[^.]+$/.exec(Sr&&Sr.keys&&Sr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Xa=iu.toString,fn=Ga.hasOwnProperty,Ya=Ga.toString,su=RegExp("^"+Xa.call(fn).replace(Zl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ka=yr.Symbol,lu=ou.splice,uu=Qa(yr,"Map"),Mt=Qa(Object,"create"),Za=Ka?Ka.prototype:void 0,Ja=Za?Za.toString:void 0;function st(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function cu(){this.__data__=Mt?Mt(null):{}}function du(e){return this.has(e)&&delete this.__data__[e]}function fu(e){var t=this.__data__;if(Mt){var n=t[e];return n===Ba?void 0:n}return fn.call(t,e)?t[e]:void 0}function pu(e){var t=this.__data__;return Mt?t[e]!==void 0:fn.call(t,e)}function hu(e,t){var n=this.__data__;return n[e]=Mt&&t===void 0?Ba:t,this}st.prototype.clear=cu,st.prototype.delete=du,st.prototype.get=fu,st.prototype.has=pu,st.prototype.set=hu;function bt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function mu(){this.__data__=[]}function gu(e){var t=this.__data__,n=pn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():lu.call(t,n,1),!0}function vu(e){var t=this.__data__,n=pn(t,e);return n<0?void 0:t[n][1]}function yu(e){return pn(this.__data__,e)>-1}function Su(e,t){var n=this.__data__,r=pn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}bt.prototype.clear=mu,bt.prototype.delete=gu,bt.prototype.get=vu,bt.prototype.has=yu,bt.prototype.set=Su;function lt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function bu(){this.__data__={hash:new st,map:new(uu||bt),string:new st}}function Tu(e){return hn(this,e).delete(e)}function Ru(e){return hn(this,e).get(e)}function Cu(e){return hn(this,e).has(e)}function _u(e,t){return hn(this,e).set(e,t),this}lt.prototype.clear=bu,lt.prototype.delete=Tu,lt.prototype.get=Ru,lt.prototype.has=Cu,lt.prototype.set=_u;function wu(e,t,n){var r=e[t];(!(fn.call(e,t)&&eo(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function pn(e,t){for(var n=e.length;n--;)if(eo(e[n][0],t))return n;return-1}function Iu(e){if(!mn(e)||Nu(e))return!1;var t=Uu(e)||au(e)?su:Ql;return t.test(Vu(e))}function xu(e,t,n,r){if(!mn(e))return e;t=Du(t,e)?[t]:Eu(t);for(var a=-1,o=t.length,i=o-1,u=e;u!=null&&++a<o;){var l=Lu(t[a]),c=n;if(a!=i){var d=u[l];c=r?r(d,l,u):void 0,c===void 0&&(c=mn(d)?d:Pu(t[a+1])?[]:{})}wu(u,l,c),u=u[l]}return e}function Ou(e){if(typeof e=="string")return e;if(Tr(e))return Ja?Ja.call(e):"";var t=e+"";return t=="0"&&1/e==-Fa?"-0":t}function Eu(e){return to(e)?e:ju(e)}function hn(e,t){var n=e.__data__;return Mu(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Qa(e,t){var n=ru(e,t);return Iu(n)?n:void 0}function Pu(e,t){return t=t==null?$l:t,!!t&&(typeof e=="number"||eu.test(e))&&e>-1&&e%1==0&&e<t}function Du(e,t){if(to(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Tr(e)?!0:Xl.test(e)||!ql.test(e)||t!=null&&e in Object(t)}function Mu(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Nu(e){return!!qa&&qa in e}var ju=br(function(e){e=Wu(e);var t=[];return Yl.test(e)&&t.push(""),e.replace(Kl,function(n,r,a,o){t.push(a?o.replace(Jl,"$1"):r||n)}),t});function Lu(e){if(typeof e=="string"||Tr(e))return e;var t=e+"";return t=="0"&&1/e==-Fa?"-0":t}function Vu(e){if(e!=null){try{return Xa.call(e)}catch{}try{return e+""}catch{}}return""}function br(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(Hl);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i),i};return n.cache=new(br.Cache||lt),n}br.Cache=lt;function eo(e,t){return e===t||e!==e&&t!==t}var to=Array.isArray;function Uu(e){var t=mn(e)?Ya.call(e):"";return t==Bl||t==Fl}function mn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ku(e){return!!e&&typeof e=="object"}function Tr(e){return typeof e=="symbol"||ku(e)&&Ya.call(e)==Gl}function Wu(e){return e==null?"":Ou(e)}function zu(e,t,n){return e==null?e:xu(e,t,n)}var Au=zu;const Hu=wn(Au);var $u="Expected a function",no="__lodash_hash_undefined__",ro=1/0,Bu="[object Function]",Fu="[object GeneratorFunction]",Gu="[object Symbol]",qu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xu=/^\w*$/,Yu=/^\./,Ku=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zu=/[\\^$.*+?()[\]{}|]/g,Ju=/\\(\\)?/g,Qu=/^\[object .+?Constructor\]$/,ec=typeof Be=="object"&&Be&&Be.Object===Object&&Be,tc=typeof self=="object"&&self&&self.Object===Object&&self,Rr=ec||tc||Function("return this")();function nc(e,t){return e==null?void 0:e[t]}function rc(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var ac=Array.prototype,oc=Function.prototype,ao=Object.prototype,Cr=Rr["__core-js_shared__"],oo=function(){var e=/[^.]+$/.exec(Cr&&Cr.keys&&Cr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),io=oc.toString,_r=ao.hasOwnProperty,so=ao.toString,ic=RegExp("^"+io.call(_r).replace(Zu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lo=Rr.Symbol,sc=ac.splice,lc=fo(Rr,"Map"),Nt=fo(Object,"create"),uo=lo?lo.prototype:void 0,co=uo?uo.toString:void 0;function ut(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function uc(){this.__data__=Nt?Nt(null):{}}function cc(e){return this.has(e)&&delete this.__data__[e]}function dc(e){var t=this.__data__;if(Nt){var n=t[e];return n===no?void 0:n}return _r.call(t,e)?t[e]:void 0}function fc(e){var t=this.__data__;return Nt?t[e]!==void 0:_r.call(t,e)}function pc(e,t){var n=this.__data__;return n[e]=Nt&&t===void 0?no:t,this}ut.prototype.clear=uc,ut.prototype.delete=cc,ut.prototype.get=dc,ut.prototype.has=fc,ut.prototype.set=pc;function Tt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function hc(){this.__data__=[]}function mc(e){var t=this.__data__,n=gn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():sc.call(t,n,1),!0}function gc(e){var t=this.__data__,n=gn(t,e);return n<0?void 0:t[n][1]}function vc(e){return gn(this.__data__,e)>-1}function yc(e,t){var n=this.__data__,r=gn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}Tt.prototype.clear=hc,Tt.prototype.delete=mc,Tt.prototype.get=gc,Tt.prototype.has=vc,Tt.prototype.set=yc;function ct(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Sc(){this.__data__={hash:new ut,map:new(lc||Tt),string:new ut}}function bc(e){return vn(this,e).delete(e)}function Tc(e){return vn(this,e).get(e)}function Rc(e){return vn(this,e).has(e)}function Cc(e,t){return vn(this,e).set(e,t),this}ct.prototype.clear=Sc,ct.prototype.delete=bc,ct.prototype.get=Tc,ct.prototype.has=Rc,ct.prototype.set=Cc;function gn(e,t){for(var n=e.length;n--;)if(jc(e[n][0],t))return n;return-1}function _c(e,t){t=Oc(t,e)?[t]:xc(t);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Mc(t[n++])];return n&&n==r?e:void 0}function wc(e){if(!ho(e)||Pc(e))return!1;var t=Lc(e)||rc(e)?ic:Qu;return t.test(Nc(e))}function Ic(e){if(typeof e=="string")return e;if(Ir(e))return co?co.call(e):"";var t=e+"";return t=="0"&&1/e==-ro?"-0":t}function xc(e){return po(e)?e:Dc(e)}function vn(e,t){var n=e.__data__;return Ec(t)?n[typeof t=="string"?"string":"hash"]:n.map}function fo(e,t){var n=nc(e,t);return wc(n)?n:void 0}function Oc(e,t){if(po(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ir(e)?!0:Xu.test(e)||!qu.test(e)||t!=null&&e in Object(t)}function Ec(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Pc(e){return!!oo&&oo in e}var Dc=wr(function(e){e=Uc(e);var t=[];return Yu.test(e)&&t.push(""),e.replace(Ku,function(n,r,a,o){t.push(a?o.replace(Ju,"$1"):r||n)}),t});function Mc(e){if(typeof e=="string"||Ir(e))return e;var t=e+"";return t=="0"&&1/e==-ro?"-0":t}function Nc(e){if(e!=null){try{return io.call(e)}catch{}try{return e+""}catch{}}return""}function wr(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError($u);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i),i};return n.cache=new(wr.Cache||ct),n}wr.Cache=ct;function jc(e,t){return e===t||e!==e&&t!==t}var po=Array.isArray;function Lc(e){var t=ho(e)?so.call(e):"";return t==Bu||t==Fu}function ho(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Vc(e){return!!e&&typeof e=="object"}function Ir(e){return typeof e=="symbol"||Vc(e)&&so.call(e)==Gu}function Uc(e){return e==null?"":Ic(e)}function kc(e,t,n){var r=e==null?void 0:_c(e,t);return r===void 0?n:r}var Wc=kc;const zc=wn(Wc),mo=(e,t)=>(s.iconMap[e]||[])[Number(t)]||"",Ac=e=>{const t=ne.useDependency(m.IUniverInstanceService),n=t.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=t.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),a=I.useMemo(()=>e.error?N.errorInput:"",[e.error]);return h.jsx("div",{className:N.positionRelative,children:e.type!==s.CFValueType.formula?h.jsxs(h.Fragment,{children:[h.jsx(q.InputNumber,{className:a,value:Number(e.value)||0,onChange:o=>e.onChange(o!=null?o:0)}),e.error&&h.jsx("div",{className:N.errorText,children:e.error})]}):h.jsx(Te.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_icon_set_${e.id}`),value:String(e.value).startsWith("=")?String(e.value):"=",openForSheetSubUnitId:r,openForSheetUnitId:n,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(o="")=>{const i=o||"";e.onChange(i)}})})},go=(e,t,n)=>({operator:s.CFNumberOperator.greaterThan,value:{type:s.CFValueType.num,value:(n.length-1-t)*10},iconType:e,iconId:String(t)}),Hc=e=>{const t=ne.useDependency(m.LocaleService),n=r=>{e.onClick(r)};return h.jsx("div",{className:N.iconGroupList,children:s.iconGroup.map((r,a)=>h.jsxs("div",{className:N.group,children:[h.jsx("div",{className:N.title,children:t.t(r.title)}),h.jsx("div",{className:N.itemContent,children:r.group.map(o=>h.jsx("div",{className:N.itemWrap,onClick:()=>{n(o.name)},children:h.jsx("div",{className:N.item,children:o.list.map((i,u)=>h.jsx("img",{className:N.icon,src:i},u))})},o.name))})]},a))})},$c=e=>{const t=I.useMemo(()=>{const r=[];for(const a in s.iconMap){const o=s.iconMap[a],i=a;o.forEach((u,l)=>{r.push({iconType:i,base64:u,iconId:String(l)})})}return r},[]),n=r=>{e.onClick(r.iconType,r.iconId)};return h.jsxs("div",{className:N.iconItemListWrap,children:[h.jsxs("div",{className:N.none,onClick:()=>n({iconType:s.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[h.jsx(zt,{className:N.icon}),h.jsx("span",{children:"无单元格图标"})]}),h.jsx("div",{className:N.iconItemList,children:t.map(r=>h.jsx("div",{className:N.item,children:h.jsx("img",{onClick:()=>n(r),className:`${N.icon}`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Bc=e=>{const{onChange:t,configList:n,errorMap:r={}}=e,a=ne.useDependency(m.LocaleService),o=[{label:a.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThan}`),value:s.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThanOrEqual}`),value:s.CFNumberOperator.greaterThanOrEqual}],i=[{label:a.t(`sheet.cf.valueType.${s.CFValueType.num}`),value:s.CFValueType.num},{label:a.t(`sheet.cf.valueType.${s.CFValueType.percent}`),value:s.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${s.CFValueType.percentile}`),value:s.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${s.CFValueType.formula}`),value:s.CFValueType.formula}],u=(p,f)=>{t([String(f),"value","value"],p)},l=(p,f)=>{t([String(f),"operator"],p);const v=s.createDefaultValue(s.CFSubRuleType.number,p);u(v,f)},c=(p,f)=>{t([String(f),"value","type"],p)};return I.useMemo(()=>n.map((p,f)=>{const v=r[f],y=mo(p.iconType,p.iconId),b=f===n.length-1,x=f===0,_=n[f-1],T=(_==null?void 0:_.value.type)===s.CFValueType.formula?a.t("sheet.cf.valueType.formula"):_==null?void 0:_.value.value,S=(R,g)=>{const O={...p,iconId:g,iconType:R};t([String(f)],O)};return h.jsxs("div",{className:`${f?D.mTXl:D.mTSm}`,children:[h.jsxs("div",{className:`${D.label} ${N.flex}`,children:[h.jsxs("div",{className:`${N.width45}`,children:[a.t("sheet.cf.iconSet.icon"),f+1]}),h.jsx("div",{className:`${N.width45}`,children:h.jsxs(h.Fragment,{children:[!x&&!b&&a.t("sheet.cf.iconSet.rule"),!x&&!b&&h.jsxs("span",{className:N.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${s.getOppositeOperator(_.operator)}`),T,b?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),h.jsxs("div",{className:`${N.flex} ${D.mTSm}`,children:[h.jsx("div",{className:`${N.iconWrap} ${N.width45}`,children:h.jsx(q.Dropdown,{overlay:h.jsx($c,{onClick:S,iconId:p.iconId,iconType:p.iconType}),children:h.jsxs("div",{className:N.dropdownIcon,children:[y?h.jsx("img",{src:y,className:N.icon}):h.jsx(zt,{className:N.icon}),h.jsx(xn,{})]})})}),b?h.jsxs("div",{className:`${N.width45} ${D.label}`,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),h.jsxs("span",{className:N.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${s.getOppositeOperator(_.operator)}`),T,b?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]}):h.jsx(q.Select,{className:`${D.mL0} ${N.width45} ${D.mR0}`,options:o,value:p.operator,onChange:R=>{l(R,f)}})]}),b?h.jsx("div",{}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:`${D.mTSm} ${D.label} ${N.flex}`,children:[h.jsx("div",{className:`${N.width45}`,children:a.t("sheet.cf.iconSet.type")}),h.jsx("div",{className:`${N.width45}`,children:a.t("sheet.cf.iconSet.value")})]}),h.jsxs("div",{className:`${D.mTSm} ${N.flex}`,children:[h.jsx(q.Select,{className:`${N.width45} ${D.mL0}`,options:i,value:p.value.type,onChange:R=>{c(R,f)}}),h.jsx("div",{className:`${D.mL0} ${N.width45}`,children:h.jsx(Ac,{id:f,type:p.value.type,error:v,value:p.value.value||"",onChange:R=>u(R,f)})})]})]})]},f)}),[n,r])},Fc=e=>{var _;const{interceptorManager:t}=e,n=((_=e.rule)==null?void 0:_.type)===s.CFRuleType.iconSet?e.rule:void 0,r=ne.useDependency(m.LocaleService),[a,o]=I.useState({}),[i,u]=I.useState(()=>{const T=Object.keys(s.iconMap)[0];if(n&&n.config.length){const S=n.config[0].iconType;if(!n.config.some(g=>g.iconType!==S))return S}return T}),[l,c]=I.useState(()=>{if(n&&n.config.length)return m.Tools.deepClone(n==null?void 0:n.config);const T=s.iconMap[i]||[];return new Array(T.length).fill("").map((S,R,g)=>R===g.length-1?{operator:s.CFNumberOperator.lessThanOrEqual,value:{type:s.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:i,iconId:String(R)}:go(i,R,g))}),[d,p]=I.useState(()=>n?!!n.isShowValue:!0),f=I.useMemo(()=>{const T=l.map(S=>mo(S.iconType,S.iconId));return h.jsx("div",{className:N.iconWrap,children:T.map((S,R)=>S?h.jsx("img",{className:N.icon,src:S},R):h.jsx(zt,{className:N.icon},R))})},[l]),v=T=>{if(T.reduce((R,g,O)=>R.preType&&!R.result||T.length-1===O?R:g.value.type===s.CFValueType.formula?{preType:s.CFValueType.formula,result:!1}:R.preType?{result:R.preType===g.value.type,preType:g.value.type}:{result:!0,preType:g.value.type},{result:!0,preType:""}).result&&[s.CFValueType.num,s.CFValueType.percent,s.CFValueType.percentile].includes(T[0].value.type)){const R={};return T.forEach((g,O,E)=>{if(O-1<0||O===E.length-1)return;const j=T[O-1],L=s.getOppositeOperator(j.operator);s.compareWithNumber({operator:L,value:j.value.value},g.value.value)||(R[O]=`${r.t(`sheet.cf.form.${L}`,String(j.value.value))} `)}),R}return{}},y=(T,S)=>{zc(l,T)!==S&&(Hu(l,T,S),c([...l]),o(v(l)))},b=T=>{u(T);const S=s.iconMap[T]||[],R=new Array(S.length).fill("").map((g,O,E)=>go(T,O,E));c(R),o(v(R))};I.useEffect(()=>{const T=t.intercept(t.getInterceptPoints().submit,{handler(){return{type:s.CFRuleType.iconSet,isShowValue:d,config:l}}});return()=>{T()}},[d,l,t]),I.useEffect(()=>{const T=t.intercept(t.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{T()}},[d,l,t,a]);const x=()=>{const T=l.map(S=>({...S}));l.forEach((S,R)=>{const g=l.length-1-R,O=T[g];S.iconId=O.iconId,S.iconType=O.iconType}),c([...l])};return h.jsxs("div",{className:N.iconSet,children:[h.jsx("div",{className:D.title,children:r.t("sheet.cf.panel.styleRule")}),h.jsx("div",{className:`${D.mTSm}`,children:h.jsx(q.Dropdown,{overlay:h.jsx(Hc,{iconType:i,onClick:b}),children:h.jsxs("div",{className:N.dropdownIcon,style:{width:"unset"},children:[f,h.jsx(xn,{})]})})}),h.jsxs("div",{className:`${D.mTSm} ${N.renderConfig}`,children:[h.jsxs("div",{className:N.utilItem,children:[h.jsx(q.Checkbox,{onChange:x}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),h.jsxs("div",{className:`${N.utilItem} ${D.mLXl}`,children:[h.jsx(q.Checkbox,{checked:!d,onChange:T=>{p(!T)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),h.jsx(Bc,{errorMap:a,onChange:y,configList:l})]})},vo=e=>e.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),yo=e=>e.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),Gc=e=>{var R,g,O,E;const t=ne.useDependency(m.LocaleService),n=ne.useDependency(m.ICommandService),r=ne.useDependency(m.IUniverInstanceService),a=ne.useDependency(s.ConditionalFormattingRuleModel),o=ne.useDependency(V.SelectionManagerService),i=vo(r),u=yo(r),l=I.useRef((g=(R=e.rule)==null?void 0:R.ranges)!=null?g:[]),c=I.useMemo(()=>{var j,L;let w=(j=e.rule)==null?void 0:j.ranges;return w!=null&&w.length||(w=(L=o.getSelectionRanges())!=null?L:[]),l.current=w,w!=null&&w.length?w.map(k=>{const G=Or.serializeRange(k);return G==="NaN"?"":G}).filter(k=>!!k).join(","):""},[e.rule]),d=[{label:t.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:t.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:t.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:t.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:t.t("sheet.cf.ruleType.formula"),value:"5"},{label:t.t("sheet.cf.ruleType.iconSet"),value:"6"}],[p,f]=I.useState(()=>{var L,k;const w=(L=e.rule)==null?void 0:L.rule.type,j=d[0].value;if(!w)return j;switch(w){case s.CFRuleType.highlightCell:{switch((k=e.rule)==null?void 0:k.rule.subType){case s.CFSubRuleType.number:case s.CFSubRuleType.text:case s.CFSubRuleType.duplicateValues:case s.CFSubRuleType.uniqueValues:case s.CFSubRuleType.timePeriod:return"1";case s.CFSubRuleType.average:case s.CFSubRuleType.rank:return"2";case s.CFSubRuleType.formula:return"5"}break}case s.CFRuleType.dataBar:return"3";case s.CFRuleType.colorScale:return"4";case s.CFRuleType.iconSet:return"6"}return j}),v=I.useRef(),y=I.useMemo(()=>new m.InterceptorManager({beforeSubmit:Ll,submit:Vl}),[]),b=I.useMemo(()=>{switch(p){case"1":return $a;case"2":return Wl;case"3":return kl;case"4":return Ul;case"5":return Al;case"6":return Fc;default:return $a}},[p]);I.useEffect(()=>{var w;if(((w=e.rule)==null?void 0:w.cfId)!==void 0){const j=n.onCommandExecuted(L=>{if(L.id===V.RemoveSheetMutation.id){const k=L.params;k.subUnitId===u&&k.unitId===i&&e.onCancel()}L.id===V.SetWorksheetActiveOperation.id&&e.onCancel()});return()=>j.dispose()}},[(O=e.rule)==null?void 0:O.cfId]);const x=w=>{v.current=w},_=w=>{l.current=w.map(j=>j.range)},T=()=>{const w=y.fetchThroughInterceptors(y.getInterceptPoints().beforeSubmit)(!0,null),j=()=>{const L=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet();return l.current.map(C=>V.setEndForRange(C,L.getRowCount(),L.getColumnCount())).filter(C=>!(Number.isNaN(C.startRow)||Number.isNaN(C.startColumn)))};if(w){const L=y.fetchThroughInterceptors(y.getInterceptPoints().submit)(null,null),k=j();if(L&&k.length){const G=vo(r),C=yo(r);let P={};e.rule&&e.rule.cfId?(P={...e.rule,ranges:k,rule:L},n.executeCommand(za.id,{unitId:G,subUnitId:C,rule:P}),e.onCancel()):(P={cfId:a.createCfId(G,C),ranges:k,rule:L,stopIfTrue:!1},n.executeCommand(un.id,{unitId:G,subUnitId:C,rule:P}),e.onCancel())}}},S=()=>{e.onCancel()};return h.jsxs("div",{className:N.cfRuleStyleEditor,children:[h.jsx("div",{className:D.title,children:t.t("sheet.cf.panel.range")}),h.jsx("div",{className:`${D.mTBase}`,children:h.jsx(Te.RangeSelector,{placeholder:t.t("sheet.cf.form.rangeSelector"),width:"100%",openForSheetSubUnitId:u,openForSheetUnitId:i,value:c,id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_rangeSelector`),onChange:_})}),h.jsx("div",{className:D.title,children:t.t("sheet.cf.panel.styleType")}),h.jsx("div",{className:D.mTBase,children:h.jsx(q.Select,{className:N.width100,value:p,options:d,onChange:w=>f(w)})}),h.jsx(b,{interceptorManager:y,rule:(E=e.rule)==null?void 0:E.rule,onChange:x}),h.jsxs("div",{className:`${D.mTBase} ${N.btnList}`,children:[h.jsx(q.Button,{size:"small",onClick:S,children:t.t("sheet.cf.panel.cancel")}),h.jsx(q.Button,{className:D.mLSm,size:"small",type:"primary",onClick:T,children:t.t("sheet.cf.panel.submit")})]})]})},qc=e=>{const[t,n]=I.useState(e.rule),[r,a]=I.useState(!!e.rule),o=()=>{a(!0)},i=()=>{a(!1),n(void 0)},u=l=>{n(l),a(!0)};return h.jsx("div",{className:D.conditionalFormattingWrap,children:r?h.jsx(Gc,{onCancel:i,rule:t}):h.jsx(jl,{onClick:u,onCreate:o})})};var Xc=Object.defineProperty,Yc=Object.getOwnPropertyDescriptor,Kc=(e,t,n,r)=>{for(var a=r>1?void 0:r?Yc(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Xc(t,n,a),a},Rt=(e,t)=>(n,r)=>t(n,r,e);const Zc={},So="sheet.conditional.formatting.panel";let Ct=class extends m.Disposable{constructor(t,n,r,a,o,i,u){super();Ze(this,"_sidebarDisposable",null);this._config=t,this._univerInstanceService=n,this._injector=r,this._componentManager=a,this._menuService=o,this._sidebarService=i,this._localeService=u,this._initMenu(),this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(m.UniverInstanceType.UNIVER_SHEET).subscribe(l=>{var c;l||(c=this._sidebarDisposable)==null||c.dispose()}))}openPanel(t){const n={header:{title:this._localeService.t("sheet.cf.title")},children:{label:So,rule:t},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initMenu(){const{menu:t={}}=this._config;this._menuService.addMenuItem(Lo(this._injector),t)}_initPanel(){this._componentManager.register(So,qc)}};Ct=Kc([m.OnLifecycle(m.LifecycleStages.Ready,Ct),Rt(1,m.IUniverInstanceService),Rt(2,U.Inject(U.Injector)),Rt(3,U.Inject(Te.ComponentManager)),Rt(4,U.Inject(Te.IMenuService)),Rt(5,U.Inject(Te.ISidebarService)),Rt(6,U.Inject(m.LocaleService))],Ct);var Oe=(e=>(e[e.createRule=1]="createRule",e[e.viewRule=2]="viewRule",e[e.highlightCell=3]="highlightCell",e[e.rank=4]="rank",e[e.formula=5]="formula",e[e.colorScale=6]="colorScale",e[e.dataBar=7]="dataBar",e[e.icon=8]="icon",e[e.clearRangeRules=9]="clearRangeRules",e[e.clearWorkSheetRules=10]="clearWorkSheetRules",e))(Oe||{});const bo={id:"sheet.operation.open.conditional.formatting.panel",type:m.CommandType.OPERATION,handler:(e,t)=>{const n=e.get(Ct),r=e.get(V.SelectionManagerService),a=e.get(m.ICommandService),o=r.getSelectionRanges()||[];switch(t.value){case 3:{n.openPanel({...s.createDefaultRule(),ranges:o});break}case 4:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank}};n.openPanel(u);break}case 5:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula,value:"="}};n.openPanel(u);break}case 6:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.colorScale,config:[]}};n.openPanel(u);break}case 7:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(u);break}case 8:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(u);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...s.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(Pr.id,{ranges:o});break}case 10:{a.executeCommand(_n.id);break}}return!0}};var Jc=Object.defineProperty,Qc=Object.getOwnPropertyDescriptor,ed=(e,t,n,r)=>{for(var a=r>1?void 0:r?Qc(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Jc(t,n,a),a},Ne=(e,t)=>(n,r)=>t(n,r,e);let yn=class extends m.Disposable{constructor(e,t,n,r,a,o,i,u,l,c,d){super(),this._sheetInterceptorService=e,this._conditionalFormattingService=t,this._univerInstanceService=n,this._renderManagerService=r,this._conditionalFormattingViewModel=a,this._conditionalFormattingRuleModel=o,this._sheetSkeletonManagerService=i,this._selectionProtectionRenderModel=u,this._rangeProtectionRuleModel=l,this._worksheetProtectionRuleModel=c,this._permissionService=d,this._initViewModelInterceptor(),this._initSkeleton()}_initSkeleton(){const e=()=>{var n,r;this._sheetSkeletonManagerService.reCalculate();const t=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=(n=this._renderManagerService.getRenderById(t))==null?void 0:n.mainComponent)==null||r.makeDirty()};this.disposeWithMe(this._conditionalFormattingViewModel.markDirty$.pipe(De.bufferTime(16),De.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(De.bufferTime(16),De.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>["sort","delete"].includes(a.type)&&a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingService.ruleComputeStatus$.pipe(De.bufferTime(16),De.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(V.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(!r)return n(e);const a=t.workbook.getStyles(),i={...(typeof(e==null?void 0:e.s)=="string"?a.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},u={...e,s:i};return r.style&&Object.assign(i,r.style),u.fontRenderExtension||(u.fontRenderExtension={},r.isShowValue!==void 0&&(u.fontRenderExtension.isSkip=!r.isShowValue)),r.dataBar&&(u.dataBar=r.dataBar),r.iconSet&&(u.iconSet=r.iconSet,u.fontRenderExtension.leftOffset=s.DEFAULT_PADDING+s.DEFAULT_WIDTH),n(u)},priority:10}))}_initViewModelByRangeInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(V.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(e={},t,n)=>{const{unitId:r,subUnitId:a,row:o,col:i}=t,u=this._selectionProtectionRenderModel.getCellInfo(r,a,o,i).filter(l=>!!l.ruleId).map(l=>{const c=this._rangeProtectionRuleModel.getRule(r,a,l.ruleId)||{};return{...l,ranges:c.ranges}}).filter(l=>!!l.ranges);if(u.length){const l=u.some(f=>!(f!=null&&f[$e.View])),c={...e,selectionProtection:u},{dataBar:d,iconSet:p}=c;return l&&(d&&(d.isSkip=!0),p&&(p.isSkip=!0)),n(c)}return n(e)}}))}_initViewModelBySheetInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(V.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(e={},t,n)=>{var i,u,l,c,d;const{unitId:r,subUnitId:a}=t,o=this._worksheetProtectionRuleModel.getRule(r,a);if(o!=null&&o.permissionId&&o.name){const p=[{[$e.View]:(u=(i=this._permissionService.getPermissionPoint(new V.WorksheetViewPermission(r,a).id))==null?void 0:i.value)!=null?u:!1,[$e.Edit]:(c=(l=this._permissionService.getPermissionPoint(new V.WorksheetEditPermission(r,a).id))==null?void 0:l.value)!=null?c:!1}],f=!((d=p[0])!=null&&d[$e.View]),v={...e,hasWorksheetRule:!0,selectionProtection:p},{dataBar:y,iconSet:b}=v;return f&&(y&&(y.isSkip=!0),b&&(b.isSkip=!0)),n(v)}return n(e)}}))}};yn=ed([m.OnLifecycle(m.LifecycleStages.Rendered,yn),Ne(0,U.Inject(V.SheetInterceptorService)),Ne(1,U.Inject(s.ConditionalFormattingService)),Ne(2,U.Inject(m.IUniverInstanceService)),Ne(3,U.Inject(wo.IRenderManagerService)),Ne(4,U.Inject(s.ConditionalFormattingViewModel)),Ne(5,U.Inject(s.ConditionalFormattingRuleModel)),Ne(6,U.Inject(le.SheetSkeletonManagerService)),Ne(7,U.Inject(V.RangeProtectionRenderModel)),Ne(8,U.Inject(V.RangeProtectionRuleModel)),Ne(9,U.Inject(V.WorksheetProtectionRuleModel)),Ne(10,m.IPermissionService)],yn);var td=Object.defineProperty,nd=Object.getOwnPropertyDescriptor,rd=(e,t,n,r)=>{for(var a=r>1?void 0:r?nd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&td(t,n,a),a},jt=(e,t)=>(n,r)=>t(n,r,e);let Sn=class extends m.Disposable{constructor(t,n,r,a,o){super();Ze(this,"_copyInfo");this._sheetClipboardService=t,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(t,n,r)=>this._collectConditionalRule(t,n,r),onPasteCells:(t,n,r,a)=>{const{copyType:o=le.COPY_TYPE.COPY,pasteType:i}=a,{range:u}=t||{},{range:l}=n;return this._generateConditionalFormattingMutations(l,{copyType:o,pasteType:i,copyRange:u})}}))}_collectConditionalRule(t,n,r){const a=new m.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:t,subUnitId:n,cfMap:o}};const i=this._conditionalFormattingViewModel.getMatrix(t,n);if(!i)return;const u={get:this._injector.get.bind(this._injector)},l=le.rangeToDiscreteRange(r,u,t,n);if(!l)return;const{rows:c,cols:d}=l,p=new Set;c.forEach((f,v)=>{d.forEach((y,b)=>{const x=this._conditionalFormattingViewModel.getCellCf(t,n,f,y,i);x&&(x.cfList.forEach(_=>p.add(_.cfId)),a.setValue(v,b,x.cfList.map(_=>_.cfId)))})}),p.forEach(f=>{const v=this._conditionalFormattingRuleModel.getRule(t,n,f);v&&(o[f]=v.rule)})}_generateConditionalFormattingMutations(t,n){const r=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),a=r.getActiveSheet(),o=r.getUnitId(),i=a.getSheetId();if(n.copyType===le.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![le.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,le.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,le.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[u,l],mapFunc:c}=le.virtualizeDiscreteRanges([n.copyRange,t]),d=le.getRepeatRange(u,l,!0),p=this._conditionalFormattingViewModel.getMatrix(o,i),f={};m.Range.foreach(l,(g,O)=>{const{row:E,col:w}=c(g,O),j=this._conditionalFormattingViewModel.getCellCf(o,i,E,w,p);j&&j.cfList.forEach(L=>{if(!f[L.cfId]){const k=new m.ObjectMatrix;f[L.cfId]=k;const G=this._conditionalFormattingRuleModel.getRule(o,i,L.cfId);G==null||G.ranges.forEach(C=>{m.Range.foreach(C,(P,Q)=>{k.setValue(P,Q,1)})})}f[L.cfId].realDeleteValue(E,w)})});const{matrix:v,info:y}=this._copyInfo,b=[];let x=this._conditionalFormattingRuleModel.createCfId(o,i);const _={},T=g=>{if(_[g])return _[g];const O=y==null?void 0:y.cfMap[g],E=[...this._conditionalFormattingRuleModel.getSubunitRules(o,i)||[],...b].find(w=>m.Tools.diffValue(w.rule,O));if(E)return _[g]=E,E;{const w={rule:O,cfId:x,ranges:[],stopIfTrue:!1};return _[g]=w,b.push(w),x=`${Number(x)+1}`,w}};d.forEach(g=>{v&&v.forValue((O,E,w)=>{const j=m.Rectangle.getPositionRange({startRow:O,endRow:O,startColumn:E,endColumn:E},g.startRange),{row:L,col:k}=c(j.startRow,j.startColumn);w.forEach(G=>{if(!f[G]){const C=T(G),P=new m.ObjectMatrix;f[G]=P,C.ranges.forEach(Q=>{m.Range.foreach(Q,(_e,ve)=>{P.setValue(_e,ve,1)})})}f[G].setValue(L,k,1)})})});const S=[],R=[];for(const g in f){const O=f[g],E=V.findAllRectangle(V.createTopMatrixFromMatrix(O));if(!E.length){const w={unitId:o,subUnitId:i,cfId:g};S.push({id:s.DeleteConditionalRuleMutation.id,params:w}),R.push(...s.DeleteConditionalRuleMutationUndoFactory(this._injector,w))}if(b.some(w=>w.cfId===g)){const w=T(g),j={unitId:o,subUnitId:i,rule:{...w,ranges:E}};S.push({id:s.AddConditionalRuleMutation.id,params:j}),R.push(s.AddConditionalRuleMutationUndoFactory(this._injector,j))}else{const w=this._conditionalFormattingRuleModel.getRule(o,i,g);if(!w)continue;const j={unitId:o,subUnitId:i,rule:{...w,ranges:E}};S.push({id:s.SetConditionalRuleMutation.id,params:j}),R.push(...s.setConditionalRuleMutationUndoFactory(this._injector,j))}}return{redos:S,undos:R}}};Sn=rd([m.OnLifecycle(m.LifecycleStages.Rendered,Sn),jt(0,U.Inject(le.ISheetClipboardService)),jt(1,U.Inject(s.ConditionalFormattingRuleModel)),jt(2,U.Inject(U.Injector)),jt(3,U.Inject(s.ConditionalFormattingViewModel)),jt(4,U.Inject(m.IUniverInstanceService))],Sn);var ad=Object.defineProperty,od=Object.getOwnPropertyDescriptor,id=(e,t,n,r)=>{for(var a=r>1?void 0:r?od(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&ad(t,n,a),a},Lt=(e,t)=>(n,r)=>t(n,r,e);let bn=class extends m.Disposable{constructor(e,t,n,r,a){super(),this._injector=e,this._univerInstanceService=t,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const e=()=>({redos:[],undos:[]}),t=(a,o,i,u,l)=>{const c=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),d=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),p={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},f={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};m.Range.foreach(i,(v,y)=>{const b=m.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},p),x=m.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},f),{row:_,col:T}=l(b.startRow,b.startColumn),S=this._conditionalFormattingViewModel.getCellCf(c,d,_,T),{row:R,col:g}=l(x.startRow,x.startColumn),O=this._conditionalFormattingViewModel.getCellCf(c,d,R,g);O&&O.cfList.forEach(E=>{let w=u.get(E.cfId);if(!u.get(E.cfId)){const j=this._conditionalFormattingRuleModel.getRule(c,d,E.cfId);if(!j)return;w=new m.ObjectMatrix,j.ranges.forEach(L=>{m.Range.foreach(L,(k,G)=>{w.setValue(k,G,1)})}),u.set(E.cfId,w)}w.realDeleteValue(R,g)}),S&&S.cfList.forEach(E=>{let w=u.get(E.cfId);if(!u.get(E.cfId)){const j=this._conditionalFormattingRuleModel.getRule(c,d,E.cfId);if(!j)return;w=new m.ObjectMatrix,j.ranges.forEach(L=>{m.Range.foreach(L,(k,G)=>{w.setValue(k,G,1)})}),u.set(E.cfId,w)}w.setValue(R,g,1)})})},n=(a,o)=>{var _,T;const i=(_=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:_.getUnitId(),u=(T=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:T.getActiveSheet().getSheetId(),l=new Map,c=[],d=[];if(!i||!u)return e();const p=le.virtualizeDiscreteRanges([a,o]),[f,v]=p.ranges,{mapFunc:y}=p,b={row:f.startRow,col:f.startColumn};return le.getAutoFillRepeatRange(f,v).forEach(S=>{t(b,S.repeatStartCell,S.relativeRange,l,y)}),l.forEach((S,R)=>{const g=this._conditionalFormattingRuleModel.getRule(i,u,R);if(!g)return;const O=V.findAllRectangle(V.createTopMatrixFromMatrix(S)),E={unitId:i,subUnitId:u,rule:{...g,ranges:O}};c.push({id:s.SetConditionalRuleMutation.id,params:E}),d.push(...s.setConditionalRuleMutationUndoFactory(this._injector,E))}),{undos:d,redos:c}},r={id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,i)=>{if(i===le.APPLY_TYPE.COPY||i===le.APPLY_TYPE.ONLY_FORMAT||i===le.APPLY_TYPE.SERIES){const{source:u,target:l}=a;return n(u,l)}return e()}};this.disposeWithMe(this._autoFillService.addHook(r))}};bn=id([m.OnLifecycle(m.LifecycleStages.Rendered,bn),Lt(0,U.Inject(U.Injector)),Lt(1,U.Inject(m.IUniverInstanceService)),Lt(2,U.Inject(le.IAutoFillService)),Lt(3,U.Inject(s.ConditionalFormattingRuleModel)),Lt(4,U.Inject(s.ConditionalFormattingViewModel))],bn);var sd=Object.defineProperty,ld=Object.getOwnPropertyDescriptor,ud=(e,t,n,r)=>{for(var a=r>1?void 0:r?ld(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&sd(t,n,a),a},Vt=(e,t)=>(n,r)=>t(n,r,e);let Tn=class extends m.Disposable{constructor(e,t,n,r,a){super(),this._conditionalFormattingRuleModel=e,this._univerInstanceService=t,this._injector=n,this._sheetSkeletonManagerService=r,this._refRangeService=a,this._initRefRange()}_initRefRange(){const e=new Map,t=(r,a,o)=>`${r}_${a}_${o}`,n=(r,a,o)=>{const i=l=>{const c=[...o.ranges],d=c.map(f=>V.handleDefaultRangeChangeWithEffectRefCommands(f,l)).filter(f=>!!f);if(s.isRangesEqual(d,c))return{redos:[],undos:[]};if(d.length){const f={unitId:r,subUnitId:a,rule:{...o,ranges:d}},v=[{id:s.SetConditionalRuleMutation.id,params:f}],y=s.setConditionalRuleMutationUndoFactory(this._injector,f);return{redos:v,undos:y}}else{const f={unitId:r,subUnitId:a,cfId:o.cfId},v=[{id:s.DeleteConditionalRuleMutation.id,params:f}],y=s.DeleteConditionalRuleMutationUndoFactory(this._injector,f);return{redos:v,undos:y}}},u=[];o.ranges.forEach(l=>{const c=this._refRangeService.registerRefRange(l,i);u.push(()=>c.dispose())}),e.set(t(r,a,o.cfId),()=>u.forEach(l=>l()))};this.disposeWithMe(we.merge(this._sheetSkeletonManagerService.currentSkeleton$.pipe(De.map(r=>r==null?void 0:r.sheetId),De.distinctUntilChanged())).pipe(De.switchMap(()=>new we.Observable(r=>{const a=new m.DisposableCollection;return r.next(a),()=>{a.dispose()}}))).subscribe(r=>{r.add(m.toDisposable(this._conditionalFormattingRuleModel.$ruleChange.subscribe(a=>{const{unitId:o,subUnitId:i,rule:u}=a,l=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),c=l.getActiveSheet();if(!(a.unitId!==l.getUnitId()||a.subUnitId!==c.getSheetId()))switch(a.type){case"add":{n(a.unitId,a.subUnitId,a.rule);break}case"delete":{const d=e.get(t(o,i,u.cfId));d&&d();break}case"set":{const d=e.get(t(o,i,u.cfId));d&&d(),n(a.unitId,a.subUnitId,a.rule)}}})))})),this.disposeWithMe(m.toDisposable(()=>{e.forEach(r=>{r()}),e.clear()}))}};Tn=ud([m.OnLifecycle(m.LifecycleStages.Rendered,Tn),Vt(0,U.Inject(s.ConditionalFormattingRuleModel)),Vt(1,U.Inject(m.IUniverInstanceService)),Vt(2,U.Inject(U.Injector)),Vt(3,U.Inject(le.SheetSkeletonManagerService)),Vt(4,U.Inject(V.RefRangeService))],Tn);var cd=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,fd=(e,t,n,r)=>{for(var a=r>1?void 0:r?dd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&cd(t,n,a),a},To=(e,t)=>(n,r)=>t(n,r,e);let Rn=class extends m.Disposable{constructor(e,t){super(),this._editorBridgeService=e,this._conditionalFormattingService=t,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(m.toDisposable(this._editorBridgeService.interceptor.intercept(this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(r!=null&&r.style&&(e!=null&&e.p)){const a=Object.keys(r==null?void 0:r.style);if(a.length>0){const o=s.getStringFromDataStream(e.p),i={...(typeof e.s=="string"?t.workbook.getStyles().get(e.s):e.s)||{}};a.forEach(l=>{delete i[l]});const u={...e,s:{...i},v:o};return delete u.p,n(u)}}return n(e)}})))}};Rn=fd([m.OnLifecycle(m.LifecycleStages.Rendered,Rn),To(0,U.Inject(le.IEditorBridgeService)),To(1,U.Inject(s.ConditionalFormattingService))],Rn);var pd=Object.defineProperty,hd=Object.getOwnPropertyDescriptor,md=(e,t,n,r)=>{for(var a=r>1?void 0:r?hd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&pd(t,n,a),a},Ut=(e,t)=>(n,r)=>t(n,r,e);B.ConditionalFormattingClearController=class extends m.Disposable{constructor(t,n,r,a,o){super(),this._injector=t,this._univerInstanceService=n,this._sheetInterceptorService=r,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:t=>{const n=[],r=[],a={redos:n,undos:r};if([V.ClearSelectionFormatCommand.id,V.ClearSelectionAllCommand.id].includes(t.id)){const o=this._selectionManagerService.getSelectionRanges();if(!o)return a;const i=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),u=i.getActiveSheet(),l=this._conditionalFormattingRuleModel.getSubunitRules(i.getUnitId(),u.getSheetId());if(!l||!l.length)return a;l.filter(c=>o.some(d=>c.ranges.some(p=>m.Rectangle.getIntersects(p,d)))).forEach(c=>{const p=new V.RangeMergeUtil().add(...c.ranges).subtract(...o).merge();if(p.length){const f={id:s.SetConditionalRuleMutation.id,params:{unitId:i.getUnitId(),subUnitId:u.getSheetId(),rule:{...c,ranges:p}}},v=s.setConditionalRuleMutationUndoFactory(this._injector,f.params);n.push(f),r.push(...v)}else{const f={id:s.DeleteConditionalRuleMutation.id,params:{unitId:i.getUnitId(),subUnitId:u.getSheetId(),cfId:c.cfId}},v=s.DeleteConditionalRuleMutationUndoFactory(this._injector,f.params);n.push(f),r.push(...v)}})}return a}}))}},B.ConditionalFormattingClearController=md([m.OnLifecycle(m.LifecycleStages.Rendered,B.ConditionalFormattingClearController),Ut(0,U.Inject(U.Injector)),Ut(1,U.Inject(m.IUniverInstanceService)),Ut(2,U.Inject(V.SheetInterceptorService)),Ut(3,U.Inject(V.SelectionManagerService)),Ut(4,U.Inject(s.ConditionalFormattingRuleModel))],B.ConditionalFormattingClearController);var gd=Object.defineProperty,vd=Object.getOwnPropertyDescriptor,yd=(e,t,n,r)=>{for(var a=r>1?void 0:r?vd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&gd(t,n,a),a},xr=(e,t)=>(n,r)=>t(n,r,e);let Cn=class extends m.Disposable{constructor(e,t,n){super(),this._localeService=e,this._commandService=t,this._sheetPermissionInterceptorBaseController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{e.id===un.id&&(this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[V.WorkbookEditablePermission],rangeTypes:[V.RangeProtectionPermissionEditPoint],worksheetTypes:[V.WorksheetEditPermission,V.WorksheetSetCellStylePermission]},e.params.rule.ranges)||this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")))}))}};Cn=yd([m.OnLifecycle(m.LifecycleStages.Rendered,Cn),xr(0,U.Inject(m.LocaleService)),xr(1,m.ICommandService),xr(2,U.Inject(le.SheetPermissionInterceptorBaseController))],Cn);var Sd=Object.defineProperty,bd=Object.getOwnPropertyDescriptor,Td=(e,t,n,r)=>{for(var a=r>1?void 0:r?bd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Sd(t,n,a),a},Ro=(e,t)=>(n,r)=>t(n,r,e);B.UniverSheetsConditionalFormattingUIPlugin=(kt=class extends m.Plugin{constructor(t={},n,r){super(),this._config=t,this._injector=n,this._commandService=r,this._config=m.Tools.deepMerge({},Zc,this._config),this._initCommand(),s.SheetsConditionalFormattingPlugin.dependencyList.forEach(a=>{this._injector.add(a)}),this._injector.add([yn]),this._injector.add([Tn]),this._injector.add([Sn]),this._injector.add([bn]),this._injector.add([Cn]),this._injector.add([Ct,{useFactory:()=>this._injector.createInstance(Ct,this._config)}]),this._injector.add([Dt]),this._injector.add([Rn]),this._injector.add([B.ConditionalFormattingClearController])}_initCommand(){[...s.SheetsConditionalFormattingPlugin.mutationList,...B.UniverSheetsConditionalFormattingUIPlugin.commandList].forEach(t=>{this._commandService.registerCommand(t)})}},Ze(kt,"pluginName",s.SHEET_CONDITIONAL_FORMATTING_PLUGIN),Ze(kt,"type",m.UniverInstanceType.UNIVER_SHEET),Ze(kt,"commandList",[Io,xo,Oo,Eo,Po,Do,Mo,No,jo,bo,hr,za,ka,un,Pr,_n]),kt),B.UniverSheetsConditionalFormattingUIPlugin=Td([Ro(1,U.Inject(U.Injector)),Ro(2,U.Inject(m.ICommandService))],B.UniverSheetsConditionalFormattingUIPlugin);const Rd=Object.freeze(Object.defineProperty({__proto__:null,default:{sheet:{cf:{title:"Conditional Formatting",menu:{manageConditionalFormatting:"Manage Conditional Formatting",createConditionalFormatting:"Create Conditional Formatting",clearRangeRules:"Clear Rules for Selected Range",clearWorkSheetRules:"Clear Rules for Entire Sheet"},form:{lessThan:"The value must be less than {0}",lessThanOrEqual:"The value must be less than or equal to {0}",greaterThan:"The value must be greater than {0}",greaterThanOrEqual:"The value must be greater than or equal to {0}",rangeSelector:"Select Range or Enter Value"},iconSet:{direction:"Direction",shape:"Shape",mark:"Mark",rank:"Rank",rule:"Rule",icon:"Icon",type:"Type",value:"Value",reverseIconOrder:"Reverse Icon Order",and:"And",when:"When",onlyShowIcon:"Only Show Icon"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"Create Rule",clear:"Clear All Rules",range:"Apply Range",styleType:"Style Type",submit:"Submit",cancel:"Cancel",rankAndAverage:"Top/Bottom/Average",styleRule:"Style Rule",isNotBottom:"Top",isBottom:"Bottom",greaterThanAverage:"Greater Than Average",lessThanAverage:"Less Than Average",medianValue:"Median Value",fillType:"Fill Type",pureColor:"Solid Color",gradient:"Gradient",colorSet:"Color Set",positive:"Positive",native:"Negative",workSheet:"Entire Sheet",selectedRange:"Selected Range",managerRuleSelect:"Manage {0} Rules",onlyShowDataBar:"Only Show Data Bars"},preview:{describe:{beginsWith:"Begins with {0}",endsWith:"Ends with {0}",containsText:"Text contains {0}",notContainsText:"Text does not contain {0}",equal:"Equal to {0}",notEqual:"Not equal to {0}",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than {0}",greaterThanOrEqual:"Greater than or equal to {0}",lessThan:"Less than {0}",lessThanOrEqual:"Less than or equal to {0}",notBetween:"Not between {0} and {1}",between:"Between {0} and {1}",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today",topN:"Top {0}",bottomN:"Bottom {0}",topNPercent:"Top {0}%",bottomNPercent:"Bottom {0}%"}},operator:{beginsWith:"Begins with",endsWith:"Ends with",containsText:"Text contains",notContainsText:"Text does not contain",equal:"Equal to",notEqual:"Not equal to",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than",greaterThanOrEqual:"Greater than or equal to",lessThan:"Less than",lessThanOrEqual:"Less than or equal to",notBetween:"Not between",between:"Between",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today"},ruleType:{highlightCell:"Highlight Cell",dataBar:"Data Bar",colorScale:"Color Scale",formula:"Custom Formula",iconSet:"Icon Set",duplicateValues:"Duplicate Values",uniqueValues:"Unique Values"},subRuleType:{uniqueValues:"Unique Values",duplicateValues:"Duplicate Values",rank:"Rank",text:"Text",timePeriod:"Time Period",number:"Number",average:"Average"},valueType:{num:"Number",min:"Minimum",max:"Maximum",percent:"Percentage",percentile:"Percentile",formula:"Formula",none:"None"}}}}},Symbol.toStringTag,{value:"Module"})),Cd=Object.freeze(Object.defineProperty({__proto__:null,default:{sheet:{cf:{title:"条件格式",menu:{manageConditionalFormatting:"管理条件格式",createConditionalFormatting:"新建条件格式",clearRangeRules:"清除所选区域的规则",clearWorkSheetRules:"清除整个工作表的规则"},form:{lessThan:"该值必须小于 {0}",lessThanOrEqual:"该值必须小于等于 {0}",greaterThan:"该值必大于 {0}",greaterThanOrEqual:"该值必大于等于 {0}",rangeSelector:"选择范围或者输入值"},iconSet:{direction:"方向",shape:"形状",mark:"标记",rank:"等级",rule:"规则",icon:"图标",type:"类型",value:"值",reverseIconOrder:"反转图标次序",and:"且",when:"当值",onlyShowIcon:"仅显示图标"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"新增规则",clear:"清空所有规则",range:"应用范围",styleType:"样式类型",submit:"确认",cancel:"取消",rankAndAverage:"最前/最后/平均值",styleRule:"样式规则",isNotBottom:"最前",isBottom:"最后",greaterThanAverage:"大于平均值",lessThanAverage:"小于平均值",medianValue:"中间值",fillType:"填充方式",pureColor:"纯色",gradient:"渐变",colorSet:"颜色设置",positive:"正值",native:"负值",workSheet:"整张工作表",selectedRange:"所选单元格",managerRuleSelect:"管理 {0} 的规则",onlyShowDataBar:"仅显示数据条"},preview:{describe:{beginsWith:"开头为{0}",endsWith:"结尾为{0}",containsText:"文本包含{0}",notContainsText:"文本不包含{0}",equal:"等于{0}",notEqual:"不等于{0}",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于{0}",greaterThanOrEqual:"大于等于{0}",lessThan:"小于{0}",lessThanOrEqual:"小于等于{0}",notBetween:"不介于{0}和{1}之间",between:"介于{0}和{1}之间",yesterday:"昨日",tomorrow:"明日",last7Days:"最近7天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日",topN:"前{0}项",bottomN:"后{0}项",topNPercent:"前{0}%",bottomNPercent:"后{0}%"}},operator:{beginsWith:"开头为",endsWith:"结尾为",containsText:"文本包含",notContainsText:"文本不包含",equal:"等于",notEqual:"不等于",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于",greaterThanOrEqual:"大于等于",lessThan:"小于",lessThanOrEqual:"小于等于",notBetween:"不介于",between:"介于",yesterday:"昨日",tomorrow:"明日",last7Days:"最近 7 天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日"},ruleType:{highlightCell:"突出显示单元格",dataBar:"数据条",colorScale:"色阶",formula:"自定义公式",iconSet:"图标集",duplicateValues:"重复值",uniqueValues:"唯一值"},subRuleType:{uniqueValues:"唯一值",duplicateValues:"重复值",rank:"最前最后",text:"文本",timePeriod:"时间日期",number:"数值",average:"平均值"},valueType:{num:"数值",min:"最小值",max:"最大值",percent:"百分比",percentile:"百分点",formula:"公式",none:"无"}}}}},Symbol.toStringTag,{value:"Module"})),_d=Object.freeze(Object.defineProperty({__proto__:null,default:{sheet:{cf:{title:"Условное форматирование",menu:{manageConditionalFormatting:"Управление условным форматированием",createConditionalFormatting:"Создание условного форматирования",clearRangeRules:"Очистить правила для выбранного диапазона",clearWorkSheetRules:"Очистить правила для всего листа"},form:{lessThan:"Значение должно быть меньше {0}",lessThanOrEqual:"Значение должно быть меньше или равно {0}",greaterThan:"Значение должно быть больше {0}",greaterThanOrEqual:"Значение должно быть больше или равно {0}",rangeSelector:"Выберите диапазон или введите значение"},iconSet:{direction:"Направление",shape:"Форма",mark:"Знак",rank:"Ранг",rule:"Правило",icon:"Иконка",type:"Тип",value:"Значение",reverseIconOrder:"Обратный порядок иконок",and:"И",when:"Когда",onlyShowIcon:"Показывать только иконку"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"Создать правило",clear:"Очистить все правила",range:"Применить диапазон",styleType:"Тип стиля",submit:"Подтвердить",cancel:"Отменить",rankAndAverage:"Верх/Низ/Среднее",styleRule:"Правило стиля",isNotBottom:"Верх",isBottom:"Низ",greaterThanAverage:"Больше среднего",lessThanAverage:"Меньше среднего",medianValue:"Медианное значение",fillType:"Тип заполнения",pureColor:"Сплошной цвет",gradient:"Градиент",colorSet:"Набор цветов",positive:"Положительный",native:"Отрицательный",workSheet:"Весь лист",selectedRange:"Выбранный диапазон",managerRuleSelect:"Управление правилами {0}",onlyShowDataBar:"Показывать только гистограммы данных"},preview:{describe:{beginsWith:"Начинается с {0}",endsWith:"Заканчивается на {0}",containsText:"Содержит текст {0}",notContainsText:"Не содержит текст {0}",equal:"Равно {0}",notEqual:"Не равно {0}",containsBlanks:"Содержит пустые ячейки",notContainsBlanks:"Не содержит пустых ячеек",containsErrors:"Содержит ошибки",notContainsErrors:"Не содержит ошибок",greaterThan:"Больше чем {0}",greaterThanOrEqual:"Больше или равно {0}",lessThan:"Меньше чем {0}",lessThanOrEqual:"Меньше или равно {0}",notBetween:"Не между {0} и {1}",between:"Между {0} и {1}",yesterday:"Вчера",tomorrow:"Завтра",last7Days:"Последние 7 дней",thisMonth:"Этот месяц",lastMonth:"Прошлый месяц",nextMonth:"Следующий месяц",thisWeek:"Эта неделя",lastWeek:"Прошлая неделя",nextWeek:"Следующая неделя",today:"Сегодня",topN:"Топ {0}",bottomN:"Низ {0}",topNPercent:"Топ {0}%",bottomNPercent:"Низ {0}%"}},operator:{beginsWith:"Начинается с",endsWith:"Заканчивается на",containsText:"Содержит текст",notContainsText:"Не содержит текст",equal:"Равно",notEqual:"Не равно",containsBlanks:"Содержит пустые ячейки",notContainsBlanks:"Не содержит пустых ячеек",containsErrors:"Содержит ошибки",notContainsErrors:"Не содержит ошибок",greaterThan:"Больше чем",greaterThanOrEqual:"Больше или равно",lessThan:"Меньше чем",lessThanOrEqual:"Меньше или равно",notBetween:"Не между",between:"Между",yesterday:"Вчера",tomorrow:"Завтра",last7Days:"Последние 7 дней",thisMonth:"Этот месяц",lastMonth:"Прошлый месяц",nextMonth:"Следующий месяц",thisWeek:"Эта неделя",lastWeek:"Прошлая неделя",nextWeek:"Следующая неделя",today:"Сегодня"},ruleType:{highlightCell:"Выделение ячеек",dataBar:"Гистограмма данных",colorScale:"Цветовая шкала",formula:"Пользовательская формула",iconSet:"Набор иконок",duplicateValues:"Дублирующиеся значения",uniqueValues:"Уникальные значения"},subRuleType:{uniqueValues:"Уникальные значения",duplicateValues:"Дублирующиеся значения",rank:"Ранг",text:"Текст",timePeriod:"Период времени",number:"Число",average:"Среднее"},valueType:{num:"Число",min:"Минимум",max:"Максимум",percent:"Процент",percentile:"Процентиль",formula:"Формула",none:"Нет"}}}}},Symbol.toStringTag,{value:"Module"}));B.AddCfCommand=un,B.enUS=Rd,B.ruRU=_d,B.zhCN=Cd,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});